Package com.simsilica.lemur
Class ListBox<T>
java.lang.Object
com.jme3.scene.Spatial
com.jme3.scene.Node
com.simsilica.lemur.Panel
com.simsilica.lemur.ListBox<T>
- All Implemented Interfaces:
HasLocalTransform
,CloneableSmartAsset
,Collidable
,Savable
,JmeCloneable
,Cloneable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
static enum
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.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
ConstructorsModifierConstructorDescriptionListBox()
protected
ListBox
(boolean applyStyles, VersionedList<T> model, ValueRenderer<T> cellRenderer, SelectionModel selection, ElementId elementId, String style) ListBox
(VersionedList<T> model) ListBox
(VersionedList<T> model, ElementId elementId, String style) ListBox
(VersionedList<T> model, ValueRenderer<T> renderer, ElementId elementId, String style) ListBox
(VersionedList<T> model, ValueRenderer<T> renderer, String style) ListBox
(VersionedList<T> model, String style) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate()
void
addClickCommands
(Command<? super ListBox>... commands) void
addCommands
(ListBox.ListAction a, Command<? super ListBox>... commands) protected void
protected void
Used when the list model is swapped out.protected Panel
getListCell
(int row, int col, Panel existing) getModel()
boolean
Returns the currently selected list item if there is one and only one item selected.int
protected void
gridResized
(Vector3f pos, Vector3f size) static void
initializeDefaultStyles
(Styles styles, Attributes attrs) protected void
protected void
void
removeClickCommands
(Command<? super ListBox>... commands) protected void
protected void
scroll
(int amount) void
setAlpha
(float alpha, boolean recursive) Sets the alpha multiplier for all ColoredComponents in this panels component stack, including things like QuadBackgroundComponent, TextComponent, etc..void
setCellRenderer
(ValueRenderer<T> renderer) void
setListCommands
(Map<ListBox.ListAction, List<Command<? super ListBox>>> map) void
setModel
(VersionedList<T> model) void
setScrollOnHover
(boolean f) Set to true to enable mouse-wheel style scrolling when the mouse is hovering over the ListBox.void
setSelectedItem
(T item) Convenience method for setting the currently selected item.void
setSelectionModel
(SelectionModel selection) void
setVisibleItems
(int count) toString()
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"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, 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, 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:
-
ITEMS_ID
- See Also:
-
SLIDER_ID
- See Also:
-
SELECTOR_ID
- See Also:
-
EFFECT_PRESS
- See Also:
-
EFFECT_RELEASE
- See Also:
-
EFFECT_CLICK
- See Also:
-
EFFECT_ACTIVATE
- See Also:
-
EFFECT_DEACTIVATE
- See Also:
-
-
Constructor Details
-
ListBox
public ListBox() -
ListBox
-
ListBox
-
ListBox
-
ListBox
-
ListBox
public ListBox(VersionedList<T> model, ValueRenderer<T> renderer, ElementId elementId, String style) -
ListBox
protected ListBox(boolean applyStyles, VersionedList<T> model, ValueRenderer<T> cellRenderer, SelectionModel selection, ElementId elementId, String style)
-
-
Method Details
-
initializeDefaultStyles
-
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:
-
gridResized
-
setModel
-
getModel
-
getSlider
-
getGridPanel
-
getSelector
-
setSelectionModel
-
getSelectionModel
-
getSelectedItem
Returns the currently selected list item if there is one and only one item selected. This is a convenience method that interrogates the selection model and looks up the current value in the list model. -
setSelectedItem
Convenience method for setting the currently selected item. -
addCommands
-
getCommands
-
addClickCommands
-
removeClickCommands
-
getClickCommands
-
setListCommands
@StyleAttribute("listCommands") public void setListCommands(Map<ListBox.ListAction, List<Command<? super ListBox>>> map) -
setVisibleItems
-
getVisibleItems
public int getVisibleItems() -
setCellRenderer
@StyleAttribute(value="cellRenderer", lookupDefault=false) public void setCellRenderer(ValueRenderer<T> renderer) -
getCellRenderer
-
setAlpha
public void setAlpha(float alpha, boolean recursive) Description copied from class:Panel
Sets the alpha multiplier for all ColoredComponents in this panels component stack, including things like QuadBackgroundComponent, TextComponent, etc.. This can be used to generally fade a GUI element in or out as needed as long as its visuals are ColoredComponent compliant. If recursive is true then all child Spatials will also be checked and have their alpha set, and their children, and so on. -
setScrollOnHover
Set to true to enable mouse-wheel style scrolling when the mouse is hovering over the ListBox. (Versus only when the list has focus.) Default is true. -
getScrollOnHover
public boolean getScrollOnHover() -
refreshSelector
protected void refreshSelector() -
resetModelRange
protected void resetModelRange() -
refreshActivation
protected void refreshActivation() -
getListCell
-
detachItemListeners
protected void detachItemListeners()Used when the list model is swapped out. -
scroll
protected void scroll(int amount) -
activate
protected void activate() -
deactivate
protected void deactivate() -
toString
Description copied from class:Spatial
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"
-