Class DataReferenceOverlay

All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class DataReferenceOverlay extends LabeledLineOverlay
The DataReferenceOverlay class annotates an EarthDataView object with row/column grid lines and labels.
Since:
3.2.2
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • DataReferenceOverlay

      public DataReferenceOverlay(Color color, int layer, Stroke stroke, boolean manualLines, double[] rows, double[] cols, boolean drawLabels, Font font)
      Constructs a new grid overlay.
      Parameters:
      color - the overlay color.
      layer - the overlay layer number.
      stroke - the stroke to use for vector paths.
      manualLines - the manual lines flag.
      rows - the reference row line values.
      cols - the reference column line values.
      drawLabels - the grid labels flag, true if grid labels should be drawn.
      font - the grid labels font. The labels font may be null if no labels are to be drawn.
    • DataReferenceOverlay

      public DataReferenceOverlay(Color color)
      Constructs a new grid overlay. The layer number is initialized to 0, the stroke to the default BasicStroke, the manual lines flag to false, labels to true, and the font to the default font face, plain style, 12 point.
      Parameters:
      color - the overlay color.
  • Method Details

    • setManualLines

      public void setManualLines(boolean flag)
      Sets the manual grid lines flag. When off, the grid lines are calculated automatically at rendering time for an optimal number of grid lines in both the rows and columns directions.
    • getManualLines

      public boolean getManualLines()
      Gets the manual grid increment mode flag.
    • setRows

      public void setRows(double[] rows)
      Sets the reference row lines.
    • getRows

      public double[] getRows()
      Gets the current reference row lines.
    • setCols

      public void setCols(double[] cols)
      Sets the reference row lines.
    • getCols

      public double[] getCols()
      Gets the current reference row lines.
    • getLines

      protected LineCollection getLines(EarthDataView view)
      Description copied from class: LabeledLineOverlay
      Gets the collection of lines for this overlay. This method should be implemented by the subclass and is called by LabeledLineOverlay.prepare(java.awt.Graphics2D, noaa.coastwatch.render.EarthDataView).
      Specified by:
      getLines in class LabeledLineOverlay
      Parameters:
      view - the earth view for line rendering.
      Returns:
      the collection of lines to render.
    • main

      public static void main(String[] argv)
      Tests this class.
      Parameters:
      argv - the array of command line parameters.