7
7
import com .google .inject .Inject ;
8
8
import com .google .inject .Singleton ;
9
9
import com .google .inject .name .Named ;
10
- import io .github .vincemann .subtitleBuddy .classpathFileFinder .ClassPathFileFinder ;
10
+ import io .github .vincemann .subtitleBuddy .classpathFileFinder .ReadOnlyClassPathFileFinder ;
11
11
import io .github .vincemann .subtitleBuddy .config .propertiesFile .PropertyFileKeys ;
12
12
import io .github .vincemann .subtitleBuddy .config .uiStringsFile .UIStringsFileKeys ;
13
13
import io .github .vincemann .subtitleBuddy .events .RequestSrtParserUpdateEvent ;
@@ -130,7 +130,7 @@ public SettingsStageController(Stage mainStage,
130
130
@ Named (PropertyFileKeys .SETTINGS_FONT_SIZE_KEY ) int settingsFontSize ,
131
131
@ Named (PropertyFileKeys .FAST_FORWARD_DELTA_KEY ) int fastForwardDelta ,
132
132
EventBus eventBus ,
133
- ClassPathFileFinder classPathFileFinder ,
133
+ ReadOnlyClassPathFileFinder readOnlyClassPathFileFinder ,
134
134
@ Named (PropertyFileKeys .CLICK_WARNING_IMAGE_PATH_KEY ) String clickWarningImagePath ,
135
135
@ Named (UIStringsFileKeys .START_BUTTON_TEXT_KEY ) String startButtonText ,
136
136
@ Named (UIStringsFileKeys .STOP_BUTTON_TEXT_KEY ) String stopButtonText ,
@@ -140,10 +140,10 @@ public SettingsStageController(Stage mainStage,
140
140
@ Named (UIStringsFileKeys .TIMESTAMP_JUMP_HINT_TEXT_KEY ) String timestampJumpHintTextString
141
141
)
142
142
throws IOException {
143
- super (classPathFileFinder .findFileOnClassPath (SETTINGS_STAGE_FXML_FILE_PATH ).getFile ().toURI ().toURL (),windowTitle ,
143
+ super (readOnlyClassPathFileFinder .findFileOnClassPath (SETTINGS_STAGE_FXML_FILE_PATH ).getFile ().toURI ().toURL (),windowTitle ,
144
144
minSize );
145
145
createStage (this ,mainStage );
146
- this .settingsClickWarning = createImageView (imageHBox , classPathFileFinder .findFileOnClassPath (clickWarningImagePath ).getFile (),new Vector2D (SETTINGS_CLICK_WARNING_SIZE ,SETTINGS_CLICK_WARNING_SIZE ));
146
+ this .settingsClickWarning = createImageView (imageHBox , readOnlyClassPathFileFinder .findFileOnClassPath (clickWarningImagePath ).getFile (),new Vector2D (SETTINGS_CLICK_WARNING_SIZE ,SETTINGS_CLICK_WARNING_SIZE ));
147
147
this .settingsFontSize =settingsFontSize ;
148
148
this .srtParser = srtParser ;
149
149
this .eventBus =eventBus ;
@@ -176,13 +176,12 @@ public Color getFontColor() {
176
176
private void constructorInit (){
177
177
setUIStrings ();
178
178
lastTimeStamp = Timestamp .ZERO ();
179
- lastSubtitleText = new SubtitleText ( Collections . singletonList ( Collections . emptyList ()) );
179
+ lastSubtitleText = srtParser . getCurrentSubtitleText ( );
180
180
this .currentFont = srtFontManager .loadDefaultFont (settingsFontSize );
181
181
if (timeStampWarningDuration <MIN_TIME_STAMP_WARNING_DURATION ){
182
182
timeStampWarningDuration =MIN_TIME_STAMP_WARNING_DURATION ;
183
183
}
184
184
this .settingsClickWarning .setVisible (false );
185
-
186
185
}
187
186
188
187
private void setUIStrings (){
@@ -377,7 +376,7 @@ private void displayWrongTimeStampWarning(){
377
376
@ Override
378
377
@ FXML
379
378
public void displaySubtitle (@ NonNull SubtitleText subtitleText ) {
380
- log .trace ("asking javafx to display new subtitle on SettingsStageController : " + subtitleText );
379
+ log .trace ("asking javafx to display new subtitle in " + this . getClass (). getSimpleName ()+ " : " + subtitleText );
381
380
lastSubtitleText =subtitleText ;
382
381
383
382
Platform .runLater (() -> {
@@ -396,6 +395,7 @@ public void displaySubtitle(@NonNull SubtitleText subtitleText) {
396
395
text .setFill (SettingsSrtDisplayer .DEFAULT_FONT_COLOR );
397
396
adjustTextSize (text ,settingsFontSize );
398
397
398
+ log .trace ("displaying text: " + text + " in " +this .getClass ().getSimpleName ());
399
399
settingsTextFlow .getChildren ().add (text );
400
400
settingsTextFlow .getChildren ().add (new Text (System .lineSeparator ()));
401
401
}
@@ -414,6 +414,11 @@ public void setTime(@NonNull Timestamp time) {
414
414
});
415
415
}
416
416
417
+ @ Override
418
+ protected void onShowStage () {
419
+ super .onShowStage ();
420
+ }
421
+
417
422
@ Override
418
423
protected void onStageClose () {
419
424
super .onStageClose ();
0 commit comments