|
||||||||||
| 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.widgets.Slider
public class Slider
A simple Slider implementation used to select a certain value from a range.
| Nested Class Summary | |
|---|---|
static class |
Slider.Description
This class is used to describe a (set of) Slider Widget(s). |
| 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 | |
|---|---|
Slider(float width)
Creates a new Slider. |
|
Slider(float width,
float height)
Creates a new Slider. |
|
Slider(float width,
float height,
Slider.Description desc)
Creates a new Slider. |
|
Slider(float width,
Slider.Description desc)
Creates a new Slider. |
|
| Method Summary | |
|---|---|
void |
addSliderListener(SliderListener l)
Adds a SliderListener to the List to be notified, when the value has changed. |
protected int |
drawHandle(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
Texture2D handleTex,
int forcedHandlePos)
|
protected void |
drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
int |
getHandleYOffset()
|
int |
getMaxValue()
|
int |
getMinValue()
|
protected int |
getMousePosition(int currentHandlePosPx,
int mouseX,
int mouseY)
Checks, if the mouse is over the handle. |
boolean |
getSmoothSliding()
|
int |
getValue()
|
protected void |
init()
This method is called when the WidgetContainer is set. |
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 |
onMouseMoved(float x,
float y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired, when the mouse is moved on a Widget. |
protected void |
onSliderValueChanged(int oldValue,
int newValue)
|
boolean |
removeSliderListener(SliderListener l)
Removes a SliderListener from the List. |
void |
setHandleYOffset(int yOffset)
|
void |
setMaxValue(int maxValue)
Sets the upper bound of scroll values. |
void |
setMinAndMax(int minValue,
int maxValue)
Sets the lower bound of scroll values. |
void |
setMinMaxAndValue(int minValue,
int maxValue,
int value)
Sets the lower bound of scroll values. |
void |
setMinValue(int minValue)
Sets the lower bound of scroll values. |
void |
setSmoothSliding(boolean b)
If true, the handle doesn't snap to discrete positiones depending on the available slide values. |
boolean |
setValue(int value)
Sets the current slide value |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Slider(float width,
float height,
Slider.Description desc)
width - the width of the Scrollbarheight - the height of the Scrollbardesc - a Slider.Description instance holding information about
this new Slider
public Slider(float width,
Slider.Description desc)
width - the width of the Sliderdesc - a Slider.Description instance holding information about
this new Slider
public Slider(float width,
float height)
width - the width of the Sliderheight - the height of the Sliderpublic Slider(float width)
width - the width of the slider| Method Detail |
|---|
public void setHandleYOffset(int yOffset)
public final int getHandleYOffset()
protected int getMousePosition(int currentHandlePosPx,
int mouseX,
int mouseY)
currentHandlePosPx - mouseX - widget local mouse-xmouseY - widget local mouse-y
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 onMouseMoved(float x,
float y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
onMouseMoved in class Widgetx - the new X coordinatey - the new Y coordinateisTopMost - is this Widget topMosthasFocus - is this Widget focusedpublic void setMinValue(int minValue)
public final int getMinValue()
public void setMaxValue(int maxValue)
public final int getMaxValue()
public void setMinAndMax(int minValue,
int maxValue)
minValue - maxValue -
public void setMinMaxAndValue(int minValue,
int maxValue,
int value)
minValue - maxValue - value -
protected void onSliderValueChanged(int oldValue,
int newValue)
oldValue - newValue - public boolean setValue(int value)
value - public final int getValue()
public void addSliderListener(SliderListener l)
l - the new SliderListenerpublic boolean removeSliderListener(SliderListener l)
l - the SliderListener to be removedpublic void setSmoothSliding(boolean b)
b - enable/disablepublic final boolean getSmoothSliding()
protected int drawHandle(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
Texture2D handleTex,
int forcedHandlePos)
protected void drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
drawWidget in class Widgetprotected void init()
init in class Widget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||