P - The root node of the stage, must extends Pane to allow children management@Configuration(value=".*jrebirth") @Localized(value=".*_rb") public abstract class AbstractApplication<P extends Pane> extends Application implements JRebirthApplication<P>, ApplicationMessages
Application.Parameters| Modifier and Type | Field and Description |
|---|---|
private static String |
APP_SUFFIX_CLASSNAME
The default suffix for Application main class.
|
private static JRLogger |
LOGGER
The class logger.
|
private static String |
PARAM
Default parameter replacement string.
|
private P |
rootNode
The root node of the scene built by reflection.
|
private Scene |
scene
The application scene.
|
private Stage |
stage
The application primary stage.
|
ATTACH_JAT_UEH, ATTACH_JIT_UEH, CSS_LOADING_ERROR, INIT_ERROR, NO_CSS_DEFINED, OVERRIDE_FIRST_MODEL_CLASS, START_APPLICATION, START_ERROR, STARTED_SUCCESSFULLY, STOP_APPLICATION, STOP_ERROR, STOPPED_SUCCESSFULLY| Constructor and Description |
|---|
AbstractApplication() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCSS(Scene scene,
StyleSheetItem styleSheetItem)
Attach a new CSS file to the scene using the default classloader.
|
protected P |
buildRootPane()
Build dynamically the root pane.
|
protected Scene |
buildScene()
Initialize the properties of the scene.
800x600 with transparent background and a Region as Parent Node
|
protected abstract void |
customizeScene(Scene scene)
Customize the default scene.
|
protected abstract void |
customizeStage(Stage stage)
Customize the primary stage.
|
protected String |
getApplicationTitle()
Return the application title.
|
protected Thread.UncaughtExceptionHandler |
getDefaultUncaughtExceptionHandler()
Build and return the Default Uncaught Exception Handler for All threads which don't have any handler.
|
protected abstract List<FontItem> |
getFontToPreload()
Return the list of FontEnum to load for CSS.
|
protected KeyCode |
getFullScreenKeyCode()
Return the #KeyCode used to put the application in full screen mode.
|
protected KeyCode |
getIconifiedKeyCode()
Return the #KeyCode used to iconify the application.
|
protected Thread.UncaughtExceptionHandler |
getJatUncaughtExceptionHandler()
Build and return the Uncaught Exception Handler for JavaFX Application Thread.
|
protected Thread.UncaughtExceptionHandler |
getJitUncaughtExceptionHandler()
Build and return the Uncaught Exception Handler for JRebirth Internal Thread.
|
Thread.UncaughtExceptionHandler |
getPoolUncaughtExceptionHandler()
Build and return the Uncaught Exception Handler for JRebirth Thread Pool.
|
P |
getRootNode()
Return the root node of the main scene of this application.
|
Scene |
getScene()
Return the scene of the main stage of this application.
|
private String |
getShortClassName()
Return the application class name without the Application suffix.
|
Stage |
getStage()
Return the main stage of this application.
|
void |
init() |
protected void |
initializeExceptionHandler()
Initialize all Uncaught Exception Handler.
|
private void |
initializeScene()
Initialize the default scene.
|
private void |
initializeStage()
Customize the primary Stage.
|
protected static void |
launchNow(Class<? extends Application> appClass,
String... args)
Launch the Given JavaFX Application (without any preloader).
|
protected static void |
launchNow(String... args)
Launch the Current JavaFX Application (without any preloader).
|
private void |
loadConfigurationFiles()
Load all configuration files before showing anything.
|
private void |
loadMessagesFiles()
Load all Messages files before showing anything.
|
private void |
manageDefaultStyleSheet(Scene scene)
Attach default CSS file if none have been previously attached.
|
protected abstract void |
postInit()
Perform custom task after application initialization phase and before starting phase.
|
protected abstract void |
preInit()
Perform custom task before application initialization phase.
|
protected static void |
preloadAndLaunch(Class<? extends Application> appClass,
Class<? extends Preloader> preloaderClass,
String... args)
Launch the given JavaFX Application with given preloader.
|
protected static void |
preloadAndLaunch(Class<? extends Preloader> preloaderClass,
String... args)
Launch the Current JavaFX Application with given preloader.
|
protected static void |
preloadAndLaunch(String... args)
Launch the Current JavaFX Application with Default JRebirth preloader.
|
void |
preloadFonts()
Preload JRebirth wrapped fonts to allow them to be used directly by CSS.
|
void |
start(Stage primaryStage) |
void |
stop() |
getHostServices, getParameters, launch, launch, notifyPreloaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFirstModelClass, getPostBootWaveList, getPreBootWaveListprivate static final String PARAM
private static final String APP_SUFFIX_CLASSNAME
private static final JRLogger LOGGER
private transient Stage stage
private transient Scene scene
protected static void preloadAndLaunch(String... args)
args - arguments passed to java command lineprotected static void preloadAndLaunch(Class<? extends Preloader> preloaderClass, String... args)
preloaderClass - the preloader class used as splash screen with progressargs - arguments passed to java command lineprotected static void preloadAndLaunch(Class<? extends Application> appClass, Class<? extends Preloader> preloaderClass, String... args)
appClass - the JavaFX application class to launchpreloaderClass - the preloader class used as splash screen with progressargs - arguments passed to java command lineprotected static void launchNow(String... args)
args - arguments passed to java command lineprotected static void launchNow(Class<? extends Application> appClass, String... args)
appClass - the JavaFX application class to launchargs - arguments passed to java command linepublic final void init()
throws CoreException
init in class ApplicationCoreExceptionprotected abstract void preInit()
protected abstract void postInit()
public final void start(Stage primaryStage) throws CoreException
start in class ApplicationCoreExceptionprivate void loadConfigurationFiles()
private void loadMessagesFiles()
public final void stop()
throws CoreException
stop in class ApplicationCoreExceptionprivate void initializeStage()
protected abstract void customizeStage(Stage stage)
stage - the primary stage to customizeprivate void initializeScene()
public void preloadFonts()
preloadFonts in interface JRebirthApplication<P extends Pane>protected abstract List<FontItem> getFontToPreload()
protected abstract void customizeScene(Scene scene)
scene - the scene to customizeprotected void addCSS(Scene scene, StyleSheetItem styleSheetItem)
scene - the scene that will hold this new CSS filestyleSheetItem - the stylesheet item to addprotected String getApplicationTitle()
JRebirthParameters.APPLICATION_NAME JRebirthParameters.APPLICATION_VERSION string.
The default application is: ApplicationClass powered by JRebirth private String getShortClassName()
private void manageDefaultStyleSheet(Scene scene)
scene - the scene to checkprotected final Scene buildScene() throws CoreException
CoreException - if build failsprotected P buildRootPane() throws CoreException
CoreException - if build failsprotected void initializeExceptionHandler()
public Stage getStage()
getStage in interface JRebirthApplication<P extends Pane>public final Scene getScene()
getScene in interface JRebirthApplication<P extends Pane>public P getRootNode()
getRootNode in interface JRebirthApplication<P extends Pane>protected KeyCode getFullScreenKeyCode()
protected KeyCode getIconifiedKeyCode()
protected Thread.UncaughtExceptionHandler getDefaultUncaughtExceptionHandler()
protected Thread.UncaughtExceptionHandler getJatUncaughtExceptionHandler()
protected Thread.UncaughtExceptionHandler getJitUncaughtExceptionHandler()
public Thread.UncaughtExceptionHandler getPoolUncaughtExceptionHandler()
Copyright © 2011–2014 JRebirth OSS. All rights reserved.