|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.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. |
class |
Application.AppPrintPreview
|
static class |
Application.InitializationException
|
static interface |
Application.InitializationListener
|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 |
Method Summary | |
---|---|
void |
about()
|
void |
addApplicationListener(ApplicationListener l)
|
JFrame |
createFrame(String[] argv)
Creates a JFrame that holds the application. |
PrintPreview |
createPrintPreview()
|
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. |
static int |
error(Component source,
String message,
Throwable detail,
Object[] options)
Show an error message in an error dialog, with optional supporting detail and user response options. |
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. |
int |
error(String message,
Throwable detail,
Object[] options)
Show an error message in an error dialog, with optional supporting detail and user response options. |
void |
exit()
Override this method to provide specialized application exit handling. |
static Application |
getApplication()
|
String |
getAppName()
|
Properties |
getAppProperties()
|
CommandLine |
getCommandLine()
|
CommandProcessor |
getCommandProcessor()
|
CommandTargetManager |
getCommandTargetManager()
|
String |
getFullVersion()
|
JMenuBar |
getMenuBar()
|
RecentFileList |
getRecentFileList(String name)
|
ServiceManager |
getServiceManager()
|
boolean |
getShowStatusBar()
|
boolean |
getShowToolBar()
|
StatusBar |
getStatusBar()
|
JPanel |
getToolBarHolder()
|
Properties |
getUserProperties()
|
String |
getVersion()
|
XMLMenuBuilder |
getXMLMenuBuilder()
|
void |
removeApplicationListener(ApplicationListener l)
|
void |
restart()
Restarts application. |
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, setUI |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public ServiceManager getServiceManager()
public static Application getApplication()
public RecentFileList getRecentFileList(String name)
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 CommandProcessor getCommandProcessor()
public CommandTargetManager getCommandTargetManager()
public CommandLine getCommandLine()
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 runpublic 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
public int error(String message, Throwable detail, Object[] options)
JOptionPane
API documentation for the description of options treatment and return values.
message
- The error messagedetail
- A throwable giving more details on the error.options
- An array of objects indicating the possible choices the user can make.
public static int error(Component source, String message, Throwable detail, Object[] options)
JOptionPane
API documentation for the description of options treatment and return values.
source
- The owner of the error dialogmessage
- The error messagedetail
- A throwable giving more details on the error.options
- An array of objects indicating the possible choices the user can make.
public JPanel getToolBarHolder()
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()
public void restart()
exit()
, then attempts to restart the application.
If the application cannot be restarted for any reason, it is shut down.
public JFrame createFrame(String[] argv) throws Application.InitializationException
Application.InitializationException
public Properties getUserProperties()
public XMLMenuBuilder getXMLMenuBuilder() throws Application.InitializationException
Application.InitializationException
public final Properties getAppProperties()
public String getAppName()
public void addApplicationListener(ApplicationListener l)
public void removeApplicationListener(ApplicationListener l)
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 |