|
||||||||||
| 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.BackgroundSettableWidget
org.xith3d.ui.hud.widgets.Scrollbar
public class Scrollbar
A simple Scrollbar implementation used to scroll content on the HUD.
| Nested Class Summary | |
|---|---|
static class |
Scrollbar.Description
This class is used to describe a (set of) Scrollbar Widget(s). |
static class |
Scrollbar.Direction
Scrolldirection of the Scrollbar |
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget |
|---|
BackgroundSettableWidget.BackgroundSettableDescriptionBase |
| 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 | |
|---|---|
Scrollbar(float width,
float height,
Scrollbar.Description sbDesc)
Creates a new Scrollbar. |
|
Scrollbar(float width,
float height,
Scrollbar.Direction direction)
Creates a new Scrollbar. |
|
Scrollbar(float length,
Scrollbar.Description sbDesc)
Creates a new Scrollbar. |
|
Scrollbar(float length,
Scrollbar.Direction direction)
Creates a new Scrollbar. |
|
| Method Summary | |
|---|---|
void |
addScrollbarListener(ScrollbarListener l)
Adds a ScrollbarListener 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 handleLTTex,
Texture2D handleRBTex,
Texture2D handleBodyTex,
Texture2D handleDecoTex,
int forcedHandlePos)
|
protected void |
drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
Scrollbar.Direction |
getDirection()
|
int |
getMaxValue()
|
int |
getMinValue()
|
protected int |
getMousePosition(int currentHandlePosPx,
int mouseX,
int mouseY)
Checks, if the mouse is over the handle. |
int |
getPageSize()
Gets the page size, which indirectly defines the size of the handle. |
int |
getSmallIncrement()
|
boolean |
getSmoothScrolling()
|
int |
getValue()
|
int |
getWidthOrHeightInPixels()
If this Scrollbar's Direction is Horizontal, the height in pixels is returned. |
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 |
onScrollbarValueChanged(int oldValue,
int newValue)
|
protected void |
onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
|
boolean |
removeScrollbarListener(ScrollbarListener l)
Removes a ScrollbarListener from the List. |
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 |
setMinMaxAndValue(int minValue,
int maxValue,
int value,
int pageSize)
Sets the lower bound of scroll values. |
void |
setMinValue(int minValue)
Sets the lower bound of scroll values. |
void |
setPageSize(int pageSize)
Sets the page size, which indirectly defines the size of the handle. |
void |
setSmallIncrement(int value)
Sets the step to increment the Scrollbar's value by when the increment button is clicked. |
void |
setSmoothScrolling(boolean b)
If true, the handle doesn't snap to discrete positiones depending on the available scroll values. |
boolean |
setValue(int value)
Sets the current scroll value |
| Methods inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget |
|---|
drawBackground, getBackgroundColor, getBackgroundTexture, getBackgroundTileMode, setBackground, setBackground, setBackground, setBackgroundColor, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTileMode, setNoBackground |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Scrollbar(float width,
float height,
Scrollbar.Description sbDesc)
width - the width of the Scrollbarheight - the height of the ScrollbarsbDesc - a Scrollbar.Description instance holding information about
this new Scrollbar
public Scrollbar(float length,
Scrollbar.Description sbDesc)
length - the length of the ScrollbarzIndex - the z-index of the ScrollbarsbDesc - a Scrollbar.Description instance holding information about
this new Scrollbar
public Scrollbar(float width,
float height,
Scrollbar.Direction direction)
width - the width of the Scrollbarheight - the height of the Scrollbardirection - the scroll-direction
public Scrollbar(float length,
Scrollbar.Direction direction)
length - if (direction == HORIZONTAL), this is the width of the
Scrollbar. if (direction == VERTICAL), this is the height of
the Scrollbar.direction - the scroll-direction| Method Detail |
|---|
public final Scrollbar.Direction getDirection()
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 setPageSize(int pageSize)
pageSize - public final int getPageSize()
public void setSmallIncrement(int value)
public final int getSmallIncrement()
public void setMinMaxAndValue(int minValue,
int maxValue,
int value,
int pageSize)
minValue - maxValue - value - pageSize -
public final void setMinMaxAndValue(int minValue,
int maxValue,
int value)
minValue - maxValue - value -
protected void onScrollbarValueChanged(int oldValue,
int newValue)
oldValue - newValue - public boolean setValue(int value)
value - public final int getValue()
public void addScrollbarListener(ScrollbarListener l)
l - the new ScrollbarListenerpublic boolean removeScrollbarListener(ScrollbarListener l)
l - the ScrollbarListener to be removedpublic void setSmoothScrolling(boolean b)
b - enable/disablepublic final boolean getSmoothScrolling()
public final int getWidthOrHeightInPixels()
protected void onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
onSizeChanged in class Widget
protected int drawHandle(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
Texture2D handleLTTex,
Texture2D handleRBTex,
Texture2D handleBodyTex,
Texture2D handleDecoTex,
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 | |||||||||