All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.JScrollPaneLayout
java.lang.Object
|
+----com.sun.java.swing.JScrollPaneLayout
- public class JScrollPaneLayout
- extends Object
- implements LayoutManager, ScrollPaneConstants
The layout manager used by JScrollPane. JScrollPaneLayout is
responsible for nine components: a viewport, two scrollbars,
a row heading, a column heading, and four "corner" components.
-
colHead
-
-
hsb
-
-
hsbPolicy
-
-
lowerLeft
-
-
lowerRight
-
-
rowHead
-
-
upperLeft
-
-
upperRight
-
-
viewport
-
-
vsb
-
-
vsbPolicy
-
-
JScrollPaneLayout()
-
-
addLayoutComponent(String, Component)
-
-
addSingletonComponent(Component, Component)
-
Only one of these is allowed, remove the old one if neccessary.
-
getColumnHeading()
-
-
getCorner(String)
-
-
getHorizontalScrollBar()
-
-
getHorizontalScrollBarPolicy()
-
-
getRowHeading()
-
-
getVerticalScrollBar()
-
-
getVerticalScrollBarPolicy()
-
-
getViewport()
-
-
layoutContainer(Container)
-
Layout the scrollpane according to the following constraints:
- The row heading, if present and visible, gets its preferred
height and the viewports width;
- The column heading, if present and visible, gets its preferred
width and the viewports height.
-
minimumLayoutSize(Container)
-
The minimum size of a ScrollPane is the size of the insets
plus minimum size of the viewport plus the minimum size
of the visible headings, 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 headings, plus the preferred size of the scrollbars
whose displayPolicy is ALWAYS.
-
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
JScrollPaneLayout
public JScrollPaneLayout()
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()
getRowHeading
public JViewport getRowHeading()
getColumnHeading
public JViewport getColumnHeading()
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 headings, plus the preferred size of the scrollbars
whose displayPolicy is ALWAYS. Note that the viewport defines
the preferred size in the sense that it's the preferred height
of the viewport that defines the vertical contribution from
the vertical scrollbar and the row heading.
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 minimum size
of the visible headings, 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 heading, if present and visible, gets its preferred
height and the viewports width;
- The column heading, 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 heading wrt it's dimensions and
it's made visible.
- If a horizontal scrollbar is needed it's treated like the
column heading (and see the vertical scrollbar item).
- 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 headings. If there's a vertical
scrollbar the right corners appear, if there's a horizontal
scrollbar the lower corners appear, a row heading gets left
corners and a column heading gets upper corners.
All Packages Class Hierarchy This Package Previous Next Index