Package com.ardor3d.extension.ui
Class AbstractLabelUIComponent
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Node
com.ardor3d.extension.ui.UIComponent
com.ardor3d.extension.ui.StateBasedUIComponent
com.ardor3d.extension.ui.AbstractLabelUIComponent
- All Implemented Interfaces:
UIKeyHandler
,Textable
,Hintable
,Savable
A state component containing a text label and an icon. These are separated by an optional gap and can also be given a
specific alignment. By default, the text is aligned LEFT and has no icon or gap.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
If true, our text could be marked up with style information.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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
drawComponent
(Renderer renderer) Draw this component's contents using the given renderer.void
Let subcomponents know that style has been changed.int
getGap()
getIcon()
getText()
boolean
void
setAlignment
(Alignment alignment) void
setGap
(int gap) Note: Also updates the minimum size of the component.void
Note: Also updates the minimum size of the component.void
setIconDimensions
(Dimension dimensions) Overrides any currently set icon size.void
setStyledText
(boolean value) void
Set the text for this component.protected void
updateChildren
(double time) Override to allow objects like Node to update their children.void
Set the icon dimensions from the currently set icon.void
Ask this component to update its minimum allowed size, based on its contents.Methods inherited from class com.ardor3d.extension.ui.StateBasedUIComponent
gainedFocus, getCurrentState, getDefaultState, getDisabledState, getStates, keyHeld, keyPressed, keyReleased, lostFocus, mouseDeparted, mouseEntered, mouseMoved, mousePressed, mouseReleased, mouseWheel, refreshState, setEnabled, setForegroundColor, switchState
Methods inherited from class com.ardor3d.extension.ui.UIComponent
addFontStyle, applySkin, attachedToHud, cancelTooltipTimer, centerOn, centerOn, clearFontStyle, clearMaximumContentSize, clearMinimumContentSize, compact, detachedFromHud, draw, fireComponentDirty, fitComponentIn, 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, getUIComponent, hasVirginContentArea, insideMargin, isAttachedToHUD, isConsumeKeyEvents, isConsumeMouseEvents, isEnabled, isUseTransparency, isVisible, layout, mouseClicked, 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, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getClassTag, getNumberOfChildren, hasChild, makeCopy, makeInstanced, propagateDirtyDown, read, sortLights, swapChildren, 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
-
_styled
protected boolean _styledIf true, our text could be marked up with style information.
-
-
Constructor Details
-
AbstractLabelUIComponent
public AbstractLabelUIComponent()
-
-
Method Details
-
updateMinimumSizeFromContents
public void updateMinimumSizeFromContents()Description copied from class:UIComponent
Ask this component to update its minimum allowed size, based on its contents.- Overrides:
updateMinimumSizeFromContents
in classUIComponent
-
getText
-
setText
Set the text for this component. Also updates the minimum size of the component. -
isStyledText
public boolean isStyledText()- Specified by:
isStyledText
in interfaceTextable
-
setStyledText
public void setStyledText(boolean value) - Specified by:
setStyledText
in interfaceTextable
-
updateChildren
protected void updateChildren(double time) Description copied from class:Spatial
Override to allow objects like Node to update their children.- Overrides:
updateChildren
in classNode
- Parameters:
time
- The time in seconds between the last two consecutive frames (time per frame). SeeReadOnlyTimer.getTimePerFrame()
-
getAlignment
-
setAlignment
-
getGap
public int getGap() -
setGap
public void setGap(int gap) Note: Also updates the minimum size of the component.- Parameters:
gap
- the size of the gap, in pixels, between the text and the label text. This is only used if both icon and text are set.
-
getIcon
-
setIcon
Note: Also updates the minimum size of the component.- Parameters:
icon
- the new icon for this label.
-
updateIconDimensionsFromIcon
public void updateIconDimensionsFromIcon()Set the icon dimensions from the currently set icon. If no icon is set, the dimensions are set to 0x0. -
setIconDimensions
Overrides any currently set icon size. Call this after setting the icon to prevent overriding.- Parameters:
dimensions
- a new icon size.
-
getIconDimensions
-
fireStyleChanged
public void fireStyleChanged()Description copied from class:UIComponent
Let subcomponents know that style has been changed.- Overrides:
fireStyleChanged
in classUIComponent
-
drawComponent
Description copied from class:UIComponent
Draw this component's contents using the given renderer.- Overrides:
drawComponent
in classUIComponent
- Parameters:
renderer
- the renderer
-
getTextObject
-