|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.sprites.Sprite
org.deken.game.component.GComponent
org.deken.game.component.GTextContainer
org.deken.game.component.GButton
org.deken.game.component.GToggleButton
public class GToggleButton
Title: GToggleButton
Description: A simple Game Button the can be toggled on and off. It internally keeps track if its toggled state. This inherits all the features of the GButton.
Copyright: Copyright (c) Nov 10, 2013
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.deken.game.component.GComponent |
---|
GComponent.Alignment, GComponent.MouseActions |
Field Summary |
---|
Fields inherited from class org.deken.game.component.GButton |
---|
ANIMATION_DEFAULT, ANIMATION_DIABLED, ANIMATION_PRESSED, ANIMATION_ROLLOVER, animationIndex, buttonListeners, buttonNotify |
Fields inherited from class org.deken.game.component.GTextContainer |
---|
baseAnimation, gText |
Fields inherited from class org.deken.game.component.GComponent |
---|
horizontalAlignment, id, invalid, keyPolling, mouseActions, parent, requestKeyPolling, screenHeight, screenWidth, verticalAlignment, xOffSet, yOffSet |
Fields inherited from class org.deken.game.sprites.Sprite |
---|
boundingBox, collisionMap, location, size |
Constructor Summary | |
---|---|
GToggleButton()
GButton is created with the Mouse action of button 1 pressed. |
|
GToggleButton(Animation animation)
GToggleButton is created with the Mouse action of button 1 pressed. |
|
GToggleButton(GText gText)
GToggleButton is created with the Mouse action of button 1 pressed. |
|
GToggleButton(GText gText,
java.awt.Color fontHighlightColor)
GToggleButton is created with the Mouse action of button 1 pressed. |
|
GToggleButton(java.lang.String text)
GToggleButton is created with the Mouse action of button 1 pressed. |
|
GToggleButton(java.lang.String text,
java.awt.Font font,
java.awt.Color fontColor,
java.awt.Color fontHighlightColor)
GToggleButton is created with the Mouse action of button 1 pressed. |
Method Summary | |
---|---|
void |
addLinkToggleButton(GToggleButton button)
|
GToggleButton |
copy()
|
boolean |
isToggled()
|
void |
notifyListener(InputMouseAction inputMouseAction)
Receive Mouse actions. |
void |
setClickUnToggles(boolean clickUnToggles)
|
void |
setEnabled(boolean b)
setEnabled |
void |
setToggled(boolean newToggled)
Makes this button selected or unSelected. |
Methods inherited from class org.deken.game.component.GButton |
---|
addAnimation, addFontColor, addGText, addInputAction, addKeyAction, addListener, copyGButtonBase, draw, getAlignment, getAnimation, getAnimation, getFontHighlightColor, getImage, getInputActionIds, getKeyAssociated, hasListeners, notifyListener, setAlignment, setAnimation, setFontHighlightColor, setGText, setKeyAssociated, setMonitored, spriteCollison, update, validate |
Methods inherited from class org.deken.game.component.GTextContainer |
---|
getBaseAnimation, getGText, setInvalid |
Methods inherited from class org.deken.game.component.GComponent |
---|
addMouseAction, copyBase, getHorizontalAlignment, getMouseActions, getParent, getVerticalAlignment, getXLocation, getYLocation, isEnabled, positionHorizontalAlignment, positionVerticalAlignment, requestKeyPolling, setHorizontalAlignment, setKeyPolling, setParent, setVerticalAlignment |
Methods inherited from class org.deken.game.sprites.Sprite |
---|
getBounds, getDepth, getHeight, getLocation, getName, getSize, getWidth, removeFromMap, setBoundingBox, setBoundingBox, setCollisionMap, setLocation, setName, setSize, toString, updateLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GToggleButton()
public GToggleButton(java.lang.String text)
text
- Stringpublic GToggleButton(Animation animation)
animation
- Animationpublic GToggleButton(java.lang.String text, java.awt.Font font, java.awt.Color fontColor, java.awt.Color fontHighlightColor)
text
- font
- fontColor
- fontHighlightColor
- public GToggleButton(GText gText)
gText
- public GToggleButton(GText gText, java.awt.Color fontHighlightColor)
gText
- fontHighlightColor
- Method Detail |
---|
public void addLinkToggleButton(GToggleButton button)
public GToggleButton copy()
copy
in class GButton
public boolean isToggled()
public void notifyListener(InputMouseAction inputMouseAction)
notifyListener
in interface InputMouseListener
notifyListener
in class GButton
inputMouseAction
- public void setClickUnToggles(boolean clickUnToggles)
public void setEnabled(boolean b)
GButton
Calls the super method, and set the current animation to the enabled or disabled.
setEnabled
in class GButton
b
- booleanpublic void setToggled(boolean newToggled)
newToggled
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |