Package apps.gui3
Class Apps3
- java.lang.Object
-
- apps.AppsBase
-
- apps.gui3.Apps3
-
- Direct Known Subclasses:
DecoderPro3,LccPro,MDI,Paned
public abstract class Apps3 extends AppsBase
Base class for GUI3 JMRI applications.This is a complete re-implementation of the apps.Apps support for JMRI applications.
Each using application provides its own main() method.
There are a large number of missing features marked with TODO in comments including code from the earlier implementation.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static javax.swing.JComponent_buttonSpace(package private) static booleandebugFired(package private) static java.awt.event.AWTEventListenerdebugListener(package private) static booleandebugmsgprotected JmriJFramemainFrame(package private) static SplashWindowsp-
Fields inherited from class apps.AppsBase
configDeferredLoadOK, configOK, preferenceFileExists
-
-
Constructor Summary
Constructors Constructor Description Apps3(java.lang.String applicationName, java.lang.String configFileDef, java.lang.String[] args)Create and initialize the application object.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static javax.swing.JComponentbuttonSpace()Provide access to a place where applications can expect the configuration code to build run-time buttons.protected voidconfigureProfile()Configure theProfileto use for this application.voidcreateAndDisplayFrame()protected abstract voidcreateMainFrame()protected voiddisplayMainFrame(java.awt.Dimension d)protected voidinitMacOSXMenus()voidlaunchFirstTimeStartupWizard()static voidpreInit(java.lang.String applicationName)Initial actions before frame is created, invoked in the applications main() routine.protected voidsetAndLoadPreferenceFile()Invoked to load the preferences information, and in the process configure the system.protected static voidsetButtonSpace()For compatability with adding in buttons to the toolbar using the existing createbuttonmodelprotected voidsetFloating(javax.swing.JToolBar toolBar)Set a toolbar to be initially floating.protected static voidsplash(boolean show)protected static voidsplash(boolean show, boolean debug)protected static javax.swing.JPanelsplashDebugMsg()protected voidstart()Final actions before releasing control of app to userprotected static voidstartupDebug()protected booleanwizardLaunchCheck()To be overridden by applications that need to make additional checks as to whether the first time wizard should be launched.-
Methods inherited from class apps.AppsBase
getConfigFileName, handleQuit, handleRestart, installConfigurationManager, installManagers, setConfigFilename, setJmriSystemProperty
-
-
-
-
Field Detail
-
_buttonSpace
static javax.swing.JComponent _buttonSpace
-
mainFrame
protected JmriJFrame mainFrame
-
sp
static SplashWindow sp
-
debugListener
static java.awt.event.AWTEventListener debugListener
-
debugFired
static boolean debugFired
-
debugmsg
static boolean debugmsg
-
-
Constructor Detail
-
Apps3
public Apps3(java.lang.String applicationName, java.lang.String configFileDef, java.lang.String[] args)
Create and initialize the application object.Expects initialization from preInit() to already be done.
- Parameters:
applicationName- application nameconfigFileDef- default configuration file nameargs- command line arguments set at application launch
-
-
Method Detail
-
preInit
public static void preInit(java.lang.String applicationName)
Initial actions before frame is created, invoked in the applications main() routine.- Operations from
AppsBase.preInit(String) - Initialize the console support
- Parameters:
applicationName- application name
- Operations from
-
wizardLaunchCheck
protected boolean wizardLaunchCheck()
To be overridden by applications that need to make additional checks as to whether the first time wizard should be launched.- Returns:
- true to force the wizard to be launched
-
launchFirstTimeStartupWizard
public void launchFirstTimeStartupWizard()
-
setButtonSpace
protected static void setButtonSpace()
For compatability with adding in buttons to the toolbar using the existing createbuttonmodel
-
buttonSpace
public static javax.swing.JComponent buttonSpace()
Provide access to a place where applications can expect the configuration code to build run-time buttons.- Returns:
- null if no such space exists
- See Also:
CreateButtonModelFactory
-
createMainFrame
protected abstract void createMainFrame()
-
createAndDisplayFrame
public void createAndDisplayFrame()
-
setFloating
protected void setFloating(javax.swing.JToolBar toolBar)
Set a toolbar to be initially floating. This doesn't quite work right.- Parameters:
toolBar- the toolbar to float
-
displayMainFrame
protected void displayMainFrame(java.awt.Dimension d)
-
start
protected void start()
Final actions before releasing control of app to user
-
splash
protected static void splash(boolean show)
-
splash
protected static void splash(boolean show, boolean debug)
-
splashDebugMsg
protected static javax.swing.JPanel splashDebugMsg()
-
startupDebug
protected static void startupDebug()
-
initMacOSXMenus
protected void initMacOSXMenus()
-
configureProfile
protected void configureProfile()
Configure theProfileto use for this application.Overrides super() method so dialogs can be displayed.
- Overrides:
configureProfilein classAppsBase
-
setAndLoadPreferenceFile
protected void setAndLoadPreferenceFile()
Description copied from class:AppsBaseInvoked 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
- Overrides:
setAndLoadPreferenceFilein classAppsBase
- Locate the preferences file based through
-
-