Package noaa.coastwatch.gui.visual
Class SymbolSwatch
java.lang.Object
noaa.coastwatch.gui.visual.SymbolSwatch
- All Implemented Interfaces:
Icon
The
SymbolSwatch
class is an icon that shows a
plot symbol.- Since:
- 3.2.3
- Author:
- Peter Hollemans
-
Field Summary
Modifier and TypeFieldDescriptionprotected 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
ConstructorDescriptionSymbolSwatch
(jahuwaldt.plot.PlotSymbol symbol, int size) Create a new symbol swatch. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the icon height.int
Gets the icon width.void
Paints the icon to the specified graphics context.void
setSymbol
(jahuwaldt.plot.PlotSymbol symbol) Sets the swatch symbol.
-
Field Details
-
BORDER_SIZE
protected static final int BORDER_SIZEThe size of the border around the icon.- See Also:
-
symbol
protected jahuwaldt.plot.PlotSymbol symbolThe swatch symbol. -
size
protected int sizeThe 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 interfaceIcon
-
getIconHeight
public int getIconHeight()Gets the icon height.- Specified by:
getIconHeight
in interfaceIcon
-
paintIcon
Paints the icon to the specified graphics context. -
setSymbol
public void setSymbol(jahuwaldt.plot.PlotSymbol symbol) Sets the swatch symbol.
-