java.awt
Interface LayoutManager2

All Superinterfaces:
LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager
All Known Implementing Classes:
BasicSplitPaneUI.BasicHorizontalLayoutManager sample code for javax.swing.plaf.basic.BasicSplitPaneUI.BasicHorizontalLayoutManager definition code for javax.swing.plaf.basic.BasicSplitPaneUI.BasicHorizontalLayoutManager , BasicSplitPaneUI.BasicVerticalLayoutManager sample code for javax.swing.plaf.basic.BasicSplitPaneUI.BasicVerticalLayoutManager definition code for javax.swing.plaf.basic.BasicSplitPaneUI.BasicVerticalLayoutManager , BorderLayout sample code for java.awt.BorderLayout definition code for java.awt.BorderLayout , BoxLayout sample code for javax.swing.BoxLayout definition code for javax.swing.BoxLayout , CardLayout sample code for java.awt.CardLayout definition code for java.awt.CardLayout , DefaultMenuLayout sample code for javax.swing.plaf.basic.DefaultMenuLayout definition code for javax.swing.plaf.basic.DefaultMenuLayout , GridBagLayout sample code for java.awt.GridBagLayout definition code for java.awt.GridBagLayout , JRootPane.RootLayout sample code for javax.swing.JRootPane.RootLayout definition code for javax.swing.JRootPane.RootLayout , OverlayLayout sample code for javax.swing.OverlayLayout definition code for javax.swing.OverlayLayout , SpringLayout sample code for javax.swing.SpringLayout definition code for javax.swing.SpringLayout

public interface LayoutManager2
extends LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.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.

See Also:
LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager , Container sample code for java.awt.Container definition code for java.awt.Container

Method Summary
 void addLayoutComponent sample code for java.awt.LayoutManager2.addLayoutComponent(java.awt.Component, java.lang.Object) definition code for java.awt.LayoutManager2.addLayoutComponent(java.awt.Component, java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  comp, Object sample code for java.lang.Object definition code for java.lang.Object  constraints)
          Adds the specified component to the layout, using the specified constraint object.
 float getLayoutAlignmentX sample code for java.awt.LayoutManager2.getLayoutAlignmentX(java.awt.Container) definition code for java.awt.LayoutManager2.getLayoutAlignmentX(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  target)
          Returns the alignment along the x axis.
 float getLayoutAlignmentY sample code for java.awt.LayoutManager2.getLayoutAlignmentY(java.awt.Container) definition code for java.awt.LayoutManager2.getLayoutAlignmentY(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  target)
          Returns the alignment along the y axis.
 void invalidateLayout sample code for java.awt.LayoutManager2.invalidateLayout(java.awt.Container) definition code for java.awt.LayoutManager2.invalidateLayout(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  target)
          Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension maximumLayoutSize sample code for java.awt.LayoutManager2.maximumLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager2.maximumLayoutSize(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  target)
          Calculates the maximum size dimensions for the specified container, given the components it contains.
 
Methods inherited from interface java.awt.LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager
addLayoutComponent sample code for java.awt.LayoutManager.addLayoutComponent(java.lang.String, java.awt.Component) definition code for java.awt.LayoutManager.addLayoutComponent(java.lang.String, java.awt.Component) , layoutContainer sample code for java.awt.LayoutManager.layoutContainer(java.awt.Container) definition code for java.awt.LayoutManager.layoutContainer(java.awt.Container) , minimumLayoutSize sample code for java.awt.LayoutManager.minimumLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager.minimumLayoutSize(java.awt.Container) , preferredLayoutSize sample code for java.awt.LayoutManager.preferredLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager.preferredLayoutSize(java.awt.Container) , removeLayoutComponent sample code for java.awt.LayoutManager.removeLayoutComponent(java.awt.Component) definition code for java.awt.LayoutManager.removeLayoutComponent(java.awt.Component)
 

Method Detail

addLayoutComponent sample code for java.awt.LayoutManager2.addLayoutComponent(java.awt.Component, java.lang.Object) definition code for java.awt.LayoutManager2.addLayoutComponent(java.awt.Component, java.lang.Object)

void addLayoutComponent(Component sample code for java.awt.Component definition code for java.awt.Component  comp,
                        Object sample code for java.lang.Object definition code for java.lang.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.

maximumLayoutSize sample code for java.awt.LayoutManager2.maximumLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager2.maximumLayoutSize(java.awt.Container)

Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  maximumLayoutSize(Container sample code for java.awt.Container definition code for java.awt.Container  target)
Calculates the maximum size dimensions for the specified container, given the components it contains.

See Also:
Component.getMaximumSize() sample code for java.awt.Component.getMaximumSize() definition code for java.awt.Component.getMaximumSize() , LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager

getLayoutAlignmentX sample code for java.awt.LayoutManager2.getLayoutAlignmentX(java.awt.Container) definition code for java.awt.LayoutManager2.getLayoutAlignmentX(java.awt.Container)

float getLayoutAlignmentX(Container sample code for java.awt.Container definition code for java.awt.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.


getLayoutAlignmentY sample code for java.awt.LayoutManager2.getLayoutAlignmentY(java.awt.Container) definition code for java.awt.LayoutManager2.getLayoutAlignmentY(java.awt.Container)

float getLayoutAlignmentY(Container sample code for java.awt.Container definition code for java.awt.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.


invalidateLayout sample code for java.awt.LayoutManager2.invalidateLayout(java.awt.Container) definition code for java.awt.LayoutManager2.invalidateLayout(java.awt.Container)

void invalidateLayout(Container sample code for java.awt.Container definition code for java.awt.Container  target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.