Class CategoryPanel

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible

    public class CategoryPanel
    extends JPanel
    The panel representing a category. It contains a CategoryButton and a panel that is displayed when the CategoryButton is in a certain state. They are used on the left side of the main Control Panel.
    See Also:
    Serialized Form
    • Constructor Detail

      • CategoryPanel

        public CategoryPanel​(JComponent child,
                             Category category)
        Constructor the the panel.
        Parameters:
        child - the component that must be displayed by this panel if its CategoryButton is in a certain state.
        category - the Category associated with the panel.
    • Method Detail

      • setExpanded

        public void setExpanded​(boolean expanded)
        Sets whether the state of the panel is extended or not (if expanded the Component provided in the constructor will be displayed).
        Parameters:
        expanded - whether the panel is extended or not.
      • getCategory

        public Category getCategory()
        Returns the category associated with this panel.
        Returns:
        the category associated with this panel.
      • getChild

        public JComponent getChild()
        Returns the component that must be displayed by this panel if its CategoryButton is in a certain state.
        Returns:
        the component that must be displayed by this panel if its CategoryButton is in a certain state.
      • isExpanded

        public boolean isExpanded()
        Returns true if the panel is extended and false otherwise.
        Returns:
        true if the panel is extended and false otherwise.