|
||||||||||
| 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
org.xith3d.ui.hud.widgets.Button
org.xith3d.ui.hud.widgets.ToggleButton
public class ToggleButton
A ToggleButton is a Button, that stays PRESSED until it gets clicked again.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.widgets.Button |
|---|
Button.Description |
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.AbstractButton |
|---|
AbstractButton.ButtonState |
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary |
|---|
| Fields inherited from class org.xith3d.ui.hud.widgets.Button |
|---|
DEFAULT_HEAVYWEIGHT |
| Fields inherited from class org.xith3d.ui.hud.base.AbstractButton |
|---|
buttonState, isStateChangable |
| Fields inherited from class org.xith3d.ui.hud.base.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text)
Create a new ToggleButton. |
|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
Button.Description desc)
Create a new ToggleButton. |
|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new ToggleButton. |
|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
HUDFont font)
Creates a new ToggleButton. |
|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
Creates a new ToggleButton. |
|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String normalTexture,
java.lang.String hoveredTexture,
java.lang.String pressedTexture)
Creates a new Image ToggleButton (textures will simply be streched over the whole Button area). |
|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String normalTexture,
java.lang.String hoveredTexture,
java.lang.String pressedTexture,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
Creates a new Image ToggleButton (textures will simply be streched over the whole Button area). |
|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
Texture2D normalTexture,
Texture2D hoveredTexture,
Texture2D pressedTexture)
Creates a new Image ToggleButton (textures will simply be streched over the whole Button area). |
|
ToggleButton(boolean isHeavyWeight,
float width,
float height,
Texture2D normalTexture,
Texture2D hoveredTexture,
Texture2D pressedTexture,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
Creates a new Image ToggleButton (textures will simply be streched over the whole Button area). |
|
ToggleButton(float width,
float height,
java.lang.String text)
Create a new ToggleButton. |
|
ToggleButton(float width,
float height,
java.lang.String text,
Button.Description desc)
Create a new ToggleButton. |
|
ToggleButton(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new ToggleButton. |
|
ToggleButton(float width,
float height,
java.lang.String text,
HUDFont font)
Creates a new ToggleButton. |
|
ToggleButton(float width,
float height,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
Creates a new ToggleButton. |
|
ToggleButton(float width,
float height,
java.lang.String normalTexture,
java.lang.String hoveredTexture,
java.lang.String pressedTexture)
Creates a new Image ToggleButton (textures will simply be streched over the whole Button area). |
|
ToggleButton(float width,
float height,
java.lang.String normalTexture,
java.lang.String hoveredTexture,
java.lang.String pressedTexture,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
Creates a new Image ToggleButton (textures will simply be streched over the whole Button area). |
|
ToggleButton(float width,
float height,
Texture2D normalTexture,
Texture2D hoveredTexture,
Texture2D pressedTexture)
Creates a new Image ToggleButton (textures will simply be streched over the whole Button area). |
|
ToggleButton(float width,
float height,
Texture2D normalTexture,
Texture2D hoveredTexture,
Texture2D pressedTexture,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
Creates a new Image ToggleButton (textures will simply be streched over the whole Button area). |
|
| Method Summary | |
|---|---|
boolean |
isToggled()
|
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 |
setToggled(boolean toggled)
Sets if the ToggleButton is currently toggled. |
| Methods inherited from class org.xith3d.ui.hud.widgets.Button |
|---|
createCaptionWidget, createImageButtonDesc, createImageButtonDesc, deriveDesc, drawWidget, getAlignment, getCurrentTexture, getFont, getFontColor, getIcon, getIconGap, getOptimalSize, getText, getTextureHovered, getTextureNormal, getTexturePressed, hasText, init, onFocusGained, onFocusLost, onSizeChanged, setAlignment, setButtonState, setEnabledImpl, setFont, setFontColor, setIcon, setIcon, setIconGap, setText, setTextureHovered, setTextureHovered, setTextureNormal, setTextureNormal, setTexturePressed, setTexturePressed, toString, update |
| Methods inherited from class org.xith3d.ui.hud.base.AbstractButton |
|---|
addButtonListener, bindAccessor, fireButtonClickedEvent, getButtonState, isDefaultFocusResponsive, isEnabled, isFocusResponsive, onInputStateChanged, removeButtonListener, setDefaultFocusResponsive, setEnabled, setFocusResponsive, unbindAccessor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
Button.Description desc)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this WidgetzIndex - the new z-index of this Widgettext - the text to display on the Buttondesc - Button.Description
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this WidgetzIndex - the new z-index of this Widgettext - the text to display on the Button
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this Widgettext - the text to display on the Buttonfont - color -
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
HUDFont font)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this Widgettext - the text to display on the Buttonfont -
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this Widgettext - the text to display on the Buttoncolor -
public ToggleButton(float width,
float height,
java.lang.String text,
Button.Description desc)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this WidgetzIndex - the new z-index of this Widgettext - the text to display on the Buttondesc - Button.Description
public ToggleButton(float width,
float height,
java.lang.String text)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the new z-index of this Widgettext - the text to display on the Button
public ToggleButton(float width,
float height,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display on the Buttonfont - color -
public ToggleButton(float width,
float height,
java.lang.String text,
HUDFont font)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display on the Buttonfont -
public ToggleButton(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display on the Buttoncolor -
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
Texture2D normalTexture,
Texture2D hoveredTexture,
Texture2D pressedTexture,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this WidgettexNormal - the texture for the normal button statetexHovered - the texture for the normal button statetexPressed - the texture for the normal button statetext - the text to display on the Buttonfont - color -
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String normalTexture,
java.lang.String hoveredTexture,
java.lang.String pressedTexture,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this WidgettexNormal - the texture for the normal button statetexHovered - the texture for the normal button statetexPressed - the texture for the normal button statetext - the text to display on the Buttonfont - color -
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
Texture2D normalTexture,
Texture2D hoveredTexture,
Texture2D pressedTexture)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this WidgettexNormal - the texture for the normal button statetexHovered - the texture for the normal button statetexPressed - the texture for the normal button state
public ToggleButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String normalTexture,
java.lang.String hoveredTexture,
java.lang.String pressedTexture)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this WidgettexNormal - the texture for the normal button statetexHovered - the texture for the normal button statetexPressed - the texture for the normal button state
public ToggleButton(float width,
float height,
Texture2D normalTexture,
Texture2D hoveredTexture,
Texture2D pressedTexture,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this WidgettexNormal - the texture for the normal button statetexHovered - the texture for the normal button statetexPressed - the texture for the normal button statetext - the text to display on the Buttonfont - color -
public ToggleButton(float width,
float height,
java.lang.String normalTexture,
java.lang.String hoveredTexture,
java.lang.String pressedTexture,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this WidgettexNormal - the texture for the normal button statetexHovered - the texture for the normal button statetexPressed - the texture for the normal button statetext - the text to display on the Buttonfont - color -
public ToggleButton(float width,
float height,
Texture2D normalTexture,
Texture2D hoveredTexture,
Texture2D pressedTexture)
width - the new width of this Widgetheight - the new height of this WidgettexNormal - the texture for the normal button statetexHovered - the texture for the normal button statetexPressed - the texture for the normal button state
public ToggleButton(float width,
float height,
java.lang.String normalTexture,
java.lang.String hoveredTexture,
java.lang.String pressedTexture)
width - the new width of this Widgetheight - the new height of this WidgettexNormal - the texture for the normal button statetexHovered - the texture for the normal button statetexPressed - the texture for the normal button state| Method Detail |
|---|
public void setToggled(boolean toggled)
public final boolean isToggled()
protected void onMouseEntered(boolean isTopMost,
boolean hasFocus)
onMouseEntered in class AbstractButtonisTopMost - is this Widget topMosthasFocus - is this Widget focused
protected void onMouseExited(boolean isTopMost,
boolean hasFocus)
onMouseExited in class AbstractButtonisTopMost - 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 AbstractButtonbutton - 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 AbstractButtonbutton - 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 | |||||||||