org.jfree.ui

Class OverlayLayout

Implemented Interfaces:
LayoutManager

public final class OverlayLayout
extends java.lang.Object
implements LayoutManager

A simple layoutmanager to overlay all components of a parent.

This layout manager acts similiar to the card layout, but all childs of the parent band have the same size and all childs can be visible at the same time.

Author:
Thomas Morgner

Constructor Summary

OverlayLayout()
DefaultConstructor.
OverlayLayout(boolean ignoreInvisible)
Creates a new instance.

Method Summary

void
addLayoutComponent(String name, Component comp)
If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.
void
layoutContainer(Container parent)
Lays out the specified container.
Dimension
minimumLayoutSize(Container parent)
Calculates the minimum size dimensions for the specified container, given the components it contains.
Dimension
preferredLayoutSize(Container parent)
Calculates the preferred size dimensions for the specified container, given the components it contains.
void
removeLayoutComponent(Component comp)
Removes the specified component from the layout.

Constructor Details

OverlayLayout

public OverlayLayout()
DefaultConstructor.

OverlayLayout

public OverlayLayout(boolean ignoreInvisible)
Creates a new instance.
Parameters:
ignoreInvisible - whether to ignore invisible components when computing the layout.

Method Details

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.
Parameters:
name - the string to be associated with the component
comp - the component to be added

layoutContainer

public void layoutContainer(Container parent)
Lays out the specified container.
Parameters:
parent - the container to be laid out

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Calculates the minimum size dimensions for the specified container, given the components it contains.
Parameters:
parent - the component to be laid out
Returns:
the minimum size computed for the parent.

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Calculates the preferred size dimensions for the specified container, given the components it contains.
Parameters:
parent - the container to be laid out
Returns:
the preferred size computed for the parent.

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.
Parameters:
comp - the component to be removed