@@ -120,14 +120,14 @@ public BookmarkWindowController() {
120
120
Font .loadFont (BookmarkWindowController .class .getResourceAsStream ("/mediathek/res/programm/fxml/fontawesome-webfont.ttf" ), 16 );
121
121
}
122
122
123
- private static void setStageSize (Stage window ) {
123
+ private void setStageSize () {
124
124
Configuration config = ApplicationConfiguration .getConfiguration ();
125
125
try {
126
126
config .lock (LockMode .READ );
127
- window .setWidth (config .getInt (ApplicationConfiguration .APPLICATION_UI_BOOKMARKLIST + ".width" , 640 ));
128
- window .setHeight (config .getInt (ApplicationConfiguration .APPLICATION_UI_BOOKMARKLIST + ".heigth" , 480 ));
129
- window .setX (config .getInt (ApplicationConfiguration .APPLICATION_UI_BOOKMARKLIST + ".location.x" , 0 ));
130
- window .setY (config .getInt (ApplicationConfiguration .APPLICATION_UI_BOOKMARKLIST + ".location.y" , 0 ));
127
+ stage .setWidth (config .getInt (ApplicationConfiguration .APPLICATION_UI_BOOKMARKLIST + ".width" , 640 ));
128
+ stage .setHeight (config .getInt (ApplicationConfiguration .APPLICATION_UI_BOOKMARKLIST + ".heigth" , 480 ));
129
+ stage .setX (config .getInt (ApplicationConfiguration .APPLICATION_UI_BOOKMARKLIST + ".location.x" , 0 ));
130
+ stage .setY (config .getInt (ApplicationConfiguration .APPLICATION_UI_BOOKMARKLIST + ".location.y" , 0 ));
131
131
}
132
132
finally {
133
133
config .unlock (LockMode .READ );
@@ -566,18 +566,28 @@ private void tbviewMouseClick(MouseEvent e) {
566
566
}
567
567
}
568
568
569
+ private Stage createStage () {
570
+ Stage stage = new Stage ();
571
+ stage .setTitle ("Merkliste verwalten" );
572
+ stage .getIcons ().add (new Image ("/mediathek/res/MediathekView.png" ));
573
+ stage .setOnHiding (_ -> {
574
+ cancelBookmarkSave ();
575
+ saveBookMarkList ();
576
+ });
577
+
578
+ return stage ;
579
+ }
580
+
569
581
/**
570
582
* Display Window on screen
571
583
* During first call a new window is created, for successive calls the existing window is reused
572
584
*/
573
585
public void show () {
574
586
Platform .runLater (() -> {
575
587
if (stage == null ) {
576
- stage = new Stage ();
577
- setStageSize (stage ); // restore size
578
- setStageEvents ();
579
- stage .setTitle ("Merkliste verwalten" );
580
- stage .getIcons ().add (new Image ("/mediathek/res/MediathekView.png" ));
588
+ stage = createStage ();
589
+ setStageSize (); // restore size
590
+
581
591
try {
582
592
FXMLLoader fxmlLoader = new FXMLLoader (getClass ().getResource ("/mediathek/res/programm/fxml/bookmarkWindow.fxml" ));
583
593
fxmlLoader .setController (this );
@@ -738,13 +748,6 @@ public void saveSettings() {
738
748
}
739
749
}
740
750
741
- private void setStageEvents () {
742
- stage .setOnHiding (_ -> {
743
- cancelBookmarkSave ();
744
- saveBookMarkList ();
745
- });
746
- }
747
-
748
751
/**
749
752
* Returns true if the current table selection contains unseen items
750
753
* @return boolean
0 commit comments