|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--javax.swing.JFrame | +--bill.util.gui.ParentGUI
"Master" Swing GUI class. Contains things that are common to a typical Swing GUI.
Inner classes inherited from class javax.swing.JFrame |
JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
Field Summary | |
protected ErrorFrame |
_errorFrame
The frame of the validation errors window |
protected HelpAboutFrame |
_helpAbout
Reference to the help about frame |
protected boolean |
_highlighting
Indicates if we are using required field highlighting |
protected Vector |
_myFrames
A list of all the frames (sub windows) that are currently active |
protected ParentGUI |
_parent
The parent GUI that created this GUI |
protected boolean |
_wasModified
Indicates if the GUI has unsaved modifications |
static String |
ACTION_HELP_ABOUT
The action name for the help->about menu option |
static String |
ACTION_HIGHLIGHT
The action name for the options->highlight required menu option |
static String |
ACTION_METAL
The action name for the options->look & feel->metal menu option |
static String |
ACTION_MOTIF
The action name for the options->look & feel->motif menu option |
static String |
ACTION_TOOLTIP
The action name for the options->show tool tips menu option |
static String |
ACTION_WINDOWS
The action name for the options->look & feel->windows menu option |
static Color |
COLOR_NOT_REQUIRED_FIELD
Color to make required fields' background when required highlighting is not set to on |
static Color |
COLOR_REQUIRED_FIELD
Color to make required fields' background |
static String |
VALUE_METAL_LF
Class name of the metal look and feel class |
static String |
VALUE_MOTIF_LF
Class name of the motif look and feel class |
static String |
VALUE_WINDOWS_LF
Class name of the windows look and feel class |
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, 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 | |
ParentGUI(ParentGUI parent,
String title)
|
Method Summary | |
void |
addFrame(JFrame frame)
Add another frame to the list of frames that we care about. |
void |
addFrameClosing(JFrame frame)
Called when a frame that was created to add data is being closed. |
void |
addFrameClosing(JFrame frame,
boolean cancelled)
Called when a frame that was created to add data is being closed. |
void |
closeDown()
Frees up all resources used by this instance of the GUI and notifies the ParentGUI that launched us that we are closing down. |
String |
getDataFileName(String[] extensions,
String filterDesc,
boolean open)
Creates and processes a file selection dialog to allow the user to indicate a data file to read or write. |
String |
getDataFileName(String[] extensions,
String filterDesc,
boolean open,
String directory)
Creates and processes a file selection dialog to allow the user to indicate a data file to read or write. |
ErrorFrame |
getErrorFrame()
Retrieves a reference to the application's error frame. |
Configuration |
getGUIConfig()
Getter for the GUI configuration file. |
HelpAboutFrame |
getHelpAboutFrame()
Retrieves a reference to the application's help about frame. |
ParentGUI |
getParentWindow()
Getter for the ParentGUI that created this GUI. |
boolean |
isHighlighting()
Checks to see if required field highlighting has been requested. |
boolean |
isModified()
Checks to see if the this GUI's data defined has been modified since it was last saved. |
boolean |
isToolTips()
Checks to see if the user has indicated a desire to see tooltips. |
protected void |
propagateHighlighting(boolean display)
Tells all the current open frames that they should either highlight or not highlinght required fields. |
protected void |
propagateToolTipDisplay(boolean display)
Tells all the current open frames that they should either start or stop showing tool tips. |
void |
removeFrame(JFrame frame)
Remove a frame from the list of frames that we care about. |
void |
setCursor(Cursor cursor)
Sets the cursor image to the specified cursor. |
void |
setErrorFrame(ErrorFrame error)
Sets the reference to the application's error frame. |
void |
setGUIConfig(Configuration config)
Setter for the GUI configuration file. |
void |
setHelpAboutFrame(HelpAboutFrame help)
Sets the reference to the application's help about frame. |
void |
setHighlighting(boolean highlight)
Sets the highlighting indicator as indicated. |
void |
setModified(boolean modified)
Sets the modification indicator as indicated. |
void |
setToolTips(boolean toolTips)
Sets the tool tips indicator as indicated. |
protected void |
updateLookAndFeel(String lookFeel)
Updates the look and feel of the GUI frames we know about. |
boolean |
verifyUnsavedChanges()
Verifies that there are no unsaved changes, or if there are, if the user wants to discard them. |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle |
Methods inherited from class java.awt.Window |
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, removeWindowListener, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFont, validate, validateTree |
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 |
Field Detail |
public static String ACTION_HIGHLIGHT
public static String ACTION_TOOLTIP
public static String ACTION_HELP_ABOUT
public static String ACTION_METAL
public static String ACTION_MOTIF
public static String ACTION_WINDOWS
public static Color COLOR_REQUIRED_FIELD
public static Color COLOR_NOT_REQUIRED_FIELD
public static String VALUE_METAL_LF
public static String VALUE_MOTIF_LF
public static String VALUE_WINDOWS_LF
protected HelpAboutFrame _helpAbout
protected ErrorFrame _errorFrame
protected boolean _wasModified
protected boolean _highlighting
protected Vector _myFrames
protected ParentGUI _parent
Constructor Detail |
public ParentGUI(ParentGUI parent, String title)
Method Detail |
public ParentGUI getParentWindow()
null
if this GUI was
started independently.public HelpAboutFrame getHelpAboutFrame()
public ErrorFrame getErrorFrame()
public boolean isModified()
true
if the data has been modified, false
otherwise.public boolean isHighlighting()
isHighlighting
in interface GUIUtilInterface
true
if the highlighting has been requested,
false
otherwise.public boolean isToolTips()
isToolTips
in interface GUIUtilInterface
true
if tool tips have been requested,
false
otherwise.public void setModified(boolean modified)
modified
- The value to set the modification indicator to.public void setHighlighting(boolean highlight)
highlight
- The value to set the highlighting indicator to.public void setToolTips(boolean toolTips)
using
- The value to set the tool tip display indicator to.public Configuration getGUIConfig()
public void setGUIConfig(Configuration config)
config
- Reference to the new GUI configuration file.public void addFrame(JFrame frame)
frame
- The frame being added to the list.public void setErrorFrame(ErrorFrame error)
error
- The error frame reference.public void setHelpAboutFrame(HelpAboutFrame help)
help
- The help about frame reference.public void setCursor(Cursor cursor)
setCursor
in class Window
cursor
- One of the constants defined by the Cursor
class. If this parameter is null then this component will inherit the
cursor of its parent.public void removeFrame(JFrame frame)
frame
- The frame being removed to the list.public void addFrameClosing(JFrame frame)
addFrameClosing
in interface GUIUtilInterface
frame
- The JFrame that is being closed.public void addFrameClosing(JFrame frame, boolean cancelled)
addFrameClosing
in interface GUIUtilInterface
frame
- The JFrame that is being closed.cancelled
- If set to true
, indicates the frame
was closed by cancelling out of it. this could be via a cancel button or
by using the window decorations.protected void updateLookAndFeel(String lookFeel)
lookFeel
- The look and feel to set the GUI to.protected void propagateToolTipDisplay(boolean display)
display
- Indicates to show (value of true
) or not
show (value of false
) tooltips.protected void propagateHighlighting(boolean display)
display
- Indicates to highlight (value of true
) or not
highlight (value of false
) fields.public void closeDown()
public String getDataFileName(String[] extensions, String filterDesc, boolean open)
extensions
- Array of file extensions to put in the extension filter
list.filterDesc
- Description for the file extension filter.open
- Indicates if the file name is to be used for a file open
of a save. true
indicates an open, false
indicates a save.public String getDataFileName(String[] extensions, String filterDesc, boolean open, String directory)
extensions
- Array of file extensions to put in the extension filter
list.filterDesc
- Description for the file extension filter.open
- Indicates if the file name is to be used for a file open
of a save. true
indicates an open, false
indicates a save.directory
- The directory the file chooser should look in initiallypublic boolean verifyUnsavedChanges()
true
if there are no unsaved changes or the user
wishes to discard the changes. false
if there are
unsaved changes and the user does not want to discard them.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |