Package com.jidesoft.swing
Class JideScrollPaneLayout
- java.lang.Object
-
- javax.swing.ScrollPaneLayout
-
- com.jidesoft.swing.JideScrollPaneLayout
-
- All Implemented Interfaces:
JideScrollPaneConstants,java.awt.LayoutManager,java.io.Serializable,javax.swing.ScrollPaneConstants
public class JideScrollPaneLayout extends javax.swing.ScrollPaneLayout implements JideScrollPaneConstants
The layout manager used byJideScrollPane.JideScrollPaneLayoutis 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.JViewport_colFootThe column footer child.protected java.awt.Component_hLeftThe component to the left of horizontal scroll bar.protected java.awt.Component_hRightThe component to the right of horizontal scroll bar.protected javax.swing.JViewport_rowFootThe row footer child.protected javax.swing.JViewport_subColHeadThe row sub column header componeng.protected java.awt.Component_subUpperLeftThe component under upper left corner.protected java.awt.Component_subUpperRightThe component under upper right corner.protected java.awt.Component_vBottomThe component to the bottom of vertical scroll bar.protected java.awt.Component_vTopThe component to the top of vertical scroll bar.-
Fields inherited from class javax.swing.ScrollPaneLayout
colHead, hsb, hsbPolicy, lowerLeft, lowerRight, rowHead, upperLeft, upperRight, viewport, vsb, vsbPolicy
-
Fields inherited from interface com.jidesoft.swing.JideScrollPaneConstants
COLUMN_FOOTER, HORIZONTAL_LEADING, HORIZONTAL_LEFT, HORIZONTAL_RIGHT, HORIZONTAL_TRAILING, ROW_FOOTER, SUB_COLUMN_HEADER, SUB_UPPER_LEFT, SUB_UPPER_RIGHT, VERTICAL_BOTTOM, VERTICAL_TOP
-
Fields inherited from interface javax.swing.ScrollPaneConstants
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
-
-
Constructor Summary
Constructors Constructor Description JideScrollPaneLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLayoutComponent(java.lang.String s, java.awt.Component c)javax.swing.JViewportgetColumnFooter()Returns theJViewportobject that is the column footer.javax.swing.JViewportgetRowFooter()Returns theJViewportobject that is the row footer.javax.swing.JViewportgetRowSubColumnHeader()Returns theJViewportobject that is the row sub column header.java.awt.ComponentgetScrollBarCorner(java.lang.String key)Returns theComponentat the specified corner.protected booleanisColumnFootersHeightUnified(javax.swing.JScrollPane sp)protected booleanisColumnHeadersHeightUnified(javax.swing.JScrollPane sp)protected booleanisHsbCoversWholeWidth(javax.swing.JScrollPane sp)protected booleanisVsbCoversWholeHeight(javax.swing.JScrollPane sp)voidlayoutContainer(java.awt.Container parent)Lays out the scrollpane.java.awt.DimensionminimumLayoutSize(java.awt.Container parent)The minimum size of aScrollPaneis 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.java.awt.DimensionpreferredLayoutSize(java.awt.Container parent)The preferred size of aScrollPaneis 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.voidremoveLayoutComponent(java.awt.Component c)voidsyncWithScrollPane(javax.swing.JScrollPane sp)-
Methods inherited from class javax.swing.ScrollPaneLayout
addSingletonComponent, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorderBounds, setHorizontalScrollBarPolicy, setVerticalScrollBarPolicy
-
-
-
-
Field Detail
-
_rowFoot
protected javax.swing.JViewport _rowFoot
The row footer child. Default isnull.
-
_subColHead
protected javax.swing.JViewport _subColHead
The row sub column header componeng. Default isnull.
-
_colFoot
protected javax.swing.JViewport _colFoot
The column footer child. Default isnull.
-
_hLeft
protected java.awt.Component _hLeft
The component to the left of horizontal scroll bar.
-
_hRight
protected java.awt.Component _hRight
The component to the right of horizontal scroll bar.
-
_vTop
protected java.awt.Component _vTop
The component to the top of vertical scroll bar.
-
_vBottom
protected java.awt.Component _vBottom
The component to the bottom of vertical scroll bar.
-
_subUpperLeft
protected java.awt.Component _subUpperLeft
The component under upper left corner. Default isnull.
-
_subUpperRight
protected java.awt.Component _subUpperRight
The component under upper right corner. Default isnull.
-
-
Method Detail
-
syncWithScrollPane
public void syncWithScrollPane(javax.swing.JScrollPane sp)
- Overrides:
syncWithScrollPanein classjavax.swing.ScrollPaneLayout
-
isHsbCoversWholeWidth
protected boolean isHsbCoversWholeWidth(javax.swing.JScrollPane sp)
-
isVsbCoversWholeHeight
protected boolean isVsbCoversWholeHeight(javax.swing.JScrollPane sp)
-
isColumnHeadersHeightUnified
protected boolean isColumnHeadersHeightUnified(javax.swing.JScrollPane sp)
-
isColumnFootersHeightUnified
protected boolean isColumnFootersHeightUnified(javax.swing.JScrollPane sp)
-
addLayoutComponent
public void addLayoutComponent(java.lang.String s, java.awt.Component c)- Specified by:
addLayoutComponentin interfacejava.awt.LayoutManager- Overrides:
addLayoutComponentin classjavax.swing.ScrollPaneLayout
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component c)
- Specified by:
removeLayoutComponentin interfacejava.awt.LayoutManager- Overrides:
removeLayoutComponentin classjavax.swing.ScrollPaneLayout
-
getRowFooter
public javax.swing.JViewport getRowFooter()
Returns theJViewportobject that is the row footer.- Returns:
- the
JViewportobject that is the row footer - See Also:
JideScrollPane.getRowFooter()
-
getRowSubColumnHeader
public javax.swing.JViewport getRowSubColumnHeader()
Returns theJViewportobject that is the row sub column header.- Returns:
- the
JViewportobject that is the row sub column header. - See Also:
JideScrollPane.getSubColumnHeader()
-
getColumnFooter
public javax.swing.JViewport getColumnFooter()
Returns theJViewportobject that is the column footer.- Returns:
- the
JViewportobject that is the column footer - See Also:
JideScrollPane.getColumnFooter()
-
getScrollBarCorner
public java.awt.Component getScrollBarCorner(java.lang.String key)
Returns theComponentat the specified corner.- Parameters:
key- theStringspecifying the corner- Returns:
- the
Componentat the specified corner, as defined inScrollPaneConstants; ifkeyis not one of the four corners,nullis returned - See Also:
JScrollPane.getCorner(java.lang.String)
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
The preferred size of aScrollPaneis 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:
preferredLayoutSizein interfacejava.awt.LayoutManager- Overrides:
preferredLayoutSizein classjavax.swing.ScrollPaneLayout- Parameters:
parent- theContainerthat will be laid out- Returns:
- a
Dimensionobject specifying the preferred size of the viewport and any scrollbars - See Also:
ViewportLayout,LayoutManager
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
The minimum size of aScrollPaneis 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:
minimumLayoutSizein interfacejava.awt.LayoutManager- Overrides:
minimumLayoutSizein classjavax.swing.ScrollPaneLayout- Parameters:
parent- theContainerthat will be laid out- Returns:
- a
Dimensionobject specifying the minimum size
-
layoutContainer
public void layoutContainer(java.awt.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
displayPolicyis 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-
nullviewportBorder, 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:
layoutContainerin interfacejava.awt.LayoutManager- Overrides:
layoutContainerin classjavax.swing.ScrollPaneLayout- Parameters:
parent- theContainerto lay out
-
-