Class SymbolSwatch

java.lang.Object
noaa.coastwatch.gui.visual.SymbolSwatch
All Implemented Interfaces:
Icon

public class SymbolSwatch extends Object implements Icon
The SymbolSwatch class is an icon that shows a plot symbol.
Since:
3.2.3
Author:
Peter Hollemans
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
    The size of the border around the icon.
    protected int
    The icon size.
    protected jahuwaldt.plot.PlotSymbol
    The swatch symbol.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SymbolSwatch(jahuwaldt.plot.PlotSymbol symbol, int size)
    Create a new symbol swatch.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the icon height.
    int
    Gets the icon width.
    void
    paintIcon(Component c, Graphics g, int x, int y)
    Paints the icon to the specified graphics context.
    void
    setSymbol(jahuwaldt.plot.PlotSymbol symbol)
    Sets the swatch symbol.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BORDER_SIZE

      protected static final int BORDER_SIZE
      The size of the border around the icon.
      See Also:
    • symbol

      protected jahuwaldt.plot.PlotSymbol symbol
      The swatch symbol.
    • size

      protected int size
      The icon size.
  • Constructor Details

    • SymbolSwatch

      public SymbolSwatch(jahuwaldt.plot.PlotSymbol symbol, int size)
      Create a new symbol swatch.
      Parameters:
      symbol - the symbol to display.
      size - the icon width and height.
  • Method Details

    • getIconWidth

      public int getIconWidth()
      Gets the icon width.
      Specified by:
      getIconWidth in interface Icon
    • getIconHeight

      public int getIconHeight()
      Gets the icon height.
      Specified by:
      getIconHeight in interface Icon
    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)
      Paints the icon to the specified graphics context.
      Specified by:
      paintIcon in interface Icon
    • setSymbol

      public void setSymbol(jahuwaldt.plot.PlotSymbol symbol)
      Sets the swatch symbol.