jwo.landserf.gui
Class GUIFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--jwo.landserf.gui.GUIFrame
All Implemented Interfaces:
Accessible, ActionListener, EventListener, GISFrame, ImageObserver, ItemListener, JWDialogueListener, MenuContainer, Serializable

public class GUIFrame
extends Frame
implements ActionListener, ItemListener, JWDialogueListener, GISFrame

Class for creating and managing main user interface window and menus. Main Program control rests here.

Version:
1.8.0, 25th April, 2002.
Author:
Jo Wood
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GUIFrame(String title)
          Creates a menu-based graphical user interface.
GUIFrame(String title, String[] args)
          Creates a menu-based graphical user interface and loads the given files supplied as command line arguments.Control of the program is implemented via menu options.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Scans all delegated action events (menu option selections) and calls appropriate actions.
 void combineRasters()
          Compares the boundaries of the surface and drape.
 void enableMenus()
          Disables/enables menu options depending on current state of of the class (eg raster present/absent etc).
 String fileDialogue(String message, String filter, int type)
          Creates a file dialogue for input or output.
 ColourTable getDefaultColours()
          Sets up a default colour scheme based on the range of values in the current object.
 RastSurf getDrape()
          Returns the draped surface currently selected by the GUI.
 GraphicsArea getGraphicsArea()
          Returns the graphics area used for displaying rasters etc.
 ClientBean getHubClient()
          Returns the hub client associated with this frame.
 GraphNetwork getMSN()
          Reports the metric surface network associated with the GUI.
 int getParamType()
          Returns the currently selected parameter type.
 Route3D getRoute3d()
          Reports the currently defined 3d route.
 StatusBar getStatusBar()
          Returns the status bar used for reporting progress.
 RastSurf getSurf()
          Returns the main surface currently selected by the GUI.
 VectorMap getVectorMap()
          Returns the vector map associated with the GUI.
 void itemStateChanged(ItemEvent event)
          Looks for checkbox events (from the menu) and performs the necessary actions.
 void loadImage(String fileName)
          Loads a given image and displays it in the window, but does nothing in this case.
 void redisplay()
          Recalculates and displays any rasters or vectors in the guiFrame.
 void setDrape(RastSurf newDrape)
          Sets the main surface currently selected by the GUI.
 void setMSN(GraphNetwork msn)
          Sets the metric surface network associated with the GUI.
 void setParamType(int pType)
          Sets the current morphometric parameter type.
 void setRoute3d(Route3D route)
          Associates the given 3d route with the window, but does nothing in this case.
 void setSurf(RastSurf newSurf)
          Sets the main surface currently selected by the GUI.
 void setVectorDisplay(boolean display)
          Turns the vector display on or off.
 void setVectorMap(VectorMap vectMap)
          Sets the vector map associated with the GUI.
 void updateFromDialogue(JWDialogue dialogueBox)
          Update from dialogue box.
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, 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, processWindowEvent, 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, addImpl, 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, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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
 

Constructor Detail

GUIFrame

public GUIFrame(String title)
Creates a menu-based graphical user interface. Control of the program is implemented via these menu options.

Parameters:
title - Title of the window.

GUIFrame

public GUIFrame(String title,
                String[] args)
Creates a menu-based graphical user interface and loads the given files supplied as command line arguments.Control of the program is implemented via menu options.

Parameters:
title - Title of the window.
args - Command line arguments representing files to load. Available arguments include 'surface', 'drape' and 'vector'.
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
Scans all delegated action events (menu option selections) and calls appropriate actions. Implements interface method.

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - Menu selection event.

getSurf

public RastSurf getSurf()
Returns the main surface currently selected by the GUI.

Specified by:
getSurf in interface GISFrame
Returns:
The currently selected surface for processing.

setSurf

public void setSurf(RastSurf newSurf)
Sets the main surface currently selected by the GUI.

Specified by:
setSurf in interface GISFrame
Parameters:
newSurf - The new surface surface for processing.

getDrape

public RastSurf getDrape()
Returns the draped surface currently selected by the GUI.

Specified by:
getDrape in interface GISFrame
Returns:
The currently selected drape for processing.

setDrape

public void setDrape(RastSurf newDrape)
Sets the main surface currently selected by the GUI.

Specified by:
setDrape in interface GISFrame

getVectorMap

public VectorMap getVectorMap()
Returns the vector map associated with the GUI.

Specified by:
getVectorMap in interface GISFrame
Returns:
The currently selected vector map.

setVectorMap

public void setVectorMap(VectorMap vectMap)
Sets the vector map associated with the GUI.

Specified by:
setVectorMap in interface GISFrame
Parameters:
vectMap - The new vector map associated with GUI.

setMSN

public void setMSN(GraphNetwork msn)
Sets the metric surface network associated with the GUI.

Parameters:
msn - The new metric surface network associated with GUI.

getMSN

public GraphNetwork getMSN()
Reports the metric surface network associated with the GUI.

Returns:
The metric surface network associated with GUI.

getGraphicsArea

public GraphicsArea getGraphicsArea()
Returns the graphics area used for displaying rasters etc.

Returns:
Graphics area for display.

getStatusBar

public StatusBar getStatusBar()
Returns the status bar used for reporting progress.

Specified by:
getStatusBar in interface GISFrame
Returns:
Status bar used for progress reporting.

getParamType

public int getParamType()
Returns the currently selected parameter type. RastSurf.ELEV, RastSurf.SLOPE etc.

Returns:
Morphometric parameter type.
See Also:
RastSurf

getHubClient

public ClientBean getHubClient()
Returns the hub client associated with this frame.

Returns:
Hub Client associated with this frame.

setParamType

public void setParamType(int pType)
Sets the current morphometric parameter type. RastSurf.ELEV, RastSurf.SLOPE etc.

Parameters:
pType - New morphometric parameter type.
See Also:
RastSurf

setVectorDisplay

public void setVectorDisplay(boolean display)
Turns the vector display on or off.

Parameters:
display - True will turn vector display on, false will turn it off.

itemStateChanged

public void itemStateChanged(ItemEvent event)
Looks for checkbox events (from the menu) and performs the necessary actions. Implements interface method.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
event - - Checkbox item event.

updateFromDialogue

public void updateFromDialogue(JWDialogue dialogueBox)
Description copied from interface: JWDialogueListener
Update from dialogue box.

Specified by:
updateFromDialogue in interface JWDialogueListener
Parameters:
dialogueBox - Dialogue box from which to update.

enableMenus

public void enableMenus()
Disables/enables menu options depending on current state of of the class (eg raster present/absent etc).

Specified by:
enableMenus in interface GISFrame

redisplay

public void redisplay()
Recalculates and displays any rasters or vectors in the guiFrame.

Specified by:
redisplay in interface GISFrame

getRoute3d

public Route3D getRoute3d()
Reports the currently defined 3d route.

Specified by:
getRoute3d in interface GISFrame
Returns:
Currently defined route.

setRoute3d

public void setRoute3d(Route3D route)
Associates the given 3d route with the window, but does nothing in this case.

Specified by:
setRoute3d in interface GISFrame
Parameters:
route - New route to be associated with this window.

loadImage

public void loadImage(String fileName)
Loads a given image and displays it in the window, but does nothing in this case.

Specified by:
loadImage in interface GISFrame
Parameters:
fileName - Name of graphics file to load.

fileDialogue

public String fileDialogue(String message,
                           String filter,
                           int type)
Creates a file dialogue for input or output. Note that the FileFilter bug in Java (#4031440) prevents platform-independent filtering of file names. The workaround is to specify wild cards as the file name.

Parameters:
message - Message to appear in dialogue window.
filter - File filter for selected files.
type - Type of dialogue to create (FileDialog.LOAD or FileDialog.SAVE).
Returns:
Fully specified file name.

getDefaultColours

public ColourTable getDefaultColours()
Sets up a default colour scheme based on the range of values in the current object.


combineRasters

public void combineRasters()
Compares the boundaries of the surface and drape. If they are different, asks user if they wish to merge them.