Class AdjustableGridPanel

    • Field Detail

      • m_Rows

        protected int m_Rows
        the rows.
      • m_Columns

        protected int m_Columns
        the columns.
      • m_Items

        protected List<Component> m_Items
        the items to display.
      • m_PanelControl

        protected JPanel m_PanelControl
        the panel with the dimensions.
      • m_SpinnerRows

        protected JSpinner m_SpinnerRows
        the spinner for the rows.
      • m_SpinnerColumns

        protected JSpinner m_SpinnerColumns
        the spinner for the columns.
      • m_ButtonApply

        protected BaseButton m_ButtonApply
        the button for applying the dimensions.
      • m_PanelContent

        protected JPanel m_PanelContent
        the panel for the actual content.
    • Constructor Detail

      • AdjustableGridPanel

        public AdjustableGridPanel()
        Initializes the panel with just one row.
      • AdjustableGridPanel

        public AdjustableGridPanel​(int rows,
                                   int cols)
        Initializes the panel with specified dimensions, no items.
        Parameters:
        rows - the number of rows
        cols - the number of columns
      • AdjustableGridPanel

        public AdjustableGridPanel​(int rows,
                                   int cols,
                                   Component[] items)
        Initializes the panel with specified dimensions and items.
        Parameters:
        rows - the number of rows
        cols - the number of columns
        items - the items to display
      • AdjustableGridPanel

        public AdjustableGridPanel​(int rows,
                                   int cols,
                                   List<Component> items)
        Initializes the panel with specified dimensions and items.
        Parameters:
        rows - the number of rows
        cols - the number of columns
        items - the items to display
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • updateLayout

        public void updateLayout()
        Updates the layout.
      • clear

        public void clear()
        Removes all components.
      • addItem

        public void addItem​(Component comp)
        Adds the component and updates the layout.
        Parameters:
        comp - the component to add
      • additem

        public void additem​(int index,
                            Component comp)
        Adds the component and updates the layout.
        Parameters:
        index - the index to add the component at
        comp - the component to add
      • removeItem

        public void removeItem​(int index)
        Removes the component and updates the layout.
        Parameters:
        index - the index of the component to remove
      • getItem

        public Component getItem​(int index)
        Returns the specified component.
        Parameters:
        index - the index of the component to return
        Returns:
        the component
      • numItems

        public int numItems()
        Returns the number of components.
        Returns:
        the number
      • setRows

        public void setRows​(int value)
        Updates the rows to display.
        Parameters:
        value - the new number of rows
      • getRows

        public int getRows()
        Returns the number of rows displayed.
        Returns:
        the rows
      • setColumns

        public void setColumns​(int value)
        Updates the columns to display.
        Parameters:
        value - the new number of columns
      • getColumns

        public int getColumns()
        Returns the number of columns displayed.
        Returns:
        the columns
      • setGrid

        public void setGrid​(int rows,
                            int cols)
        Updates rows and columns to display.
        Parameters:
        rows - the rows
        cols - the columns
      • setControlsVisible

        public void setControlsVisible​(boolean value)
        Sets whether the controls are shown or not.
        Parameters:
        value - true if to show controls
      • getControlsVisible

        public boolean getControlsVisible()
        Returns whether the controls are show or not.
        Returns:
        true if controls shown