Class ListBox<T>

All Implemented Interfaces:
HasLocalTransform, CloneableSmartAsset, Collidable, Savable, JmeCloneable, Cloneable

public class ListBox<T> extends Panel
  • Field Details

  • Constructor Details

  • Method Details

    • initializeDefaultStyles

      public static void initializeDefaultStyles(Styles styles, Attributes attrs)
    • updateLogicalState

      public void updateLogicalState(float tpf)
      Description copied from class: Spatial
      updateLogicalState calls the update() method for all controls attached to this Spatial.
      Overrides:
      updateLogicalState in class Node
      Parameters:
      tpf - Time per frame.
      See Also:
    • gridResized

      protected void gridResized(Vector3f pos, Vector3f size)
    • setModel

      public void setModel(VersionedList<T> model)
    • getModel

      public VersionedList<T> getModel()
    • getSlider

      public Slider getSlider()
    • getGridPanel

      public GridPanel getGridPanel()
    • getSelector

      public Panel getSelector()
    • setSelectionModel

      public void setSelectionModel(SelectionModel selection)
    • getSelectionModel

      public SelectionModel getSelectionModel()
    • getSelectedItem

      public T 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

      public void setSelectedItem(T item)
      Convenience method for setting the currently selected item.
    • addCommands

      public void addCommands(ListBox.ListAction a, Command<? super ListBox>... commands)
    • getCommands

      public List<Command<? super ListBox>> getCommands(ListBox.ListAction a)
    • addClickCommands

      public void addClickCommands(Command<? super ListBox>... commands)
    • removeClickCommands

      public void removeClickCommands(Command<? super ListBox>... commands)
    • getClickCommands

      public List<Command<? super ListBox>> getClickCommands()
    • setListCommands

      @StyleAttribute("listCommands") public void setListCommands(Map<ListBox.ListAction,List<Command<? super ListBox>>> map)
    • setVisibleItems

      @StyleAttribute(value="visibleItems", lookupDefault=false) public void setVisibleItems(int count)
    • getVisibleItems

      public int getVisibleItems()
    • setCellRenderer

      @StyleAttribute(value="cellRenderer", lookupDefault=false) public void setCellRenderer(ValueRenderer<T> renderer)
    • getCellRenderer

      public ValueRenderer<T> 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.
      Overrides:
      setAlpha in class Panel
    • setScrollOnHover

      @StyleAttribute(value="scrollOnHover", lookupDefault=false) public void setScrollOnHover(boolean f)
      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

      protected Panel getListCell(int row, int col, Panel existing)
    • 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

      public String toString()
      Description copied from class: Spatial
      Returns the Spatial's name followed by the class of the spatial
      Example: "MyNode (com.jme3.scene.Spatial)"
      Overrides:
      toString in class Panel
      Returns:
      Spatial's name followed by the class of the Spatial