|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.Widget
org.xith3d.ui.hud.base.StateButton
public abstract class StateButton
This class is a base for all state capable Buttons on a HUD. You can add WidgetActionListeners to it to get notified of a click event.
WidgetStateListener| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary |
|---|
| Fields inherited from class org.xith3d.ui.hud.base.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
StateButton(boolean isHeavyWeight,
boolean hasWidgetAssembler,
float width,
float height)
Creates a new StateButton. |
|
| Method Summary | |
|---|---|
void |
addStateListener(WidgetStateListener listener)
Add a StateListener |
protected void |
cycleState()
|
boolean |
getState()
|
ButtonGroup |
getStateGroup()
|
boolean |
isEnabled()
|
protected void |
notifyListeners()
Notifies all added listeners about a state event |
protected abstract void |
onExtendedStateChanged(boolean state,
boolean hovered)
|
protected void |
onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
This event is fired, when a mouse button is pressed on a focused Widget. |
protected void |
onMouseEntered(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse entered the Widget area. |
protected void |
onMouseExited(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse exited the Widget area. |
void |
removeStateListener(WidgetStateListener listener)
Remove a StateListener |
void |
setEnabled(boolean enabled)
|
protected abstract void |
setEnabledImpl(boolean enabled)
|
void |
setState(boolean state)
Sets the current state of this StateButton |
void |
setStateGroup(ButtonGroup sg)
Assotiates this StateButton with a StateGroup |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StateButton(boolean isHeavyWeight,
boolean hasWidgetAssembler,
float width,
float height)
isHeavyWeight - hasWidgetAssembler - width - the desired widthheight - the desired height| Method Detail |
|---|
public void setStateGroup(ButtonGroup sg)
sg - the StateGroup to assotiate this StateButton withpublic final ButtonGroup getStateGroup()
protected final void notifyListeners()
protected abstract void onExtendedStateChanged(boolean state,
boolean hovered)
public void setState(boolean state)
state - public final boolean getState()
protected void onMouseEntered(boolean isTopMost,
boolean hasFocus)
onMouseEntered in class WidgetisTopMost - is this Widget topMosthasFocus - is this Widget focused
protected void onMouseExited(boolean isTopMost,
boolean hasFocus)
onMouseExited in class WidgetisTopMost - is this Widget topMosthasFocus - is this Widget focusedprotected void cycleState()
protected void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonPressed in class Widgetbutton - the button that was pressedx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCodepublic void addStateListener(WidgetStateListener listener)
public void removeStateListener(WidgetStateListener listener)
protected abstract void setEnabledImpl(boolean enabled)
public final void setEnabled(boolean enabled)
setEnabled in interface org.jagatoo.datatypes.Enableablepublic final boolean isEnabled()
isEnabled in interface org.jagatoo.datatypes.Enableable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||