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.
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.
-
IMAGE_PANEL
- The constraint used to add a component to the image
area.
-
NAVIGATION_PANEL
- The constraint used to add a component to the
navigation area.
-
WIZARD_PANEL
- The constraint used to add a component to the wizard
area.
-
WizardConsoleLayout()
- Creates a WizardConsoleLayout object with the default
image width, navigation height, horizontal gap, and
vertical gap.
-
WizardConsoleLayout(int, int)
- Creates a WizardConsoleLayout object with the specified
image width and navigation height.
-
WizardConsoleLayout(int, int, int, int)
- Creates a WizardConsoleLayout object with the specified
image width, navigation height, horizontal gap, and vertical gap.
-
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 name 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 manager
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)
- Calulates the minimum 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.
IMAGE_PANEL
public static final String IMAGE_PANEL
- The constraint used to add a component to the image
area.
WIZARD_PANEL
public static final String WIZARD_PANEL
- The constraint used to add a component to the wizard
area.
NAVIGATION_PANEL
public static final String NAVIGATION_PANEL
- The constraint used to add a component to the
navigation area.
WizardConsoleLayout
public WizardConsoleLayout()
- Creates a WizardConsoleLayout object with the default
image width, navigation height, horizontal gap, and
vertical gap.
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.
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.
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.
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.
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)
- 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.
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.
maximumLayoutSize
public Dimension maximumLayoutSize(Container parent)
- Returns the maximum size of this component.
- Parameters:
- parent - The parent container.
- Returns:
- The maximum size.
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.
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.
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.
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