diff --git a/bin/application/DBController.class b/bin/application/DBController.class index a1a5c42..1dd0f16 100644 Binary files a/bin/application/DBController.class and b/bin/application/DBController.class differ diff --git a/bin/application/Main.class b/bin/application/Main.class index 04ee8bc..00f5b39 100644 Binary files a/bin/application/Main.class and b/bin/application/Main.class differ diff --git a/bin/application/MainWindow.fxml b/bin/application/MainWindow.fxml index a455653..8b41bd8 100644 --- a/bin/application/MainWindow.fxml +++ b/bin/application/MainWindow.fxml @@ -3,11 +3,11 @@ - + @@ -20,9 +20,12 @@ - - - + + + + + + @@ -31,7 +34,7 @@ - + diff --git a/bin/application/MainWindowController$1.class b/bin/application/MainWindowController$1.class index 181a88f..08603c9 100644 Binary files a/bin/application/MainWindowController$1.class and b/bin/application/MainWindowController$1.class differ diff --git a/bin/application/MainWindowController$2.class b/bin/application/MainWindowController$2.class index 70f04c3..6f29071 100644 Binary files a/bin/application/MainWindowController$2.class and b/bin/application/MainWindowController$2.class differ diff --git a/bin/application/MainWindowController$3.class b/bin/application/MainWindowController$3.class index fc86b80..7f994ae 100644 Binary files a/bin/application/MainWindowController$3.class and b/bin/application/MainWindowController$3.class differ diff --git a/bin/application/MainWindowController$4.class b/bin/application/MainWindowController$4.class index d91fced..58a519f 100644 Binary files a/bin/application/MainWindowController$4.class and b/bin/application/MainWindowController$4.class differ diff --git a/bin/application/MainWindowController$5.class b/bin/application/MainWindowController$5.class index efb4d6a..dadbf05 100644 Binary files a/bin/application/MainWindowController$5.class and b/bin/application/MainWindowController$5.class differ diff --git a/bin/application/MainWindowController$6.class b/bin/application/MainWindowController$6.class index ea8dddf..f6c6f54 100644 Binary files a/bin/application/MainWindowController$6.class and b/bin/application/MainWindowController$6.class differ diff --git a/bin/application/MainWindowController$7.class b/bin/application/MainWindowController$7.class index 9f0a1b0..9caeb45 100644 Binary files a/bin/application/MainWindowController$7.class and b/bin/application/MainWindowController$7.class differ diff --git a/bin/application/MainWindowController.class b/bin/application/MainWindowController.class index 5541174..fa3c82e 100644 Binary files a/bin/application/MainWindowController.class and b/bin/application/MainWindowController.class differ diff --git a/bin/application/apiQuery.class b/bin/application/apiQuery.class index ab95a6e..83ed6ce 100644 Binary files a/bin/application/apiQuery.class and b/bin/application/apiQuery.class differ diff --git a/bin/application/tableData.class b/bin/application/tableData.class index 00d2897..76223fc 100644 Binary files a/bin/application/tableData.class and b/bin/application/tableData.class differ diff --git a/src/application/DBController.java b/src/application/DBController.java index 9e2f3fd..a6bfde2 100644 --- a/src/application/DBController.java +++ b/src/application/DBController.java @@ -25,6 +25,9 @@ import com.eclipsesource.json.JsonValue; import javafx.scene.image.Image; import javafx.scene.image.ImageView; +import javafx.scene.text.Font; +import javafx.scene.text.FontWeight; +import javafx.scene.text.Text; public class DBController { @@ -244,9 +247,9 @@ public class DBController { rs = stmt.executeQuery("SELECT * FROM film_streaming;"); while (rs.next()) { if(rs.getString(8).equals("favorite_black")){ - mainWindowController.streamingFilms.add(new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_black),rs.getBoolean(5))); + mainWindowController.streamingFilms.add(new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_black),rs.getBoolean(9))); }else{ - mainWindowController.streamingFilms.add(new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_border_black),rs.getBoolean(5))); + mainWindowController.streamingFilms.add(new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_border_black),rs.getBoolean(9))); } } stmt.close(); @@ -279,9 +282,9 @@ public class DBController { stmt = connection.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM film_streaming WHERE titel = '"+name+"';" ); if(rs.getString(8).equals("favorite_black")){ - mainWindowController.streamingFilms.set(i,new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_black),rs.getBoolean(5))); + mainWindowController.streamingFilms.set(i,new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_black),rs.getBoolean(9))); }else{ - mainWindowController.streamingFilms.set(i,new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_border_black),rs.getBoolean(5))); + mainWindowController.streamingFilms.set(i,new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_border_black),rs.getBoolean(9))); } stmt.close(); rs.close(); @@ -291,7 +294,10 @@ public class DBController { } } } - + /** + * check if there are any entries that have been removed from the film-directory + * @throws SQLException + */ private void checkRemoveEntry() throws SQLException{ System.out.println("checking for entrys to remove to DB ..."); Statement stmt = connection.createStatement(); @@ -318,6 +324,12 @@ public class DBController { } + /** + * check if there are new films in the film-directory + * @throws SQLException + * @throws FileNotFoundException + * @throws IOException + */ private void checkAddEntry() throws SQLException, FileNotFoundException, IOException{ //TODO sort alphabetical System.out.println("checking for entrys to add to DB ..."); String[] entries = new File(mainWindowController.getPath()).list(); @@ -494,7 +506,7 @@ public class DBController { void addCache( String streamUrl, String Title, String Year, String Rated, String Released, String Runtime, String Genre, String Director, String Writer, String Actors, String Plot, String Language, String Country, String Awards, String Metascore, String imdbRating, - String imdbVotes, String imdbID, String Type, String Poster, String Response) throws SQLException{ + String Type, String imdbVotes, String imdbID, String Poster, String Response) throws SQLException{ PreparedStatement ps = connection.prepareStatement("insert into cache values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); System.out.println("adding to cache..."); @@ -528,28 +540,62 @@ public class DBController { void readCache(String streamUrl){ try{ - Statement stmt = connection.createStatement(); - ResultSet rs = stmt.executeQuery("SELECT * FROM cache WHERE streamUrl='"+streamUrl+"';"); + Statement stmt = connection.createStatement(); + ResultSet rs = stmt.executeQuery("SELECT * FROM cache WHERE streamUrl='"+streamUrl+"';"); + ArrayList nameText = new ArrayList(); + ArrayList responseText = new ArrayList(); + String fontFamily = mainWindowController.fontFamily; + Image im; + int fontSize = (int) Math.round(mainWindowController.size); + int j=2; - mainWindowController.ta1.appendText(mainWindowController.title+": "+rs.getString(2)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.year+": "+ rs.getString(3)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.rating+": "+rs.getString(4)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.publishedOn+": "+rs.getString(5)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.duration+": "+rs.getString(6)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.genre+": "+rs.getString(7)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.director+": "+rs.getString(8)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.writer+": "+rs.getString(9)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.actors+": "+rs.getString(10)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.plot+": "+rs.getString(11)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.language+": "+rs.getString(12)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.country+": "+rs.getString(13)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.awards+": "+rs.getString(14)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.metascore+": "+rs.getString(15)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.imdbRating+": "+rs.getString(16)+"\n"); - mainWindowController.ta1.appendText(mainWindowController.type+": "+rs.getString(19)+"\n"); + nameText.add(0, new Text(mainWindowController.title+": ")); + nameText.add(1, new Text(mainWindowController.year+": ")); + nameText.add(2, new Text(mainWindowController.rating+": ")); + nameText.add(3, new Text(mainWindowController.publishedOn+": ")); + nameText.add(4, new Text(mainWindowController.duration+": ")); + nameText.add(5, new Text(mainWindowController.genre+": ")); + nameText.add(6, new Text(mainWindowController.director+": ")); + nameText.add(7, new Text(mainWindowController.writer+": ")); + nameText.add(8, new Text(mainWindowController.actors+": ")); + nameText.add(9, new Text(mainWindowController.plot+": ")); + nameText.add(10, new Text(mainWindowController.language+": ")); + nameText.add(11, new Text(mainWindowController.country+": ")); + nameText.add(12, new Text(mainWindowController.awards+": ")); + nameText.add(13, new Text(mainWindowController.metascore+": ")); + nameText.add(14, new Text(mainWindowController.imdbRating+": ")); + nameText.add(15, new Text(mainWindowController.type+": ")); + + for(int i=0; i<15; i++){ + responseText.add(new Text(rs.getString(j)+"\n")); + j++; + } + responseText.add(new Text(rs.getString(19)+"\n")); + im = new Image(rs.getString(20)); stmt.close(); rs.close(); + + for(int i=0; i - + @@ -20,9 +20,12 @@ - - - + + + + + + @@ -31,7 +34,7 @@ - + diff --git a/src/application/MainWindowController.java b/src/application/MainWindowController.java index 20581e8..f2f5ec9 100644 --- a/src/application/MainWindowController.java +++ b/src/application/MainWindowController.java @@ -46,7 +46,6 @@ import org.apache.commons.lang3.SystemUtils; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXColorPicker; import com.jfoenix.controls.JFXSlider; -import com.jfoenix.controls.JFXTextArea; import com.jfoenix.controls.JFXTextField; import com.jfoenix.controls.JFXToggleButton; @@ -103,8 +102,6 @@ public class MainWindowController { @FXML private TableView tableViewStreamingdata; @FXML - JFXTextArea ta1; - @FXML TextFlow textFlow; @FXML ScrollPane scrollPane; @@ -181,7 +178,6 @@ public class MainWindowController { private TableColumn dataNameColumn = new TableColumn<>("Datei Name"); @FXML private TableColumn dataNameEndColumn = new TableColumn<>("Datei Name mit Endung"); - private boolean menutrue = false; //saves the position of menubtn (opened or closed) private boolean settingstrue = false; @@ -189,7 +185,7 @@ public class MainWindowController { static boolean firststart = false; private int hashA = -2055934614; private String version = "0.5.0"; - private String buildNumber = "119"; + private String buildNumber = "121"; private String versionName = "plasma cow"; private String buildURL = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/buildNumber.txt"; private String downloadLink = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/downloadLink.txt"; @@ -220,6 +216,7 @@ public class MainWindowController { @SuppressWarnings("unused") private String ratingSortType; private String local; + String fontFamily = "System"; //TODO -> in mainwindowcontroller machen String title; String year; String rating; @@ -236,7 +233,7 @@ public class MainWindowController { String metascore; String imdbRating; String type; - private double size; + double size; private int last; private int selected; private int next; @@ -540,7 +537,7 @@ public class MainWindowController { treeTableViewfilm.setShowRoot(false); //write content into cell - columnTitel.setCellValueFactory(cellData -> cellData.getValue().getValue().titelProperty()); + columnTitel.setCellValueFactory(cellData -> cellData.getValue().getValue().titleProperty()); columnRating.setCellValueFactory(cellData -> cellData.getValue().getValue().imageProperty()); columnStreamUrl.setCellValueFactory(cellData -> cellData.getValue().getValue().streamUrlProperty()); columnResolution.setCellValueFactory(cellData -> cellData.getValue().getValue().resolutionProperty()); @@ -561,7 +558,6 @@ public class MainWindowController { next = selected + 1; name = columnTitel.getCellData(selected); //get name of selected item datPath = columnStreamUrl.getCellData(selected); //get file path of selected item - ta1.setText(""); //delete text in ta1 if(mode.equals("local")){ if(localFilms.get(selected).getCached()==true){ @@ -571,6 +567,7 @@ public class MainWindowController { ApiQuery.startQuery(name,datPath); // start api query } }else{ + System.out.println(streamingFilms.size()); if(streamingFilms.get(selected).getCached()==true){ System.out.println("loading from cache: "+name); dbController.readCache(datPath); @@ -578,7 +575,6 @@ public class MainWindowController { ApiQuery.startQuery(name,datPath); // start api query } } - ta1.positionCaret(0); //set cursor position in ta1 } }); @@ -586,7 +582,7 @@ public class MainWindowController { treeTableViewfilm.setContextMenu(menu); //Streaming-Settings Table - dataNameColumn.setCellValueFactory(cellData -> cellData.getValue().titelProperty()); + dataNameColumn.setCellValueFactory(cellData -> cellData.getValue().titleProperty()); dataNameEndColumn.setCellValueFactory(cellData -> cellData.getValue().streamUrlProperty()); tableViewStreamingdata.getColumns().addAll(dataNameColumn, dataNameEndColumn); @@ -610,7 +606,7 @@ public class MainWindowController { } for(int i = 0; i < helpData.size(); i++){ - if(helpData.get(i).getTitel().toLowerCase().contains(tfsearch.getText().toLowerCase())){ + if(helpData.get(i).getTitle().toLowerCase().contains(tfsearch.getText().toLowerCase())){ filterData.add(helpData.get(i)); //add data from newDaten to filteredData where title contains search input } } @@ -639,7 +635,12 @@ public class MainWindowController { @Override public void changed(ObservableValue ov,Number old_val, Number new_val) { setSize(sliderFontSize.getValue()); - ta1.setFont(Font.font("System", size)); + + if(name != null){ + dbController.readCache(datPath); + } + +// ta1.setFont(Font.font("System", size)); saveSettings(); } }); @@ -699,6 +700,7 @@ public class MainWindowController { ArrayList fav_false = new ArrayList(); ObservableList helpData; filterData.removeAll(filterData); +// treeTableViewfilm.getSelectionModel().clearSelection(selected); root.getChildren().remove(0,root.getChildren().size()); if(mode.equals("local")){ @@ -761,10 +763,6 @@ public class MainWindowController { }else{ autoupdateBtn.setSelected(false); } - - ta1.setWrapText(true); - ta1.setEditable(false); - ta1.setFont(Font.font("System", getSize())); } private void refreshTable(){ @@ -780,7 +778,7 @@ public class MainWindowController { for(int i = 0; i < localFilms.size(); i++){ root.getChildren().add(new TreeItem(localFilms.get(i))); //add data to root-node } - columnRating.setMaxWidth(90); + columnRating.setMaxWidth(85); columnTitel.setMaxWidth(290); treeTableViewfilm.getColumns().get(3).setVisible(false); treeTableViewfilm.getColumns().get(4).setVisible(false); diff --git a/src/application/apiQuery.java b/src/application/apiQuery.java index 1fc9c6b..69622a5 100644 --- a/src/application/apiQuery.java +++ b/src/application/apiQuery.java @@ -8,20 +8,17 @@ import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; +import java.util.ArrayList; import java.util.Scanner; import com.eclipsesource.json.Json; import com.eclipsesource.json.JsonObject; -import javafx.collections.ObservableList; -import javafx.scene.Node; import javafx.scene.image.Image; -import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.FontWeight; import javafx.scene.text.Text; -@SuppressWarnings("unused") //TODO public class apiQuery{ public apiQuery(MainWindowController m, DBController db){ @@ -32,8 +29,9 @@ public class apiQuery{ private MainWindowController mainWindowController; private DBController dbController; private Image im; - private int fontSize = 20; - private String fontFamily = "System"; + private String[] responseString = new String[20]; + ArrayList responseText = new ArrayList(); + ArrayList nameText = new ArrayList(); void startQuery(String titel, String streamUrl){ URL url = null; @@ -44,6 +42,11 @@ public class apiQuery{ String retdata = null; InputStream is = null; BufferedReader br = null; + String fontFamily = mainWindowController.fontFamily; + int fontSize = (int) Math.round(mainWindowController.size); + + responseText.removeAll(responseText); + nameText.removeAll(nameText); try { @@ -69,158 +72,93 @@ public class apiQuery{ is = url.openStream(); br = new BufferedReader(new InputStreamReader(is, "UTF-8")); - // lesen der Daten aus dem Antwort Stream + // read data from response Stream while ((retdata = br.readLine()) != null) { - //retdata in json object parsen und anschließend das json Objekt "zerschneiden" + //cut the json response into separate strings System.out.println(retdata); JsonObject object = Json.parse(retdata).asObject(); - String titelV = object.getString("Title", ""); - String yearV = object.getString("Year", ""); - String ratedV = object.getString("Rated", ""); - String releasedV = object.getString("Released", ""); - String runtimeV = object.getString("Runtime", ""); - String genreV = object.getString("Genre", ""); - String directorV = object.getString("Director", ""); - String writerV = object.getString("Writer", ""); - String actorsV = object.getString("Actors", ""); - String plotV = object.getString("Plot", ""); - String languageV = object.getString("Language", ""); - String countryV = object.getString("Country", ""); - String awardsV = object.getString("Awards", ""); - - String metascoreV = object.getString("Metascore", ""); - String imdbRatingV = object.getString("imdbRating", ""); - String imdbVotesV = object.getString("imdbVotes", ""); - String imdbIDV = object.getString("imdbID", ""); - String typeV = object.getString("Type", ""); - String posterURL = object.getString("Poster", ""); - String response = object.getString("Response", ""); + responseString[0] = object.getString("Title", ""); + responseString[1] = object.getString("Year", ""); + responseString[2] = object.getString("Rated", ""); + responseString[3] = object.getString("Released", ""); + responseString[4] = object.getString("Runtime", ""); + responseString[5] = object.getString("Genre", ""); + responseString[6] = object.getString("Director", ""); + responseString[7] = object.getString("Writer", ""); + responseString[8] = object.getString("Actors", ""); + responseString[9] = object.getString("Plot", ""); + responseString[10] = object.getString("Language", ""); + responseString[11] = object.getString("Country", ""); + responseString[12] = object.getString("Awards", ""); + responseString[13] = object.getString("Metascore", ""); + responseString[14] = object.getString("imdbRating", ""); + responseString[15] = object.getString("Type", ""); + responseString[16] = object.getString("imdbVotes", ""); + responseString[17] = object.getString("imdbID", ""); + responseString[18] = object.getString("Poster", ""); + responseString[19] = object.getString("Response", ""); - dbController.addCache( streamUrl, titelV, yearV, ratedV, releasedV, runtimeV, genreV, directorV, writerV, actorsV, plotV, languageV, countryV, - awardsV, metascoreV, imdbRatingV, imdbVotesV, imdbIDV, typeV, posterURL, response); + //adding strings to the cache + dbController.addCache( streamUrl, responseString[0], responseString[1],responseString[2], responseString[3], responseString[4], responseString[5], + responseString[6], responseString[7], responseString[8], responseString[9], responseString[10],responseString[11], responseString[12], + responseString[13], responseString[14], responseString[15], responseString[16], responseString[17], responseString[18], + responseString[19]); dbController.setCached(streamUrl); - -// Text titelR = new Text (object.getString("Title", "")+"\n"); -// titelR.setFont(Font.font (fontFamily, fontSize)); -// Text yearR = new Text (object.getString("Year", "")+"\n"); -// yearR.setFont(Font.font (fontFamily, fontSize)); -// Text ratedR = new Text (object.getString("Rated", "")+"\n"); -// ratedR.setFont(Font.font (fontFamily, fontSize)); -// Text releasedR = new Text (object.getString("Released", "")+"\n"); -// releasedR.setFont(Font.font (fontFamily, fontSize)); -// Text runtimeR = new Text (object.getString("Runtime", "")+"\n"); -// runtimeR.setFont(Font.font (fontFamily, fontSize)); -// Text genreR = new Text (object.getString("Genre", "")); -// genreR.setFont(Font.font (fontFamily, fontSize)); -// Text directorR = new Text (object.getString("Director", "")+"\n"); -// directorR.setFont(Font.font (fontFamily, fontSize)); -// Text writerR = new Text (object.getString("Writer", "")+"\n"); -// writerR.setFont(Font.font (fontFamily, fontSize)); -// Text actorsR = new Text (object.getString("Actors", "")+"\n"); -// actorsR.setFont(Font.font (fontFamily, fontSize)); -// Text plotR = new Text (object.getString("Plot", "")+"\n"); -// plotR.setFont(Font.font (fontFamily, fontSize)); -// Text languageR = new Text (object.getString("Language", "")+"\n"); -// languageR.setFont(Font.font (fontFamily, fontSize)); -// Text countryR = new Text (object.getString("Country", "")+"\n"); -// countryR.setFont(Font.font (fontFamily, fontSize)); -// Text awardsR = new Text (object.getString("Awards", "")+"\n"); -// awardsR.setFont(Font.font (fontFamily, fontSize)); -// Text metascoreR = new Text (object.getString("Metascore", "")+"\n"); -// metascoreR.setFont(Font.font (fontFamily, fontSize)); -// Text imdbRatingR = new Text (object.getString("imdbRating", "")+"\n"); -// imdbRatingR.setFont(Font.font (fontFamily, fontSize)); -// @SuppressWarnings("unused") -// Text imdbVotesR = new Text (object.getString("imdbVotes", "")+"\n"); -// imdbVotesR.setFont(Font.font (fontFamily, fontSize)); -// @SuppressWarnings("unused") -// Text imdbIDR = new Text (object.getString("imdbID", "")+"\n"); -// imdbIDR.setFont(Font.font (fontFamily, fontSize)); -// Text typeR = new Text (object.getString("Type", "")+"\n"); -// typeR.setFont(Font.font (fontFamily, fontSize)); + for(int i=0; i<20; i++){ + Text text = new Text(responseString[i]+"\n"); + responseText.add(text); + responseText.get(i).setFont(Font.font(fontFamily, fontSize)); + } - - if(response.equals("False")){ - mainWindowController.ta1.appendText(mainWindowController.noFilmFound); + //if response == false then show mainWindowController.noFilmFound else create new Texts and add them to flowText + if(responseString[19].equals("False")){ + mainWindowController.textFlow.getChildren().add(new Text(mainWindowController.noFilmFound)); im = new Image("recources/icons/close_black_2048x2048.png"); mainWindowController.image1.setImage(im); }else{ - //ausgabe des Textes in ta1 in jeweils neuer Zeile - mainWindowController.ta1.appendText(mainWindowController.title+": "+titelV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.year+": "+ yearV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.rating+": "+ratedV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.publishedOn+": "+releasedV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.duration+": "+runtimeV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.genre+": "+genreV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.director+": "+directorV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.writer+": "+writerV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.actors+": "+actorsV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.plot+": "+plotV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.language+": "+languageV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.country+": "+countryV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.awards+": "+awardsV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.metascore+": "+metascoreV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.imdbRating+": "+imdbRatingV+"\n"); - mainWindowController.ta1.appendText(mainWindowController.type+": "+typeV+"\n"); + // + nameText.add(0, new Text(mainWindowController.title+": ")); + nameText.add(1, new Text(mainWindowController.year+": ")); + nameText.add(2, new Text(mainWindowController.rating+": ")); + nameText.add(3, new Text(mainWindowController.publishedOn+": ")); + nameText.add(4, new Text(mainWindowController.duration+": ")); + nameText.add(5, new Text(mainWindowController.genre+": ")); + nameText.add(6, new Text(mainWindowController.director+": ")); + nameText.add(7, new Text(mainWindowController.writer+": ")); + nameText.add(8, new Text(mainWindowController.actors+": ")); + nameText.add(9, new Text(mainWindowController.plot+": ")); + nameText.add(10, new Text(mainWindowController.language+": ")); + nameText.add(11, new Text(mainWindowController.country+": ")); + nameText.add(12, new Text(mainWindowController.awards+": ")); + nameText.add(13, new Text(mainWindowController.metascore+": ")); + nameText.add(14, new Text(mainWindowController.imdbRating+": ")); + nameText.add(15, new Text(mainWindowController.type+": ")); + + + for(int i=0; i list = mainWindowController.textFlow.getChildren(); -// -// list.addAll(title,titelR,year,yearR,rating,ratedR, -// publishedOn,releasedR,duration,runtimeR,genre,genreR,director,directorR,writer,writerR, -// actors,actorsR,plot,plotR,language,languageR,country,countryR,awards,awardsR,metascore, -// metascoreR,imdbRating,imdbRatingR,type,typeR); -// - - if(posterURL.equals("N/A")){ + for(int i=0;i image = new SimpleObjectProperty<>(); private final BooleanProperty cached = new SimpleBooleanProperty(); - //tableData is the data-type of tree-table-view - public tableData (final int year, final int season, final int episode, final double rating, final String resolution, final String titel, final String streamUrl, final ImageView image, final boolean cached) { + /** + * 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) { this.year.set(year); this.season.set(season); this.episode.set(episode); this.rating.set(rating); this.resolution.set(resolution); - this.titel.set(titel); + this.title.set(title); this.streamUrl.set(streamUrl); this.image.set(image); this.cached.set(cached); @@ -55,8 +66,8 @@ public class tableData { return resolution; } - public StringProperty titelProperty(){ - return titel; + public StringProperty titleProperty(){ + return title; } public StringProperty streamUrlProperty(){ @@ -92,8 +103,8 @@ public class tableData { return resolutionProperty().get(); } - public final String getTitel() { - return titelProperty().get(); + public final String getTitle() { + return titleProperty().get(); } public final String getStreamUrl() { @@ -129,8 +140,8 @@ public class tableData { resolutionProperty().set(resolution); } - public final void setTitel(String titel) { - titelProperty().set(titel); + public final void setTitle(String title) { + titleProperty().set(title); } public final void setStreamUrl(String streamUrl) {