Class ScrollerLayout

java.lang.Object
   |
   +----ScrollerLayout

public class ScrollerLayout
extends Object
implements LayoutManager
A special layout manager for placing and sizing the viewport and scrollbars of a Scroller. Based on class ScrollerLayout from "Graphic Java 1.1" p. 784. Java 1.1 Implementation

See Also:
Scroller, AdjustmentListener, Scrollbar, ScrollPane, Panel

Variable Index

 o EAST
The east layout constraint (left side of container).
 o NORTH
The north layout constraint (top of container).
 o SOUTH
The south layout constraint (bottom of container).
 o VIEWPORT
The viewport layout constraint (the component that displays whatever is being scrolled).
 o WEST
The west layout constraint (right side of container).

Constructor Index

 o ScrollerLayout(Scroller)
Straightforward constructor.

Method Index

 o addLayoutComponent(String, Component)
Add the specified component with the specified name to the layout.
 o layoutContainer(Container)
Lay out the specified container.
 o minimumLayoutSize(Container)
Determine the minimum size of the target container using this layout manager.
 o preferredLayoutSize(Container)
Determine the preferred size of the target container using this layout manager.
 o removeLayoutComponent(Component)
Removes the specified component from this scroller layout.

Variables

 o NORTH
 public static final String NORTH
The north layout constraint (top of container).

 o SOUTH
 public static final String SOUTH
The south layout constraint (bottom of container).

 o EAST
 public static final String EAST
The east layout constraint (left side of container).

 o WEST
 public static final String WEST
The west layout constraint (right side of container).

 o VIEWPORT
 public static final String VIEWPORT
The viewport layout constraint (the component that displays whatever is being scrolled).

Constructors

 o ScrollerLayout
 public ScrollerLayout(Scroller scroller)
Straightforward constructor.

Parameters:
scroller - the Scroller object to be laid out.
See Also:
Scroller

Methods

 o addLayoutComponent
 public void addLayoutComponent(String name,
                                Component comp)
Add the specified component with the specified name to the layout. If the component is a horizontal scrollbar then the name indicates its location, either NORTH or SOUTH, SOUTH is the default. If the component is a vertical scrollbar then the name indicates its location, either EAST or WEST, EAST is the default. If a Scrollbar has an unknown Orientation then an error message is printed.

Parameters:
name - the name of the component.
comp - the component to be added.
Throws: IllegalArgumentException
if a component is null.
See Also:
LayoutManager, Scrollbar
 o layoutContainer
 public void layoutContainer(Container target)
Lay out the specified container. Determines the locations and the sizes of the components to be laid out in the container.

Parameters:
the - container to be laid out.
See Also:
Scroller, LayoutManager
 o minimumLayoutSize
 public Dimension minimumLayoutSize(Container target)
Determine the minimum size of the target container using this layout manager. This method is called when a container calls its getMinimumSize method. Most applications do not call this method directly.

Parameters:
target - the container in which to do the layout.
Returns:
the minimum dimensions needed to lay out the subcomponents of the specified container.
See Also:
Container, getMinimumSize, preferredLayoutSize, LayoutManager
 o preferredLayoutSize
 public Dimension preferredLayoutSize(Container target)
Determine the preferred size of the target container using this layout manager. Most applications do not call this method directly. This method is called when a container calls its getPreferredSize method.

Parameters:
target - the container in which to do the layout.
Returns:
the preferred dimensions to lay out the subcomponents of the specified container.
See Also:
Container, getPreferredSize, minimumLayoutSize, LayoutManager
 o removeLayoutComponent
 public void removeLayoutComponent(Component comp)
Removes the specified component from this scroller layout. This method is called when a container calls its remove or removeAll methods. Most applications do not call this method directly.

Parameters:
comp - the component to be removed.
See Also:
remove