|
||||||||||
| 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
jmri.util.JmriJFrame
public class JmriJFrame
JFrame extended for common JMRI use.
We needed a place to refactor common JFrame additions in JMRI code, so this class was created.
Features:
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE)
If you want this behavior, but need to do something when the
window is closing, override the windowClosing(java.awt.event.WindowEvent) method
to do what you want. Also, if you override dispose(),
make sure to call super.dispose().
If you want the window to just do nothing or just hide, rather than be disposed, when closed, set the DefaultCloseOperation to DO_NOTHING_ON_CLOSE or HIDE_ON_CLOSE depending on what you're looking for.
| Nested Class Summary |
|---|
| 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.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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 | |
|---|---|
JmriJFrame()
|
|
JmriJFrame(String name)
|
|
| Method Summary | |
|---|---|
void |
addHelpMenu(String ref,
boolean direct)
Add a standard help menu, including window specific help item. |
void |
addNotify()
|
void |
dispose()
When window is finally destroyed, remove it from the list of windows. |
static JmriJFrame |
getFrame(String name)
Get a JmriJFrame of a particular name. |
static List<JmriJFrame> |
getFrameList()
Get a List of the currently-existing JmriJFrame objects. |
Dimension |
getMaximumSize()
Provide a maximum frame size that is limited to what can fit on the screen after toolbars, etc are deducted. |
boolean |
getModifiedFlag()
Get the balue of the modified flag. |
Dimension |
getPreferredSize()
The preferred size must fit on the physical screen, so calculate the lesser of either the preferred size from the layout or the screen size. |
protected void |
handleModified()
Handle closing a window or quiting the program while the modified bit was set. |
void |
initComponents()
By default, Swing components should be created an installed in this method, rather than in the ctor itself. |
void |
markWindowModified(boolean yes)
|
void |
setModifiedFlag(boolean flag)
A frame is considered "modified" if it has changes that have not been stored. |
protected void |
setShutDownTask()
|
protected void |
storeValues()
|
void |
windowActivated(WindowEvent e)
|
void |
windowClosed(WindowEvent e)
|
void |
windowClosing(WindowEvent e)
|
void |
windowDeactivated(WindowEvent e)
|
void |
windowDeiconified(WindowEvent e)
|
void |
windowIconified(WindowEvent e)
|
void |
windowOpened(WindowEvent e)
|
| Methods inherited from class java.awt.Frame |
|---|
finalize, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Constructor Detail |
|---|
public JmriJFrame()
public JmriJFrame(String name)
| Method Detail |
|---|
public void initComponents()
throws Exception
Exception
public void addHelpMenu(String ref,
boolean direct)
ref - JHelp reference for the desired window-specific help pagedirect - true if the help menu goes directly to the help system,
e.g. there are no items in the help menupublic Dimension getMaximumSize()
Some of the methods used here return null pointers on some Java implementations, however, so this will return the superclasses's maximum size if the algorithm used here fails.
getMaximumSize in class Containerpublic Dimension getPreferredSize()
getPreferredSize in class Containerpublic static List<JmriJFrame> getFrameList()
public static JmriJFrame getFrame(String name)
public void addNotify()
addNotify in class Framepublic void setModifiedFlag(boolean flag)
setModifiedFlag in interface ModifiedFlagflag - true if the object has been modifiedpublic boolean getModifiedFlag()
Not a bound parameter
getModifiedFlag in interface ModifiedFlagprotected void handleModified()
protected void storeValues()
public void markWindowModified(boolean yes)
public void windowOpened(WindowEvent e)
windowOpened in interface WindowListenerpublic void windowClosed(WindowEvent e)
windowClosed in interface WindowListenerpublic void windowActivated(WindowEvent e)
windowActivated in interface WindowListenerpublic void windowDeactivated(WindowEvent e)
windowDeactivated in interface WindowListenerpublic void windowIconified(WindowEvent e)
windowIconified in interface WindowListenerpublic void windowDeiconified(WindowEvent e)
windowDeiconified in interface WindowListenerpublic void windowClosing(WindowEvent e)
windowClosing in interface WindowListenerprotected void setShutDownTask()
public void dispose()
Subclasses that over-ride this method must invoke this implementation with super.dispose()
dispose in class Window
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||