Class ThumbnailScrollerLayout
java.lang.Object
|
+----ThumbnailScrollerLayout
- public class ThumbnailScrollerLayout
- extends Object
- implements LayoutManager
A special layout manager for placing and sizing the scroller and thumbnail
of a ThumbnailScroller.
If the thumbnail is displayed then it has priority over the scroller, ie,
as much of it as possible is displayed;
the scroller occupies the space leftover.
While the thumbnail scroller is the model for this layout manager,
the interface is general, working for any two components one of which
should be displayed at the other's expense.
Java 1.1 Implementation
- See Also:
- ImageThumbnailScroller
-
SCROLLER
- The scroller layout constraint (the component that displays
whatever is being scrolled).
-
THUMBNAIL
- The thumbnail layout constraint (the component that displays
a thumbnail representation of whatever is being scrolled).
-
ThumbnailScrollerLayout(Container)
- 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.
SCROLLER
public static final String SCROLLER
- The scroller layout constraint (the component that displays
whatever is being scrolled).
This component only consumes what remains of the display
area after the thumbnail is shown.
THUMBNAIL
public static final String THUMBNAIL
- The thumbnail layout constraint (the component that displays
a thumbnail representation of whatever is being scrolled).
This component has priority; it consumes as much of the display
area as is necessary to show it in its entirety.
ThumbnailScrollerLayout
public ThumbnailScrollerLayout(Container thumbnailScroller)
- Straightforward constructor.
- See Also:
- ImageThumbnailScroller
addLayoutComponent
public void addLayoutComponent(String name,
Component comp)
- Add the specified component with the specified name to the layout.
- Parameters:
- name - the name of the component.
- comp - the component to be added.
- Throws: IllegalArgumentException
- if a component is null.
- See Also:
- LayoutManager
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:
- ImageThumbnailScroller, 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.
- Throws: IllegalArgumentException
- if the container is not the
thumbnailScroller.
- 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 needed to lay out the subcomponents
of the specified container.
- Throws: IllegalArgumentException
- if the container is not the
thumbnailScroller.
- 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