2017-07-26 17:10:37 +02:00
package org.kellerkinder.Project_HomeFlix ;
2016-09-09 20:41:20 +02:00
2017-03-06 17:59:44 +01:00
import javafx.beans.property.BooleanProperty ;
2016-09-09 20:41:20 +02:00
import javafx.beans.property.DoubleProperty ;
import javafx.beans.property.IntegerProperty ;
2017-03-06 17:59:44 +01:00
import javafx.beans.property.SimpleBooleanProperty ;
2016-09-09 20:41:20 +02:00
import javafx.beans.property.SimpleDoubleProperty ;
import javafx.beans.property.SimpleIntegerProperty ;
2017-02-02 20:41:38 +01:00
import javafx.beans.property.SimpleObjectProperty ;
2016-09-09 20:41:20 +02:00
import javafx.beans.property.SimpleStringProperty ;
import javafx.beans.property.StringProperty ;
2017-02-02 20:41:38 +01:00
import javafx.scene.image.ImageView ;
2016-09-09 20:41:20 +02:00
2017-03-06 17:59:44 +01:00
public class tableData {
2017-02-02 20:41:38 +01:00
private final IntegerProperty year = new SimpleIntegerProperty ( ) ;
private final IntegerProperty season = new SimpleIntegerProperty ( ) ;
private final IntegerProperty episode = new SimpleIntegerProperty ( ) ;
private final DoubleProperty rating = new SimpleDoubleProperty ( ) ;
private final StringProperty resolution = new SimpleStringProperty ( ) ;
2017-03-09 22:26:37 +01:00
private final StringProperty title = new SimpleStringProperty ( ) ;
2017-02-02 20:41:38 +01:00
private final StringProperty streamUrl = new SimpleStringProperty ( ) ;
private final SimpleObjectProperty < ImageView > image = new SimpleObjectProperty < > ( ) ;
2017-03-06 17:59:44 +01:00
private final BooleanProperty cached = new SimpleBooleanProperty ( ) ;
2016-09-09 20:41:20 +02:00
2017-03-09 22:26:37 +01:00
/ * *
* tableData is the data - type of tree - table - view
* @param year : the release year of the film
* @param season : season if it ' s a series
* @param episode : episode if it ' s a series
* @param rating : indicator for favourites , used for sorting the items
* @param resolution : resolution of the film
* @param titel : title of the film
* @param streamUrl : the concrete path to the file or the URL
* @param image : the favourite icon
* @param cached : indicator for caching status
* /
public tableData ( final int year , final int season , final int episode , final double rating , final String resolution , final String title , final String streamUrl , final ImageView image , final boolean cached ) {
2016-09-09 20:41:20 +02:00
this . year . set ( year ) ;
this . season . set ( season ) ;
2016-10-10 16:55:26 +02:00
this . episode . set ( episode ) ;
2016-09-09 20:41:20 +02:00
this . rating . set ( rating ) ;
this . resolution . set ( resolution ) ;
2017-03-09 22:26:37 +01:00
this . title . set ( title ) ;
2016-09-09 20:41:20 +02:00
this . streamUrl . set ( streamUrl ) ;
2017-02-02 20:41:38 +01:00
this . image . set ( image ) ;
2017-03-06 17:59:44 +01:00
this . cached . set ( cached ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public IntegerProperty yearProperty ( ) {
return year ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public IntegerProperty seasonProperty ( ) {
return season ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public IntegerProperty episodeProperty ( ) {
return episode ;
2016-10-10 16:55:26 +02:00
}
2017-02-02 20:41:38 +01:00
public DoubleProperty ratingProperty ( ) {
return rating ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public StringProperty resolutionProperty ( ) {
return resolution ;
2016-09-09 20:41:20 +02:00
}
2017-03-09 22:26:37 +01:00
public StringProperty titleProperty ( ) {
return title ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public StringProperty streamUrlProperty ( ) {
return streamUrl ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public SimpleObjectProperty < ImageView > imageProperty ( ) {
return image ;
}
2017-03-06 17:59:44 +01:00
public BooleanProperty cachedProperty ( ) {
return cached ;
}
2017-02-02 20:41:38 +01:00
public final int getYear ( ) {
return yearProperty ( ) . get ( ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final int getSeason ( ) {
return seasonProperty ( ) . get ( ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final int getEpisode ( ) {
return episodeProperty ( ) . get ( ) ;
2016-10-10 16:55:26 +02:00
}
2017-02-02 20:41:38 +01:00
public final double getRating ( ) {
return ratingProperty ( ) . get ( ) ;
}
public final String getResolution ( ) {
return resolutionProperty ( ) . get ( ) ;
2016-09-09 20:41:20 +02:00
}
2017-03-09 22:26:37 +01:00
public final String getTitle ( ) {
return titleProperty ( ) . get ( ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final String getStreamUrl ( ) {
return streamUrlProperty ( ) . get ( ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final ImageView getImage ( ) {
return imageProperty ( ) . get ( ) ;
}
2017-03-06 17:59:44 +01:00
public final boolean getCached ( ) {
return cachedProperty ( ) . get ( ) ;
}
2017-02-02 20:41:38 +01:00
2016-09-09 20:41:20 +02:00
2017-02-02 20:41:38 +01:00
public final void setYear ( int year ) {
yearProperty ( ) . set ( year ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final void setSeason ( int season ) {
seasonProperty ( ) . set ( season ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final void setEpisode ( int season ) {
episodeProperty ( ) . set ( season ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final void setRating ( int rating ) {
ratingProperty ( ) . set ( rating ) ;
2016-10-10 16:55:26 +02:00
}
2017-02-02 20:41:38 +01:00
public final void setResolution ( String resolution ) {
resolutionProperty ( ) . set ( resolution ) ;
2016-09-09 20:41:20 +02:00
}
2017-03-09 22:26:37 +01:00
public final void setTitle ( String title ) {
titleProperty ( ) . set ( title ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final void setStreamUrl ( String streamUrl ) {
streamUrlProperty ( ) . set ( streamUrl ) ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public final void setImage ( ImageView image ) {
imageProperty ( ) . set ( image ) ;
2016-09-09 20:41:20 +02:00
}
2017-03-06 17:59:44 +01:00
public final void setCached ( boolean cached ) {
cachedProperty ( ) . set ( cached ) ;
}
2016-09-09 20:41:20 +02:00
}