Class TextOverlay

java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.TextOverlay
All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class TextOverlay extends EarthDataOverlay
The TextOverlay class may be used to render a list of text annotation elements.
Since:
3.1.7
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • TextOverlay

      public TextOverlay(Color color)
      Creates a new text overlay with the specified color. The layer number is initialized to 0.
  • Method Details

    • getTextDropShadow

      public boolean getTextDropShadow()
      Gets the text drop shadow flag.
    • setTextDropShadow

      public void setTextDropShadow(boolean flag)
      Sets the text drop shadow flag. When drop shadow mode is on, a shadow is drawn behind the text. By default, drop shadow mode is off.
    • setFont

      public void setFont(Font font)
      Sets the text font. The font is set for each text element in the list.
    • getFont

      public Font getFont()
      Gets the text font. We assume that all text elements have the same font, and that there is at least one text element.
    • addElement

      public void addElement(TextElement element)
      Adds a new text element to the list. The base point coordinates are considered to be in the data coordinate reference frame.
      Parameters:
      element - the new text element to add to the list.
    • getElementIterator

      public Iterator getElementIterator()
      Gets an iterator over the list of text elements.
    • removeElement

      public void removeElement(TextElement element)
      Removes an element from the list.
      Parameters:
      element - the element to remove from the list.
    • 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.