public class GGRadioButton extends GGButtonBase
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
isEnabled, setEnabled, setHotspotArea, setRefreshEnabled
act, addActorCollisionListener, addBorderListener, addCollisionActor, addCollisionActors, addCollisionTile, addCollisionTiles, addMouseTouchListener, addMouseTouchListener, addTileCollisionListener, collide, collide, delay, displace, getBackground, getCollisionActors, getCollisionActorsInRange, getCollisionTiles, getCurrentImage, getDirection, getDirectionStart, getDisplacePosition, getHeight, getIdVisible, getImage, getImage, getIntDirection, getLocation, getLocationOffset, getLocationStart, getNbCycles, getNbHorzCells, getNbSprites, getNbVertCells, getNeighbours, getNeighbours, getNextMoveLocation, getPixelColor, getPixelLocation, getRotatedPosition, getRotationIndex, getScaledImage, getScaledImage, getScaledImage, getSlowDown, getWidth, getX, getXStart, getY, getYStart, hide, isActEnabled, isActorCollisionEnabled, isHorzMirror, isInGrid, isMoveValid, isNearBorder, isRemoved, isRotatable, isTileCollisionEnabled, isVertMirror, isVisible, move, move, nearBorder, removeSelf, rotate, rotate, setActEnabled, setActorCollisionEnabled, setCollisionCircle, setCollisionCircle, setCollisionImage, setCollisionImage, setCollisionLine, setCollisionLine, setCollisionRectangle, setCollisionRectangle, setCollisionSpot, setCollisionSpot, setDirection, setDirection, setDisplacePosition, setHorzMirror, setLocation, setLocationOffset, setLocationOffset, setMouseTouchCircle, setMouseTouchCircle, setMouseTouchEnabled, setMouseTouchImage, setMouseTouchImage, setMouseTouchRectangle, setMouseTouchRectangle, setOnBottom, setOnTop, setPixelLocation, setSlowDown, setTileCollisionEnabled, setVertMirror, setX, setY, show, show, showNextSprite, showPreviousSprite, turn
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 selectedpublic boolean isSelected()
public void setSelected(boolean selected)
selected
- if true, the button is selected; otherwise it is deselectedpublic void reset()
public void addRadioButtonListener(GGRadioButtonListener listener)
listener
- the GGRadioButtonListener to register