Adempiere 3.5.2a

org.compiere.apps
Class ALayout

java.lang.Object
  extended by org.compiere.apps.ALayout
All Implemented Interfaces:
LayoutManager, LayoutManager2

public class ALayout
extends Object
implements LayoutManager2

Application Layout Manager. panel.setLayout(new ALayout()); panel.add(field11, new ALayoutConstraint(0,0)); panel.add(field12, null); panel.add(field13, null); panel.add(field14, null); panel.add(field21, new ALayoutConstraint(1,0));

Version:
$Id: ALayout.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
Author:
Jorg Janke

Constructor Summary
ALayout()
          Default Constructor with spacing of 2 and columns filled
ALayout(int spaceH, int spaceV, boolean colFill)
          Detail Contructor
 
Method Summary
 void addLayoutComponent(Component component, Object constraint)
          Adds the specified component to the layout, using the specified constraint object.
 void addLayoutComponent(String name, Component comp)
          Add To Layout with NULL constraint
 int getColCount()
          Get Number of Columns
 float getLayoutAlignmentX(Container target)
          Returns the alignment along the x axis.
 float getLayoutAlignmentY(Container target)
          Returns the alignment along the y axis.
 int getRowCount()
          Get Number of Rows
 int getSpaceH()
          Get Horizontal Space (top, between rows, button)
 int getSpaceV()
          Get Vertical Space (left, between columns, right)
 void invalidateLayout(Container target)
          Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 void layoutContainer(Container parent)
          Lays out the specified container.
 Dimension maximumLayoutSize(Container parent)
          Calculates the maximum size dimensions for the specified container, given the components it contains.
 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.
 void setSpaceH(int spaceH)
          Set Horizontal Space (top, between rows, button)
 void setSpaceV(int spaceV)
          Set Vertical Space (left, between columns, right)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ALayout

public ALayout()
Default Constructor with spacing of 2 and columns filled


ALayout

public ALayout(int spaceH,
               int spaceV,
               boolean colFill)
Detail Contructor

Parameters:
spaceH - horizontal space (top, between rows, button)
spaceV - vertical space (left, between columns, right)
colFill - fields are fully filled (rather then preferred size)
Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Add To Layout with NULL constraint

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
name - the string to be associated with the component - ignored
comp - the component to be added

addLayoutComponent

public void addLayoutComponent(Component component,
                               Object constraint)
Adds the specified component to the layout, using the specified constraint object. If the constraint is not a ALayoutConstraint the component is added with a NULL constraint.

Components with a NULL constraint are added as the next column to the last row

Specified by:
addLayoutComponent in interface LayoutManager2
Parameters:
component - the component to be added
constraint - where/how the component is added to the layout.
See Also:
ALayoutConstraint

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Calculates the preferred size dimensions for the specified container, given the components it contains.

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
parent - the container to be laid out
Returns:
Size
See Also:
minimumLayoutSize(java.awt.Container)

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Calculates the minimum size dimensions for the specified container, given the components it contains.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
parent - the component to be laid out
Returns:
Size
See Also:
preferredLayoutSize(java.awt.Container)

maximumLayoutSize

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

Specified by:
maximumLayoutSize in interface LayoutManager2
Parameters:
parent - Parent Container
Returns:
Size
See Also:
Component.getMaximumSize(), LayoutManager

layoutContainer

public void layoutContainer(Container parent)
Lays out the specified container.

Specified by:
layoutContainer in interface LayoutManager
Parameters:
parent - the container to be laid out

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.

Specified by:
getLayoutAlignmentX in interface LayoutManager2
Parameters:
target - target
Returns:
0f

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.

Specified by:
getLayoutAlignmentY in interface LayoutManager2
Parameters:
target - target
Returns:
0f

invalidateLayout

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

Specified by:
invalidateLayout in interface LayoutManager2
Parameters:
target - target

getRowCount

public int getRowCount()
Get Number of Rows

Returns:
no pf rows

getColCount

public int getColCount()
Get Number of Columns

Returns:
no of cols

setSpaceH

public void setSpaceH(int spaceH)
Set Horizontal Space (top, between rows, button)

Parameters:
spaceH - horizontal space (top, between rows, button)

getSpaceH

public int getSpaceH()
Get Horizontal Space (top, between rows, button)

Returns:
spaceH horizontal space (top, between rows, button)

setSpaceV

public void setSpaceV(int spaceV)
Set Vertical Space (left, between columns, right)

Parameters:
spaceV - vertical space (left, between columns, right)

getSpaceV

public int getSpaceV()
Get Vertical Space (left, between columns, right)

Returns:
spaceV vertical space (left, between columns, right)

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.