jwo.landserf.gui
Class EditBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by jwo.utils.gui.JWDialogue
                          extended by jwo.landserf.gui.EditBox
All Implemented Interfaces:
ActionListener, ItemListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, DocumentListener, RootPaneContainer, WindowConstants, RubberbandListener

public class EditBox
extends JWDialogue
implements ActionListener, DocumentListener, ItemListener, RubberbandListener

Displays spatial model information (bounding area, resolution, title, notes etc) and allows selective editing of values.

Version:
2.4, 6th October, 2007.
Author:
Jo Wood.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
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
static int BLANK
          Blank raster selected.
static int EXISTING_RAST
          Allow editing of existing raster (no new surface generation allowed).
static int EXISTING_VECT
          Allow editing of existing vector map.
static int FRACTAL
          Fractal raster selected.
static int INFO_RAST
          Display raster fields for information (read only).
static int INFO_VECT
          Display vector fields for information (read only).
static int NEW_RAST
          Allow creation of new raster (fractal and polynomial options available).
static int NEW_RAST_DIM
          Allow creation of new raster dimensions.
static int NEW_VECT
          Allow creation of new vector map.
static int NEW_VECT_DIM
          Allow creation of new vector dimensions.
static int POLYNOMIAL
          Polynomial raster selected.
 
Fields inherited from class jwo.utils.gui.JWDialogue
DIALOGUE, MONOLOGUE
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
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, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
EditBox(GISFrame gisFrame, RasterMap rast, RasterMap origRast)
          Creates a dialogue box for editing existing raster details.
EditBox(GISFrame gisFrame, SpatialObject spObj, SpatialObject origSpObject, int editType)
          Creates a dialogue box for editing or displaying spatial model details.
EditBox(GISFrame gisFrame, VectorMap vect, VectorMap origVect)
          Creates a dialogue box for editing existing vector map details.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Checks for button presses and updates boundaries if 'Reset' button pressed.
 void changedUpdate(DocumentEvent e)
          Responds to a change in one of the bounding text fields by checking input is valid and updating raster row and column sizes (if object is a raster) and interpolation/subset options.
 boolean checkInput()
          Checks input parameters are legal before finishing.
 float getFracDimension()
          Returns the fractal dimension identified by the user.
 boolean getInterpolate()
          Reports whether interpolation of existing raster is required.
 int getNewRastType()
          Reports the type of new raster to be created.
 String getNotes()
          Returns the new set of notes associated with the raster after it has been edited.
 SpatialObject getOriginalSpatialObject()
          Reports the original spatial object of which this edited one is based.
 String getPolynomial()
          Returns the polynomial expression identified by the user.
 RasterMap getRaster()
          Reports the raster that has been edited.
 boolean getSubset()
          Reports whether subsetting of existing raster is required.
 VectorMap getVector()
          Reports the vector map that has been edited.
 void insertUpdate(DocumentEvent docEvent)
          Responds to an insert in one of the bounding text fields by checking input is valid and updating row and column sizes and interpolation/subset options.
 void itemStateChanged(ItemEvent e)
          Checks to see if any of the raster creation types have changed and updates the user interface appropriately.
 void removeUpdate(DocumentEvent docEvent)
          Responds to a remove event in one of the bounding text fields by checking input is valid and updating row and column sizes and interpolation/subset options.
 void updateFromRubberband(Footprint bounds)
          Updates the boundary boxes from values in a graphically selected rubber-band box.
 
Methods inherited from class jwo.utils.gui.JWDialogue
addDialogueListener, closedown, getContentPane, isChanged, removeDialogueListener, setFullBackground
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, 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.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INFO_RAST

public static final int INFO_RAST
Display raster fields for information (read only).

See Also:
Constant Field Values

NEW_RAST

public static final int NEW_RAST
Allow creation of new raster (fractal and polynomial options available).

See Also:
Constant Field Values

EXISTING_RAST

public static final int EXISTING_RAST
Allow editing of existing raster (no new surface generation allowed).

See Also:
Constant Field Values

NEW_RAST_DIM

public static final int NEW_RAST_DIM
Allow creation of new raster dimensions.

See Also:
Constant Field Values

INFO_VECT

public static final int INFO_VECT
Display vector fields for information (read only).

See Also:
Constant Field Values

NEW_VECT

public static final int NEW_VECT
Allow creation of new vector map.

See Also:
Constant Field Values

EXISTING_VECT

public static final int EXISTING_VECT
Allow editing of existing vector map.

See Also:
Constant Field Values

NEW_VECT_DIM

public static final int NEW_VECT_DIM
Allow creation of new vector dimensions.

See Also:
Constant Field Values

BLANK

public static final int BLANK
Blank raster selected.

See Also:
Constant Field Values

FRACTAL

public static final int FRACTAL
Fractal raster selected.

See Also:
Constant Field Values

POLYNOMIAL

public static final int POLYNOMIAL
Polynomial raster selected.

See Also:
Constant Field Values
Constructor Detail

EditBox

public EditBox(GISFrame gisFrame,
               RasterMap rast,
               RasterMap origRast)
Creates a dialogue box for editing existing raster details. Validates input so that boundaries and resolution match number of rows and columns in raster.

Parameters:
gisFrame - Frame from which dialogue was called.
rast - Raster spatial object to edit.
origRast - Original raster map that can be replaced with the edited version, or null if an existing raster map is not to be replaced.

EditBox

public EditBox(GISFrame gisFrame,
               VectorMap vect,
               VectorMap origVect)
Creates a dialogue box for editing existing vector map details. Validates input so that boundaries and resolution match number of rows and columns in raster.

Parameters:
gisFrame - Frame from which dialogue was called.
vect - Vector spatial object to edit.
origVect - Original vector map that can be replaced with the edited version, or null if an existing vector map is not to be replaced.

EditBox

public EditBox(GISFrame gisFrame,
               SpatialObject spObj,
               SpatialObject origSpObject,
               int editType)
Creates a dialogue box for editing or displaying spatial model details. Depending on the value of editType, this window will allow a new spatial object to be created (NEW_RAST/NEW_RAST_DIM/NEW_VECT), an existing spatial object to be edited (EXISTING_RAST/EXISTING_VECT) or an existing one to be viewed only (INFO_RAST/INFO_VECT).

Parameters:
gisFrame - Frame from which dialogue was called.
spObj - Spatial object to edit.
origSpObject - Original spatial object that can be replaced with the edited version, or null if an existing object is not to be replaced.
editType - Type of spatial object to edit/view (NEW_RAST/VECT/NEW_RAST_DIM, EXISTING_RAST/VECT or INFO_RAST/VECT).
Method Detail

getInterpolate

public boolean getInterpolate()
Reports whether interpolation of existing raster is required.

Returns:
True if interpolation requested, otherwise false.

getSubset

public boolean getSubset()
Reports whether subsetting of existing raster is required.

Returns:
True if subsetting requested, otherwise false.

getNewRastType

public int getNewRastType()
Reports the type of new raster to be created.

Returns:
Type of new raster. Currently either FRACTAL, POLYNOMIAL or BLANK.

getFracDimension

public float getFracDimension()
Returns the fractal dimension identified by the user.

Returns:
Fractal Dimension.

getPolynomial

public String getPolynomial()
Returns the polynomial expression identified by the user.

Returns:
Polynomial expression

getNotes

public String getNotes()
Returns the new set of notes associated with the raster after it has been edited.

Returns:
New (edited) raster notes.

getRaster

public RasterMap getRaster()
Reports the raster that has been edited.

Returns:
Raster that has been edited, or null if some other type of spatial object.

getVector

public VectorMap getVector()
Reports the vector map that has been edited.

Returns:
Vector map that has been edited, or null if some other type of spatial object.

getOriginalSpatialObject

public SpatialObject getOriginalSpatialObject()
Reports the original spatial object of which this edited one is based. Depending on the user choice, this object may be replaced with the edited version.

Returns:
Original spatial object or null if edited object is new.

itemStateChanged

public void itemStateChanged(ItemEvent e)
Checks to see if any of the raster creation types have changed and updates the user interface appropriately.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
e - Item selection event.

updateFromRubberband

public void updateFromRubberband(Footprint bounds)
Updates the boundary boxes from values in a graphically selected rubber-band box. If raster selected, rounds coordinates to nearest whole raster cell.

Specified by:
updateFromRubberband in interface RubberbandListener
Parameters:
bounds - New geographical boundaries.

actionPerformed

public void actionPerformed(ActionEvent event)
Checks for button presses and updates boundaries if 'Reset' button pressed.

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - Action event representing button press.

changedUpdate

public void changedUpdate(DocumentEvent e)
Responds to a change in one of the bounding text fields by checking input is valid and updating raster row and column sizes (if object is a raster) and interpolation/subset options.

Specified by:
changedUpdate in interface DocumentListener
Parameters:
e - Event representing a change in a text field.

insertUpdate

public void insertUpdate(DocumentEvent docEvent)
Responds to an insert in one of the bounding text fields by checking input is valid and updating row and column sizes and interpolation/subset options.

Specified by:
insertUpdate in interface DocumentListener
Parameters:
docEvent - Event representing an insert in a text field.

removeUpdate

public void removeUpdate(DocumentEvent docEvent)
Responds to a remove event in one of the bounding text fields by checking input is valid and updating row and column sizes and interpolation/subset options.

Specified by:
removeUpdate in interface DocumentListener
Parameters:
docEvent - Event representing an insert in a text field.

checkInput

public boolean checkInput()
Checks input parameters are legal before finishing.

Overrides:
checkInput in class JWDialogue
Returns:
True if input is valid.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009