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
-
AbsoluteLayout()
- creates a new AbsoluteLayout of default size.
-
AbsoluteLayout(Dimension, boolean, boolean)
- creates a new AbsoluteLayout of the specified size, with the option to set the horizontal
and vertical scaling.
-
AbsoluteLayout(int, int)
- creates a new AbsoluteLayout of the specified size.
-
AbsoluteLayout(int, int, boolean, boolean)
- creates a new AbsoluteLayout of the specified size, with the option to set the horizontal
and vertical scaling.
-
addLayoutComponent(Component, Object)
- adds a component to the layout.
-
addLayoutComponent(String, Component)
- adds a component to the layout.
-
getLayoutAlignmentX(Container)
-
-
getLayoutAlignmentY(Container)
-
-
invalidateLayout(Container)
-
-
isHorizontalScaling()
- returns a boolean corresponding to whether the horizontal scaling is on.
-
isVerticalScaling()
- returns a boolean corresponding to whether the vertical scaling is on.
-
layoutContainer(Container)
-
-
maximumLayoutSize(Container)
-
-
minimumLayoutSize(Container)
-
-
preferredLayoutSize(Container)
-
-
removeLayoutComponent(Component)
-
-
setAutoSize(boolean)
- specifies whether a component's preferred size property
should be used for sizing rather than its Rectangle constraint.
-
setConstraints(Component, Rectangle)
- sets the constraints for the specified Component.
-
setHorizontalScaling(boolean)
- sets the horizontal scaling
-
setSize(Dimension)
-
-
setSize(int, int)
-
-
setVerticalScaling(boolean)
- sets the vertical scaling
AbsoluteLayout
public AbsoluteLayout()
- creates a new AbsoluteLayout of default size.
AbsoluteLayout
public AbsoluteLayout(int x,
int y)
- creates a new AbsoluteLayout of the specified size.
- Parameters:
- x - width of layout
- y - height of layout
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
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.
addLayoutComponent
public void addLayoutComponent(String name,
Component comp)
- adds a component to the layout.
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
setConstraints
public void setConstraints(Component c,
Rectangle r)
- sets the constraints for the specified Component.
setHorizontalScaling
public void setHorizontalScaling(boolean b)
- sets the horizontal scaling
setVerticalScaling
public void setVerticalScaling(boolean b)
- sets the vertical scaling
setAutoSize
public void setAutoSize(boolean b)
- specifies whether a component's preferred size property
should be used for sizing rather than its Rectangle constraint.
isHorizontalScaling
public boolean isHorizontalScaling()
- returns a boolean corresponding to whether the horizontal scaling is on.
isVerticalScaling
public boolean isVerticalScaling()
- returns a boolean corresponding to whether the vertical scaling is on.
removeLayoutComponent
public void removeLayoutComponent(Component comp)
getLayoutAlignmentX
public float getLayoutAlignmentX(Container target)
getLayoutAlignmentY
public float getLayoutAlignmentY(Container target)
invalidateLayout
public void invalidateLayout(Container target)
setSize
public void setSize(Dimension d)
setSize
public void setSize(int x,
int y)
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
maximumLayoutSize
public Dimension maximumLayoutSize(Container target)
layoutContainer
public void layoutContainer(Container parent)
All Packages Class Hierarchy This Package Previous Next Index