Class JideScrollPaneLayout

java.lang.Object
javax.swing.ScrollPaneLayout
com.jidesoft.swing.JideScrollPaneLayout
All Implemented Interfaces:
JideScrollPaneConstants, LayoutManager, Serializable, ScrollPaneConstants

public class JideScrollPaneLayout extends ScrollPaneLayout implements JideScrollPaneConstants
The layout manager used by JideScrollPane. JideScrollPaneLayout is responsible for eleven components: a viewport, two scrollbars, a row header, a column header, a row footer, a column footer, and four "corner" components.
See Also:
  • Field Details

  • Constructor Details

    • JideScrollPaneLayout

      public JideScrollPaneLayout()
  • Method Details

    • syncWithScrollPane

      public void syncWithScrollPane(JScrollPane sp)
      Overrides:
      syncWithScrollPane in class ScrollPaneLayout
    • isHsbCoversWholeWidth

      protected boolean isHsbCoversWholeWidth(JScrollPane sp)
    • isVsbCoversWholeHeight

      protected boolean isVsbCoversWholeHeight(JScrollPane sp)
    • isColumnHeadersHeightUnified

      protected boolean isColumnHeadersHeightUnified(JScrollPane sp)
    • isColumnFootersHeightUnified

      protected boolean isColumnFootersHeightUnified(JScrollPane sp)
    • addLayoutComponent

      public void addLayoutComponent(String s, Component c)
      Specified by:
      addLayoutComponent in interface LayoutManager
      Overrides:
      addLayoutComponent in class ScrollPaneLayout
    • removeLayoutComponent

      public void removeLayoutComponent(Component c)
      Specified by:
      removeLayoutComponent in interface LayoutManager
      Overrides:
      removeLayoutComponent in class ScrollPaneLayout
    • getRowFooter

      public JViewport getRowFooter()
      Returns the JViewport object that is the row footer.
      Returns:
      the JViewport object that is the row footer
      See Also:
    • getRowSubColumnHeader

      public JViewport getRowSubColumnHeader()
      Returns the JViewport object that is the row sub column header.
      Returns:
      the JViewport object that is the row sub column header.
      See Also:
    • getColumnFooter

      public JViewport getColumnFooter()
      Returns the JViewport object that is the column footer.
      Returns:
      the JViewport object that is the column footer
      See Also:
    • getScrollBarCorner

      public Component getScrollBarCorner(String key)
      Returns the Component at the specified corner.
      Parameters:
      key - the String specifying the corner
      Returns:
      the Component at the specified corner, as defined in ScrollPaneConstants; if key is not one of the four corners, null is returned
      See Also:
    • preferredLayoutSize

      public Dimension preferredLayoutSize(Container parent)
      The preferred size of a ScrollPane is the size of the insets, plus the preferred size of the viewport, plus the preferred size of the visible headers, plus the preferred size of the scrollbars that will appear given the current view and the current scrollbar displayPolicies.

      Note that the rowHeader is calculated as part of the preferred width and the colHeader is calculated as part of the preferred size.

      Specified by:
      preferredLayoutSize in interface LayoutManager
      Overrides:
      preferredLayoutSize in class ScrollPaneLayout
      Parameters:
      parent - the Container that will be laid out
      Returns:
      a Dimension object specifying the preferred size of the viewport and any scrollbars
      See Also:
    • minimumLayoutSize

      public Dimension minimumLayoutSize(Container parent)
      The minimum size of a ScrollPane is the size of the insets plus minimum size of the viewport, plus the scrollpane's viewportBorder insets, plus the minimum size of the visible headers, plus the minimum size of the scrollbars whose displayPolicy isn't NEVER.
      Specified by:
      minimumLayoutSize in interface LayoutManager
      Overrides:
      minimumLayoutSize in class ScrollPaneLayout
      Parameters:
      parent - the Container that will be laid out
      Returns:
      a Dimension object specifying the minimum size
    • layoutContainer

      public void layoutContainer(Container parent)
      Lays out the scrollpane. The positioning of components depends on the following constraints:
      • The row header, if present and visible, gets its preferred width and the viewport's height.

      • The column header, if present and visible, gets its preferred height and the viewport's width.

      • If a vertical scrollbar is needed, i.e. if the viewport's extent height is smaller than its view height or if the displayPolicy is ALWAYS, it's treated like the row header with respect to its dimensions and is made visible.

      • If a horizontal scrollbar is needed, it is treated like the column header (see the paragraph above regarding the vertical scrollbar).

      • If the scrollpane has a non-null viewportBorder, then space is allocated for that.

      • The viewport gets the space available after accounting for the previous constraints.

      • The corner components, if provided, are aligned with the ends of the scrollbars and headers. If there is a vertical scrollbar, the right corners appear; if there is a horizontal scrollbar, the lower corners appear; a row header gets left corners, and a column header gets upper corners.
      Specified by:
      layoutContainer in interface LayoutManager
      Overrides:
      layoutContainer in class ScrollPaneLayout
      Parameters:
      parent - the Container to lay out