java.awt
Interface LayoutManager2

All Superinterfaces:
LayoutManager
All Known Implementing Classes:
BasicSplitPaneUI.BasicHorizontalLayoutManager, BasicSplitPaneUI.BasicVerticalLayoutManager, BorderLayout, BoxLayout, CardLayout, DefaultMenuLayout, GridBagLayout, JRootPane.RootLayout, OverlayLayout, SpringLayout

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

Method Summary
 void addLayoutComponent(Component component, Object constraints)
          Adds the specified component to the layout, with the specified constraints object.
 float getLayoutAlignmentX(Container target)
          Returns the preferred X axis alignment for the specified target container.
 float getLayoutAlignmentY(Container target)
          Returns the preferred Y axis alignment for the specified target container.
 void invalidateLayout(Container target)
          Forces the layout manager to purge any cached information about the layout of the target container.
 Dimension maximumLayoutSize(Container target)
          Determines the maximum size of the specified target container.
 
Methods inherited from interface java.awt.LayoutManager
addLayoutComponent, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent
 

Method Detail

addLayoutComponent

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

maximumLayoutSize

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:
Component.getMaximumSize()

getLayoutAlignmentX

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

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

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