code cleanup

This commit is contained in:
Jannik 2018-04-08 13:22:20 +02:00
parent 4b5c9482c8
commit 96e3d9e3ac
3 changed files with 3 additions and 11 deletions

View File

@ -103,7 +103,7 @@ public class MainWindowController {
@FXML
private AnchorPane mainAnchorPane;
@FXML
private AnchorPane tableModeAnchorPane;

View File

@ -31,11 +31,9 @@ import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import kellerkinder.HomeFlix.application.Main;
import kellerkinder.HomeFlix.application.MainWindowController;
import kellerkinder.HomeFlix.datatypes.FilmTabelDataType;
public class Player {
private MainWindowController mainWindowController;
private PlayerController playerController;
private Stage stage;
private AnchorPane pane;
@ -46,7 +44,6 @@ public class Player {
* @param mainWindowController the MainWindowController
*/
public Player(MainWindowController mainWindowController) {
this.mainWindowController = mainWindowController;
try {
FXMLLoader fxmlLoader = new FXMLLoader(ClassLoader.getSystemResource("fxml/PlayerWindow.fxml"));
pane = (AnchorPane) fxmlLoader.load();
@ -73,10 +70,6 @@ public class Player {
e.printStackTrace();
}
}
public void playNewFilm(FilmTabelDataType film) {
playerController.init(mainWindowController, this, film);
}
public Stage getStage() {
return stage;

View File

@ -138,7 +138,6 @@ public class PlayerController {
});
// every time the play time changes execute this
// TODO rework autoplay
mediaPlayer.currentTimeProperty().addListener(new ChangeListener<Duration>() {
@Override
public void changed(ObservableValue<? extends Duration> observable, Duration oldValue, Duration newValue) {
@ -152,7 +151,7 @@ public class PlayerController {
FilmTabelDataType nextFilm = mainWCon.getDbController().getNextEpisode(film.getTitle(), (episode + 1));
if (nextFilm != null) {
mediaPlayer.stop();
player.playNewFilm(nextFilm);
init(mainWCon, player, nextFilm);
autoplay = true;
}
} else if ((duration - currentTime) < 100) {
@ -178,7 +177,7 @@ public class PlayerController {
private void initActions() {
player.getScene().addEventFilter(MouseEvent.MOUSE_MOVED, new EventHandler<MouseEvent>() {
// hide controls timer init
// hide controls timer initialization
final Timer timer = new Timer();
TimerTask controlAnimationTask = null; // task to execute save operation
final long delayTime = 1000;