Package xal.extension.fxapplication
Class FxApplication
java.lang.Object
javafx.application.Application
xal.extension.fxapplication.FxApplication
public abstract class FxApplication
extends javafx.application.Application
The Application class handles defines the core of an application. It is often
the first handler of application wide events and typically forwards those
events to the custom application adaptor for further processing. Every
application has exactly one instance of this class.
For now the FxApplication does nothing (except inheriting all from
Application)
- Author:
- Yngve Levinsen <yngve.levinsen@ess.eu>
-
Nested Class Summary
Nested classes/interfaces inherited from class javafx.application.Application
javafx.application.Application.Parameters -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Stringprotected XalFxDocumentprotected booleanprotected booleanprotected booleanprotected Stringprotected javafx.scene.control.MenuBarstatic final StringFields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENA -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApplication constructor.protectedFxApplication(URL[] urls) Application constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidaddComboHandler(javafx.scene.control.ToggleGroup groupSequence, javafx.event.Event t) voidbeforeStart(javafx.stage.Stage stage) start() calls this method after initialize() and before showing the scene.voidbuildSequenceMenu(Accelerator accelerator, javafx.scene.control.Menu sequenceMenu, javafx.scene.control.ToggleGroup groupSequence) protected voideLogMenuHandler(String docType) protected voidHandles exit the application.Get the launch time which is the time at which the Application instance was instantiated.static javafx.stage.StagegetStage()protected voidprotected voidprotected voidprotected voidHandles loading of files.protected voidHandles creation of new files.protected final voidRegister the application status service so clients on the network can query the status of this application instance.protected voidsaveFileMenuHandler(boolean saveAs) Handles saving of files.protected voidselectSequenceMenuHandler(javafx.event.Event t) protected voidsetAcceleratorWithPath(String acceleratorPath) voidsetApplicationName(String applicationName) static voidsetOxalDarkStyle(javafx.scene.Scene scene) static voidsetOxalStyle(javafx.scene.Scene scene) This method sets the default Style for Open XAL applications (including Source Sans Pro font).voidsetTestMode(boolean testModeFlag) voidsetTestModeSuffix(String suffix) static voidsetTheme(javafx.scene.Scene scene) abstract voidsetup(javafx.stage.Stage stage) start() calls this method before initialize().final voidstart(javafx.stage.Stage stage) voidstop()Overriding the stop method to ensure that applications close properly after calling Platform.exit().protected voidtestModeMenuHandler(javafx.event.Event e) protected voidtestModeSuffixMenuHandler(javafx.event.Event e) protected voidMethods inherited from class javafx.application.Application
getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet
-
Field Details
-
MAIN_SCENE
-
CSS_STYLE
-
SAVE_PATH_PREF_KEY
- See Also:
-
DOCUMENT
-
HAS_DOCUMENTS
protected boolean HAS_DOCUMENTS -
HAS_ACCELERATOR
protected boolean HAS_ACCELERATOR -
HAS_SEQUENCE
protected boolean HAS_SEQUENCE -
MENU_BAR
protected javafx.scene.control.MenuBar MENU_BAR
-
-
Constructor Details
-
FxApplication
protected FxApplication()Application constructor. -
FxApplication
Application constructor.- Parameters:
urls- An array of document URLs to open upon startup.
-
-
Method Details
-
getStage
public static javafx.stage.Stage getStage() -
getApplicationName
-
setApplicationName
-
getDocument
-
setOxalStyle
public static void setOxalStyle(javafx.scene.Scene scene) This method sets the default Style for Open XAL applications (including Source Sans Pro font). It is public and static to be able to use it from application that don't extend FxApplication. -
setOxalDarkStyle
public static void setOxalDarkStyle(javafx.scene.Scene scene) -
setTheme
public static void setTheme(javafx.scene.Scene scene) -
setup
public abstract void setup(javafx.stage.Stage stage) start() calls this method before initialize(). It should be used to define the DOCUMENT variable. -
beforeStart
public void beforeStart(javafx.stage.Stage stage) start() calls this method after initialize() and before showing the scene. For example, here the user can modify the menu bar. -
start
- Specified by:
startin classjavafx.application.Application- Throws:
IOException
-
buildSequenceMenu
public void buildSequenceMenu(Accelerator accelerator, javafx.scene.control.Menu sequenceMenu, javafx.scene.control.ToggleGroup groupSequence) -
registerApplicationStatusService
protected final void registerApplicationStatusService()Register the application status service so clients on the network can query the status of this application instance. -
stop
public void stop()Overriding the stop method to ensure that applications close properly after calling Platform.exit(). In case some application need to perform some preparation before exiting, this method should be overridden.- Overrides:
stopin classjavafx.application.Application
-
getLaunchTime
Get the launch time which is the time at which the Application instance was instantiated.- Returns:
- The launch time
-
newFileMenuHandler
protected void newFileMenuHandler()Handles creation of new files. By default it calls the newDocument() method of the XalFxDocument class, which must be implemented by subclasses. -
saveFileMenuHandler
protected void saveFileMenuHandler(boolean saveAs) Handles saving of files. It creates a saving dialog by default, and then calls the saveDocument() method of the XalFxDocument class. -
loadFileMenuHandler
protected void loadFileMenuHandler()Handles loading of files. It creates a loading dialog by default, and then calls the loadDocument() method of the XalFxDocument class. -
exitMenuHandler
protected void exitMenuHandler()Handles exit the application. Can be overriden to add cleanup routines. -
testModeMenuHandler
protected void testModeMenuHandler(javafx.event.Event e) -
testModeSuffixMenuHandler
protected void testModeSuffixMenuHandler(javafx.event.Event e) -
setTestMode
public void setTestMode(boolean testModeFlag) -
setTestModeSuffix
-
loadDefaultAcceleratorMenuHandler
protected void loadDefaultAcceleratorMenuHandler() -
setAcceleratorWithPath
-
loadAcceleratorMenuHandler
protected void loadAcceleratorMenuHandler() -
selectSequenceMenuHandler
protected void selectSequenceMenuHandler(javafx.event.Event t) -
addComboHandler
protected void addComboHandler(javafx.scene.control.ToggleGroup groupSequence, javafx.event.Event t) -
eLogMenuHandler
-
helpMenuHandler
protected void helpMenuHandler() -
aboutMenuHandler
protected void aboutMenuHandler() -
urlMenuHandler
protected void urlMenuHandler()
-