Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.sun.java.swing.ScrollPaneLayout

java.lang.Object
  |
  +--com.sun.java.swing.ScrollPaneLayout

public class ScrollPaneLayout
extends java.lang.Object
implements java.awt.LayoutManager, ScrollPaneConstants, java.io.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.

See Also:
JScrollPane, JViewport, Serialized Form

Field Summary
JViewport colHead
          The column-header component
int hsbPolicy
          The display policy for the horizontal scrollbar.
JScrollBar hsb
          The horizontal scrollbar
java.awt.Component lowerLeft
          The component at the lower left corner
java.awt.Component lowerRight
          The component at the lower right corner
JViewport rowHead
          The row-header component
java.awt.Component upperLeft
          The component at the upper left corner
java.awt.Component upperRight
          The component at the upper right corner
JViewport viewport
          The JViewport that displays the pane's contents
int vsbPolicy
          The display policy for the vertical scrollbar.
JScrollBar vsb
          The vertical scrollbar
 
Method Summary
void addLayoutComponent(java.lang.String s, java.awt.Component c)
          Adds the specified component to the layout, identifying it as one of:
  • ScrollPaneConstants.
java.awt.Component addSingletonComponent(java.awt.Component oldC, java.awt.Component newC)
          The method used to replace an existing component (if any) with a new one.
JViewport getColumnHeader()
          Returns the column header component.
java.awt.Component getCorner(java.lang.String key)
          Returns the component at the specified corner, where the corner specification is one of:
  • ScrollPaneConstants.
int getHorizontalScrollBarPolicy()
          Returns the horizontal scrollbar-display policy.
JScrollBar getHorizontalScrollBar()
          Returns the horizontal scrollbar.
JViewport getRowHeader()
          Returns the row header component.
int getVerticalScrollBarPolicy()
          Returns the vertical scrollbar-display policy.
JScrollBar getVerticalScrollBar()
          Returns the vertical scrollbar.
java.awt.Rectangle getViewportBorderBounds(JScrollPane sp)
          Returns the bounds of the border around the specified scroll pane's viewport.
JViewport getViewport()
          Returns the view port object.
void layoutContainer(java.awt.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.
java.awt.Dimension minimumLayoutSize(java.awt.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.
java.awt.Dimension preferredLayoutSize(java.awt.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.
void removeLayoutComponent(java.awt.Component c)
          Removes the specified component from the layout.
void setHorizontalScrollBarPolicy(int x)
          Returns the horizontal scrollbar-display policy, where the options are:
  • ScrollPaneConstants.
void setVerticalScrollBarPolicy(int x)
          Returns the vertical scrollbar-display policy, where the options are:
  • ScrollPaneConstants.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

viewport

protected JViewport viewport
The JViewport that displays the pane's contents

vsb

protected JScrollBar vsb
The vertical scrollbar

hsb

protected JScrollBar hsb
The horizontal scrollbar

rowHead

protected JViewport rowHead
The row-header component

colHead

protected JViewport colHead
The column-header component

lowerLeft

protected java.awt.Component lowerLeft
The component at the lower left corner

lowerRight

protected java.awt.Component lowerRight
The component at the lower right corner

upperLeft

protected java.awt.Component upperLeft
The component at the upper left corner

upperRight

protected java.awt.Component upperRight
The component at the upper right corner

vsbPolicy

protected int vsbPolicy
The display policy for the vertical scrollbar. Default = As Needed

hsbPolicy

protected int hsbPolicy
The display policy for the horizontal scrollbar. Default = As Needed
Method Detail

addSingletonComponent

protected java.awt.Component addSingletonComponent(java.awt.Component oldC,
                                          java.awt.Component newC)
The method used to replace an existing component (if any) with a new one. Used to add each different kind of component to a JScrollPane, since there can be one and only one left corner, vertical scrollbar, and so on. So only one of each subcomponent is allowed, the old one is removed (if it exists) when a new one is added.
Parameters:
oldC - the Component to replace
newC - the Component to add

addLayoutComponent

public void addLayoutComponent(java.lang.String s,
                               java.awt.Component c)
Adds the specified component to the layout, identifying it as one of:
Specified by:
addLayoutComponent(java.lang.String, java.awt.Component) in interface java.awt.LayoutManager
Parameters:
s - the component identifier
comp - the the component to be added

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component c)
Removes the specified component from the layout.
Specified by:
removeLayoutComponent(java.awt.Component) in interface java.awt.LayoutManager
Parameters:
comp - the component to remove

getVerticalScrollBarPolicy

public int getVerticalScrollBarPolicy()
Returns the vertical scrollbar-display policy.
Returns:
an int giving the display policy
See Also:
setVerticalScrollBarPolicy

setVerticalScrollBarPolicy

public void setVerticalScrollBarPolicy(int x)
Returns the vertical scrollbar-display policy, where the options are:
Parameters:
x - an int giving the display policy

getHorizontalScrollBarPolicy

public int getHorizontalScrollBarPolicy()
Returns the horizontal scrollbar-display policy.
Returns:
an int giving the display policy
See Also:
setHorizontalScrollBarPolicy

setHorizontalScrollBarPolicy

public void setHorizontalScrollBarPolicy(int x)
Returns the horizontal scrollbar-display policy, where the options are:
Parameters:
x - an int giving the display policy

getViewport

public JViewport getViewport()
Returns the view port object.
Returns:
the JViewport object that displays the scrollable contents

getHorizontalScrollBar

public JScrollBar getHorizontalScrollBar()
Returns the horizontal scrollbar.
Returns:
the JScrollbar object that handles horizontal scrolling

getVerticalScrollBar

public JScrollBar getVerticalScrollBar()
Returns the vertical scrollbar.
Returns:
the JScrollbar object that handles vertical scrolling

getRowHeader

public JViewport getRowHeader()
Returns the row header component.
Returns:
the JViewport object that is the row header

getColumnHeader

public JViewport getColumnHeader()
Returns the column header component.
Returns:
the JViewport object that is the column header

getCorner

public java.awt.Component getCorner(java.lang.String key)
Returns the component at the specified corner, where the corner specification is one of:
Returns:
the Component at the specified corner

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.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.
Specified by:
preferredLayoutSize(java.awt.Container) in interface java.awt.LayoutManager
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:
ViewportLayout, java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.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(java.awt.Container) in interface java.awt.LayoutManager
Parameters:
parent - the Container that will be laid out
Returns:
a Dimension object specifying the minimum size

layoutContainer

public void layoutContainer(java.awt.Container parent)
Layout the scrollpane according to the following constraints:
Specified by:
layoutContainer(java.awt.Container) in interface java.awt.LayoutManager
Parameters:
parent - the Container to lay out

getViewportBorderBounds

public java.awt.Rectangle getViewportBorderBounds(JScrollPane sp)
Returns the bounds of the border around the specified scroll pane's viewport.
Returns:
a Rectangle containing the size and position of the viewport border

Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Submit a bug or feature
Submit comments/suggestions about javadoc
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.