Package apps
Class AppsBase
java.lang.Object
apps.AppsBase
- Direct Known Subclasses:
Apps3,JmriFaceless
Base class for the core of JMRI applications.
This provides a non-GUI base for applications. Below this is the
Apps3 subclass which provides basic Swing GUI support.
There are a series of steps in the configuration:
- preInit
- Initialize log4j, invoked from the main()
- ctor
- Construct the basic application object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected boolean(package private) static boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigure theProfileto use for this application.static Stringstatic booleanThe application decided to quit, handle that.static voidThe application decided to restart, handle that.protected voidprotected voidstatic voidInitial actions before frame is created, invoked in the applications main() routine.protected voidInvoked to load the preferences information, and in the process configure the system.protected static voidsetConfigFilename(String def, String[] args) Set up the configuration file name at startup.protected static voidsetJmriSystemProperty(String key, String value) protected voidstart()Final actions before releasing control of the application to the user, invoked explicitly after object has been constructed in main().
-
Field Details
-
configOK
-
configDeferredLoadOK
-
preferenceFileExists
-
preInit
-
-
Constructor Details
-
AppsBase
Create and initialize the application object.- Parameters:
applicationName- user-visible name of applicationconfigFileDef- default config filenameargs- arguments passed to application at launch
-
-
Method Details
-
preInit
Initial actions before frame is created, invoked in the applications main() routine.- Initialize logging
- Set application name
- Parameters:
applicationName- The application name as presented to the user
-
configureProfile
Configure theProfileto use for this application.Note that GUI-based applications must override this method, since this method does not provide user feedback.
-
installConfigurationManager
-
installManagers
-
setAndLoadPreferenceFile
Invoked to load the preferences information, and in the process configure the system. The high-level steps are:- Locate the preferences file based through
FileUtil.getFile(String) - See if the preferences file exists, and handle it if it doesn't
- Obtain a
ConfigureManagerfrom theInstanceManager - Ask that ConfigureManager to load the file, in the process loading information into existing and new managers.
- Do any deferred loads that are needed
- If needed, migrate older formats
- Locate the preferences file based through
-
start
Final actions before releasing control of the application to the user, invoked explicitly after object has been constructed in main(). -
setConfigFilename
Set up the configuration file name at startup.The Configuration File name variable holds the name used to load the configuration file during later startup processing. Applications invoke this method to handle the usual startup hierarchy:
- If an absolute filename was provided on the command line, use it
- If a filename was provided that's not absolute, consider it to be in the preferences directory
- If no filename provided, use a default name (that's application specific)
- Parameters:
def- Default value if no other is providedargs- Argument array from the main routine
-
getConfigFileName
-
setJmriSystemProperty
-
handleQuit
The application decided to quit, handle that.- Returns:
- always returns false
-
handleRestart
The application decided to restart, handle that.
-