public class SymbolSwatch
extends java.lang.Object
implements javax.swing.Icon
SymbolSwatch
class is an icon that shows a
plot symbol.Modifier and Type | Field and Description |
---|---|
protected static int |
BORDER_SIZE
The size of the border around the icon.
|
protected int |
size
The icon size.
|
protected jahuwaldt.plot.PlotSymbol |
symbol
The swatch symbol.
|
Constructor and Description |
---|
SymbolSwatch(jahuwaldt.plot.PlotSymbol symbol,
int size)
Create a new symbol swatch.
|
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight()
Gets the icon height.
|
int |
getIconWidth()
Gets the icon width.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paints the icon to the specified graphics context.
|
void |
setSymbol(jahuwaldt.plot.PlotSymbol symbol)
Sets the swatch symbol.
|
protected static final int BORDER_SIZE
protected jahuwaldt.plot.PlotSymbol symbol
protected int size
public SymbolSwatch(jahuwaldt.plot.PlotSymbol symbol, int size)
symbol
- the symbol to display.size
- the icon width and height.public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public void setSymbol(jahuwaldt.plot.PlotSymbol symbol)