All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.ScrollPaneLayout
java.lang.Object
|
+----com.sun.java.swing.ScrollPaneLayout
- public class ScrollPaneLayout
- extends Object
- implements LayoutManager, ScrollPaneConstants, Serializable
The layout manager used by JScrollPane. JScrollPaneLayout is
responsible for nine components: a viewport, two scrollbars,
a row header, a column header, and four "corner" components.
Warning: serialized objects of this class will not be compatible with
future swing releases. The current serialization support is appropriate
for short term storage or RMI between Swing1.0 applications. It will
not be possible to load serialized Swing1.0 objects with future releases
of Swing. The JDK1.2 release of Swing will be the compatibility
baseline for the serialized form of Swing objects.
-
colHead
-
-
hsb
-
-
hsbPolicy
-
-
lowerLeft
-
-
lowerRight
-
-
rowHead
-
-
upperLeft
-
-
upperRight
-
-
viewport
-
-
vsb
-
-
vsbPolicy
-
-
ScrollPaneLayout()
-
-
addLayoutComponent(String, Component)
-
-
addSingletonComponent(Component, Component)
-
Only one of these is allowed, remove the old one if neccessary.
-
getColumnHeader()
-
-
getCorner(String)
-
-
getHorizontalScrollBar()
-
-
getHorizontalScrollBarPolicy()
-
-
getRowHeader()
-
-
getVerticalScrollBar()
-
-
getVerticalScrollBarPolicy()
-
-
getViewport()
-
-
getViewportBorderBounds(JScrollPane)
-
-
layoutContainer(Container)
-
Layout the scrollpane according to the following constraints:
- The row header, if present and visible, gets its preferred
height and the viewports width.
-
minimumLayoutSize(Container)
-
The minimum size of a ScrollPane is the size of the insets
plus minimum size of the viewport, plus the scrollpanes
viewportBorder insets, plus the minimum size
of the visible headers, plus the minimum size of the
scrollbars whose displayPolicy isn't NEVER.
-
preferredLayoutSize(Container)
-
The preferred size of a ScrollPane is the size of the insets
plus 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.
-
removeLayoutComponent(Component)
-
-
setHorizontalScrollBarPolicy(int)
-
-
setVerticalScrollBarPolicy(int)
-
viewport
protected JViewport viewport
vsb
protected JScrollBar vsb
hsb
protected JScrollBar hsb
rowHead
protected JViewport rowHead
colHead
protected JViewport colHead
lowerLeft
protected Component lowerLeft
lowerRight
protected Component lowerRight
upperLeft
protected Component upperLeft
upperRight
protected Component upperRight
vsbPolicy
protected int vsbPolicy
hsbPolicy
protected int hsbPolicy
ScrollPaneLayout
public ScrollPaneLayout()
addSingletonComponent
protected Component addSingletonComponent(Component oldC,
Component newC)
- Only one of these is allowed, remove the old one if neccessary.
addLayoutComponent
public void addLayoutComponent(String s,
Component c)
removeLayoutComponent
public void removeLayoutComponent(Component c)
getVerticalScrollBarPolicy
public int getVerticalScrollBarPolicy()
setVerticalScrollBarPolicy
public void setVerticalScrollBarPolicy(int x)
getHorizontalScrollBarPolicy
public int getHorizontalScrollBarPolicy()
setHorizontalScrollBarPolicy
public void setHorizontalScrollBarPolicy(int x)
getViewport
public JViewport getViewport()
getHorizontalScrollBar
public JScrollBar getHorizontalScrollBar()
getVerticalScrollBar
public JScrollBar getVerticalScrollBar()
getRowHeader
public JViewport getRowHeader()
getColumnHeader
public JViewport getColumnHeader()
getCorner
public Component getCorner(String key)
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- The preferred size of a ScrollPane is the size of the insets
plus 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.
- Returns:
- The preferred size of the viewport and any scrollbars.
- See Also:
- ViewportLayout, LayoutManager
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 scrollpanes
viewportBorder insets, plus the minimum size
of the visible headers, plus the minimum size of the
scrollbars whose displayPolicy isn't NEVER.
layoutContainer
public void layoutContainer(Container parent)
- Layout the scrollpane according to the following constraints:
- The row header, if present and visible, gets its preferred
height and the viewports width.
- The column header, if present and visible, gets its preferred
width and the viewports height.
- If a vertical scrollbar is needed, i.e. if the viewports extent
height is smaller than its view height or if the displayPolicy
is ALWAYS, it's treated like the row header wrt it's dimensions and
it's made visible.
- If a horizontal scrollbar is needed it's treated like the
column header (and see the vertical scrollbar item).
- 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's a vertical
scrollbar the right corners appear, if there's a horizontal
scrollbar the lower corners appear, a row header gets left
corners and a column header gets upper corners.
getViewportBorderBounds
public Rectangle getViewportBorderBounds(JScrollPane sp)
All Packages Class Hierarchy This Package Previous Next Index