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
-
EAST
- The east layout constraint (left side of container).
-
NORTH
- The north layout constraint (top of container).
-
SOUTH
- The south layout constraint (bottom of container).
-
VIEWPORT
- The viewport layout constraint (the component that displays whatever is
being scrolled).
-
WEST
- The west layout constraint (right side of container).
-
ScrollerLayout(Scroller)
- Straightforward constructor.
-
addLayoutComponent(String, Component)
- Add the specified component with the specified name to the layout.
-
layoutContainer(Container)
- Lay out the specified container.
-
minimumLayoutSize(Container)
- Determine the minimum size of the
target container
using this layout manager.
-
preferredLayoutSize(Container)
- Determine the preferred size of the
target container
using this layout manager.
-
removeLayoutComponent(Component)
- Removes the specified component from this scroller layout.
NORTH
public static final String NORTH
- The north layout constraint (top of container).
SOUTH
public static final String SOUTH
- The south layout constraint (bottom of container).
EAST
public static final String EAST
- The east layout constraint (left side of container).
WEST
public static final String WEST
- The west layout constraint (right side of container).
VIEWPORT
public static final String VIEWPORT
- The viewport layout constraint (the component that displays whatever is
being scrolled).
ScrollerLayout
public ScrollerLayout(Scroller scroller)
- Straightforward constructor.
- Parameters:
- scroller - the Scroller object to be laid out.
- See Also:
- Scroller
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
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
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
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
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