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 String
protected XalFxDocument
protected boolean
protected boolean
protected boolean
protected String
protected javafx.scene.control.MenuBar
static final String
Fields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENA
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Application constructor.protected
FxApplication
(URL[] urls) Application constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
addComboHandler
(javafx.scene.control.ToggleGroup groupSequence, javafx.event.Event t) void
beforeStart
(javafx.stage.Stage stage) start() calls this method after initialize() and before showing the scene.void
buildSequenceMenu
(Accelerator accelerator, javafx.scene.control.Menu sequenceMenu, javafx.scene.control.ToggleGroup groupSequence) protected void
eLogMenuHandler
(String docType) protected void
Handles exit the application.Get the launch time which is the time at which the Application instance was instantiated.static javafx.stage.Stage
getStage()
protected void
protected void
protected void
protected void
Handles loading of files.protected void
Handles creation of new files.protected final void
Register the application status service so clients on the network can query the status of this application instance.protected void
saveFileMenuHandler
(boolean saveAs) Handles saving of files.protected void
selectSequenceMenuHandler
(javafx.event.Event t) protected void
setAcceleratorWithPath
(String acceleratorPath) void
setApplicationName
(String applicationName) static void
setOxalDarkStyle
(javafx.scene.Scene scene) static void
setOxalStyle
(javafx.scene.Scene scene) This method sets the default Style for Open XAL applications (including Source Sans Pro font).void
setTestMode
(boolean testModeFlag) void
setTestModeSuffix
(String suffix) static void
setTheme
(javafx.scene.Scene scene) abstract void
setup
(javafx.stage.Stage stage) start() calls this method before initialize().final void
start
(javafx.stage.Stage stage) void
stop()
Overriding the stop method to ensure that applications close properly after calling Platform.exit().protected void
testModeMenuHandler
(javafx.event.Event e) protected void
testModeSuffixMenuHandler
(javafx.event.Event e) protected void
Methods 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:
start
in 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:
stop
in 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()
-