|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjview.CircleIcon
public class CircleIcon
A icon that displays itself as a filled circle, color depending on its state. The outline of the circle is drawn in the current color, if not specified. This icon is also a toggle.
| Nested Class Summary | |
|---|---|
static class |
CircleIcon.Label
Constructs labels with this icon and displays them. |
| Field Summary | |
|---|---|
static int |
DEFHEIGHT
The default icon height in pixel. |
static int |
DEFWIDTH
The default icon width in pixel. |
private int |
height
The icon height. |
private Color |
off
The off color. |
private Color |
on
The on color. |
private Color |
outline
The outl;ine color. |
private Component |
parent
The parent component for redraws if the state changes. |
private Boolean |
state
State of the icon. |
private int |
width
The icon width. |
| Constructor Summary | |
|---|---|
CircleIcon(Color red,
Color green)
Constructs a new circular icon with the specified on and off color and the default size. |
|
CircleIcon(Color red,
Color green,
boolean init)
Constructs a new circular icon with the specified on and off color and the default size. |
|
CircleIcon(Color red,
Color green,
int w,
int h)
Constructs a new circular icon with the specified on and off color and the given size. |
|
CircleIcon(Color red,
Color green,
int w,
int h,
boolean init)
Constructs a new circular icon with the specified on and off color and the given size. |
|
| Method Summary | |
|---|---|
int |
getIconHeight()
Returns the icon height. |
int |
getIconWidth()
Returns the icon width. |
boolean |
getState()
Gets the state of the icon. |
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
Paints the icon. |
void |
setOutlineColor(Color out)
Sets the outline color. |
void |
setState(boolean on)
Sets the state of the icon. |
boolean |
toggle()
Toggles the state of the icon. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFWIDTH
public static final int DEFHEIGHT
private int width
private int height
private Color on
private Color off
private Color outline
private Boolean state
private Component parent
| Constructor Detail |
|---|
public CircleIcon(Color red,
Color green)
public CircleIcon(Color red,
Color green,
boolean init)
public CircleIcon(Color red,
Color green,
int w,
int h,
boolean init)
public CircleIcon(Color red,
Color green,
int w,
int h)
| Method Detail |
|---|
public int getIconWidth()
getIconWidth in interface Iconpublic int getIconHeight()
getIconHeight in interface Icon
public void paintIcon(Component c,
Graphics g,
int x,
int y)
paintIcon in interface Iconx - the X coordinate of the icon's top-left corner.y - the Y coordinate of the icon's top-left cornerpublic void setOutlineColor(Color out)
public boolean toggle()
public void setState(boolean on)
public boolean getState()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||