|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.Rectangle
dods.clients.importwizard.TMAP.map.MapRegion
public abstract class MapRegion
A region on the map which can be drawn and which may
listen to mouse events.
The abstract
method which makes this class
abstract is the draw(Graphics g)
method.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
---|
Rectangle2D.Double, Rectangle2D.Float |
Field Summary | |
---|---|
protected Rectangle |
canvas_clipRect
The area of the map canvas occupied by the map. |
protected Color |
color
The color of the tool. |
MapGrid |
grid
The grid on which this tool acts. |
protected Polygon |
sensitiveArea
The region which is sensitive to mouse events. |
double |
user_X
Current "user" value assocaited with MapRegion.x. |
double |
user_Y
Current "user" values assocaited with MapRegion.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 |
Constructor Summary | |
---|---|
MapRegion()
Constructs a new MapRegion. |
|
MapRegion(double x,
double y,
Color color)
Constructs and initializes a MapRegion with the specified parameters. |
|
MapRegion(int x,
int y,
Color color)
Constructs and initializes a MapRegion with the specified parameters. |
Method Summary | |
---|---|
abstract void |
draw(Graphics g)
Draws a MapRegion. |
Color |
getColor()
Gets the color for this tool. |
MapGrid |
getGrid()
Returns the grid on which this tool acts. |
void |
mouseDown(int mouse_x,
int mouse_y)
Notifies tool of a mouseDown event. |
int |
mouseMove(int mouse_x,
int mouse_y)
Notifies tool of a mouseMove event. |
void |
mouseUp(int mouse_x,
int mouse_y)
Notifies tool of a mouseUp event. |
void |
setColor(Color color)
Sets the color for this tool. |
void |
setGrid(MapGrid grid)
Sets the grid on which this tool acts. |
void |
setLocation(int x,
int y)
Moves the region to a new x, y location interpreting x and y as pixels. |
void |
setUserLocation()
Moves the region to a new x, y location interpreting x and y as user values on the associated grid. |
void |
setUserLocation(double x,
double y)
Moves the region to a new x, y location interpreting x and y as user values on the associated grid. |
String |
toString()
Returns the String representation of the tool's values. |
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, setBounds, setBounds, 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 |
Field Detail |
---|
public double user_X
public double user_Y
public MapGrid grid
protected Polygon sensitiveArea
protected Rectangle canvas_clipRect
protected Color color
Constructor Detail |
---|
public MapRegion()
public MapRegion(int x, int y, Color color)
x
- the x coordinatey
- the y coordinatecolor
- the color of the MapRegionpublic MapRegion(double x, double y, Color color)
x
- the x coordinate in "user" valuesy
- the y coordinate in "user" valuescolor
- the color of the MapRegionMethod Detail |
---|
public String toString()
toString
in class Rectangle
public MapGrid getGrid()
public void setGrid(MapGrid grid)
new_grid
- the new gridpublic void setLocation(int x, int y)
setLocation
in class Rectangle
Rectangle
public void setUserLocation()
Rectangle
public void setUserLocation(double x, double y)
Rectangle
public Color getColor()
public void setColor(Color color)
color
- the Color of this tool.public abstract void draw(Graphics g)
abstract
method which makes this class abstract.
g
- the graphics context for the drawing operation.public int mouseMove(int mouse_x, int mouse_y)
Frame.MOVE_CURSOR
if the
mouse moves of the center tool handle.
mouse_x
- current mouse Xmouse_y
- current mouse Y
public void mouseDown(int mouse_x, int mouse_y)
mouse_x
- current mouse Xmouse_y
- current mouse Ypublic void mouseUp(int mouse_x, int mouse_y)
x
- current mouseXy
- current mouseY
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |