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
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 */
5d6d4736cd0d3e25df00a1962e9ac3e1ae0aa18f
The text was updated successfully, but these errors were encountered:
properly log any exception
bookie-scrape/src/main/java/com/bookiescrape/app/sample/ApplicationHandler.java
Line 142 in 0392c1e
5d6d4736cd0d3e25df00a1962e9ac3e1ae0aa18f
The text was updated successfully, but these errors were encountered: