Package com.simsilica.lemur
Class OptionPanel
java.lang.Object
com.jme3.scene.Spatial
com.jme3.scene.Node
com.simsilica.lemur.Panel
com.simsilica.lemur.OptionPanel
- All Implemented Interfaces:
HasLocalTransform
,CloneableSmartAsset
,Collidable
,Savable
,JmeCloneable
,Cloneable
Presents an option title, a message, and a set of option actions
to the user. The message portion of the panel can be augmented
with additional components as needed. This is similar to Swing's
JOptionPane in functionality.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jme3.scene.Spatial
Spatial.BatchHint, Spatial.CullHint, Spatial.DFSMode
-
Field Summary
FieldsFields inherited from class com.simsilica.lemur.Panel
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
ConstructorsModifierConstructorDescriptionprotected
OptionPanel
(boolean applyStyles, String title, String message, Action[] options, ElementId elementId, String style) OptionPanel
(String message, Action... options) Creates a new OptionPanel without a title but with the specified message and actions.Creates a new OptionPanel with the specified title, message, style, and actions.OptionPanel
(String title, String message, String style, Action... options) Creates a new OptionPanel with the specified title, message, style, and actions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Removes this panel from its parent.Returns the container that holds the action buttons.Returns the central container to which the message label was added.Returns the label element that holds the message text.Action[]
getTitle()
Returns the label element that holds the title text.boolean
Returns true if this panel is still attached to a parent and not CullHint.Always.void
setMessage
(String message) Sets the message text of this option panel that will appear on the option panel's container.void
setOptions
(Action... options) Sets the actions that will be turned into ActionButtons at the bottom of the panel.void
Sets the title of this option panel.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, updateLogicalState, 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:
-
EFFECT_OPEN
- See Also:
-
EFFECT_CLOSE
- See Also:
-
-
Constructor Details
-
OptionPanel
Creates a new OptionPanel without a title but with the specified message and actions. -
OptionPanel
Creates a new OptionPanel with the specified title, message, style, and actions. -
OptionPanel
public OptionPanel(String title, String message, ElementId elementId, String style, Action... options) Creates a new OptionPanel with the specified title, message, style, and actions. -
OptionPanel
-
-
Method Details
-
setTitle
Sets the title of this option panel. -
getTitle
-
setMessage
Sets the message text of this option panel that will appear on the option panel's container. -
getMessage
-
setOptions
Sets the actions that will be turned into ActionButtons at the bottom of the panel. Any action that is clicked will also call the OptionPanel.close() method which by default removes the panel from its parent node. -
getOptions
-
getContainer
Returns the central container to which the message label was added. Callers can use this to include additional components if needed. The container by default has the SpringGridLayout in row/column setup. -
getTitleLabel
Returns the label element that holds the title text. -
getMessageLabel
Returns the label element that holds the message text. -
getButtons
Returns the container that holds the action buttons. -
isVisible
public boolean isVisible()Returns true if this panel is still attached to a parent and not CullHint.Always. -
close
public void close()Removes this panel from its parent. Can be overridden by subclasses to provide different close behavior.
-