All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.awt.NavigationLayout

java.lang.Object
   |
   +----com.sun.wizards.awt.NavigationLayout

public class NavigationLayout
extends Object
implements LayoutManager, LayoutManager2, Serializable
NavigationLayout is the layout manager for the WizardConsole navigation area.

    -----------------------------------------
    |            |                          |
    |            |                          |
    |            |                          |
    |            |                          |
    |            |                          |
    |            |                          |
    | Image      |        Tree              |
    |            |                          |
    |            |                          |
    |            |                          |
    |            |                          |
    |            |                          |
    -----------------------------------------
    |                                       |
    |          Navigation                   |
    -----------------------------------------
 

The Navigation panel has a fixed height, and the width will vary according to the width of the frame. The NavigationLayout will have 2 parts: a "Navigation" area and an "Action" area.

These parts will be separated by a small amount to give the user a sense of function separation.

The buttons placed in the navigation area will facilitate a navigation function. Examples are: "back", "next", and "finish".

The buttons placed in the action area will facilitate special actions that the software may have available. Examples are: "cancel", "exit", and "help".

Graphic of NavigationLayout displaying navigation and action 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 NavigationLayout());
       add(new Button("  Back  "), "Navigation");
       add(new Button("  Next  "), "Navigation");
       add(new Button("  Exit  "), "Action");
     }
 }
 


Constructor Index

 o NavigationLayout()
Creates a navigation layout with horizontal and vertical gaps of 5 pixels.
 o NavigationLayout(int, int)
Creates a navigation 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 NavigationLayout
 public NavigationLayout()
Creates a navigation layout with horizontal and vertical gaps of 5 pixels.

 o NavigationLayout
 public NavigationLayout(int hgap,
                         int vgap)
Creates a navigation 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: "Navigation" "Action" "Separator"

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: "Navigation", "Action", and "Separator".

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