org.jscience.swing.spinner.icons
Class SquareIcon
java.lang.Object
org.jscience.swing.spinner.icons.SquareIcon
- All Implemented Interfaces:
- javax.swing.Icon
public class SquareIcon
- extends java.lang.Object
- implements javax.swing.Icon
An Icon showing a square. For example you can use it as the
Icon for a stop button of a timer.
The size of the Icon is not the size of the actual square the Icon is
showing. The square size fits to the arrow size of an ArrowIcon object.
- See Also:
ArrowIcon
|
Constructor Summary |
SquareIcon()
Creates a new SquareIcon with
the default size of 8 pixels. |
SquareIcon(int iconSize)
Creates a new SquareIcon with the specified
size. |
|
Method Summary |
int |
getIconHeight()
|
int |
getIconWidth()
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
|
void |
paintTriangle(java.awt.Graphics g,
int x,
int y,
int size,
boolean isEnabled,
java.awt.Color foreground)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SquareIcon
public SquareIcon()
- Creates a new SquareIcon with
the default size of 8 pixels.
SquareIcon
public SquareIcon(int iconSize)
- Creates a new SquareIcon with the specified
size. Note that the size of the Icon is its width AND height,
the square displayed by this Icon lies within that square but
is not that size - it fits to an appropriate sized arrow of an
ArrowIcon.
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight in interface javax.swing.Icon
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth in interface javax.swing.Icon
paintIcon
public void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
- Specified by:
paintIcon in interface javax.swing.Icon
paintTriangle
public void paintTriangle(java.awt.Graphics g,
int x,
int y,
int size,
boolean isEnabled,
java.awt.Color foreground)