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 enum
protected class
protected class
Nested 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
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class com.simsilica.lemur.Label
LAYER_ICON, LAYER_SHADOW_TEXT, LAYER_TEXT
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClickCommands
(Command<? super Button> command) void
addClickCommands
(Command<? super Button>... commands) void
addCommands
(Button.ButtonAction a, Command<? super Button>... commands) void
click()
Can be called by application code to simulate a click on a button.getColor()
static void
boolean
boolean
boolean
boolean
boolean
void
removeClickCommands
(Command<? super Button>... commands) protected void
protected void
runClick()
void
setButtonCommands
(Map<Button.ButtonAction, List<Command<? super Button>>> map) void
void
setEnabled
(boolean b) void
setFocusColor
(ColorRGBA color) void
setFocusShadowColor
(ColorRGBA color) void
setHighlightColor
(ColorRGBA color) void
setHighlightShadowColor
(ColorRGBA color) protected void
setPressed
(boolean f) void
setShadowColor
(ColorRGBA color) protected void
showFocus
(boolean f) protected void
showHighlight
(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, setTextVAlignment
Methods 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, setSize
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_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
-
initializeDefaultStyles
-
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:
setShadowColor
in classLabel
-
getShadowColor
- Overrides:
getShadowColor
in 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:Spatial
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"
-