|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.binding.beans.Model
com.jgoodies.uif.application.Application
com.jgoodies.uif.application.AbstractUIFApplication
public abstract class AbstractUIFApplication
An abstract class that organizes the application startup process. It therefore defines a default startup sequence and provides some convenience code, useful for this task.
This class uses the JGoodies foundation classes only. In contrast,
the DefaultApplicationStarter
uses more of the JGoodies
convenience classes.
Application
,
Splash
,
Serialized FormConstructor Summary | |
---|---|
AbstractUIFApplication()
|
Method Summary | |
---|---|
protected void |
addLogFileHandler(File logDirectory,
String logFilePattern)
Adds a FileHandler to the root Logger that writes log files with the specified pattern to the given directory. |
protected abstract void |
configureHelp()
Configures the application wide help. |
protected abstract void |
configureLogging()
Configures the logging. |
protected void |
configureLoggingFromProperties(String configurationFileName)
Reads the specified logging configuration properties file and configures the LogManager. |
protected abstract void |
configureSplash()
Configures the splash component. |
protected abstract void |
configureUI()
Configures all UI related properties: look&feel, system properties, etc. |
protected void |
disposeFramesAndWindows()
Disposes all frames and their owned windows. |
protected void |
ensureParentDirectoryExists(String pattern)
Ensures that the parent directory exists for the file associated with the specified logging pattern. |
protected void |
exitSystem()
|
File |
getApplicationDataDirectory()
Lazily looks up and returns the directory that shall be used to store and retrieve application data. |
protected ResourceMap |
getAppResourceMap()
Returns the application's application resource map chain. |
protected abstract void |
launchApplication()
Brings up the application, it therefore initializes the main frame, checks the setup process, initializes all actions, then builds the main frame, and finally opens it. |
protected void |
load()
Loads, configures, initializes, and brings up the application. |
protected File |
lookupApplicationDataBaseDirectory()
Looks up and returns the base directory for application data such as log files,project data, etc. |
protected File |
lookupApplicationDataDirectory()
Looks up and returns the directory for application data such as log files, project data, etc. |
protected void |
shutdown()
Performs cleanup tasks when the application exits. |
protected void |
startup(String[] args)
Does a minimal preparation before running the application load process: initializes fields and catches errors. |
Methods inherited from class com.jgoodies.uif.application.Application |
---|
addExitListener, clearActionMap, end, exit, exit, exitAllowed, fireApplicationExiting, getAction, getActionMap, getApplicationExitOnWindowClosingHandler, getResourceMap, launch, removeExitListener |
Methods inherited from class com.jgoodies.binding.beans.Model |
---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractUIFApplication()
Method Detail |
---|
protected void startup(String[] args)
startup
in class Application
Application.launch(Class, String[])
,
Application.shutdown()
protected void shutdown()
Application
shutdown
in class Application
Application.startup(String[])
,
Application.exit(EventObject)
,
Application.addExitListener(ExitListener)
protected void load()
protected void exitSystem()
protected abstract void configureLogging()
protected abstract void configureSplash()
protected abstract void configureHelp()
protected abstract void configureUI()
protected abstract void launchApplication()
TODO: Consider renaming this method to #createAndShowGUI
to make it consistent with the examples used in Kathy's Java Tutorial.
public final File getApplicationDataDirectory()
lookupApplicationDataDirectory()
which in turn gets
the base dir from lookupApplicationDataBaseDirectory()
.
The default implementation of lookupApplicationDataDirectory()
requires the following application resource values:
application.id
and application.vendor.id
.
Examples for the default implementation:
application.id=Skeleton Pro application.vendor.id=JGoodies C:\Documents and Files\Karsten\AppData\JGoodies\Skeleton Pro\ # XP C:\Dokumente und Einstellungen\Karsten\Anwendungsdaten\JGoodies\Skeleton Pro\ # XP German C:\Users\Karsten\AppData\JGoodies\Skeleton Pro\ # Vista C:\Users\Karsten\Anwendungsdaten\JGoodies\Skeleton Pro\ # Vista German /Users/Karsten/Library/Application Support/JGoodies/Skeleton Pro/ # Mac OS X /users/karsten/.jgoodies/skeletonpro/ # Solaris, Linux, all other OS
protected final ResourceMap getAppResourceMap()
ApplicationContext.getResourceMap()
protected final void ensureParentDirectoryExists(String pattern)
pattern
- a pattern as used with the Java loggingprotected final void disposeFramesAndWindows()
protected File lookupApplicationDataDirectory()
On Windows and Mac the ${application.vendor.id}
and
${application.id}
are appended to the application base
directory. On all other platforms whitespace characters are stripped
from the vendor id and application id, and both are in lower case.
Also, the path aims to result in a hidden directory by prepending
a dot ('.').
Examples:
<basedir>/JGoodies/Skeleton Pro/ # Windows, Mac <basedir>/.jgoodies/skeletonpro/ # Other platforms
MissingResourceException
- if ${application.id}
or ${application.vendor.id}
is undefinedprotected File lookupApplicationDataBaseDirectory()
On Windows the %APPDATA% environment variable is requested
from the System
. On the Mac the user home directory is
appended by Libraries/Application Support. All other platforms
just use the user home dir.
Examples:
C:\Documents and Files\Karsten\AppData\ # XP C:\Dokumente und Einstellungen\Karsten\Anwendungsdaten\ # XP German C:\Users\Karsten\AppData\ # Vista C:\Users\Karsten\Anwendungsdaten\ # Vista German /users/Karsten/Library/Application Support/ # Mac OS X /users/karsten/ # Other OS
protected void configureLoggingFromProperties(String configurationFileName)
configurationFileName
- a properties file to configure the LogManager.LogManager.readConfiguration(InputStream)
protected void addLogFileHandler(File logDirectory, String logFilePattern)
logDirectory
- the directory where log files shall be locatedlogFilePattern
- a pattern that shall not contain path information,
for example "console%u.log".
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |