Class ZoomPolygon

java.lang.Object
PamView.zoomer.ZoomShape
PamView.zoomer.ZoomPolygon

public class ZoomPolygon extends ZoomShape
A zoom polygon created by the zoomer.
Author:
Doug Gillespie
  • Constructor Details

    • ZoomPolygon

      public ZoomPolygon(Zoomer zoomer, Point startPoint, int coordinateType, double xStart, double yStart)
  • Method Details

    • drawShape

      public Rectangle drawShape(Graphics g, 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 - graphics
      component - component to draw on
      Returns:
      outer bounds of drawn region (should be same as getBounds());
    • drawShapeOutline

      public Rectangle drawShapeOutline(Graphics g, Component component)
    • drawShapeSolid

      public Rectangle drawShapeSolid(Graphics g, Component component)
    • getBounds

      public Rectangle getBounds(Component component)
      Specified by:
      getBounds in class ZoomShape
      Returns:
      the outer bounds of the zoom shape in pixels.
    • containsPoint

      public boolean containsPoint(Component component, 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
      Parameters:
      pt - point
      Returns:
      true if the point is within the shape.
    • 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 PIXELS
      y - y coordinate in display units such as time or bearing, NOT PIXELS
    • 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.

    • setCurrentMousePoint

      public void setCurrentMousePoint(Point currentMousePoint)
      Parameters:
      currentMousePoint - the currentMousePoint to set
    • getStartPoint

      public Point getStartPoint()
      Returns:
      the startPoint
    • getNumPoints

      public int getNumPoints()
    • 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
    • getxPoints

      public double[] getxPoints()
      Returns:
      the xPoints
    • getyPoints

      public double[] getyPoints()
      Returns:
      the yPoints
    • zoomShapeToOverlayMark

      public OverlayMark zoomShapeToOverlayMark(OverlayMarker overlayMarker)
      Description copied from class: ZoomShape
      Convert the obsolete zoom shapes into newer overlay marks.
      Specified by:
      zoomShapeToOverlayMark in class ZoomShape
      Returns: