Class SidePane

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

public class SidePane extends JPanel implements SwingConstants, Accessible
SidePane is a component that can display several buttons horzontally or vertically. It usually attaches to side of a JFrame.

Buttons in SidePane can be grouped. Each group is called SidePaneGroup. Each button in the group is called SidePaneItem.

See Also:
  • Constructor Details

    • SidePane

      public SidePane(int attachedSide)
      Constructor thats takes the side which this component is attached to.
      Parameters:
      attachedSide - the side which this component is attached to. Possible values are:
      • SwingConstants.NORTH
      • SwingConstants.SOUTH
      • SwingConstants.WEST
      • SwingConstants.EAST
      Throws:
      IllegalArgumentException - if the value is not one of NORTH, SOUTH, WEST, or EAST.
  • Method Details

    • getUI

      public SidePaneUI getUI()
      Returns the UI object which implements the Linvalid input: '&F' for this component.
      Overrides:
      getUI in class JPanel
      Returns:
      a TabbedPaneUI object
      See Also:
    • setUI

      public void setUI(SidePaneUI ui)
      Sets the UI object which implements the Linvalid input: '&F' for this component.
      Parameters:
      ui - the new UI object
      See Also:
    • updateUI

      public void updateUI()
      Resets the UI property to a value from the current look and feel.
      Overrides:
      updateUI in class JPanel
      See Also:
    • getUIClassID

      public String getUIClassID()
      Returns the name of the UI class that implements the Linvalid input: '&F' for this component.
      Overrides:
      getUIClassID in class JPanel
      Returns:
      the string "TabbedPaneUI"
      See Also:
    • addGroup

      public void addGroup(SidePaneGroup group)
      Adds a SidePaneGroup to this component. Do nothing if there is nothing in the group.
      Parameters:
      group - the group to be added
    • removeGroup

      public void removeGroup(SidePaneGroup group)
      Removes a SidePaneGroup from this component.
      Parameters:
      group - the group to be removed
    • removeGroup

      public void removeGroup(int index)
      Removes a SidePaneGroup at a spefific index from this component.
      Parameters:
      index - position of the group to be removed
    • getGroups

      public List<SidePaneGroup> getGroups()
      Gets the list of groups in this components.
      Returns:
      the list of groups
    • getAttachedSide

      public int getAttachedSide()
      Gets attached side.
      Returns:
      the attached side
    • setAttachedSide

      public void setAttachedSide(int attachedSide)
      Sets the attached side. It will call updateUI automatically. Possible values are:
      • SwingConstants.NORTH
      • SwingConstants.SOUTH
      • SwingConstants.WEST
      • SwingConstants.EAST

      Note: Please call this method before this component is rendered on screen.

      Parameters:
      attachedSide - the attached side
      Throws:
      IllegalArgumentException - if the value is not one of valid values
    • isRollover

      public boolean isRollover()
      Is the side pane expand when mouse moves over?
      Returns:
      if true, side pane will expand when mouse moves over.
    • setRollover

      public void setRollover(boolean rollover)
      Set if the side pane expand when mouse moves over.
      Parameters:
      rollover - the flag
    • getToolTipText

      public String getToolTipText(MouseEvent event)
      Overrides:
      getToolTipText in class JComponent
    • getAccessibleContext

      public AccessibleContext getAccessibleContext()
      Gets the AccessibleContext associated with this JToolBar. For tool bars, the AccessibleContext takes the form of an AccessibleJToolBar. A new AccessibleJToolBar instance is created if necessary.
      Specified by:
      getAccessibleContext in interface Accessible
      Overrides:
      getAccessibleContext in class JPanel
      Returns:
      an AccessibleJToolBar that serves as the AccessibleContext of this JToolBar