org.tigris.toolbar.layouts
Class DockLayout

java.lang.Object
  |
  +--org.tigris.toolbar.layouts.DockLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2

public class DockLayout
extends java.lang.Object
implements java.awt.LayoutManager, java.awt.LayoutManager2

Class providing layout management to control positions of docked toolbars.

Author:
Christopher Bach

Field Summary
static java.lang.String center
           
static int CENTER
           
static int CHAINING_STYLE
           
static java.lang.String east
           
static int EAST
           
static int HORIZONTAL
           
static int MAX
           
static java.lang.String north
           
static int NORTH
           
static java.lang.String south
           
static int SOUTH
           
static int STACKING_STYLE
           
static int VERTICAL
           
static java.lang.String west
           
static int WEST
           
static int WRAPPING_STYLE
           
 
Constructor Summary
DockLayout(java.awt.Container target)
          Creates a DockLayout for the specified container with a default wrapping style layout.
DockLayout(java.awt.Container target, int style)
          Creates a DockLayout for the specified container with the specified layout style (wrapping, stacking, or chaining).
 
Method Summary
 void addLayoutComponent(java.awt.Component component, java.lang.Object constraints)
          Adds the specified component to the layout.
 void addLayoutComponent(java.lang.String constraints, java.awt.Component component)
          Adds the specified component to the layout.
 int getHorizontalSpacing()
          Returns the horizontal spacing between the content and the west and east docks.
 float getLayoutAlignmentX(java.awt.Container target)
          Returns the alignment of this layout along the X-axis.
 float getLayoutAlignmentY(java.awt.Container target)
          Returns the alignment of this layout along the Y-axis.
 int getToolBarSpacing()
          Returns the spacing between the toolbars at each dock.
 int getVerticalSpacing()
          Returns the vertical spacing between the content and the north and south docks.
 void installDockBoundary(org.tigris.toolbar.layouts.DockBoundary boundary)
          Provided for those who wish to create their own DockBoundary implementation for functionality not available in the provided docking styles.
 void invalidateLayout(java.awt.Container target)
          Invalidates the layout.
 void layoutContainer(java.awt.Container target)
          Sets the sizes and locations of the specified container's subcomponents (docked toolbars and content).
 java.awt.Dimension maximumLayoutSize(java.awt.Container target)
          Determines the maximum dimensions of the specified container.
 java.awt.Dimension minimumLayoutSize(java.awt.Container target)
          Determines the minimum dimensions of the specified container.
 java.awt.Dimension preferredLayoutSize(java.awt.Container target)
          Determines the preferred dimensions of the specified container.
 void removeLayoutComponent(java.awt.Component component)
          Removes the specified component from the layout.
 void setHorizontalSpacing(int spacing)
          Sets the horizontal spacing between the content and the east and west docks.
 void setToolBarSpacing(int spacing)
          Sets the spacing between the toolbars at each dock.
 void setVerticalSpacing(int spacing)
          Sets the vertical spacing between the content and the north and south docks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHAINING_STYLE

public static final int CHAINING_STYLE
See Also:
Constant Field Values

WRAPPING_STYLE

public static final int WRAPPING_STYLE
See Also:
Constant Field Values

STACKING_STYLE

public static final int STACKING_STYLE
See Also:
Constant Field Values

MAX

public static final int MAX
See Also:
Constant Field Values

NORTH

public static final int NORTH
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

EAST

public static final int EAST
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
See Also:
Constant Field Values

north

public static final java.lang.String north
See Also:
Constant Field Values

south

public static final java.lang.String south
See Also:
Constant Field Values

east

public static final java.lang.String east
See Also:
Constant Field Values

west

public static final java.lang.String west
See Also:
Constant Field Values

center

public static final java.lang.String center
See Also:
Constant Field Values
Constructor Detail

DockLayout

public DockLayout(java.awt.Container target)
Creates a DockLayout for the specified container with a default wrapping style layout.


DockLayout

public DockLayout(java.awt.Container target,
                  int style)
Creates a DockLayout for the specified container with the specified layout style (wrapping, stacking, or chaining).

Method Detail

setHorizontalSpacing

public void setHorizontalSpacing(int spacing)
Sets the horizontal spacing between the content and the east and west docks.


setVerticalSpacing

public void setVerticalSpacing(int spacing)
Sets the vertical spacing between the content and the north and south docks.


setToolBarSpacing

public void setToolBarSpacing(int spacing)
Sets the spacing between the toolbars at each dock.


getHorizontalSpacing

public int getHorizontalSpacing()
Returns the horizontal spacing between the content and the west and east docks.


getVerticalSpacing

public int getVerticalSpacing()
Returns the vertical spacing between the content and the north and south docks.


getToolBarSpacing

public int getToolBarSpacing()
Returns the spacing between the toolbars at each dock.


installDockBoundary

public void installDockBoundary(org.tigris.toolbar.layouts.DockBoundary boundary)
Provided for those who wish to create their own DockBoundary implementation for functionality not available in the provided docking styles.


getLayoutAlignmentX

public float getLayoutAlignmentX(java.awt.Container target)
Returns the alignment of this layout along the X-axis.

Specified by:
getLayoutAlignmentX in interface java.awt.LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(java.awt.Container target)
Returns the alignment of this layout along the Y-axis.

Specified by:
getLayoutAlignmentY in interface java.awt.LayoutManager2

addLayoutComponent

public void addLayoutComponent(java.awt.Component component,
                               java.lang.Object constraints)
Adds the specified component to the layout. If the constraints object is a DockingConstraints instance, the parameters of this object will be used to determine the location of the component within the layout relative to components already added to the layout.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager2

addLayoutComponent

public void addLayoutComponent(java.lang.String constraints,
                               java.awt.Component component)
Adds the specified component to the layout. A JToolBar passed into this method will be docked at the edge specified by its associated ToolBarHandler unless the caller passes in an alternate edge as the constraint.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component component)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

invalidateLayout

public void invalidateLayout(java.awt.Container target)
Invalidates the layout.

Specified by:
invalidateLayout in interface java.awt.LayoutManager2

layoutContainer

public void layoutContainer(java.awt.Container target)
Sets the sizes and locations of the specified container's subcomponents (docked toolbars and content).

Specified by:
layoutContainer in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
Determines the preferred dimensions of the specified container.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
Determines the minimum dimensions of the specified container.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
Determines the maximum dimensions of the specified container.

Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2