|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.jgamegrid.Actor ch.aplu.jgamegrid.GGButtonBase ch.aplu.jgamegrid.GGRadioButton
public class GGRadioButton
Class that implements a radio button actor with standard behavior. Events are generated when the button changes its state due to a mouse click from selected to deselected or vise versa. In order to align several radio buttons, the actor's image is centered in the middle of the radio box and extends the same size to the left and right determined by the text length. The left part is always transparent. The default hot spot area is the bounding square of the circle. Use Actor.setLocationOffset() to fine tune the button location.
Field Summary |
---|
Fields inherited from class ch.aplu.jgamegrid.Actor |
---|
gameGrid, nbCycles |
Constructor Summary | |
---|---|
GGRadioButton(java.lang.String text)
Creates a deselected radio button with the given text annotation, black text and white background colors. |
|
GGRadioButton(java.lang.String text,
boolean isSelected)
Creates a radio button with the given text annotation, black text and and white background colors. |
|
GGRadioButton(java.lang.String text,
java.awt.Color textColor,
java.awt.Color bkColor)
Creates a deselected radio button with the given text annotation and given text and background colors. |
|
GGRadioButton(java.lang.String text,
java.awt.Color textColor,
java.awt.Color bkColor,
boolean isSelected)
Creates a radio button with the given text annotation and given text and background colors. |
Method Summary | |
---|---|
void |
addRadioButtonListener(GGRadioButtonListener listener)
Registers a GGRadioListener to get notifications when the button is manipulated. |
boolean |
isSelected()
Returns the current state of the button. |
void |
reset()
Overrides the actor's reset() called when the button is added to the game grid. |
void |
setSelected(boolean selected)
Sets the button in the selected/deselected state. |
Methods inherited from class ch.aplu.jgamegrid.GGButtonBase |
---|
isEnabled, setEnabled, setHotspotArea, setRefreshEnabled |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GGRadioButton(java.lang.String text)
text
- the text annotationpublic GGRadioButton(java.lang.String text, boolean isSelected)
text
- the text annotationisSelected
- if true, the radio button is initially selectedpublic GGRadioButton(java.lang.String text, java.awt.Color textColor, java.awt.Color bkColor)
text
- the text annotationtextColor
- the color of the annotation textbkColor
- the background colorpublic GGRadioButton(java.lang.String text, java.awt.Color textColor, java.awt.Color bkColor, boolean isSelected)
text
- the text annotationtextColor
- the color of the annotation textbkColor
- the background colorisSelected
- if true, the radio button is initially selectedMethod Detail |
---|
public boolean isSelected()
public void setSelected(boolean selected)
selected
- if true, the button is selected; otherwise it is deselectedpublic void reset()
reset
in class Actor
public void addRadioButtonListener(GGRadioButtonListener listener)
listener
- the GGRadioButtonListener to register
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |