Class AnnotationOverlay

All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class AnnotationOverlay extends PolygonOverlay
An annotation overlay annotes a data view with annotation elements. Annotation elements may be based in the image reference frame or the data reference frame. With image referencing, the annotation location and size follow the image coordinates and do not change when the view window location and size changes. With data referencing, the annotation follows the data coordinates and changes with the view window and size.
Since:
3.1.1
Author:
Peter Hollemans
See Also:
  • Field Details

    • IMAGE

      public static final int IMAGE
      The image reference frame.
      See Also:
    • DATA

      public static final int DATA
      The data reference frame.
      See Also:
    • elements

      protected List elements
      The list of annotation elements.
  • Constructor Details

    • AnnotationOverlay

      public AnnotationOverlay(Color color, int layer, Stroke stroke, Color fillColor, int reference)
      Constructs a new annotation overlay.
      Parameters:
      color - the overlay color.
      layer - the overlay layer number.
      stroke - the stroke to use for vector paths.
      fillColor - the fill color to use for polygon fills.
      reference - the annotation reference frame. The options are IMAGE and DATA.
    • AnnotationOverlay

      public AnnotationOverlay(Color color)
      Constructs a new annotation overlay. The layer number is initialized to 0, the stroke to the default BasicStroke, the fill color to null, and the reference to the image reference frame.
      Parameters:
      color - the overlay color.
  • Method Details

    • addElement

      public void addElement(AnnotationElement element)
      Adds an annotation element to the list.
    • setReference

      public void setReference(int frame)
      Sets the annotation element reference frame.
      Parameters:
      frame - the reference frame, either IMAGE and DATA.
    • needsPrepare

      protected boolean needsPrepare()
      Returns false as this class needs no preparation.
      Overrides:
      needsPrepare in class EarthDataOverlay
      Returns:
      true if this overlay class needs a preparation stage, or false if not.
    • prepare

      protected void prepare(Graphics2D g, EarthDataView view)
      Description copied from class: EarthDataOverlay
      Prepares the overlay graphics prior to drawing.
      Specified by:
      prepare in class EarthDataOverlay
      Parameters:
      g - the graphics object for drawing.
      view - the earth data view.
    • draw

      protected void draw(Graphics2D g, EarthDataView view)
      Description copied from class: EarthDataOverlay
      Draws the overlay graphics.
      Specified by:
      draw in class EarthDataOverlay
      Parameters:
      g - the graphics object for drawing.
      view - the earth data view.