PamView.zoomer
Class ZoomRectangle
java.lang.Object
PamView.zoomer.ZoomShape
PamView.zoomer.ZoomRectangle
public class ZoomRectangle
- extends ZoomShape
|
Field Summary |
(package private) double |
x1
|
(package private) double |
x2
|
(package private) double |
y1
|
(package private) double |
y2
|
|
Constructor Summary |
ZoomRectangle(Zoomer zoomer,
int coordindateType,
double xStart,
double yStart)
|
|
Method Summary |
void |
closeShape()
Shape is complete for whatever reason. |
boolean |
containsPoint(java.awt.Component component,
java.awt.Point pt)
Shape contains the point pt. |
java.awt.Rectangle |
drawShape(java.awt.Graphics g,
java.awt.Component component,
boolean beforeOther)
Draw the shape using the given graphics handle on the
given component. |
java.awt.Rectangle |
getBounds(java.awt.Component component)
|
double |
getXLength()
|
double |
getXStart()
|
double |
getYLength()
|
double |
getYStart()
|
void |
newPoint(double x,
double y)
New point to add to the shape - or update old point if it's a
rectangle. |
boolean |
removeOnZoom()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
x1
double x1
x2
double x2
y1
double y1
y2
double y2
ZoomRectangle
public ZoomRectangle(Zoomer zoomer,
int coordindateType,
double xStart,
double yStart)
drawShape
public java.awt.Rectangle drawShape(java.awt.Graphics g,
java.awt.Component component,
boolean beforeOther)
- Description copied from class:
ZoomShape
- Draw the shape using the given graphics handle on the
given component.
- Specified by:
drawShape in class ZoomShape
- Parameters:
g - graphicscomponent - component to draw on
- Returns:
- outer bounds of drawn region (should be same as getBounds());
containsPoint
public boolean containsPoint(java.awt.Component component,
java.awt.Point pt)
- Description copied from class:
ZoomShape
- Shape contains the point pt.
Note that these are in screen pixel coordinates.
- Specified by:
containsPoint in class ZoomShape
pt - point
- Returns:
- true if the point is within the shape.
closeShape
public void closeShape()
- Description copied from class:
ZoomShape
- Shape is complete for whatever reason.
- Overrides:
closeShape in class ZoomShape
removeOnZoom
public boolean removeOnZoom()
- Specified by:
removeOnZoom in class ZoomShape
- Returns:
- true if the object should no longer be displayed after zooming
Basically true for rectangles, false for polygons.
newPoint
public void newPoint(double x,
double y)
- Description copied from class:
ZoomShape
- New point to add to the shape - or update old point if it's a
rectangle.
- Specified by:
newPoint in class ZoomShape
- Parameters:
x - x coordinate in display units such as time or bearing, NOT PIXELSy - y coordinate in display units such as time or bearing, NOT PIXELS
getBounds
public java.awt.Rectangle getBounds(java.awt.Component component)
- Specified by:
getBounds in class ZoomShape
- Returns:
- the outer bounds of the zoom shape in pixels.
getXLength
public double getXLength()
- Specified by:
getXLength in class ZoomShape
- Returns:
- the difference between the minimum and maximum
x values.
getXStart
public double getXStart()
- Specified by:
getXStart in class ZoomShape
- Returns:
- the lowest x value
getYLength
public double getYLength()
- Specified by:
getYLength in class ZoomShape
- Returns:
- the difference between the minimum and maximum
y values.
getYStart
public double getYStart()
- Specified by:
getYStart in class ZoomShape
- Returns:
- the lowest y value