java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.client.util.gui.SlidingPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
ExpressionParamTable

public class SlidingPane extends JPanel

SlidingPane is a panel that acts very much like a CardLayout, as in: one pane displayed at a time. The difference is that instead of stacked on top of each other, the panes are arranged side-by-side. When swapped, they have a sliding animation.

To use, simply add your panels to this one in left-to-right order to this panel. The order you add them defines their index. Then switch panels using setSelectedPane(int)

Note: for simplicity's sake: borders are not allowed on this panel. Setting one will get you an exception.

See Also:
  • Field Details

    • SELECTED_PANE_PROPERTY

      public static final String SELECTED_PANE_PROPERTY
      See Also:
    • previousSelection

      protected int previousSelection
    • selectedPane

      protected int selectedPane
  • Constructor Details

    • SlidingPane

      public SlidingPane()
      Create a sliding panel with a 200ms animation time
    • SlidingPane

      public SlidingPane(int duration)
      Creates a sliding panel.
      Parameters:
      duration - The amount of time for the sliding animation.
  • Method Details

    • addImpl

      protected void addImpl(Component comp, Object constraints, int index)
      Overrides:
      addImpl in class Container
    • removeAll

      public void removeAll()
      Overrides:
      removeAll in class Container
    • setSelectedPane

      public void setSelectedPane(int selectedPane)
    • setBorder

      public void setBorder(Border border)
      Overrides:
      setBorder in class JComponent
    • getSelectedPane

      public int getSelectedPane()