You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO hide stage if app should start minimized in system tray
privateStageprimaryStage;
privateControllerMediatorcontrollerMediator;
// used by stage's scene, set by loadFxmlAndCreateControllerMediator()privateParentrootView;
/** * JavaFX needed no-arg constructor . */publicApplicationHandler() {}
@Overridepublicfinalvoidstart(StageprimaryStage) throwsException {
this.primaryStage = primaryStage;
try {
// load all of the fxml files and create controller mediatorcontrollerMediator = loadFxmlAndCreateControllerMediator();
} catch (Exceptione) {
// TODO properly notify user of unrecoverable exceptionSystem.err.println(e.getMessage());
e.printStackTrace();
/* exception is unrecoverable, exit javafx */Platform.exit();
}
// allow system tray supporting implementing classes to do their thingsetUpSystemTrayIfSupported();
// configure and set up listeners in controller mediatorconfigureControllerMediator();
// load fonts from resourcesFontUtils.loadFontsFromResources(FONT_RES_PATH);
// create window with no title bar or default min, max, close buttonsprimaryStage.initStyle(StageStyle.UNDECORATED);
primaryStage.setScene(newScene(rootView));
// add listener to stage for window edge resizingResizeHelper.addResizeListener(primaryStage);
primaryStage.show();
// TODO hide stage if app should start minimized in system traycontrollerMediator.requestShowDashboardView();
setPrimaryStageMinBounds();
}
/** * Loads all of the fxmls into FXMLReferences and creates a * ControllerMediator from them. * <p> * This must be called after the primary stage has been set. */privateControllerMediatorloadFxmlAndCreateControllerMediator() throwsIOException {
// load fxml references from fxml fileFXMLReferencerootReference = loadReference(ROOT_FXML);
FXMLReferencedashReference = loadReference(DASHBOARD_FXML);
FXMLReferencesettingsReference = loadReference(SETTINGS_FXML);
FXMLReferencelogReference = loadReference(LOG_FXML);
// need this to init stage's scenerootView = rootReference.getView();
returnnewControllerMediator(primaryStage, rootReference, dashReference, settingsReference, logReference);
}
/** Convenience helper that loads fxml references. */privatestaticFXMLReferenceloadReference(Stringref) throwsIOException {
returnFXMLReference.loadFxml(ApplicationHandler.class.getResource(ref));
}
/** * Helper method that configures and sets up handlers in controller * mediator. */privatevoidconfigureControllerMediator() {
/* set application control button handlers */controllerMediator.setOnWindowCloseButtonActionHandler(getApplicationCloseButtonHandler());
controllerMediator.setOnWindowMinimizeButtonActionHandler(getApplicationMinimizeButtonHandler());
controllerMediator.setOnWindowMinimizeButtonActionHandler(getApplicationMaximizeButtonHandler());
}
/** Allow system tray supporting implementing classes to do their thing. */privatevoidsetUpSystemTrayIfSupported() {
// do nothing if system tray is not supportedif (!systemTrayIsSupported()) { return; }
try {
// call 'this' abstract methodsetUpSystemTray();
} catch (Exceptione) {
// TODO properly log any exceptionSystem.err.println(e.getMessage());
}
}
/* enforces window to not become smaller than root's min bounds */
fedacfa120e8426176a8d9e6a44bab15f9998cd2
The text was updated successfully, but these errors were encountered:
hide stage if app should start minimized in system tray
bookie-scrape/src/main/java/com/bookiescrape/app/sample/ApplicationHandler.java
Line 90 in 0392c1e
fedacfa120e8426176a8d9e6a44bab15f9998cd2
The text was updated successfully, but these errors were encountered: