anl.aida.palette
Class PaletteIcon
java.lang.Object
anl.aida.palette.PaletteIcon
- All Implemented Interfaces:
- javax.swing.Icon
public class PaletteIcon
- extends java.lang.Object
- implements javax.swing.Icon
- Version:
- $Revision$ $Date$
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
icons
private SquareIcon[] icons
orientation
private PaletteIcon.Orientation orientation
width
private int width
height
private int height
iconSize
private int iconSize
PaletteIcon
public PaletteIcon(Palette palette,
PaletteIcon.Orientation orientation)
PaletteIcon
public PaletteIcon(SquareIcon[] icons,
PaletteIcon.Orientation orientation)
getColorAt
public java.awt.Color getColorAt(int x,
int y)
getColorIndexAt
public int getColorIndexAt(int x,
int y)
init
private void init(SquareIcon[] icons,
PaletteIcon.Orientation orientation)
getIconHeight
public int getIconHeight()
- Returns the icon's height.
- Specified by:
getIconHeight
in interface javax.swing.Icon
- Returns:
- an int specifying the fixed height of the icon.
getIconWidth
public int getIconWidth()
- Returns the icon's width.
- Specified by:
getIconWidth
in interface javax.swing.Icon
- Returns:
- an int specifying the fixed width of the icon.
paintIcon
public void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
- Draw the icon at the specified location. Icon implementations may use the
Component argument to get properties useful for painting, e.g. the
foreground or background color.
- Specified by:
paintIcon
in interface javax.swing.Icon