|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.freehep.application.Application
public class Application
A framework for a simple swing application. This framework assumes there will be only one top level window associated with the application, which can always be accessed using the static method Application.getApplication();
The framework provides the following facilities:
Nested Class Summary | |
---|---|
class |
Application.ApplicationCommandProcessor
Extends CommandProcessor to handle some standard Application commands. |
protected class |
Application.ApplicationCommandTargetManager
|
class |
Application.AppPrintPreview
|
static class |
Application.InitializationException
|
static interface |
Application.InitializationListener
|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
protected |
Application(String appName)
Creates new Application |
Method Summary | |
---|---|
void |
about()
|
void |
addApplicationListener(ApplicationListener l)
|
protected JDialog |
createAboutDialog()
|
protected Properties |
createAppProperties()
|
protected org.freehep.util.commandline.CommandLine |
createCommandLine()
|
protected org.freehep.util.commanddispatcher.CommandProcessor |
createCommandProcessor()
|
protected org.freehep.util.commanddispatcher.CommandTargetManager |
createCommandTargetManager()
|
JFrame |
createFrame(String[] argv)
Creates a JFrame that holds the application. |
protected HelpService |
createHelpService()
|
PrintPreview |
createPrintPreview()
|
protected ServiceManager |
createServiceManager()
Override this method to provide a specialized ServiceManager. |
protected Application.InitializationListener |
createSplashScreen()
|
protected StatusBar |
createStatusBar()
Override this to provide an application specific status bar |
protected JPanel |
createToolBarHolder()
|
protected Properties |
createUserProperties()
|
protected org.freehep.xml.menus.XMLMenuBuilder |
createXMLMenuBuilder()
|
protected XMLReader |
createXMLReader()
|
static void |
error(Component source,
String message)
Show an error message in an error dialog. |
static void |
error(Component source,
String message,
Throwable detail)
Show an error message in an error dialog, with optional supporting detail. |
void |
error(String message)
Show an error dialog with a simple message This method is thread safe and can be called from any thread. |
void |
error(String message,
Throwable detail)
Show an error dialog with a message and supporting detail. |
void |
exit()
Override this method to provide specialized application exit handling. |
protected void |
fireAboutToExit(ApplicationEvent event)
|
protected void |
fireApplicationVisible(ApplicationEvent event)
|
protected void |
fireInitializationComplete(ApplicationEvent event)
|
static Application |
getApplication()
|
String |
getAppName()
|
Properties |
getAppProperties()
|
org.freehep.util.commandline.CommandLine |
getCommandLine()
|
org.freehep.util.commanddispatcher.CommandProcessor |
getCommandProcessor()
|
org.freehep.util.commanddispatcher.CommandTargetManager |
getCommandTargetManager()
|
String |
getFullVersion()
|
JMenuBar |
getMenuBar()
|
protected Rectangle |
getPreferredBounds()
|
org.freehep.swing.RecentFileList |
getRecentFileList(String name)
|
ServiceManager |
getServiceManager()
|
boolean |
getShowStatusBar()
|
boolean |
getShowToolBar()
|
StatusBar |
getStatusBar()
|
JPanel |
getToolBarHolder()
|
Properties |
getUserProperties()
|
String |
getVersion()
|
org.freehep.xml.menus.XMLMenuBuilder |
getXMLMenuBuilder()
|
protected void |
init()
|
protected void |
loadDefaultProperties(Properties app)
|
void |
removeApplicationListener(ApplicationListener l)
|
protected void |
saveUserProperties()
|
void |
setLookAndFeel(String lookAndFeelName)
|
void |
setShowStatusBar(boolean show)
Show or Hide the status bar. |
void |
setShowToolBar(boolean show)
Show or Hide the tool bar. |
void |
setStatusMessage(String message)
Display a message in the applications status bar. |
void |
showDialog(JDialog dlg,
String key)
Shows a dialog and remembers its screen position (across sessions) |
void |
showHelpContents()
Shows the table of contents for the help system. |
void |
showHelpIndex()
Shows the index for the help system. |
void |
showHelpSearch()
Opens a search window for the help system. |
void |
showHelpTopic(String helpTopicTarget)
|
void |
showHelpTopic(String helpTopicTarget,
Component owner)
|
static void |
updateComponentTreeUI(Component c)
A simple minded look and feel change: ask each node in the tree to updateUI() -- that is, to initialize its UI property
with the current look and feel. |
void |
updateUI()
|
static int |
versionNumberCompare(String v1,
String v2)
Compares two version numbers of the form 1.2.3.4 |
void |
whenAvailable(String part,
Runnable run)
Run Runnable when part is downloaded and available. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Application(String appName)
Method Detail |
---|
protected ServiceManager createServiceManager() throws Application.InitializationException
Application.InitializationException
AppServiceManager
public ServiceManager getServiceManager()
public static Application getApplication()
public org.freehep.swing.RecentFileList getRecentFileList(String name)
protected void saveUserProperties()
public void setLookAndFeel(String lookAndFeelName)
public String getVersion()
public String getFullVersion()
public static int versionNumberCompare(String v1, String v2) throws NumberFormatException
NumberFormatException
public PrintPreview createPrintPreview()
public void showDialog(JDialog dlg, String key)
public org.freehep.util.commanddispatcher.CommandProcessor getCommandProcessor()
protected org.freehep.util.commanddispatcher.CommandProcessor createCommandProcessor()
public org.freehep.util.commanddispatcher.CommandTargetManager getCommandTargetManager()
protected org.freehep.util.commandline.CommandLine createCommandLine()
public org.freehep.util.commandline.CommandLine getCommandLine()
protected org.freehep.util.commanddispatcher.CommandTargetManager createCommandTargetManager()
public final void showHelpTopic(String helpTopicTarget)
public void showHelpTopic(String helpTopicTarget, Component owner)
public void whenAvailable(String part, Runnable run)
part
- The part will be downloaded (if necessary)run
- The Runnable that will be runprotected HelpService createHelpService() throws Application.InitializationException
Application.InitializationException
public final void showHelpContents()
public final void showHelpIndex()
public final void showHelpSearch()
public void about()
public void error(String message)
message
- The message to displaypublic void error(String message, Throwable detail)
message
- The error messagedetail
- the nested exceptionpublic static void error(Component source, String message)
source
- The owner of the error dialogmessage
- The error messagepublic static void error(Component source, String message, Throwable detail)
source
- The owner of the error dialogmessage
- The error messagedetail
- A throwable giving more details on the error.org.freehep.util.HasNestedException
protected JDialog createAboutDialog()
protected JPanel createToolBarHolder()
public JPanel getToolBarHolder()
protected StatusBar createStatusBar()
public StatusBar getStatusBar()
public void setStatusMessage(String message)
message
- The message to displaypublic boolean getShowStatusBar()
public void setShowStatusBar(boolean show)
show
- true to display the status barpublic boolean getShowToolBar()
public void setShowToolBar(boolean show)
show
- true to display the tool barpublic void exit()
protected Application.InitializationListener createSplashScreen()
public JFrame createFrame(String[] argv) throws Application.InitializationException
Application.InitializationException
protected void init()
protected Rectangle getPreferredBounds()
public Properties getUserProperties()
protected Properties createUserProperties()
protected XMLReader createXMLReader()
protected org.freehep.xml.menus.XMLMenuBuilder createXMLMenuBuilder()
public org.freehep.xml.menus.XMLMenuBuilder getXMLMenuBuilder() throws Application.InitializationException
Application.InitializationException
public Properties getAppProperties()
protected Properties createAppProperties() throws Application.InitializationException
Application.InitializationException
protected void loadDefaultProperties(Properties app) throws IOException
IOException
public String getAppName()
public void addApplicationListener(ApplicationListener l)
public void removeApplicationListener(ApplicationListener l)
protected void fireInitializationComplete(ApplicationEvent event)
protected void fireApplicationVisible(ApplicationEvent event)
protected void fireAboutToExit(ApplicationEvent event)
public JMenuBar getMenuBar()
public void updateUI()
updateUI
in class JPanel
public static void updateComponentTreeUI(Component c)
updateUI()
-- that is, to initialize its UI property
with the current look and feel. Unlike SwingUtilities.updateComponentTreeUI
this method updates each component's children before updating the component itself,
making it easier for components to fine tune their children's look and feel's.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |