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>
  • Field Details

    • MAIN_SCENE

      protected String MAIN_SCENE
    • CSS_STYLE

      protected static String CSS_STYLE
    • SAVE_PATH_PREF_KEY

      public static final String SAVE_PATH_PREF_KEY
      See Also:
    • DOCUMENT

      protected XalFxDocument DOCUMENT
    • HAS_DOCUMENTS

      protected boolean HAS_DOCUMENTS
    • HAS_ACCELERATOR

      protected boolean HAS_ACCELERATOR
    • HAS_SEQUENCE

      protected boolean HAS_SEQUENCE
  • Constructor Details

    • FxApplication

      protected FxApplication()
      Application constructor.
    • FxApplication

      protected FxApplication(URL[] urls)
      Application constructor.
      Parameters:
      urls - An array of document URLs to open upon startup.
  • Method Details

    • getStage

      public static javafx.stage.Stage getStage()
    • getApplicationName

      public String getApplicationName()
    • setApplicationName

      public void setApplicationName(String applicationName)
    • getDocument

      public XalFxDocument 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

      public final void start(javafx.stage.Stage stage) throws IOException
      Specified by:
      start in class javafx.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 class javafx.application.Application
    • getLaunchTime

      public Date 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

      public void setTestModeSuffix(String suffix)
    • loadDefaultAcceleratorMenuHandler

      protected void loadDefaultAcceleratorMenuHandler()
    • setAcceleratorWithPath

      protected void setAcceleratorWithPath(String acceleratorPath)
    • 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

      protected void eLogMenuHandler(String docType)
    • helpMenuHandler

      protected void helpMenuHandler()
    • aboutMenuHandler

      protected void aboutMenuHandler()
    • urlMenuHandler

      protected void urlMenuHandler()