|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.client.reference.util.ApplicationSupport
Provides support for Swing applications. This class acts as a facade to commonly needed functionality, typically implemented elsewhere.
If the application is using a tool bar, then the application main panel
should be put in the center of the tool bar panel. For example, getContentPane().add( ApplicationSupport.getToolBarPanel(),
BorderLayout.CENTER );
Hierarchy:
getContentPane().add( ApplicationSupport.createStatusBar( new int[] { 100,
50, 25 } ), BorderLayout.SOUTH );
getToolBarPanel().add( mainPanel, BorderLayout.CENTER );
JFrame > ContentPane > ( ToolBarPanel:CENTER > ( JToolBar:NORTH
MainPanel:CENTER ) ) StatusBar:SOUTH
Field Summary | |
private static ActionManager |
_actionManager
The action manager. |
private static Locale |
_locale
The locale. |
private static Object |
_owner
The owner. |
private static Cursor |
_previousCursor
Handle to the previous cursor. |
private static StatusBar |
_statusBar
The status bar. |
private static JToolBar |
_toolBar
The tool bar. |
private static JPanel |
_toolBarPanel
The panel which holds the tool bar. |
private static String |
PREFERRED_LOCALE_KEY
The base name of the resource bundle. |
private static int |
STATUS_AREA
Constant index for the status area. |
Fields inherited from interface org.moyoman.client.reference.util.IGUIConstants |
DEBUG, DIRTY_PROPERTY, GAP, MARGIN, TRANSPARENT_COLOR |
Constructor Summary | |
private |
ApplicationSupport()
Private constructor to disallow direct instantiation. |
Method Summary | |
static JMenu |
addMenu(JFrame f,
String titleKey,
String[] itemKeys)
|
static StatusBar |
createStatusBar(int[] relativeSizes)
Create the status bar with the given cells. |
static JToolBar |
createToolBar()
Create the tool bar. |
static String |
formatMessage(String patternKey,
String[] params)
Return a formatted message made up of the resource obtained from the pattern key and the parameters. |
static Action |
getAboutAction()
Return the about action. |
static KeyStroke |
getAccelerator(int keyCode)
Return the accelerator for the given key code. |
static ActionManager |
getActionManager()
Return the action manager, creating it if necessary. |
static Color |
getColor(String key)
Return the color specified by the given key. |
static Action |
getCopyAction()
Return the copy action. |
static Action |
getCutAction()
Return the cut action. |
static Action |
getDeleteAction()
Return the delete action. |
static int |
getExitConfirmation(JFrame frame)
Show a dialog requesting confirmation of the exit action. |
static Font |
getFont(String key)
Return the font specified by the given key. |
static Action |
getHelpAction()
Return the help action. |
static Icon |
getIcon(String key)
Return the icon specified by the given key. |
static int |
getInt(String key)
Return the integer specified by the given key. |
static Locale |
getLocale()
Return the locale. |
static Action |
getNewAction()
Return the new action. |
static Action |
getOpenAction()
Return the open action. |
static Action |
getPasteAction()
Return the paste action. |
static Action |
getPreferencesAction()
Return the preferences action. |
static Action |
getQuitAction()
Return the quit action. |
static String |
getResource(String key)
Return the resource for the given key. |
static Action |
getSaveAction()
Return the save action. |
static Action |
getSaveAsAction()
Return the save as action. |
static StatusBar |
getStatusBar()
Return the status bar. |
static JToolBar |
getToolBar()
Return the tool bar. |
static JPanel |
getToolBarPanel()
Return the tool bar. |
static void |
launch(JFrame f,
String title,
int x,
int y,
int w,
int h)
Launch the application in the given frame with the given title with the given bounds. |
static void |
quitActionPerformed(JFrame frame)
Perform the quit action. |
static void |
setCursorBusy(JFrame frame,
boolean busy)
Set the cursor to busy depending upon the given state. |
static void |
setOwner(Object owner)
Set the owner object. |
static void |
showStatus(int area,
String s)
Show the given string in the status area of the status bar. |
static void |
showStatus(int area,
String s,
int displayTime)
Show the given string in the status area of the status bar. |
static void |
showStatus(String s)
Show the given string in the status area of the status bar. |
static void |
showStatus(String s,
int displayTime)
Show the given string in the status area of the status bar. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int STATUS_AREA
private static Cursor _previousCursor
private static final String PREFERRED_LOCALE_KEY
private static StatusBar _statusBar
private static JToolBar _toolBar
private static JPanel _toolBarPanel
private static Locale _locale
private static Object _owner
private static ActionManager _actionManager
Constructor Detail |
private ApplicationSupport()
Method Detail |
public static Action getAboutAction()
public static KeyStroke getAccelerator(int keyCode)
public static ActionManager getActionManager()
public static Color getColor(String key)
key
- Key which identifies the desired resource.public static Action getCopyAction()
public static void setCursorBusy(JFrame frame, boolean busy)
public static Action getCutAction()
public static Action getDeleteAction()
public static int getExitConfirmation(JFrame frame)
public static Font getFont(String key)
key
- Key which identifies the desired resource.public static Action getHelpAction()
public static Icon getIcon(String key)
public static int getInt(String key)
key
- Key which identifies the desired resource.public static Locale getLocale()
public static Action getNewAction()
public static Action getOpenAction()
public static void setOwner(Object owner)
public static Action getPasteAction()
public static Action getPreferencesAction()
public static Action getQuitAction()
public static String getResource(String key)
public static Action getSaveAction()
public static Action getSaveAsAction()
public static StatusBar getStatusBar()
IllegalStateException
- if the status bar has not yet been
created.public static JToolBar getToolBar()
public static JPanel getToolBarPanel()
public static JMenu addMenu(JFrame f, String titleKey, String[] itemKeys)
public static StatusBar createStatusBar(int[] relativeSizes)
public static JToolBar createToolBar()
public static String formatMessage(String patternKey, String[] params)
public static void launch(JFrame f, String title, int x, int y, int w, int h)
public static void quitActionPerformed(JFrame frame)
public static void showStatus(int area, String s)
public static void showStatus(int area, String s, int displayTime)
public static void showStatus(String s)
public static void showStatus(String s, int displayTime)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |