All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.core.WizardConsoleLayout

java.lang.Object
   |
   +----com.sun.wizards.core.WizardConsoleLayout

public class WizardConsoleLayout
extends Object
implements LayoutManager2
WizardConsoleLayout is the layout manager that gives the WizardConsole its general appearence. This object divides the container into three sections.

Graphic of a simple wizard, illustrating the WizardConsole.

Here is the code for this applet:


 import java.applet.Applet;
 import java.awt.*;
 import com.sun.wizards.core.WizardConsoleLayout;
 public class Test extends Applet
 {
   public void init()
     {
       setLayout(new WizardConsoleLayout());
       Panel imagePanel = new Panel();
       imagePanel.setBackground(Color.red);
       Panel wizardPanel = new Panel();
       wizardPanel.setBackground(Color.white);
       Panel navigationPanel = new Panel();
       navigationPanel.setBackground(Color.blue);
       add(imagePanel, WizardConsoleLayout.IMAGE_PANEL);
       add(wizardPanel, WizardConsoleLayout.WIZARD_PANEL);
       add(navigationPanel, WizardConsoleLayout.NAVIGATION_PANEL);
     }
 }
 

The image area appears in red. The wizard panel area appears in white. The navigation area appears in blue. As the frame is resized the red area will grow/shrink only in the vertical direction, the white area will grow/shrink horizontally and vertically, and the blue area will grow/shrink only in the horizontal direction.


Variable Index

 o IMAGE_PANEL
The constraint used to add a component to the image area.
 o NAVIGATION_PANEL
The constraint used to add a component to the navigation area.
 o WIZARD_PANEL
The constraint used to add a component to the wizard area.

Constructor Index

 o WizardConsoleLayout()
Creates a WizardConsoleLayout object with the default image width, navigation height, horizontal gap, and vertical gap.
 o WizardConsoleLayout(int, int)
Creates a WizardConsoleLayout object with the specified image width and navigation height.
 o WizardConsoleLayout(int, int, int, int)
Creates a WizardConsoleLayout object with the specified image width, navigation height, horizontal gap, and vertical gap.

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 name 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 manager 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)
Calulates the minimum 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.

Variables

 o IMAGE_PANEL
 public static final String IMAGE_PANEL
The constraint used to add a component to the image area.

 o WIZARD_PANEL
 public static final String WIZARD_PANEL
The constraint used to add a component to the wizard area.

 o NAVIGATION_PANEL
 public static final String NAVIGATION_PANEL
The constraint used to add a component to the navigation area.

Constructors

 o WizardConsoleLayout
 public WizardConsoleLayout()
Creates a WizardConsoleLayout object with the default image width, navigation height, horizontal gap, and vertical gap.

 o WizardConsoleLayout
 public WizardConsoleLayout(int imageWidth,
                            int navigationHeight)
Creates a WizardConsoleLayout object with the specified image width and navigation height.

Parameters:
imageWidth - The desired width of the image area.
navigationHeight - The desired height of the navigation area.
 o WizardConsoleLayout
 public WizardConsoleLayout(int imageWidth,
                            int navigationHeight,
                            int hgap,
                            int vgap)
Creates a WizardConsoleLayout object with the specified image width, navigation height, horizontal gap, and vertical gap.

Parameters:
imageWidth - The desired width of the image area.
navigationHeight - The desired height of the navigation area.
hgap - The desired horizontal gap in pixels.
vgap - The desired vertical gap in pixels.

Methods

 o addLayoutComponent
 public void addLayoutComponent(String name,
                                Component comp)
Adds the specified component with the specified name to the layout.

Parameters:
name - The component name.
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.

Parameters:
comp - The component to be added.
constraints - where/how the 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)
Calulates the minimum size dimensions for the specified panel given the components in the specified parent container.

Parameters:
parent - The component to be laid out.
Returns:
The minimum size.
 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.
Returns:
The preferred size.
 o maximumLayoutSize
 public Dimension maximumLayoutSize(Container parent)
Returns the maximum size of this component.

Parameters:
parent - The parent container.
Returns:
The maximum size.
 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.

Parameters:
parent - The parent container.
Returns:
the horizontal alignment.
 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.

Parameters:
parent - The parent container.
Returns:
The vertical alignment.
 o invalidateLayout
 public void invalidateLayout(Container parent)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

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

All Packages  Class Hierarchy  This Package  Previous  Next  Index