Class BasicSplitPaneUI

Direct Known Subclasses:
MetalSplitPaneUI, SynthSplitPaneUI

public class BasicSplitPaneUI extends SplitPaneUI
A Basic L&F implementation of the SplitPaneUI.
  • Field Details Link icon

    • NON_CONTINUOUS_DIVIDER Link icon

      protected static final String NON_CONTINUOUS_DIVIDER
      The divider used for non-continuous layout is added to the split pane with this object.
      See Also:
    • KEYBOARD_DIVIDER_MOVE_OFFSET Link icon

      protected static int KEYBOARD_DIVIDER_MOVE_OFFSET
      How far (relative) the divider does move when it is moved around by the cursor keys on the keyboard.
    • splitPane Link icon

      protected JSplitPane splitPane
      JSplitPane instance this instance is providing the look and feel for.
    • layoutManager Link icon

      LayoutManager that is created and placed into the split pane.
    • divider Link icon

      protected BasicSplitPaneDivider divider
      Instance of the divider for this JSplitPane.
    • propertyChangeListener Link icon

      protected PropertyChangeListener propertyChangeListener
      Instance of the PropertyChangeListener for this JSplitPane.
    • focusListener Link icon

      protected FocusListener focusListener
      Instance of the FocusListener for this JSplitPane.
    • dividerSize Link icon

      protected int dividerSize
      The size of the divider while the dragging session is valid.
    • nonContinuousLayoutDivider Link icon

      protected Component nonContinuousLayoutDivider
      Instance for the shadow of the divider when non continuous layout is being used.
    • draggingHW Link icon

      protected boolean draggingHW
      Set to true in startDragging if any of the children (not including the nonContinuousLayoutDivider) are heavy weights.
    • beginDragDividerLocation Link icon

      protected int beginDragDividerLocation
      Location of the divider when the dragging session began.
    • upKey Link icon

      @Deprecated protected KeyStroke upKey
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • downKey Link icon

      @Deprecated protected KeyStroke downKey
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • leftKey Link icon

      @Deprecated protected KeyStroke leftKey
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • rightKey Link icon

      @Deprecated protected KeyStroke rightKey
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • homeKey Link icon

      @Deprecated protected KeyStroke homeKey
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • endKey Link icon

      @Deprecated protected KeyStroke endKey
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • dividerResizeToggleKey Link icon

      @Deprecated protected KeyStroke dividerResizeToggleKey
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • keyboardUpLeftListener Link icon

      @Deprecated protected ActionListener keyboardUpLeftListener
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • keyboardDownRightListener Link icon

      @Deprecated protected ActionListener keyboardDownRightListener
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • keyboardHomeListener Link icon

      @Deprecated protected ActionListener keyboardHomeListener
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • keyboardEndListener Link icon

      @Deprecated protected ActionListener keyboardEndListener
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
    • keyboardResizeToggleListener Link icon

      @Deprecated protected ActionListener keyboardResizeToggleListener
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
  • Constructor Details Link icon

    • BasicSplitPaneUI Link icon

      public BasicSplitPaneUI()
      Constructs a BasicSplitPaneUI.
  • Method Details Link icon

    • createUI Link icon

      public static ComponentUI createUI(JComponent x)
      Creates a new instance of BasicSplitPaneUI.
      Parameters:
      x - a component
      Returns:
      a new instance of BasicSplitPaneUI
    • installUI Link icon

      public void installUI(JComponent c)
      Installs the UI.
      Overrides:
      installUI in class ComponentUI
      Parameters:
      c - the component where this UI delegate is being installed
      See Also:
    • installDefaults Link icon

      protected void installDefaults()
      Installs the UI defaults.
    • installListeners Link icon

      protected void installListeners()
      Installs the event listeners for the UI.
    • installKeyboardActions Link icon

      protected void installKeyboardActions()
      Installs the keyboard actions for the UI.
    • uninstallUI Link icon

      public void uninstallUI(JComponent c)
      Uninstalls the UI.
      Overrides:
      uninstallUI in class ComponentUI
      Parameters:
      c - the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
      See Also:
    • uninstallDefaults Link icon

      protected void uninstallDefaults()
      Uninstalls the UI defaults.
    • uninstallListeners Link icon

      protected void uninstallListeners()
      Uninstalls the event listeners for the UI.
    • uninstallKeyboardActions Link icon

      protected void uninstallKeyboardActions()
      Uninstalls the keyboard actions for the UI.
    • createPropertyChangeListener Link icon

      protected PropertyChangeListener createPropertyChangeListener()
      Creates a PropertyChangeListener for the JSplitPane UI.
      Returns:
      an instance of PropertyChangeListener
    • createFocusListener Link icon

      protected FocusListener createFocusListener()
      Creates a FocusListener for the JSplitPane UI.
      Returns:
      an instance of FocusListener
    • createKeyboardUpLeftListener Link icon

      @Deprecated protected ActionListener createKeyboardUpLeftListener()
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

      Creates an ActionListener for the JSplitPane UI that listens for specific key presses.

      Returns:
      an instance of ActionListener
    • createKeyboardDownRightListener Link icon

      @Deprecated protected ActionListener createKeyboardDownRightListener()
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

      Creates an ActionListener for the JSplitPane UI that listens for specific key presses.

      Returns:
      an instance of ActionListener
    • createKeyboardHomeListener Link icon

      @Deprecated protected ActionListener createKeyboardHomeListener()
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

      Creates an ActionListener for the JSplitPane UI that listens for specific key presses.

      Returns:
      an instance of ActionListener
    • createKeyboardEndListener Link icon

      @Deprecated protected ActionListener createKeyboardEndListener()
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

      Creates an ActionListener for the JSplitPane UI that listens for specific key presses.

      Returns:
      an instance of ActionListener
    • createKeyboardResizeToggleListener Link icon

      @Deprecated protected ActionListener createKeyboardResizeToggleListener()
      Deprecated.
      As of Java 2 platform v1.3.
      As of Java 2 platform v1.3 this method is no longer used. Subclassers previously using this method should instead create an Action wrapping the ActionListener, and register that Action by overriding installKeyboardActions and placing the Action in the SplitPane's ActionMap. Please refer to the key bindings specification for further details.

      Creates an ActionListener for the JSplitPane UI that listens for specific key presses.

      Returns:
      an instance of ActionListener
    • getOrientation Link icon

      public int getOrientation()
      Returns the orientation for the JSplitPane.
      Returns:
      the orientation
    • setOrientation Link icon

      public void setOrientation(int orientation)
      Set the orientation for the JSplitPane.
      Parameters:
      orientation - the orientation
    • isContinuousLayout Link icon

      public boolean isContinuousLayout()
      Determines whether the JSplitPane is set to use a continuous layout.
      Returns:
      true if a continuous layout is set
    • setContinuousLayout Link icon

      public void setContinuousLayout(boolean b)
      Turn continuous layout on/off.
      Parameters:
      b - if true the continuous layout turns on
    • getLastDragLocation Link icon

      public int getLastDragLocation()
      Returns the last drag location of the JSplitPane.
      Returns:
      the last drag location
    • setLastDragLocation Link icon

      public void setLastDragLocation(int l)
      Set the last drag location of the JSplitPane.
      Parameters:
      l - the drag location
    • getDivider Link icon

      public BasicSplitPaneDivider getDivider()
      Returns the divider between the top Components.
      Returns:
      the divider between the top Components
    • createDefaultNonContinuousLayoutDivider Link icon

      protected Component createDefaultNonContinuousLayoutDivider()
      Returns the default non continuous layout divider, which is an instance of Canvas that fills in the background with dark gray.
      Returns:
      the default non continuous layout divider
    • setNonContinuousLayoutDivider Link icon

      protected void setNonContinuousLayoutDivider(Component newDivider)
      Sets the divider to use when the JSplitPane is configured to not continuously layout. This divider will only be used during a dragging session. It is recommended that the passed in component be a heavy weight.
      Parameters:
      newDivider - the new divider
    • setNonContinuousLayoutDivider Link icon

      protected void setNonContinuousLayoutDivider(Component newDivider, boolean rememberSizes)
      Sets the divider to use.
      Parameters:
      newDivider - the new divider
      rememberSizes - if true the pane size is remembered
    • getNonContinuousLayoutDivider Link icon

      public Component getNonContinuousLayoutDivider()
      Returns the divider to use when the JSplitPane is configured to not continuously layout. This divider will only be used during a dragging session.
      Returns:
      the divider
    • getSplitPane Link icon

      public JSplitPane getSplitPane()
      Returns the JSplitPane this instance is currently contained in.
      Returns:
      the instance of JSplitPane
    • createDefaultDivider Link icon

      public BasicSplitPaneDivider createDefaultDivider()
      Creates the default divider.
      Returns:
      the default divider
    • resetToPreferredSizes Link icon

      public void resetToPreferredSizes(JSplitPane jc)
      Messaged to reset the preferred sizes.
      Specified by:
      resetToPreferredSizes in class SplitPaneUI
      Parameters:
      jc - a JSplitPane
    • setDividerLocation Link icon

      public void setDividerLocation(JSplitPane jc, int location)
      Sets the location of the divider to location.
      Specified by:
      setDividerLocation in class SplitPaneUI
      Parameters:
      jc - a JSplitPane
      location - an integer specifying the location of the divider
    • getDividerLocation Link icon

      public int getDividerLocation(JSplitPane jc)
      Returns the location of the divider, which may differ from what the splitpane thinks the location of the divider is.
      Specified by:
      getDividerLocation in class SplitPaneUI
      Parameters:
      jc - a JSplitPane
      Returns:
      an integer specifying the location of the divider
    • getMinimumDividerLocation Link icon

      public int getMinimumDividerLocation(JSplitPane jc)
      Gets the minimum location of the divider.
      Specified by:
      getMinimumDividerLocation in class SplitPaneUI
      Parameters:
      jc - a JSplitPane
      Returns:
      and integer specifying the minimum location of the divider
    • getMaximumDividerLocation Link icon

      public int getMaximumDividerLocation(JSplitPane jc)
      Gets the maximum location of the divider.
      Specified by:
      getMaximumDividerLocation in class SplitPaneUI
      Parameters:
      jc - a JSplitPane
      Returns:
      an integer specifying the maximum location of the divider
    • finishedPaintingChildren Link icon

      public void finishedPaintingChildren(JSplitPane sp, Graphics g)
      Called when the specified split pane has finished painting its children.
      Specified by:
      finishedPaintingChildren in class SplitPaneUI
      Parameters:
      sp - a JSplitPane
      g - the Graphics context
    • getPreferredSize Link icon

      public Dimension getPreferredSize(JComponent jc)
      Returns the preferred size for the passed in component, This is passed off to the current layout manager.
      Overrides:
      getPreferredSize in class ComponentUI
      Parameters:
      jc - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
      Returns:
      a Dimension object containing given component's preferred size appropriate for the look and feel
      See Also:
    • getMinimumSize Link icon

      public Dimension getMinimumSize(JComponent jc)
      Returns the minimum size for the passed in component, This is passed off to the current layout manager.
      Overrides:
      getMinimumSize in class ComponentUI
      Parameters:
      jc - the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
      Returns:
      a Dimension object or null
      See Also:
    • getMaximumSize Link icon

      public Dimension getMaximumSize(JComponent jc)
      Returns the maximum size for the passed in component, This is passed off to the current layout manager.
      Overrides:
      getMaximumSize in class ComponentUI
      Parameters:
      jc - the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
      Returns:
      a Dimension object or null
      See Also:
    • getInsets Link icon

      public Insets getInsets(JComponent jc)
      Returns the insets. The insets are returned from the border insets of the current border.
      Parameters:
      jc - a component
      Returns:
      the insets
    • resetLayoutManager Link icon

      protected void resetLayoutManager()
      Resets the layout manager based on orientation and messages it with invalidateLayout to pull in appropriate Components.
    • startDragging Link icon

      protected void startDragging()
      Should be messaged before the dragging session starts, resets lastDragLocation and dividerSize.
    • dragDividerTo Link icon

      protected void dragDividerTo(int location)
      Messaged during a dragging session to move the divider to the passed in location. If continuousLayout is true the location is reset and the splitPane validated.
      Parameters:
      location - the location of divider
    • finishDraggingTo Link icon

      protected void finishDraggingTo(int location)
      Messaged to finish the dragging session. If not continuous display the dividers location will be reset.
      Parameters:
      location - the location of divider
    • getDividerBorderSize Link icon

      @Deprecated protected int getDividerBorderSize()
      Deprecated.
      As of Java 2 platform v1.3, instead set the border on the divider.
      As of Java 2 platform v1.3 this method is no longer used. Instead you should set the border on the divider.

      Returns the width of one side of the divider border.

      Returns:
      the width of one side of the divider border