Package com.ardor3d.extension.ui
Class UISliderKnob
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Node
com.ardor3d.extension.ui.UIComponent
com.ardor3d.extension.ui.UIContainer
com.ardor3d.extension.ui.UISliderKnob
- All Implemented Interfaces:
UIKeyHandler
,Hintable
,Savable
Defines the knob (aka slider or scrubber) on a slider. Generally created by UISlider directly.
-
Field Summary
Modifier and TypeFieldDescriptionprotected float
The current relative position of the knob handle, as a percent.Fields inherited from class com.ardor3d.extension.ui.UIContainer
_textureRenderer, STANDIN_TEXTURE_SIZE
Fields inherited from class com.ardor3d.extension.ui.UIComponent
_tooltipPopTime, _tooltipText, DEFAULT_FOREGROUND_COLOR
Fields inherited from class com.ardor3d.scenegraph.Spatial
_controllers, _delegateMap, _dirtyMark, _frustumIntersects, _listener, _localTransform, _name, _parent, _queueDistance, _renderStateList, _sceneHints, _userData, _worldBound, _worldTransform, ON_DIRTY_ATTACHED, ON_DIRTY_BOUNDING, ON_DIRTY_RENDERSTATE, ON_DIRTY_TRANSFORM, ON_DIRTY_TRANSFORM_ONLY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Override to provide an action to take when this component or its top level component are attached to a UIHud.void
Override to provide an action to take just before this component or its top level component are removed from a UIHud.float
protected int
void
layout()
Override this to perform actual layout.boolean
mousePressed
(MouseButton button, InputState state) Enable clicking in slider to step the knob one way or the other.void
setEnabled
(boolean enabled) void
setPosition
(float newPosition) Sets the current position of the knob handleMethods inherited from class com.ardor3d.extension.ui.UIContainer
add, clearStandin, contains, contains, detachAllChildren, draw, drawComponent, fireComponentDirty, fireStyleChanged, getLayout, getMinificationFilter, getUIComponent, isDirty, isDoClip, isDrawingStandin, isUseStandin, remove, removeAllComponents, setDirty, setDoClip, setLayout, setMinificationFilter, setUseStandin, updateMinimumSizeFromContents
Methods inherited from class com.ardor3d.extension.ui.UIComponent
addFontStyle, applySkin, cancelTooltipTimer, centerOn, centerOn, clearFontStyle, clearMaximumContentSize, clearMinimumContentSize, compact, fitComponentIn, gainedFocus, getBackdrop, getBorder, getCombinedOpacity, getContentHeight, getContentWidth, getCurrentOpacity, getDefaultFontFamily, getDefaultFontSize, getDefaultFontStyles, getFontStyles, getForegroundColor, getHud, getHudX, getHudY, getKeyFocusTarget, getLayoutData, getLocalComponentHeight, getLocalComponentWidth, getLocalFontStyles, getLocalForegroundColor, getLocalOpacity, getLocalX, getLocalY, getMargin, getMaximumContentHeight, getMaximumContentWidth, getMaximumLocalComponentHeight, getMaximumLocalComponentWidth, getMinimumContentHeight, getMinimumContentWidth, getMinimumLocalComponentHeight, getMinimumLocalComponentWidth, getPadding, getRelativeComponentBounds, getRelativeMaxComponentBounds, getRelativeMinComponentBounds, getTooltipPopTime, getTooltipText, getTopLevelComponent, getTotalBottom, getTotalLeft, getTotalRight, getTotalTop, hasVirginContentArea, insideMargin, isAttachedToHUD, isConsumeKeyEvents, isConsumeMouseEvents, isEnabled, isUseTransparency, isVisible, keyHeld, keyPressed, keyReleased, lostFocus, mouseClicked, mouseDeparted, mouseEntered, mouseMoved, mouseReleased, mouseWheel, pack, postdrawComponent, predrawComponent, requestFocus, setBackdrop, setBorder, setConsumeKeyEvents, setConsumeMouseEvents, setContentHeight, setContentSize, setContentWidth, setDefaultFontFamily, setDefaultFontSize, setDefaultFontStyles, setFontStyles, setForegroundColor, setHudX, setHudXY, setHudY, setKeyFocusTarget, setLayoutData, setLayoutMinimumContentSize, setLocalComponentHeight, setLocalComponentSize, setLocalComponentWidth, setLocalX, setLocalXY, setLocalY, setMargin, setMaximumContentHeight, setMaximumContentSize, setMaximumContentWidth, setMinimumContentHeight, setMinimumContentSize, setMinimumContentWidth, setOpacity, setPadding, setTooltipPopTime, setTooltipText, setUseTransparency, setVirginContentArea, setVisible, updateWorldTransform, updateWorldTransform, validateContentSize
Methods inherited from class com.ardor3d.scenegraph.Node
acceptVisitor, attachChild, attachChildAt, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getClassTag, getNumberOfChildren, hasChild, makeCopy, makeInstanced, propagateDirtyDown, read, sortLights, swapChildren, updateChildren, updateWorldBound, updateWorldRenderStates, write
Methods inherited from class com.ardor3d.scenegraph.Spatial
addController, addTranslation, addTranslation, applyWorldRenderStates, clearControllers, clearDirty, clearDirty, clearRenderState, getController, getControllerCount, getControllers, getCurrentRenderDelegate, getLastFrustumIntersection, getListener, getLocalLastFrustumIntersection, getLocalRenderState, getLocalRenderStates, getName, getParent, getParentHintable, getRenderDelegate, getRotation, getScale, getSceneHints, getTransform, getTranslation, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, isDirty, localToWorld, markDirty, markDirty, onDraw, propagateBoundToRoot, propagateDirtyUp, propagateStatesFromRoot, propageEventUp, removeController, removeController, removeFromParent, setLastFrustumIntersection, setListener, setName, setParent, setRenderDelegate, setRenderState, setRotation, setRotation, setScale, setScale, setScale, setTransform, setTranslation, setTranslation, setUserData, setWorldRotation, setWorldRotation, setWorldScale, setWorldScale, setWorldScale, setWorldTransform, setWorldTranslation, setWorldTranslation, toString, updateControllers, updateGeometricState, updateGeometricState, updateWorldRenderStates, worldToLocal
-
Field Details
-
_position
protected float _positionThe current relative position of the knob handle, as a percent.
-
-
Method Details
-
getKnobLabel
- Returns:
- the UILabel that represents the handle of the knob
-
getPosition
public float getPosition()- Returns:
- the current position (as a percent) of the knob handle [0.0, 1.0]
-
setPosition
public void setPosition(float newPosition) Sets the current position of the knob handle- Parameters:
newPosition
- the new position as a percent [0.0, 1.0]
-
layout
public void layout()Description copied from class:UIComponent
Override this to perform actual layout.- Overrides:
layout
in classUIContainer
-
getSliderFrontEdge
protected int getSliderFrontEdge()- Returns:
- the relative location (x or y) of the leading edge of the knob handle. An x value if the we are horizontal or a y value if we are vertical. This is used for various mouse interactions.
-
attachedToHud
public void attachedToHud()Description copied from class:UIComponent
Override to provide an action to take when this component or its top level component are attached to a UIHud.- Overrides:
attachedToHud
in classUIContainer
-
detachedFromHud
public void detachedFromHud()Description copied from class:UIComponent
Override to provide an action to take just before this component or its top level component are removed from a UIHud.- Overrides:
detachedFromHud
in classUIContainer
-
setEnabled
public void setEnabled(boolean enabled) - Overrides:
setEnabled
in classUIComponent
- Parameters:
enabled
- true if this component should be considered "enabled"... a concept that is interpreted by each individual component type.
-
mousePressed
Enable clicking in slider to step the knob one way or the other.- Overrides:
mousePressed
in classUIComponent
- Parameters:
button
- the button that was pressedstate
- the current tracked state of the input system.- Returns:
- true if we want to consider the event "consumed" by the UI system.
-