Package PamView.zoomer
Class ZoomShape
java.lang.Object
PamView.zoomer.ZoomShape
- Direct Known Subclasses:
ZoomPolygon
,ZoomRectangle
Interface to support a variety of zoomable shapes.
I currently can't think of anything but a rectangle and an arbitrary polygon, but you never know !
- Author:
- Doug Gillespie
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Shape is complete for whatever reason.abstract boolean
containsPoint
(Component component, Point pt) Shape contains the point pt.abstract Rectangle
Draw the shape using the given graphics handle on the given component.abstract Rectangle
int
Get the type of coordinate (only needs to be specific within a particular display, not more generally.abstract double
abstract double
abstract double
abstract double
boolean
isClosed()
abstract void
newPoint
(double x, double y) New point to add to the shape - or update old point if it's a rectangle.abstract boolean
void
setZoomShapeFill
(Color fillColor) void
setZoomShapeOutline
(Color outlineColor) abstract OverlayMark
zoomShapeToOverlayMark
(OverlayMarker overlayMarker) Convert the obsolete zoom shapes into newer overlay marks.
-
Constructor Details
-
ZoomShape
- Parameters:
zoomer
-coordinateType
-
-
-
Method Details
-
getBounds
- Returns:
- the outer bounds of the zoom shape in pixels.
-
drawShape
Draw the shape using the given graphics handle on the given component.- Parameters:
g
- graphicscomponent
- component to draw onbeforeOther
-- Returns:
- outer bounds of drawn region (should be same as getBounds());
-
newPoint
public abstract void newPoint(double x, double y) New point to add to the shape - or update old point if it's a rectangle.- 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
-
closeShape
public void closeShape()Shape is complete for whatever reason. -
isClosed
public boolean isClosed()- Returns:
- the closed
-
removeOnZoom
public abstract boolean removeOnZoom()- Returns:
- true if the object should no longer be displayed after zooming
Basically true for rectangles, false for polygons.
-
containsPoint
Shape contains the point pt.Note that these are in screen pixel coordinates.
- Parameters:
pt
- pointComponent
- component- Returns:
- true if the point is within the shape.
-
getXStart
public abstract double getXStart()- Returns:
- the lowest x value
-
getXLength
public abstract double getXLength()- Returns:
- the difference between the minimum and maximum x values.
-
getYStart
public abstract double getYStart()- Returns:
- the lowest y value
-
getYLength
public abstract double getYLength()- Returns:
- the difference between the minimum and maximum y values.
-
getCoordinateType
public int getCoordinateType()Get the type of coordinate (only needs to be specific within a particular display, not more generally.- Returns:
- coordinate type.
-
getZoomer
-
setZoomShapeOutline
-
setZoomShapeFill
-
zoomShapeToOverlayMark
Convert the obsolete zoom shapes into newer overlay marks.- Parameters:
overlayMarker
-- Returns:
-