Package com.simsilica.lemur
Class Button
java.lang.Object
com.jme3.scene.Spatial
com.jme3.scene.Node
com.simsilica.lemur.Panel
com.simsilica.lemur.Label
com.simsilica.lemur.Button
- All Implemented Interfaces:
HasLocalTransform,CloneableSmartAsset,Collidable,Savable,JmeCloneable,Cloneable
- Direct Known Subclasses:
ActionButton,Checkbox,NButton,NIconButton
A standard Button GUI element that can be clicked to
perform an action or set of actions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumprotected classprotected classNested classes/interfaces inherited from class com.jme3.scene.Spatial
Spatial.BatchHint, Spatial.CullHint, Spatial.DFSMode -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.simsilica.lemur.Label
LAYER_ICON, LAYER_SHADOW_TEXT, LAYER_TEXTFields inherited from class com.simsilica.lemur.Panel
EFFECT_CLOSE, EFFECT_OPEN, LAYER_BACKGROUND, LAYER_BORDER, LAYER_INSETSFields 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_GLOBAL_LIGHTS, RF_LIGHTLIST, RF_MATPARAM_OVERRIDE, RF_TRANSFORM, shadowMode, userData, worldBound, worldLights, worldOverrides, worldTransform -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClickCommands(Command<? super Button> command) voidaddClickCommands(Command<? super Button>... commands) voidaddCommands(Button.ButtonAction a, Command<? super Button>... commands) voidclick()Can be called by application code to simulate a click on a button.getColor()booleanbooleanbooleanbooleanbooleanvoidremoveClickCommands(Command<? super Button>... commands) protected voidprotected voidrunClick()voidsetButtonCommands(Map<Button.ButtonAction, List<Command<? super Button>>> map) voidvoidsetEnabled(boolean b) voidsetFocusColor(ColorRGBA color) voidsetFocusShadowColor(ColorRGBA color) voidsetHighlightColor(ColorRGBA color) voidsetHighlightShadowColor(ColorRGBA color) protected voidsetPressed(boolean f) voidsetShadowColor(ColorRGBA color) protected voidshowFocus(boolean f) protected voidshowHighlight(boolean f) toString()Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"Methods inherited from class com.simsilica.lemur.Label
createText2d, getFont, getFontName, getFontSize, getIcon, getMaxWidth, getShadowOffset, getText, getTextHAlignment, getTextVAlignment, setFont, setFontName, setFontSize, setIcon, setMaxWidth, setShadowOffset, setText, setTextHAlignment, setTextVAlignmentMethods inherited from class com.simsilica.lemur.Panel
addEffect, addMouseListener, getAlpha, getBackground, getBorder, getEffectControl, getEffects, getElementId, getInsets, getInsetsComponent, getPreferredSize, getSize, getStyle, hasEffect, removeEffect, removeMouseListener, runEffect, setAlpha, setAlpha, setBackground, setBorder, setChildAlpha, setEffects, setInsets, setInsetsComponent, setPreferredSize, setSizeMethods 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, writeMethods 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, hasGlobalLights, 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_PRESS
- See Also:
-
EFFECT_RELEASE
- See Also:
-
EFFECT_CLICK
- See Also:
-
EFFECT_ACTIVATE
- See Also:
-
EFFECT_DEACTIVATE
- See Also:
-
EFFECT_FOCUS
- See Also:
-
EFFECT_UNFOCUS
- See Also:
-
EFFECT_ENABLE
- See Also:
-
EFFECT_DISABLE
- See Also:
-
-
Constructor Details
-
Button
-
Button
-
Button
-
Button
-
Button
-
-
Method Details
-
addCommands
-
getCommands
-
addClickCommands
-
addClickCommands
-
removeClickCommands
-
getClickCommands
-
setButtonCommands
@StyleAttribute("buttonCommands") public void setButtonCommands(Map<Button.ButtonAction, List<Command<? super Button>>> map) -
setColor
-
getColor
-
setShadowColor
@StyleAttribute(value="shadowColor", lookupDefault=false) public void setShadowColor(ColorRGBA color) - Overrides:
setShadowColorin classLabel
-
getShadowColor
- Overrides:
getShadowColorin classLabel
-
setHighlightColor
@StyleAttribute(value="highlightColor", lookupDefault=false) public void setHighlightColor(ColorRGBA color) -
getHighlightColor
-
setHighlightShadowColor
@StyleAttribute(value="highlightShadowColor", lookupDefault=false) public void setHighlightShadowColor(ColorRGBA color) -
getHighlightShadowColor
-
setFocusColor
-
getFocusColor
-
setFocusShadowColor
@StyleAttribute(value="focusShadowColor", lookupDefault=false) public void setFocusShadowColor(ColorRGBA color) -
getFocusShadowColor
-
click
public void click()Can be called by application code to simulate a click on a button. Note: this will run the click effects/actions but not the press/release actions. -
setEnabled
public void setEnabled(boolean b) -
isEnabled
public boolean isEnabled() -
isPressed
public boolean isPressed() -
isHighlightOn
public boolean isHighlightOn() -
isFocusHighlightOn
public boolean isFocusHighlightOn() -
isFocused
public boolean isFocused() -
showHighlight
protected void showHighlight(boolean f) -
showFocus
protected void showFocus(boolean f) -
resetColors
protected void resetColors() -
setPressed
protected void setPressed(boolean f) -
runClick
protected void runClick() -
toString
Description copied from class:SpatialReturns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"
-