|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.WidgetBase
org.xith3d.ui.hud.base.RectangularWidget
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 | |
|---|---|
static class |
StateButton.State
All states of a StateButton |
| Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary |
|---|
| Fields inherited from class org.xith3d.ui.hud.base.WidgetBase |
|---|
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER |
| Constructor Summary | |
|---|---|
StateButton(float width,
float height)
Creates a new StateButton |
|
StateButton(float width,
float height,
int zIndex)
Creates a new StateButton |
|
| Method Summary | |
|---|---|
void |
addStateListener(WidgetStateListener listener)
Add a StateListener |
protected void |
cycleState()
|
boolean |
getBooleanState()
|
StateButton.State |
getState()
|
ButtonGroup |
getStateGroup()
|
boolean |
isEnabled()
|
protected void |
notifyListeners()
Notifies all added listeners about a state event |
void |
onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
This event is fired, when a mouse button is pressed on a focused Widget. |
void |
onMouseEntered(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse entered the Widget area |
void |
onMouseLeft(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse left the Widget area |
protected abstract void |
onStateChanged(StateButton.State state)
|
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 |
setState(StateButton.State state)
Sets the current state of this StateButton |
void |
setStateGroup(ButtonGroup sg)
Assotiates this StateButton with a StateGroup |
| Methods inherited from class org.xith3d.ui.hud.base.RectangularWidget |
|---|
getPickHeight, getPickSGZPosition, getPickWidth, pick |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.xith3d.ui.hud.base.Widget |
|---|
getTransparency |
| Constructor Detail |
|---|
public StateButton(float width,
float height,
int zIndex)
width - the desired widthheight - the desired heightzIndex - the desired z-index
public StateButton(float width,
float height)
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 onStateChanged(StateButton.State state)
public void setState(StateButton.State state)
state - public final StateButton.State getState()
public void setState(boolean state)
state - public final boolean getBooleanState()
public void onMouseEntered(boolean isTopMost,
boolean hasFocus)
onMouseEntered in interface WidgetonMouseEntered in class WidgetBaseisTopMost - is this Widget topMosthasFocus - is this Widget focused
public void onMouseLeft(boolean isTopMost,
boolean hasFocus)
onMouseLeft in interface WidgetonMouseLeft in class WidgetBaseisTopMost - is this Widget topMosthasFocus - is this Widget focusedprotected void cycleState()
public void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonPressed in interface WidgetonMouseButtonPressed in class WidgetBasebutton - 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 | |||||||||