All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class datarep.common.AbsoluteLayout

java.lang.Object
   |
   +----datarep.common.AbsoluteLayout

public class AbsoluteLayout
extends Object
implements LayoutManager2, Serializable
An absolute layout lays out the components in a container using absolute locations and sizes. The locations and sizes are specified using a java.awt.Rectangle object as a constraint. The layout can also be given a preferred Size. If the container's size differs from the layout's preferred size, the components can be optionally scaled to fit the new size. For example:
    Panel p = new Panel(new AbsoluteLayout());
    p.add(new Button(), new Rectangle(0,0,40,40));
    p.add(new Button(), new Rectangle(20,20,40,40));
    p.add(new Button(), new Rectangle(40,40,40,40));
 

Version:
1.2
Author:
Data Representations, Inc.
See Also:
LayoutManager2

Constructor Index

 o AbsoluteLayout()
creates a new AbsoluteLayout of default size.
 o AbsoluteLayout(Dimension, boolean, boolean)
creates a new AbsoluteLayout of the specified size, with the option to set the horizontal and vertical scaling.
 o AbsoluteLayout(int, int)
creates a new AbsoluteLayout of the specified size.
 o AbsoluteLayout(int, int, boolean, boolean)
creates a new AbsoluteLayout of the specified size, with the option to set the horizontal and vertical scaling.

Method Index

 o addLayoutComponent(Component, Object)
adds a component to the layout.
 o addLayoutComponent(String, Component)
adds a component to the layout.
 o getLayoutAlignmentX(Container)
 o getLayoutAlignmentY(Container)
 o invalidateLayout(Container)
 o isHorizontalScaling()
returns a boolean corresponding to whether the horizontal scaling is on.
 o isVerticalScaling()
returns a boolean corresponding to whether the vertical scaling is on.
 o layoutContainer(Container)
 o maximumLayoutSize(Container)
 o minimumLayoutSize(Container)
 o preferredLayoutSize(Container)
 o removeLayoutComponent(Component)
 o setAutoSize(boolean)
specifies whether a component's preferred size property should be used for sizing rather than its Rectangle constraint.
 o setConstraints(Component, Rectangle)
sets the constraints for the specified Component.
 o setHorizontalScaling(boolean)
sets the horizontal scaling
 o setSize(Dimension)
 o setSize(int, int)
 o setVerticalScaling(boolean)
sets the vertical scaling

Constructors

 o AbsoluteLayout
 public AbsoluteLayout()
creates a new AbsoluteLayout of default size.

 o AbsoluteLayout
 public AbsoluteLayout(int x,
                       int y)
creates a new AbsoluteLayout of the specified size.

Parameters:
x - width of layout
y - height of layout
 o AbsoluteLayout
 public AbsoluteLayout(int x,
                       int y,
                       boolean scaleh,
                       boolean scalev)
creates a new AbsoluteLayout of the specified size, with the option to set the horizontal and vertical scaling.

Parameters:
x - width of layout
y - height of layout
scaleh - if true, horizontal scaling is turned on
scalev - if true, vertical scaling is turned on
 o AbsoluteLayout
 public AbsoluteLayout(Dimension size,
                       boolean scaleh,
                       boolean scalev)
creates a new AbsoluteLayout of the specified size, with the option to set the horizontal and vertical scaling. A Dimension object is used rather than int x, int y to set the size.

Methods

 o addLayoutComponent
 public void addLayoutComponent(String name,
                                Component comp)
adds a component to the layout.

 o addLayoutComponent
 public void addLayoutComponent(Component comp,
                                Object constraints)
adds a component to the layout.

Parameters:
comp - the component to add
Throws: IllegalArgumentException
throws this exception if the constraint is not a rectangle
 o setConstraints
 public void setConstraints(Component c,
                            Rectangle r)
sets the constraints for the specified Component.

 o setHorizontalScaling
 public void setHorizontalScaling(boolean b)
sets the horizontal scaling

 o setVerticalScaling
 public void setVerticalScaling(boolean b)
sets the vertical scaling

 o setAutoSize
 public void setAutoSize(boolean b)
specifies whether a component's preferred size property should be used for sizing rather than its Rectangle constraint.

 o isHorizontalScaling
 public boolean isHorizontalScaling()
returns a boolean corresponding to whether the horizontal scaling is on.

 o isVerticalScaling
 public boolean isVerticalScaling()
returns a boolean corresponding to whether the vertical scaling is on.

 o removeLayoutComponent
 public void removeLayoutComponent(Component comp)
 o getLayoutAlignmentX
 public float getLayoutAlignmentX(Container target)
 o getLayoutAlignmentY
 public float getLayoutAlignmentY(Container target)
 o invalidateLayout
 public void invalidateLayout(Container target)
 o setSize
 public void setSize(Dimension d)
 o setSize
 public void setSize(int x,
                     int y)
 o minimumLayoutSize
 public Dimension minimumLayoutSize(Container parent)
 o preferredLayoutSize
 public Dimension preferredLayoutSize(Container parent)
 o maximumLayoutSize
 public Dimension maximumLayoutSize(Container target)
 o layoutContainer
 public void layoutContainer(Container parent)

All Packages  Class Hierarchy  This Package  Previous  Next  Index