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.

Graphic of layout for four buttons

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.


Constructor Index

 o BiflowLayout()
Creates a layout with horizontal and vertical gaps of 5 pixels.
 o BiflowLayout(int, int)
Creates a layout with the specified horizontal and vertical gaps.

Method Index

 o addLayoutComponent(Component, Object)
Adds the specified component to the layout using the specified constraint object.
 o addLayoutComponent(String, Component)
Adds the specified component with the specified constraint to the layout.
 o getLayoutAlignmentX(Container)
Returns the alignment along the x axis.
 o getLayoutAlignmentY(Container)
Returns the alignment along the y axis.
 o invalidateLayout(Container)
Invalidates the layout, indicating that if the layout maanager has cached information it should be discarded.
 o layoutContainer(Container)
Lays out the container in the specified panel.
 o maximumLayoutSize(Container)
Returns the maximum size of this component.
 o minimumLayoutSize(Container)
Calculates the minmum size dimensions for the specified panel given the components in the specified parent container.
 o preferredLayoutSize(Container)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
 o removeLayoutComponent(Component)
Removes the specified component from the layout.

Constructors

 o BiflowLayout
 public BiflowLayout()
Creates a layout with horizontal and vertical gaps of 5 pixels.

 o 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.

Methods

 o 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.
 o 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.
 o removeLayoutComponent
 public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.

Parameters:
comp - The component to be removed.
 o 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.
 o 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.
 o layoutContainer
 public void layoutContainer(Container parent)
Lays out the container in the specified panel.

Parameters:
parent - The component which needs to be laid out.
 o maximumLayoutSize
 public Dimension maximumLayoutSize(Container parent)
Returns the maximum size of this component.

Parameters:
parent - The parent container.
 o 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.
 o 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.
 o 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