|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.jdesktop.swingx.JXFrame
com.ehsbe.commons.gui.AppFrame
public class AppFrame
The application Frame.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jdesktop.swingx.JXFrame |
---|
org.jdesktop.swingx.JXFrame.StartPosition |
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
ACTION_FILE_QUIT
the command, which gets send, when the frame receives a WindowEvent.WINDOW_CLOSING event |
static int |
PREF_APP_HEIGHT_DEFAULT
default value to be used for the frames height |
static String |
PREF_APP_HEIGHT_KEY
key to be used for reading/storing the frames height in preferences |
static int |
PREF_APP_WIDTH_DEFAULT
default value to be used for the frames width |
static String |
PREF_APP_WIDTH_KEY
key to be used for reading/storing the frames width in preferences |
static int |
PREF_APP_X_DEFAULT
default value to be used for the frames x position |
static String |
PREF_APP_X_KEY
key to be used for reading/storing the frames x position in preferences |
static int |
PREF_APP_Y_DEFAULT
default value to be used for the frames y position |
static String |
PREF_APP_Y_KEY
key to be used for reading/storing the frames y position in preferences |
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
AppFrame()
Construct the frame using the default locale. |
|
AppFrame(Locale locale)
Construct a new frame using the given locale. |
Method Summary | ||
---|---|---|
void |
dispose()
|
|
ActionManager |
getManager()
Get the action manager attached to this frame |
|
|
getProperty(Class<T> clazz,
String key)
Get user data |
|
boolean |
hasJxStatusBar()
Convinience method to check, whether the frame uses an enhanced JxStatusBar . |
|
protected void |
processWindowEvent(WindowEvent e)
Overridden, so that a controller may intercept the window closing event. |
|
void |
putProperty(String key,
Object value)
Set user data. |
|
void |
saveLocation(Preferences prefs)
Save the current location of the frame to the given preferences. |
|
void |
saveSize(Preferences prefs)
Save the current size of the frame into the given preferences. |
|
void |
setIconImage(String path)
Set the image to be displayed when minimized. |
|
void |
setLocation(Preferences prefs)
Try to set the location of the frame using the given preferences. |
|
void |
setSize(Preferences prefs)
Try to set the size of the frame using the given preferences. |
|
void |
setStatusBar(org.jdesktop.swingx.JXStatusBar statusBar)
Use this method to set a statusbar. |
Methods inherited from class org.jdesktop.swingx.JXFrame |
---|
createRootPane, getCancelButton, getDefaultButton, getIdleThreshold, getKeyPreview, getRootPaneExt, getStartPosition, getStatusBar, getToolBar, getWaitPane, isIdle, isWaitCursorVisible, isWaiting, isWaitPaneVisible, setCancelButton, setCursor, setDefaultButton, setIdle, setIdleThreshold, setKeyPreview, setRootPane, setStartPosition, setToolBar, setVisible, setWaitCursorVisible, setWaiting, setWaitPane, setWaitPaneVisible |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public static final String ACTION_FILE_QUIT
WindowEvent.WINDOW_CLOSING
event
public static final String PREF_APP_WIDTH_KEY
public static final int PREF_APP_WIDTH_DEFAULT
public static final String PREF_APP_HEIGHT_KEY
public static final int PREF_APP_HEIGHT_DEFAULT
public static final String PREF_APP_X_KEY
public static final int PREF_APP_X_DEFAULT
public static final String PREF_APP_Y_KEY
public static final int PREF_APP_Y_DEFAULT
Constructor Detail |
---|
public AppFrame()
public AppFrame(Locale locale)
locale
- locale to use. If null
the default locale will
be used instead.Method Detail |
---|
public void setIconImage(String path)
path
- the path to the image resource, which should be loaded via the
current context classloader. Ignored if null
.public void setSize(Preferences prefs)
prefs
- preferences to use for looking up PREF_APP_HEIGHT_KEY
and
PREF_APP_WIDTH_KEY
. If the keys are not found, the
appropriate default values will be used. If prefs is
null
, this method does nothing.public void saveSize(Preferences prefs)
prefs
- where to store all values. Ignored if null
.public void setLocation(Preferences prefs)
prefs
- preferences to use for looking up PREF_APP_X_KEY
and
PREF_APP_Y_KEY
. If the keys are not found, the appropriate
default values will be used. If prefs is null
,
this method does nothing.Toolkit.getScreenSize()
public void saveLocation(Preferences prefs)
prefs
- Where to store the values. Ignored if null
.protected void processWindowEvent(WindowEvent e)
It is done by obtaining the ACTION_FILE_QUIT
action of the
actionManager for this frame, and fireing the actions
actionPerformed
method with an ManagedActionEvent
.
The event contains this frame as source and the
ACTION_FILE_QUIT
as action command.
Since the fired event is a managed event, a controller, which is
registered with the manager of the fram or the action itself may stop/
veto disposing the frame by calling
ManagedActionEvent.stopDispatching()
processWindowEvent
in class JFrame
e
- public void dispose()
dispose
in class Window
public ActionManager getManager()
null
if no action manager has been setpublic void putProperty(String key, Object value)
key
- property keyvalue
- property valuepublic <T> T getProperty(Class<T> clazz, String key)
T
- type of the valueclazz
- class of the valuekey
- key for the data to retrieve.
null
if not found, the value otherwise.public void setStatusBar(org.jdesktop.swingx.JXStatusBar statusBar)
JxStatusBar
and also fixes some bugs in the
original.
setStatusBar
in class org.jdesktop.swingx.JXFrame
public boolean hasJxStatusBar()
JxStatusBar
.
setStatusBar(JXStatusBar)
cached value.
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |