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 classstatic enumNested 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.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
ConstructorsModifierConstructorDescriptionListBox()protectedListBox(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 voidactivate()voidaddClickCommands(Command<? super ListBox>... commands) voidaddCommands(ListBox.ListAction a, Command<? super ListBox>... commands) protected voidprotected voidUsed when the list model is swapped out.protected PanelgetListCell(int row, int col, Panel existing) getModel()booleanReturns the currently selected list item if there is one and only one item selected.intprotected voidgridResized(Vector3f pos, Vector3f size) protected voidprotected voidvoidremoveClickCommands(Command<? super ListBox>... commands) protected voidprotected voidscroll(int amount) voidsetAlpha(float alpha, boolean recursive) Sets the alpha multiplier for all ColoredComponents in this panels component stack, including things like QuadBackgroundComponent, TextComponent, etc..voidsetCellRenderer(ValueRenderer<T> renderer) voidsetListCommands(Map<ListBox.ListAction, List<Command<? super ListBox>>> map) voidsetModel(VersionedList<T> model) voidsetScrollOnHover(boolean f) Set to true to enable mouse-wheel style scrolling when the mouse is hovering over the ListBox.voidsetSelectedItem(T item) Convenience method for setting the currently selected item.voidsetSelectionModel(SelectionModel selection) voidsetVisibleItems(int count) toString()Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"voidupdateLogicalState(float tpf) updateLogicalStatecalls 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, removeEffect, removeMouseListener, runEffect, 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, 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:
-
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
-
updateLogicalState
public void updateLogicalState(float tpf) Description copied from class:SpatialupdateLogicalStatecalls theupdate()method for all controls attached to this Spatial.- Overrides:
updateLogicalStatein 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:PanelSets 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:SpatialReturns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"
-