apps
Class AppsBase

java.lang.Object
  extended by apps.AppsBase
Direct Known Subclasses:
Apps3

public abstract class AppsBase
extends Object

Base class for the core of JMRI applications.

This provides a non-GUI base for applications. Below this is the Apps3 class which provides basic Swing GUI support.

For an example of using this, see FacelessApp and comments therein.

There are a series of steps in the configuration:

preInit
Initialize log4j, invoked from the main()
ctor

Author:
Bob Jacobsen Copyright 2009, 2010

Field Summary
protected  boolean configDeferredLoadOK
           
protected  boolean configOK
           
protected static String nameString
           
protected  boolean preferenceFileExists
           
 
Constructor Summary
AppsBase()
          Create and initialize the application object.
 
Method Summary
protected  void addDefaultShutDownTasks()
           
protected  void createDemoScaffolding()
           
static String getConfigFileName()
           
protected  JComponent getSensorTableDemo()
           
protected static void initLog4J()
           
protected  void installConfigurationManager()
           
protected  void installManagers()
           
protected  void installShutDownManager()
           
protected  void postInit()
          Final actions before releasing control of app to user, invoked explicitly after object has been constructed, e.g. in main().
static void preInit()
          Initial actions before frame is created, invoked in the applications main() routine.
protected  void setAndLoadPreferenceFile()
           
protected static void setConfigFilename(String def, String[] args)
          Set up the configuration file name at startup.
protected static void setJmriSystemProperty(String key, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameString

protected static final String nameString
See Also:
Constant Field Values

configOK

protected boolean configOK

configDeferredLoadOK

protected boolean configDeferredLoadOK

preferenceFileExists

protected boolean preferenceFileExists
Constructor Detail

AppsBase

public AppsBase()
Create and initialize the application object.

Expects initialization from preInit() to already be done.

Method Detail

preInit

public static void preInit()
Initial actions before frame is created, invoked in the applications main() routine.


createDemoScaffolding

protected void createDemoScaffolding()

getSensorTableDemo

protected JComponent getSensorTableDemo()

installConfigurationManager

protected void installConfigurationManager()

installManagers

protected void installManagers()

setAndLoadPreferenceFile

protected void setAndLoadPreferenceFile()

installShutDownManager

protected void installShutDownManager()

addDefaultShutDownTasks

protected void addDefaultShutDownTasks()

postInit

protected void postInit()
Final actions before releasing control of app to user, invoked explicitly after object has been constructed, e.g. in main().


setConfigFilename

protected static void setConfigFilename(String def,
                                        String[] args)
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:

This name will be used for reading and writing the preferences. It need not exist when the program first starts up.

Parameters:
def - Default value if no other is provided
args - Argument array from the main routine

getConfigFileName

public static String getConfigFileName()

setJmriSystemProperty

protected static void setJmriSystemProperty(String key,
                                            String value)

initLog4J

protected static void initLog4J()


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads