Class LatLonOverlay

All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class LatLonOverlay extends LabeledLineOverlay
The LatLonOverlay class annotates an EarthDataView view with latitude/longitude grid lines and labels.
Since:
3.1.1
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • LatLonOverlay

      public LatLonOverlay(Color color, int layer, Stroke stroke, boolean manualIncrement, int inc, 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.
      manualIncrement - the manual increment flag.
      inc - the latitude and longitude grid increment in degrees.
      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.
    • LatLonOverlay

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

    • setManualIncrement

      public void setManualIncrement(boolean flag)
      Sets the manual grid increment mode flag. When off, the grid increment is calculated automatically at rendering time for an optimal number of grid lines.
    • getManualIncrement

      public boolean getManualIncrement()
      Gets the manual grid increment mode flag.
    • setIncrement

      public void setIncrement(int inc)
      Sets the grid increment in degrees.
    • getIncrement

      public int getIncrement()
      Gets the current grid increment value in degrees.
    • 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.