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
FieldsModifier and TypeFieldDescriptionprotected booleanIf true, our text could be marked up with style information.Fields inherited from class com.ardor3d.extension.ui.UIComponent
_tooltipPopTime, _tooltipText, DEFAULT_FOREGROUND_COLORFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawComponent(Renderer renderer) Draw this component's contents using the given renderer.voidLet subcomponents know that style has been changed.intgetGap()getIcon()getText()booleanvoidsetAlignment(Alignment alignment) voidsetGap(int gap) Note: Also updates the minimum size of the component.voidNote: Also updates the minimum size of the component.voidsetIconDimensions(Dimension dimensions) Overrides any currently set icon size.voidsetStyledText(boolean value) voidSet the text for this component.protected voidupdateChildren(double time) Override to allow objects like Node to update their children.voidSet the icon dimensions from the currently set icon.voidAsk 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, switchStateMethods 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, validateContentSizeMethods 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, writeMethods 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:UIComponentAsk this component to update its minimum allowed size, based on its contents.- Overrides:
updateMinimumSizeFromContentsin classUIComponent
-
getText
-
setText
Set the text for this component. Also updates the minimum size of the component. -
isStyledText
public boolean isStyledText()- Specified by:
isStyledTextin interfaceTextable
-
setStyledText
public void setStyledText(boolean value) - Specified by:
setStyledTextin interfaceTextable
-
updateChildren
protected void updateChildren(double time) Description copied from class:SpatialOverride to allow objects like Node to update their children.- Overrides:
updateChildrenin 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:UIComponentLet subcomponents know that style has been changed.- Overrides:
fireStyleChangedin classUIComponent
-
drawComponent
Description copied from class:UIComponentDraw this component's contents using the given renderer.- Overrides:
drawComponentin classUIComponent- Parameters:
renderer- the renderer
-
getTextObject
-