All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.awt.BiflowLayout
java.lang.Object
|
+----com.sun.wizards.awt.BiflowLayout
- public class BiflowLayout
- extends Object
- implements LayoutManager, LayoutManager2, Serializable
The BiflowLayout is a layout manager that arranges components both to
the left and to the right of the container. The position (left or
right) is specified as the constaint.
Here is the code for this applet:
import java.applet.Applet;
import java.awt.*;
import com.sun.wizards.awt.*;
public class Test extends Applet
{
public void init()
{
setLayout(new BiflowLayout());
add(new Button("Button 1"), "Left");
add(new Button("Button 2"), "Left");
add(new Button("Button 3"), "Right");
add(new Button("Button 4"), "Right");
}
}
A BiflowLayout lets each component assume its natural (preferred) size.
-
BiflowLayout()
- Creates a layout with horizontal and
vertical gaps of 5 pixels.
-
BiflowLayout(int, int)
- Creates a layout with the specified
horizontal and vertical gaps.
-
addLayoutComponent(Component, Object)
- Adds the specified component to the layout using the specified
constraint object.
-
addLayoutComponent(String, Component)
- Adds the specified component with the specified constraint
to the layout.
-
getLayoutAlignmentX(Container)
- Returns the alignment along the x axis.
-
getLayoutAlignmentY(Container)
- Returns the alignment along the y axis.
-
invalidateLayout(Container)
- Invalidates the layout, indicating that if the layout maanager has
cached information it should be discarded.
-
layoutContainer(Container)
- Lays out the container in the specified panel.
-
maximumLayoutSize(Container)
- Returns the maximum size of this component.
-
minimumLayoutSize(Container)
- Calculates the minmum size dimensions for the specified
panel given the components in the specified parent container.
-
preferredLayoutSize(Container)
- Calculates the preferred size dimensions for the specified
panel given the components in the specified parent container.
-
removeLayoutComponent(Component)
- Removes the specified component from the layout.
BiflowLayout
public BiflowLayout()
- Creates a layout with horizontal and
vertical gaps of 5 pixels.
BiflowLayout
public BiflowLayout(int hgap,
int vgap)
- Creates a layout with the specified
horizontal and vertical gaps.
- Parameters:
- hgap - The horizontal gap.
- vgap - The vertical gap.
addLayoutComponent
public void addLayoutComponent(String constraint,
Component comp)
- Adds the specified component with the specified constraint
to the layout.
Legal values for constraint are:
"Left"
"Right"
- Parameters:
- constraint - The position where the component should be added.
- comp - The component to be added.
addLayoutComponent
public void addLayoutComponent(Component comp,
Object constraints)
- Adds the specified component to the layout using the specified
constraint object. The constraints object for a NavigatioLayout
must be a String indicating which region the component is to
be added to.
Legal values for constraints are: "Left" and "Right".
- Parameters:
- comp - The component to be added.
- constraints - A string object indicating where the specified
component should be added.
removeLayoutComponent
public void removeLayoutComponent(Component comp)
- Removes the specified component from the layout.
- Parameters:
- comp - The component to be removed.
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
- Calculates the minmum size dimensions for the specified
panel given the components in the specified parent container.
- Parameters:
- parent - The component to be laid out.
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- Calculates the preferred size dimensions for the specified
panel given the components in the specified parent container.
- Parameters:
- parent - The component to be laid out.
layoutContainer
public void layoutContainer(Container parent)
- Lays out the container in the specified panel.
- Parameters:
- parent - The component which needs to be laid out.
maximumLayoutSize
public Dimension maximumLayoutSize(Container parent)
- Returns the maximum size of this component.
- Parameters:
- parent - The parent container.
getLayoutAlignmentX
public float getLayoutAlignmentX(Container parent)
- 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:
- parent - The parent container.
getLayoutAlignmentY
public float getLayoutAlignmentY(Container parent)
- 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:
- parent - The parent container.
invalidateLayout
public void invalidateLayout(Container parent)
- Invalidates the layout, indicating that if the layout maanager has
cached information it should be discarded.
- Parameters:
- parent - The parent container.
All Packages Class Hierarchy This Package Previous Next Index