|
||||||||||
| 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.AbstractButton
public abstract class AbstractButton
This class is a base for all Buttons on a HUD. You can add WidgetActionListeners to it to get notified of a click event.
ButtonListener| Nested Class Summary | |
|---|---|
static class |
AbstractButton.ButtonState
|
| Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary | |
|---|---|
protected AbstractButton.ButtonState |
buttonState
|
protected boolean |
isStateChangable
|
| Fields inherited from class org.xith3d.ui.hud.base.WidgetBase |
|---|
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER |
| Constructor Summary | |
|---|---|
AbstractButton(float width,
float height)
Creates a new Button for the HUD. |
|
AbstractButton(float width,
float height,
int zIndex)
Creates a new Button for the HUD. |
|
| Method Summary | |
|---|---|
void |
addButtonListener(ButtonListener l)
Adds a ButtonListener. |
protected void |
fireButtonClickedEvent()
|
AbstractButton.ButtonState |
getButtonState()
|
boolean |
isEnabled()
|
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 |
onMouseButtonReleased(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 released 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 |
void |
removeButtonListener(ButtonListener l)
Removes a ButtonListener. |
void |
setEnabled(boolean enabled)
|
protected abstract void |
setEnabledImpl(boolean enabled)
|
| 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 |
| Field Detail |
|---|
protected AbstractButton.ButtonState buttonState
protected boolean isStateChangable
| Constructor Detail |
|---|
public AbstractButton(float width,
float height,
int zIndex)
width - the desired widthheight - the desired heightzIndex - the desired z-index
public AbstractButton(float width,
float height)
width - the desired widthheight - the desired height| Method Detail |
|---|
public void addButtonListener(ButtonListener l)
public void removeButtonListener(ButtonListener l)
protected void fireButtonClickedEvent()
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.Enableablepublic AbstractButton.ButtonState getButtonState()
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 focused
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.MouseCode
public void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonReleased in interface WidgetonMouseButtonReleased in class WidgetBasebutton - the button that was releasedx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||