dods.clients.importwizard.TMAP.map
Class XTool

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.Rectangle
              extended by dods.clients.importwizard.TMAP.map.MapTool
                  extended by dods.clients.importwizard.TMAP.map.XTool
All Implemented Interfaces:
MapConstants, Shape, Serializable, Cloneable
Direct Known Subclasses:
PTcXTool

public class XTool
extends MapTool

A rectangular map tool defined by x, y, width and height. This tool draws a rubber-band box on the screen.

Version:
0.1, 15 Aug 1996
Author:
Jonathan Callahan
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float
 
Field Summary
 
Fields inherited from class dods.clients.importwizard.TMAP.map.MapTool
active, bottom_edge_scroll, boundingRect, canvas_clipRect, color, delta_X, delta_Y, drawHandles, grid, handle, left_edge_scroll, mouseDownHandle, needsRange_X, needsRange_Y, numHandles, range_X, range_Y, right_edge_scroll, snap_X, snap_Y, top_edge_scroll, user_X, user_Y
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Fields inherited from interface dods.clients.importwizard.TMAP.map.MapConstants
DEPTH_AXIS, HEIGHT_AXIS, HI, LATITUDE_AXIS, LO, LONGITUDE_AXIS, MID, PT, SNAP_MID, SNAP_ON, TIME_AXIS
 
Constructor Summary
XTool(int x, int y, int width, int height, Color color)
          Constructs and initializes an XTool with the specified parameters.
XTool(Rectangle rect, Color color)
          Constructs an XTool and initializes it to the specified rectangle.
 
Method Summary
 void adjustWidthHeight()
          Adjust the width or height for those tools which don't specify an extent of width or height.
 void bump_against_sides(int mouse_x, int mouse_y)
          Allows movement of the tool within the bounding rectangle specified in applyClipRect().
 void draw(Graphics g)
          Draws an XTool.
protected  void saveHandles()
          Saves the current positions of all the handles.
 
Methods inherited from class dods.clients.importwizard.TMAP.map.MapTool
applyClipRect, applyClipRect, check_for_zero_range, getColor, getDelta_X, getDelta_Y, getGrid, getRectangle, getSnap_X, getSnap_Y, handle_reshape, intersect, is_active, mouseDown, mouseDrag, mouseMove, mouseUp, setBounds, setBounds, setColor, setDelta_X, setDelta_Y, setGrid, setLocation, setRange_X, setRange_Y, setSnapping, setUser_X, setUser_X, setUser_XY, setUser_XY, setUser_Y, setUser_Y, setUserBounds, setUserLocation, toString
 
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setLocation, setRect, setSize, setSize, translate, union
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Constructor Detail

XTool

public XTool(int x,
             int y,
             int width,
             int height,
             Color color)
Constructs and initializes an XTool with the specified parameters.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the XTool
height - the height of the XTool

XTool

public XTool(Rectangle rect,
             Color color)
Constructs an XTool and initializes it to the specified rectangle.

Parameters:
rect - the rectangle of the XTool
Method Detail

draw

public void draw(Graphics g)
Draws an XTool. This method overrides the abstract method in MapTool and allows us to instantiate an XTool.

Specified by:
draw in class MapTool
Parameters:
g - the graphics context for the drawing operation.

saveHandles

protected void saveHandles()
Saves the current positions of all the handles.

Overrides:
saveHandles in class MapTool

adjustWidthHeight

public void adjustWidthHeight()
Adjust the width or height for those tools which don't specify an extent of width or height. XTool, and decendents need to adjust the height.

Overrides:
adjustWidthHeight in class MapTool

bump_against_sides

public void bump_against_sides(int mouse_x,
                               int mouse_y)
Description copied from class: MapTool
Allows movement of the tool within the bounding rectangle specified in applyClipRect().

Overrides:
bump_against_sides in class MapTool