All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.awt.VerticalLayout
java.lang.Object
|
+----com.sun.wizards.awt.VerticalLayout
- public class VerticalLayout
- extends Object
- implements LayoutManager, LayoutManager2, Serializable
VerticalLayout lays out components according to a specified
percent. For example, if a component is added to VerticalLayout
with a constraint of 50%, the component will be displayed in
the center (vertically) of the container.
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 VerticalLayout());
add(new Separator(), "25");
add(new FlowLabel("The separator is placed at 25% and this label is" +
" placed at 70%."), "70");
}
}
As the panel is resized, the components will be moved accordingly.
-
VerticalLayout()
- Creates a VerticalLayout manager with a horizontal
and vertical gap of zero.
-
VerticalLayout(int, int)
- Creates a VerticalLayout manager 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 position 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.
VerticalLayout
public VerticalLayout()
- Creates a VerticalLayout manager with a horizontal
and vertical gap of zero.
VerticalLayout
public VerticalLayout(int hgap,
int vgap)
- Creates a VerticalLayout manager with the specified
horizontal and vertical gaps.
- Parameters:
- hgap - The horizontal gap between components.
- vgap - The vertical gap between components.
addLayoutComponent
public void addLayoutComponent(String position,
Component comp)
- Adds the specified component with the specified position to the layout.
- Parameters:
- position - The position (an integer value between 0 and 100)
indicating where the new component should be
displayed.
- 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 constraint object for a VerticalLayout
must be a String indicating a number between 0 and 100, which
specifies the vertical position (in percent of target height)
where the specified component should be displayed.
- Parameters:
- comp - The component to be added.
- constraints - A string object indicating the position of
the specified component.
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 target)
- Calculates the minmum size dimensions for the specified
panel given the components in the specified parent container.
- Parameters:
- target - The component to be laid out.
preferredLayoutSize
public Dimension preferredLayoutSize(Container target)
- Calculates the preferred size dimensions for the specified
panel given the components in the specified parent container.
- Parameters:
- target - The component to be laid out.
layoutContainer
public void layoutContainer(Container target)
- Lays out the container in the specified panel.
- Parameters:
- target - The component which needs to be laid out.
maximumLayoutSize
public Dimension maximumLayoutSize(Container target)
- Returns the maximum size of this component.
- Parameters:
- target - 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 target)
- Invalidates the layout, indicating that if the layout maanager has
cached information it should be discarded.
- Parameters:
- target - The parent container.
All Packages Class Hierarchy This Package Previous Next Index