2018-03-01 15:42:47 +01:00
/ * *
* Project - HomeFlix
*
* Copyright 2016 - 2018 < @Seil0 >
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston ,
* MA 02110 - 1301 , USA .
* /
package kellerkinder.HomeFlix.datatypes ;
2016-09-09 20:41:20 +02:00
2017-03-06 17:59:44 +01:00
import javafx.beans.property.BooleanProperty ;
import javafx.beans.property.SimpleBooleanProperty ;
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
2018-03-05 22:37:32 +01:00
public class FilmTabelDataType {
2017-02-02 20:41:38 +01:00
private final StringProperty streamUrl = new SimpleStringProperty ( ) ;
2018-03-09 20:12:03 +01:00
private final StringProperty title = new SimpleStringProperty ( ) ;
private final StringProperty season = new SimpleStringProperty ( ) ;
private final StringProperty episode = new SimpleStringProperty ( ) ;
private final BooleanProperty favorite = new SimpleBooleanProperty ( ) ;
2017-03-06 17:59:44 +01:00
private final BooleanProperty cached = new SimpleBooleanProperty ( ) ;
2018-03-09 20:12:03 +01:00
private final SimpleObjectProperty < ImageView > image = new SimpleObjectProperty < > ( ) ;
2016-09-09 20:41:20 +02:00
2018-03-09 20:12:03 +01:00
/ * *
2017-03-09 22:26:37 +01:00
* tableData is the data - type of tree - table - view
2018-03-06 20:41:52 +01:00
* @param streamUrl the concrete path to the file or the URL
* @param title title of the film
2017-11-12 19:35:48 +01:00
* @param season season if it ' s a series
* @param episode episode if it ' s a series
2018-03-09 20:12:03 +01:00
* @param favorite indicator for favorites , used for sorting the items
2017-11-12 19:35:48 +01:00
* @param cached indicator for caching status
2018-03-06 20:41:52 +01:00
* @param image favorite icon
2017-03-09 22:26:37 +01:00
* /
2018-03-09 20:12:03 +01:00
public FilmTabelDataType ( final String streamUrl , final String title , final String season , final String episode ,
final boolean favorite , final boolean cached , final ImageView image ) {
2018-03-06 20:41:52 +01:00
this . streamUrl . set ( streamUrl ) ;
this . title . set ( title ) ;
2016-09-09 20:41:20 +02:00
this . season . set ( season ) ;
2016-10-10 16:55:26 +02:00
this . episode . set ( episode ) ;
2018-03-09 20:12:03 +01:00
this . favorite . set ( favorite ) ;
2017-03-06 17:59:44 +01:00
this . cached . set ( cached ) ;
2018-03-06 20:41:52 +01:00
this . image . set ( image ) ;
}
public StringProperty streamUrlProperty ( ) {
return streamUrl ;
}
public StringProperty titleProperty ( ) {
return title ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
2018-03-09 20:12:03 +01:00
public StringProperty seasonProperty ( ) {
2017-02-02 20:41:38 +01:00
return season ;
2016-09-09 20:41:20 +02:00
}
2018-03-09 20:12:03 +01:00
public StringProperty episodeProperty ( ) {
2017-02-02 20:41:38 +01:00
return episode ;
2016-10-10 16:55:26 +02:00
}
2018-03-09 20:12:03 +01:00
public BooleanProperty favoriteProperty ( ) {
return favorite ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
2018-03-06 20:41:52 +01:00
public BooleanProperty cachedProperty ( ) {
return cached ;
2016-09-09 20:41:20 +02:00
}
2017-02-02 20:41:38 +01:00
public SimpleObjectProperty < ImageView > imageProperty ( ) {
return image ;
}
2018-03-06 20:41:52 +01:00
public final String getStreamUrl ( ) {
return streamUrlProperty ( ) . get ( ) ;
2017-03-06 17:59:44 +01:00
}
2018-03-06 20:41:52 +01:00
public final String getTitle ( ) {
return titleProperty ( ) . get ( ) ;
}
2016-09-09 20:41:20 +02:00
2018-03-09 20:12:03 +01:00
public final String getSeason ( ) {
2017-02-02 20:41:38 +01:00
return seasonProperty ( ) . get ( ) ;
2016-09-09 20:41:20 +02:00
}
2018-03-09 20:12:03 +01:00
public final String getEpisode ( ) {
2017-02-02 20:41:38 +01:00
return episodeProperty ( ) . get ( ) ;
2016-10-10 16:55:26 +02:00
}
2018-03-09 20:12:03 +01:00
public final boolean getFavorite ( ) {
return favoriteProperty ( ) . get ( ) ;
2017-02-02 20:41:38 +01:00
}
2016-09-09 20:41:20 +02:00
2018-03-06 20:41:52 +01:00
public final boolean getCached ( ) {
return cachedProperty ( ) . 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
2018-03-06 20:41:52 +01:00
public final void setStreamUrl ( String streamUrl ) {
streamUrlProperty ( ) . set ( streamUrl ) ;
2017-03-06 17:59:44 +01:00
}
2017-02-02 20:41:38 +01:00
2018-03-06 20:41:52 +01:00
public final void setTitle ( String title ) {
titleProperty ( ) . set ( title ) ;
}
2016-09-09 20:41:20 +02:00
2018-03-09 20:12:03 +01:00
public final void setSeason ( String season ) {
2017-02-02 20:41:38 +01:00
seasonProperty ( ) . set ( season ) ;
2016-09-09 20:41:20 +02:00
}
2018-03-09 20:12:03 +01:00
public final void setEpisode ( String season ) {
2017-02-02 20:41:38 +01:00
episodeProperty ( ) . set ( season ) ;
2016-09-09 20:41:20 +02:00
}
2018-03-09 20:12:03 +01:00
public final void setFavorite ( boolean favorite ) {
favoriteProperty ( ) . set ( favorite ) ;
2016-10-10 16:55:26 +02:00
}
2018-03-06 20:41:52 +01:00
public final void setCached ( boolean cached ) {
cachedProperty ( ) . set ( cached ) ;
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
2018-03-06 20:41:52 +01:00
2016-09-09 20:41:20 +02:00
}