edu.kzoo.grid.gui
Class GridAppFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--edu.kzoo.grid.gui.GridAppFrame
All Implemented Interfaces:
javax.accessibility.Accessible, GridDisplay, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
Direct Known Subclasses:
GridEditor, SteppedGridAppFrame

public class GridAppFrame
extends javax.swing.JFrame
implements GridDisplay

Grid GUI Support Package:
The GridAppFrame class provides a window in which to display a grid and its contents. Options include menus, a speed slider bar, and a control panel containing buttons such as a Start/Restart/Reset button. Menus and buttons are usually enabled (clickable) except when one of them is executing, when they are generally disabled (grayed-out and not clickable). It is possible, though, to create components that are always enabled (such as the speed slider bar), enabled only when the application is actively executing (such as a stop button), or always disabled (useful when the program is under construction and the behavior for a particular component has not yet been implemented).

Version:
1 September 2004
Author:
Alyce Brady (based on code by Julie Zelenski)
See Also:
Serialized Form

Nested Class Summary
 class GridAppFrame.DisplayMouseListener
          Nested class that handles simple mouse presses over the grid display.
static class GridAppFrame.GUIExceptionHandler
          Nested class that is registered as the handler for exceptions on the Swing event thread.
 
Field Summary
static int DEFAULT_MAX_DELAY_MSECS
          Default maximum value for speed slider bar (1000 milliseconds).
static int DEFAULT_MIN_DELAY_MSECS
          Default minimum value for speed slider bar (10 milliseconds).
 
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
GridAppFrame()
          Constructs an empty GridAppFrame window object that will display a grid.
 
Method Summary
 void addGridChangeListener(GridChangeListener listener)
          Registers the specified object as interested in being notified of changes in the identify of the grid being modeled.
protected  boolean componentRequiresGrid(javax.swing.JComponent component)
          Returns true if the given component requires the grid to have been set in order to be enabled; false otherwise.
protected  java.util.Collection componentsEnabledOnlyIfGridSet()
          Returns the set of components that should be enabled only when the current grid is not null.
protected  java.util.Collection componentsEnabledOnlyWhenRunning()
          Returns the set of components that should be enabled only when the application is actively running, and should be disabled when the application is ready and waiting for user input.
protected  java.util.Collection componentsEnabledOnlyWhenWaiting()
          Returns the set of components that should be enabled only when the application is ready and waiting for user input.
protected  ScrollableGridDisplay constructDisplay(int viewingWidth, int viewingHeight, int minCellSize, java.awt.Color bgColor)
          Constructs the grid display at the heart of the graphical user interface.
 void constructWindowContents(java.lang.String title, java.awt.Color bgColor, int viewingWidth, int viewingHeight, int minCellSize)
          Constructs the body of a window containing a scrollable display for a grid and its contents.
 void constructWindowContents(java.lang.String title, int viewingWidth, int viewingHeight, int minCellSize)
          Constructs the body of a window containing a scrollable display for a grid and its contents.
protected  javax.swing.JPanel defineContent()
          Defines contents of main window panel.
protected  void enableAndDisable()
          Enables and disables components appropriately.
 void enableOnlyIfGridSet(javax.swing.JComponent component)
          Enables the given component only when the application is ready and waiting for user input.
 void enableOnlyWhenRunning(javax.swing.JComponent component)
          Enables the given component only when the application is actively executing (not just waiting for user input).
 void enableOnlyWhenWaiting(javax.swing.JComponent component)
          Enables the given component only when the application is ready and waiting for user input.
 void enterNotRunningMode()
          Enables and disables GUI components as necessary when an application is not running.
 void enterRunningMode()
          Enables and disables GUI components as necessary while the application is running.
protected  javax.swing.JPanel getControlPanel()
          Returns the control panel (null if this graphical user interface has no control panel).
 int getDelay()
          Returns the current delay value from the speed slider or a previous call to setDelay; defaults to 0 if there is no speed slider included with this graphical user interface and if setDelay has never been called.
 ScrollableGridDisplay getDisplay()
          Gets the grid display.
 Grid getGrid()
          Returns the grid at the center of this graphical user interface.
protected  java.awt.event.MouseAdapter getMouseListenerForDisplay()
          Returns a mouse adapter that responds to mouse presses over the grid display.
protected  javax.swing.JSlider getSpeedSlider()
          Returns the speed slider bar (null if no speed slider is included with this graphical user interface).
 void includeControlComponent(javax.swing.JComponent component, int enableDisableIndicator)
          Includes the specified control component in a list of control buttons.
 void includeControlComponent(javax.swing.JComponent component, int enableDisableIndicator, boolean initiallyEnabled)
          Includes the specified control component in a list of control buttons.
 void includeControlComponents(java.util.ArrayList componentList, int enableDisableIndicator)
          Includes the control components in the given list in the control panel.
 void includeMenu(javax.swing.JMenu menu)
          Includes the specified menu.
 void includeMenu(javax.swing.JMenu menu, int enableDisableIndicator)
          Includes the specified menu.
 void includeSpeedSlider()
          Includes a speed adjustment slider bar with default values.
 void includeSpeedSlider(int maxDelayMsecs, int minDelayMsecs)
          Includes a speed adjustment slider bar with the specified extreme values and an initial delay halfway between them.
 void includeSpeedSlider(int maxDelayMsecs, int minDelayMsecs, int initialDelayMsecs)
          Includes a speed adjustment slider bar with the specified properties.
 boolean isInRunningMode()
          Returns true if the application is in "running mode" (executing the behavior associated with a control button, for example); returns false otherwise.
protected  javax.swing.JPanel makeControlPanel(java.lang.String title)
          Creates a control panel that lays out control buttons starting from the top.
protected  javax.swing.JComponent makeDisplayPanel()
          Creates the panel for displaying a grid application.
protected  javax.swing.JPanel makeSliderPanel()
          Creates a speed slider for controling the speed of the animation.
 void notifyGridChangeListeners()
          Notifies all registered model change listeners that the model has been replaced.
protected  void onMousePressOverDisplay(Location loc)
          Handles a mouse press over the grid display.
 void resetDelay()
          Resets the current delay value to the initial delay value and adjusts the speed slider, if there is one.
 void setDelay(int delayMsecs)
          Sets the current delay value and adjusts the speed slider, if there is one.
protected  void setEnabledStatus(javax.swing.JComponent component, int enableDisableIndicator)
          Specifies when a given component should be enabled or disabled.
 void setGrid(Grid grid)
          Sets the grid being displayed.
 void showGrid()
          Shows the grid.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
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

DEFAULT_MIN_DELAY_MSECS

public static final int DEFAULT_MIN_DELAY_MSECS
Default minimum value for speed slider bar (10 milliseconds).

See Also:
Constant Field Values

DEFAULT_MAX_DELAY_MSECS

public static final int DEFAULT_MAX_DELAY_MSECS
Default maximum value for speed slider bar (1000 milliseconds).

See Also:
Constant Field Values
Constructor Detail

GridAppFrame

public GridAppFrame()
Constructs an empty GridAppFrame window object that will display a grid. Use methods such as includeStartRestart and includeSpeedSlider to include components on the window other than the basic grid display. Use the constructWindowContents method to set the properties of the window and make it visible.

Method Detail

includeMenu

public void includeMenu(javax.swing.JMenu menu)
Includes the specified menu. The menu will be enabled only when the application is inactive, waiting for user input. If some menu items are enabled/disabled or visible/invisible based on the existence or identity of the grid, then the menu should be a JMenu subclass, should implement the GridChangeListener interface, and should register itself as a grid change listener. This method will have no effect unless it is called before the constructWindowContents method.

Parameters:
menu - the menu to include
See Also:
BasicGridFileMenu, BasicHelpMenu, MinimalFileMenu, addGridChangeListener(edu.kzoo.grid.gui.GridChangeListener)

includeMenu

public void includeMenu(javax.swing.JMenu menu,
                        int enableDisableIndicator)
Includes the specified menu. If some menu items are enabled/disabled or visible/invisible based on the existence or identity of the grid, then the menu should be a JMenu subclass, should implement the GridChangeListener interface, and should register itself as a grid change listener. This method will have no effect unless it is called before the constructWindowContents method.

Parameters:
menu - the menu to include
enableDisableIndicator - indicates when the menu should enabled or disabled
See Also:
BasicGridFileMenu, BasicHelpMenu, MinimalFileMenu, addGridChangeListener(edu.kzoo.grid.gui.GridChangeListener)

setEnabledStatus

protected void setEnabledStatus(javax.swing.JComponent component,
                                int enableDisableIndicator)
Specifies when a given component should be enabled or disabled.

Parameters:
component - the component to include
enableDisableIndicator - indicates when the component should enabled or disabled

enableOnlyIfGridSet

public void enableOnlyIfGridSet(javax.swing.JComponent component)
Enables the given component only when the application is ready and waiting for user input.


enableOnlyWhenWaiting

public void enableOnlyWhenWaiting(javax.swing.JComponent component)
Enables the given component only when the application is ready and waiting for user input.


enableOnlyWhenRunning

public void enableOnlyWhenRunning(javax.swing.JComponent component)
Enables the given component only when the application is actively executing (not just waiting for user input). A stop button, for example, might be enabled only when the application is actively running.


includeControlComponent

public void includeControlComponent(javax.swing.JComponent component,
                                    int enableDisableIndicator)
Includes the specified control component in a list of control buttons. This method will have no effect unless it is called before the constructWindowContents method.

Parameters:
component - the component to include
enableDisableIndicator - indicates when the component should be enabled or disabled

includeControlComponent

public void includeControlComponent(javax.swing.JComponent component,
                                    int enableDisableIndicator,
                                    boolean initiallyEnabled)
Includes the specified control component in a list of control buttons. The component starts out enabled (visible and usable) or disabled according to the initiallyEnabled parameter; it later switches to enabled or disabled under the conditions indicated by the enableDisableIndicator parameter. Note, though, that it will only switch if there is a state change that would normally cause it to switch. It will never switch, for example, if the enableDisableIndicator parameter is ALWAYS_ENABLED or ALWAYS_DISABLED, because there is no defined state change that would cause such components to switch. Thus, a component that is specified as ALWAYS_ENABLED but initially disabled will remain disabled throughout the application.

This method will have no effect unless it is called before the constructWindowContents method.

Parameters:
component - the component to include
enableDisableIndicator - indicates when the component should be enabled or disabled
initiallyEnabled - true if button should initially be enabled; false if button should initially be disabled

includeControlComponents

public void includeControlComponents(java.util.ArrayList componentList,
                                     int enableDisableIndicator)
Includes the control components in the given list in the control panel. This method will have no effect unless it is called before the constructWindowContents method. (Precondition: all object in componentList are JComponent objects.)

Parameters:
componentList - the list of components to include in the control panel
enableDisableIndicator - indicates when the components should be enabled or disabled

includeSpeedSlider

public void includeSpeedSlider()
Includes a speed adjustment slider bar with default values. This method will have no effect unless it is called before the constructWindowContents method. The slider will be initialized to range from DEFAULT_MAX_DELAY_MSECS to DEFAULT_MIN_DELAY_MSECS (maximum delay is slowest; minimum dalay is fastest), with an initial delay halfway between them.


includeSpeedSlider

public void includeSpeedSlider(int maxDelayMsecs,
                               int minDelayMsecs)
Includes a speed adjustment slider bar with the specified extreme values and an initial delay halfway between them. This method will have no effect unless it is called before the constructWindowContents method. The slider will be initialized to range from maxDelayMsecs to minDelayMsecsY_MSECS (maximum delay is slowest; minimum dalay is fastest). (Precondition: minDelayMsecs <= <= maxDelayMsecs)

Parameters:
maxDelayMsecs - maximum delay value for slider, in milliseconds
minDelayMsecs - minimum delay value for slider, in milliseconds

includeSpeedSlider

public void includeSpeedSlider(int maxDelayMsecs,
                               int minDelayMsecs,
                               int initialDelayMsecs)
Includes a speed adjustment slider bar with the specified properties. This method will have no effect unless it is called before the constructWindowContents method. The slider will be initialized to range from maxDelayMsecs to minDelayMsecsY_MSECS (maximum delay is slowest; minimum dalay is fastest). (Precondition: minDelayMsecs <= initialDelayMsecs <= maxDelayMsecs)

Parameters:
maxDelayMsecs - maximum delay value for slider, in milliseconds
minDelayMsecs - minimum delay value for slider, in milliseconds
initialDelayMsecs - initial value for slider, in milliseconds

constructWindowContents

public void constructWindowContents(java.lang.String title,
                                    int viewingWidth,
                                    int viewingHeight,
                                    int minCellSize)
Constructs the body of a window containing a scrollable display for a grid and its contents.

Parameters:
title - frame title
viewingWidth - the width of the viewing area
viewingHeight - the height of the viewing area
minCellSize - minimum grid cell side length

constructWindowContents

public void constructWindowContents(java.lang.String title,
                                    java.awt.Color bgColor,
                                    int viewingWidth,
                                    int viewingHeight,
                                    int minCellSize)
Constructs the body of a window containing a scrollable display for a grid and its contents.

Parameters:
title - frame title
bgColor - color to paint background of grid
viewingWidth - the width of the viewing area
viewingHeight - the height of the viewing area
minCellSize - minimum grid cell side length

constructDisplay

protected ScrollableGridDisplay constructDisplay(int viewingWidth,
                                                 int viewingHeight,
                                                 int minCellSize,
                                                 java.awt.Color bgColor)
Constructs the grid display at the heart of the graphical user interface. Should be redefined in subclasses that wish to use a subclass of ScrollableGridDisplay (for example, to modify the way tool tips are displayed, or some other aspect of the scrollable display).

Parameters:
viewingWidth - the width of the viewing area
viewingHeight - the height of the viewing area
minCellSize - minimum grid cell side length
bgColor - color to paint background of grid
Returns:
a scrollable grid display

setGrid

public void setGrid(Grid grid)
Sets the grid being displayed.

Specified by:
setGrid in interface GridDisplay
Parameters:
grid - the Grid to display

getGrid

public Grid getGrid()
Returns the grid at the center of this graphical user interface.

Returns:
the grid

showGrid

public void showGrid()
Shows the grid. (Precondition: must have called setGrid.)

Specified by:
showGrid in interface GridDisplay

getDisplay

public ScrollableGridDisplay getDisplay()
Gets the grid display.

Returns:
a scrollable grid display

getMouseListenerForDisplay

protected java.awt.event.MouseAdapter getMouseListenerForDisplay()
Returns a mouse adapter that responds to mouse presses over the grid display. Subclasses that wish to respond to other mouse events should redefine this method to return a subclass of DisplayMouseListener (or another MouseAdapter subclass) that handles other mouse events.


getControlPanel

protected javax.swing.JPanel getControlPanel()
Returns the control panel (null if this graphical user interface has no control panel).


componentRequiresGrid

protected boolean componentRequiresGrid(javax.swing.JComponent component)
Returns true if the given component requires the grid to have been set in order to be enabled; false otherwise.


componentsEnabledOnlyIfGridSet

protected java.util.Collection componentsEnabledOnlyIfGridSet()
Returns the set of components that should be enabled only when the current grid is not null.


componentsEnabledOnlyWhenWaiting

protected java.util.Collection componentsEnabledOnlyWhenWaiting()
Returns the set of components that should be enabled only when the application is ready and waiting for user input.


componentsEnabledOnlyWhenRunning

protected java.util.Collection componentsEnabledOnlyWhenRunning()
Returns the set of components that should be enabled only when the application is actively running, and should be disabled when the application is ready and waiting for user input.


isInRunningMode

public boolean isInRunningMode()
Returns true if the application is in "running mode" (executing the behavior associated with a control button, for example); returns false otherwise.


getSpeedSlider

protected javax.swing.JSlider getSpeedSlider()
Returns the speed slider bar (null if no speed slider is included with this graphical user interface).


setDelay

public void setDelay(int delayMsecs)
Sets the current delay value and adjusts the speed slider, if there is one. Subsequent changes to the slider bar will override this value.

Parameters:
delayMsecs - the length of time the application should pause after displaying the grid to allow users time to see it (in milliseconds)

resetDelay

public void resetDelay()
Resets the current delay value to the initial delay value and adjusts the speed slider, if there is one.


getDelay

public int getDelay()
Returns the current delay value from the speed slider or a previous call to setDelay; defaults to 0 if there is no speed slider included with this graphical user interface and if setDelay has never been called.

Returns:
the length of time the application should pause after displaying the grid to allow users time to see it (in milliseconds)

defineContent

protected javax.swing.JPanel defineContent()
Defines contents of main window panel. Redefine this method to define panels other than a grid display panel, control panel, or speed slider bar panel, or to alter the layout or border of the main contents panel.

Returns:
the panel that will serve as the window's content panel

makeDisplayPanel

protected javax.swing.JComponent makeDisplayPanel()
Creates the panel for displaying a grid application.


makeControlPanel

protected javax.swing.JPanel makeControlPanel(java.lang.String title)
Creates a control panel that lays out control buttons starting from the top. Redefine this method to change the layout or border of the control panel.

Parameters:
title - a title to put in the border of this control panel, or null if no title is desired
Returns:
a panel containing the control components

makeSliderPanel

protected javax.swing.JPanel makeSliderPanel()
Creates a speed slider for controling the speed of the animation.

Returns:
a panel containing the speed slider

addGridChangeListener

public void addGridChangeListener(GridChangeListener listener)
Registers the specified object as interested in being notified of changes in the identify of the grid being modeled.

Parameters:
listener - the object that should be notified of changes to the identity of the grid

notifyGridChangeListeners

public void notifyGridChangeListeners()
Notifies all registered model change listeners that the model has been replaced.


onMousePressOverDisplay

protected void onMousePressOverDisplay(Location loc)
Handles a mouse press over the grid display. Currently does nothing, but can be redefined in subclasses to handle actions.


enterRunningMode

public void enterRunningMode()
Enables and disables GUI components as necessary while the application is running.


enterNotRunningMode

public void enterNotRunningMode()
Enables and disables GUI components as necessary when an application is not running.


enableAndDisable

protected void enableAndDisable()
Enables and disables components appropriately.