This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.awt
interface LayoutManager2

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

public interface LayoutManager2
extends LayoutManager

Defines an interface for classes that know how to layout Containers based on a layout constraints object. This interface extends the LayoutManager interface to deal with layouts explicitly in terms of constraint objects that specify how and where components should be added to the layout.

This minimal extension to LayoutManager is intended for tool providers who wish to the creation of constraint-based layouts. It does not yet provide full, general support for custom constraint-based layout managers.


Method Summary
 void
addLayoutComponent(Component comp, Object constraints)

          Adds the specified component to the layout, using the specified constraint object.
 float

          Returns the alignment along the x axis.
 float

          Returns the alignment along the y axis.
 void

          Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 Dimension

          Calculates the maximum size dimensions for the specified container, given the components it contains.
 
Methods inherited from class java.awt.LayoutManager
addLayoutComponent, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent
 

Method Detail

addLayoutComponent

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

Parameters:
comp - the component to be added
constraints - where/how the component is added to the layout.

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Parameters:
target

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Parameters:
target

invalidateLayout

public void invalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

Parameters:
target

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)
Calculates the maximum size dimensions for the specified container, given the components it contains.

Parameters:
target


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.