Class List


  • public class List
    extends GameObject
    List gui element
    Author:
    Darius Dinger
    • Constructor Detail

      • List

        public List​(GUIPane parent,
                    String font)
        Parameters:
        parent - Parent pane of the list or null
        font - Font of the list
    • Method Detail

      • addItem

        public boolean addItem​(String item)
        Adding item to the list. If item already exist in the list it return false else it returns true
        Parameters:
        item - Item to add
        Returns:
        Could the item be added
      • clear

        public void clear()
        Clear list
      • size

        public int size()
        Returns:
        Itemcount of the list
      • removeItem

        public boolean removeItem​(String item)
        Removing item from list
        Parameters:
        item - Item name to remove
        Returns:
        Could the item be removed
      • onUpdate

        public void onUpdate()
        Description copied from class: GameObject
        This method gets called every frame before the render method. Here is place for the GameObject logic updates, e.g. input handling, physics, actions, ...
        Overrides:
        onUpdate in class GameObject
      • getSelectedItem

        public String getSelectedItem()
        Returns:
        Current selected item of the list or null, if no item is selected
      • getPane

        public GUIPane getPane()
        Returns:
        Main pane of the list
      • onRender

        public void onRender()
        Description copied from class: GameObject
        In this method the GameObject gets rendered onto the screen (if it has an graphical representation). Its primary used for MasterRenderer calls.
        Overrides:
        onRender in class GameObject
      • getSelectedColor

        public Color getSelectedColor()
        Returns:
        Read/Writeable color of a selected item
      • getItemColor

        public Color getItemColor()
        Returns:
        Read/Writeable color of a item