Package com.jidesoft.swing
Class JideScrollPaneLayout
java.lang.Object
javax.swing.ScrollPaneLayout
com.jidesoft.swing.JideScrollPaneLayout
- All Implemented Interfaces:
JideScrollPaneConstants
,LayoutManager
,Serializable
,ScrollPaneConstants
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 Summary
FieldsModifier and TypeFieldDescriptionprotected JViewport
The column footer child.protected Component
The component to the left of horizontal scroll bar.protected Component
The component to the right of horizontal scroll bar.protected JViewport
The row footer child.protected JViewport
The row sub column header componeng.protected Component
The component under upper left corner.protected Component
The component under upper right corner.protected Component
The component to the bottom of vertical scroll bar.protected Component
The 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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns theJViewport
object that is the column footer.Returns theJViewport
object that is the row footer.Returns theJViewport
object that is the row sub column header.getScrollBarCorner
(String key) Returns theComponent
at the specified corner.protected boolean
protected boolean
protected boolean
protected boolean
void
layoutContainer
(Container parent) Lays out the scrollpane.minimumLayoutSize
(Container parent) The minimum size of aScrollPane
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.preferredLayoutSize
(Container parent) The preferred size of aScrollPane
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.void
void
Methods inherited from class javax.swing.ScrollPaneLayout
addSingletonComponent, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorderBounds, setHorizontalScrollBarPolicy, setVerticalScrollBarPolicy
-
Field Details
-
_rowFoot
The row footer child. Default isnull
.- See Also:
-
_subColHead
The row sub column header componeng. Default isnull
.- See Also:
-
_colFoot
The column footer child. Default isnull
.- See Also:
-
_hLeft
The component to the left of horizontal scroll bar. -
_hRight
The component to the right of horizontal scroll bar. -
_vTop
The component to the top of vertical scroll bar. -
_vBottom
The component to the bottom of vertical scroll bar. -
_subUpperLeft
The component under upper left corner. Default isnull
. -
_subUpperRight
The component under upper right corner. Default isnull
.
-
-
Constructor Details
-
JideScrollPaneLayout
public JideScrollPaneLayout()
-
-
Method Details
-
syncWithScrollPane
- Overrides:
syncWithScrollPane
in classScrollPaneLayout
-
isHsbCoversWholeWidth
-
isVsbCoversWholeHeight
-
isColumnHeadersHeightUnified
-
addLayoutComponent
- Specified by:
addLayoutComponent
in interfaceLayoutManager
- Overrides:
addLayoutComponent
in classScrollPaneLayout
-
removeLayoutComponent
- Specified by:
removeLayoutComponent
in interfaceLayoutManager
- Overrides:
removeLayoutComponent
in classScrollPaneLayout
-
getRowSubColumnHeader
Returns theJViewport
object that is the row sub column header.- Returns:
- the
JViewport
object that is the row sub column header. - See Also:
-
getScrollBarCorner
Returns theComponent
at the specified corner.- Parameters:
key
- theString
specifying the corner- Returns:
- the
Component
at the specified corner, as defined inScrollPaneConstants
; ifkey
is not one of the four corners,null
is returned - See Also:
-
preferredLayoutSize
The preferred size of aScrollPane
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 interfaceLayoutManager
- Overrides:
preferredLayoutSize
in classScrollPaneLayout
- Parameters:
parent
- theContainer
that will be laid out- Returns:
- a
Dimension
object specifying the preferred size of the viewport and any scrollbars - See Also:
-
minimumLayoutSize
The minimum size of aScrollPane
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 interfaceLayoutManager
- Overrides:
minimumLayoutSize
in classScrollPaneLayout
- Parameters:
parent
- theContainer
that will be laid out- Returns:
- a
Dimension
object specifying the minimum size
-
layoutContainer
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 interfaceLayoutManager
- Overrides:
layoutContainer
in classScrollPaneLayout
- Parameters:
parent
- theContainer
to lay out
-