|
||||||||||
| 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.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 class 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.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
AbstractButton(boolean isHeavyWeight,
boolean hasWidgetAssembler,
float width,
float height)
Creates a new Button for the HUD. |
|
| Method Summary | ||
|---|---|---|
void |
addButtonListener(ButtonListener l)
Adds a ButtonListener. |
|
static void |
bindAccessor(org.jagatoo.input.devices.components.DeviceComponent comp)
Binds a DeviceComponent to ALL Buttons, that works as an accessor. |
|
protected void |
fireButtonClickedEvent()
|
|
AbstractButton.ButtonState |
getButtonState()
|
|
abstract
|
getOptimalSize(Dim2f_ buffer)
Calculates implementation dependent optimal size for this Button. |
|
static boolean |
isDefaultFocusResponsive()
|
|
boolean |
isEnabled()
|
|
boolean |
isFocusResponsive()
|
|
protected void |
onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired when the state of any DeviceComponent has changed. |
|
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 |
onMouseButtonReleased(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 released 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 |
removeButtonListener(ButtonListener l)
Removes a ButtonListener. |
|
boolean |
setButtonState(AbstractButton.ButtonState buttonState)
Sets the new AbstractButton.ButtonState for this Button. |
|
static void |
setDefaultFocusResponsive(boolean resp)
Sets whether the Button Widget is focus-responsive by default. |
|
void |
setEnabled(boolean enabled)
|
|
protected abstract void |
setEnabledImpl(boolean enabled)
|
|
void |
setFocusResponsive(boolean resp)
Sets whether this Button Widget is focus-responsive. |
|
static void |
unbindAccessor(org.jagatoo.input.devices.components.DeviceComponent comp)
Unbinds a DeviceComponent from ALL Buttons. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected AbstractButton.ButtonState buttonState
protected boolean isStateChangable
| Constructor Detail |
|---|
public AbstractButton(boolean isHeavyWeight,
boolean hasWidgetAssembler,
float width,
float height)
isHeavyWeight - hasWidgetAssembler - width - the desired widthheight - the desired height| Method Detail |
|---|
public static final void setDefaultFocusResponsive(boolean resp)
resp - setFocusResponsive(boolean)public static final boolean isDefaultFocusResponsive()
isFocusResponsive()public final void setFocusResponsive(boolean resp)
resp - isFocusResponsive(),
setDefaultFocusResponsive(boolean),
isDefaultFocusResponsive()public final boolean isFocusResponsive()
setFocusResponsive(boolean),
setDefaultFocusResponsive(boolean),
isDefaultFocusResponsive()public static void bindAccessor(org.jagatoo.input.devices.components.DeviceComponent comp)
comp - public static void unbindAccessor(org.jagatoo.input.devices.components.DeviceComponent comp)
comp - 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 boolean setButtonState(AbstractButton.ButtonState buttonState)
AbstractButton.ButtonState for this Button.
buttonState -
public final AbstractButton.ButtonState getButtonState()
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 focused
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.MouseCode
protected void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonReleased in class Widgetbutton - 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
protected void onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
long when,
boolean isTopMost,
boolean hasFocus)
onInputStateChanged in class Widgetwhen - the gameTime of the eventpublic abstract <Dim2f_ extends org.openmali.types.twodee.Dim2f> Dim2f_ getOptimalSize(Dim2f_ buffer)
buffer -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||