Package com.simsilica.lemur
Class ProgressBar
java.lang.Object
com.jme3.scene.Spatial
com.jme3.scene.Node
com.simsilica.lemur.Panel
com.simsilica.lemur.ProgressBar
- All Implemented Interfaces:
HasLocalTransform
,CloneableSmartAsset
,Collidable
,Savable
,JmeCloneable
,Cloneable
A horizontal progress indicator supporting an optional text overlay.
This is a composite component where an indicator panel overlays
the base panel.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.jme3.scene.Spatial
Spatial.BatchHint, Spatial.CullHint, Spatial.DFSMode
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class com.simsilica.lemur.Panel
EFFECT_CLOSE, EFFECT_OPEN, LAYER_BACKGROUND, LAYER_BORDER, LAYER_INSETS
Fields inherited from class com.jme3.scene.Spatial
batchHint, controls, cullHint, frustrumIntersects, key, localLights, localOverrides, localTransform, name, parent, queueBucket, queueDistance, refreshFlags, RF_BOUND, RF_CHILD_LIGHTLIST, RF_LIGHTLIST, RF_MATPARAM_OVERRIDE, RF_TRANSFORM, shadowMode, userData, worldBound, worldLights, worldOverrides, worldTransform
-
Constructor Summary
ConstructorsModifierConstructorDescriptionProgressBar
(RangedValueModel model) protected
ProgressBar
(RangedValueModel model, boolean applyStyles, ElementId elementId, String style) ProgressBar
(RangedValueModel model, String style) ProgressBar
(ElementId elementId, String style) ProgressBar
(String style) -
Method Summary
Modifier and TypeMethodDescriptiongetLabel()
Returns the GUI element that is used for the main progress bar area and overlay label.Returns the message text that currently appears in the progress bar text overlay.getModel()
Returns the current range model for this progress bar.double
Returns the current progress value as a percentage (0-1.0) of the current range.double
Returns the raw progress value.Returns the GUI element that is used for the value indicator.static void
initializeDefaultStyles
(Styles styles, Attributes attrs) protected void
void
setMessage
(String message) Sets the message text that appears in the progress bar text overlay.void
setModel
(RangedValueModel model) Sets the ranged value model that will be used to calculate progress percentage.void
setProgressPercent
(double percent) Sets the current progress value as a percentage (0-1.0) of the current range.void
setProgressValue
(double val) Sets the raw progress value.void
updateLogicalState
(float tpf) updateLogicalState
calls theupdate()
method for all controls attached to this Spatial.Methods inherited from class com.simsilica.lemur.Panel
addEffect, addMouseListener, getAlpha, getBackground, getBorder, getEffectControl, getEffects, getElementId, getInsets, getInsetsComponent, getPreferredSize, getSize, getStyle, hasEffect, initializeDefaultStyles, removeEffect, removeMouseListener, runEffect, setAlpha, setAlpha, setBackground, setBorder, setChildAlpha, setEffects, setInsets, setInsetsComponent, setPreferredSize, setSize, toString
Methods inherited from class com.jme3.scene.Node
attachChild, attachChildAt, breadthFirstTraversal, clone, cloneFields, collideWith, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, oldDeepClone, read, setLightListRefresh, setLodLevel, setMaterial, setMatParamOverrideRefresh, setModelBound, setParent, setTransformRefresh, swapChildren, updateGeometricState, updateModelBound, updateWorldBound, write
Methods inherited from class com.jme3.scene.Spatial
addControl, addControlAt, addLight, addMatParamOverride, breadthFirstTraversal, center, checkCulling, clearMatParamOverrides, clone, depthFirstTraversal, forceRefresh, getBatchHint, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalBatchHint, getLocalCullHint, getLocalLightList, getLocalMatParamOverrides, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldMatParamOverrides, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, jmeClone, localToWorld, lookAt, matches, move, move, oldClone, removeControl, removeControl, removeFromParent, removeLight, removeMatParamOverride, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setBatchHint, setBoundRefresh, setCullHint, setKey, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setQueueBucket, setRequiresUpdates, setShadowMode, setUserData, updateMatParamOverrides, updateWorldLightList, updateWorldTransforms, worldToLocal
-
Field Details
-
ELEMENT_ID
- See Also:
-
CONTAINER_ID
- See Also:
-
LABEL_ID
- See Also:
-
VALUE_ID
- See Also:
-
-
Constructor Details
-
ProgressBar
public ProgressBar() -
ProgressBar
-
ProgressBar
-
ProgressBar
-
ProgressBar
-
ProgressBar
protected ProgressBar(RangedValueModel model, boolean applyStyles, ElementId elementId, String style)
-
-
Method Details
-
initializeDefaultStyles
-
setProgressPercent
public void setProgressPercent(double percent) Sets the current progress value as a percentage (0-1.0) of the current range. -
getProgressPercent
public double getProgressPercent()Returns the current progress value as a percentage (0-1.0) of the current range. -
setProgressValue
public void setProgressValue(double val) Sets the raw progress value. -
getProgressValue
public double getProgressValue()Returns the raw progress value. -
setModel
Sets the ranged value model that will be used to calculate progress percentage. The default model is is a DefaultRangedValueModel() where the range is 0 to 100. If setModel(null) is called then a new default range is created. -
getModel
Returns the current range model for this progress bar. -
setMessage
Sets the message text that appears in the progress bar text overlay. -
getMessage
Returns the message text that currently appears in the progress bar text overlay. -
getLabel
Returns the GUI element that is used for the main progress bar area and overlay label. This can be used to apply special styling. -
getValueIndicator
Returns the GUI element that is used for the value indicator. This can be used to apply special styling. -
updateLogicalState
public void updateLogicalState(float tpf) Description copied from class:Spatial
updateLogicalState
calls theupdate()
method for all controls attached to this Spatial.- Overrides:
updateLogicalState
in classNode
- Parameters:
tpf
- Time per frame.- See Also:
-
resetStateView
protected void resetStateView()
-