documentation improvements

This commit is contained in:
Jannik 2018-07-22 23:30:52 +02:00
parent 23ac33ca9b
commit d16e724cce
5 changed files with 51 additions and 33 deletions

View File

@ -10,6 +10,7 @@
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">

View File

@ -10,4 +10,5 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=9 org.eclipse.jdt.core.compiler.source=9

View File

@ -8,7 +8,7 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Project-HomeFlix</name> <name>Project-HomeFlix</name>
<url>http://www.kellerkinder.xyz</url> <url>http://www.mosad.xyz</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -32,7 +32,7 @@
<dependency> <dependency>
<groupId>com.jfoenix</groupId> <groupId>com.jfoenix</groupId>
<artifactId>jfoenix</artifactId> <artifactId>jfoenix</artifactId>
<version>9.0.4</version> <version>9.0.5</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -259,7 +259,7 @@ public class MainWindowController {
dbController.init(); dbController.init();
} }
// Initialize UI elements // Initialize general UI elements
private void initUI() { private void initUI() {
versionLbl.setText("Version: " + version + " (Build: " + buildNumber + ")"); versionLbl.setText("Version: " + version + " (Build: " + buildNumber + ")");
fontsizeSlider.setValue(getFontSize()); fontsizeSlider.setValue(getFontSize());
@ -281,7 +281,10 @@ public class MainWindowController {
applyColor(); applyColor();
} }
// Initialize the tables (treeTableViewfilm and sourcesTable) /**
* Initialize the tables (treeTableViewfilm and sourcesTable)
* only needed for Tabel-Mode
*/
private void initTabel() { private void initTabel() {
// film Table // film Table
@ -323,6 +326,7 @@ public class MainWindowController {
// Initializing the actions // Initializing the actions
private void initActions() { private void initActions() {
// general actions
HamburgerBackArrowBasicTransition burgerTask = new HamburgerBackArrowBasicTransition(menuHam); HamburgerBackArrowBasicTransition burgerTask = new HamburgerBackArrowBasicTransition(menuHam);
menuHam.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> { menuHam.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
if (menuTrue) { if (menuTrue) {
@ -343,32 +347,6 @@ public class MainWindowController {
settingsTrue = false; settingsTrue = false;
} }
}); });
searchTextField.textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
ObservableList<FilmTabelDataType> helpData;
filterData.clear();
filmRoot.getChildren().clear();
helpData = filmsList;
for (int i = 0; i < helpData.size(); i++) {
if (helpData.get(i).getTitle().toLowerCase().contains(searchTextField.getText().toLowerCase())) {
filterData.add(helpData.get(i)); // add data from newDaten to filteredData where title contains search input
}
}
for (int i = 0; i < filterData.size(); i++) {
filmRoot.getChildren().add(new TreeItem<FilmTabelDataType>(filterData.get(i))); // add filtered data to root node after search
}
if (searchTextField.getText().hashCode() == hashA) {
setColor("000000");
colorPicker.setValue(new Color(0, 0, 0, 1));
applyColor();
}
}
});
languageChoisBox.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() { languageChoisBox.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
@Override @Override
@ -404,6 +382,33 @@ public class MainWindowController {
} }
}); });
// Table-Mode actions
searchTextField.textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
ObservableList<FilmTabelDataType> helpData;
filterData.clear();
filmRoot.getChildren().clear();
helpData = filmsList;
for (int i = 0; i < helpData.size(); i++) {
if (helpData.get(i).getTitle().toLowerCase().contains(searchTextField.getText().toLowerCase())) {
filterData.add(helpData.get(i)); // add data from newDaten to filteredData where title contains search input
}
}
for (int i = 0; i < filterData.size(); i++) {
filmRoot.getChildren().add(new TreeItem<FilmTabelDataType>(filterData.get(i))); // add filtered data to root node after search
}
if (searchTextField.getText().hashCode() == hashA) {
setColor("000000");
colorPicker.setValue(new Color(0, 0, 0, 1));
applyColor();
}
}
});
like.setOnAction(new EventHandler<ActionEvent>() { like.setOnAction(new EventHandler<ActionEvent>() {
@Override @Override
public void handle(ActionEvent event) { public void handle(ActionEvent event) {
@ -485,8 +490,11 @@ public class MainWindowController {
} }
} }
}); });
// Poster-Mode actions
} }
// Table-Mode fxml actions
@FXML @FXML
private void playbtnclicked() { private void playbtnclicked() {
if (currentTableFilm.getStreamUrl().contains("_rootNode")) { if (currentTableFilm.getStreamUrl().contains("_rootNode")) {
@ -558,6 +566,7 @@ public class MainWindowController {
filmsTreeTable.getSelectionModel().select(next); filmsTreeTable.getSelectionModel().select(next);
} }
// general fxml actions
@FXML @FXML
private void aboutBtnAction() { private void aboutBtnAction() {
String bodyText = "cemu_UI by @Seil0 \nVersion: " + version + " (Build: " + buildNumber + ") \"" String bodyText = "cemu_UI by @Seil0 \nVersion: " + version + " (Build: " + buildNumber + ") \""
@ -674,7 +683,11 @@ public class MainWindowController {
sourceRoot.getChildren().add(new TreeItem<SourceDataType>(sourcesList.get(sourcesList.size() - 1))); // adds data to root-node sourceRoot.getChildren().add(new TreeItem<SourceDataType>(sourcesList.get(sourcesList.size() - 1))); // adds data to root-node
} }
// add a source to the newsources list /**
* add a source to the newsources list
* @param path to the source
* @param mode of the source (local or streaming)
*/
public void addSource(String path, String mode) { public void addSource(String path, String mode) {
JsonObject source = null; JsonObject source = null;
JsonArray newsources = null; JsonArray newsources = null;

View File

@ -60,8 +60,6 @@ public class OMDbAPIController implements Runnable {
this.mainWindowController = mainWindowController; this.mainWindowController = mainWindowController;
this.dbController = dbController; this.dbController = dbController;
this.main = main; this.main = main;
} }
@Override @Override
@ -135,6 +133,11 @@ public class OMDbAPIController implements Runnable {
return; return;
} }
/**
* get a movie/series by its title
* @param title of the movie/series
* @return a jsonObject of the API answer
*/
private JsonObject getByTitle(String title) { private JsonObject getByTitle(String title) {
String output = null; String output = null;
URL apiUrl; URL apiUrl;