java.awt

Interface LayoutManager2

public interface LayoutManager2 extends LayoutManager

Layout manager for laying out containers based on contraints. The constraints control how the layout will proceed.

Since: 1.0

See Also: LayoutManager Container

UNKNOWN: updated to 1.4

Method Summary
voidaddLayoutComponent(Component component, Object constraints)
Adds the specified component to the layout, with the specified constraints object.
floatgetLayoutAlignmentX(Container target)
Returns the preferred X axis alignment for the specified target container.
floatgetLayoutAlignmentY(Container target)
Returns the preferred Y axis alignment for the specified target container.
voidinvalidateLayout(Container target)
Forces the layout manager to purge any cached information about the layout of the target container.
DimensionmaximumLayoutSize(Container target)
Determines the maximum size of the specified target container.

Method Detail

addLayoutComponent

public void addLayoutComponent(Component component, Object constraints)
Adds the specified component to the layout, with the specified constraints object.

Parameters: component the component to add constraints the constraints to satisfy

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)
Returns the preferred X axis alignment for the specified target container. This value will range from 0 to 1 where 0 is alignment closest to the origin, 0.5 is centered, and 1 is aligned furthest from the origin.

Parameters: target the target container

Returns: the x-axis alignment preference

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)
Returns the preferred Y axis alignment for the specified target container. This value will range from 0 to 1 where 0 is alignment closest to the origin, 0.5 is centered, and 1 is aligned furthest from the origin.

Parameters: target the target container

Returns: the y-axis alignment preference

invalidateLayout

public void invalidateLayout(Container target)
Forces the layout manager to purge any cached information about the layout of the target container. This will force it to be recalculated.

Parameters: target the target container

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)
Determines the maximum size of the specified target container.

Parameters: target the container to lay out

Returns: the maximum size of the container

See Also: getMaximumSize