com.smardec.asc.xmlbars.toolbar.layouts
Class ToolbarDockLayout
java.lang.Object
|
+--com.smardec.asc.xmlbars.toolbar.layouts.ToolbarDockLayout
- All Implemented Interfaces:
- java.awt.LayoutManager, java.awt.LayoutManager2
- public class ToolbarDockLayout
- extends java.lang.Object
- implements java.awt.LayoutManager, java.awt.LayoutManager2
ToolbarDockLayout is LayoutManager that provides layout management for dockable toolbars.
Sample usage 1:
// The following example demonstrates multiline dock style for file and view toolbars.
getContentPane().setLayout(new ToolbarDockLayout(this, ToolbarDockLayout.DOCK_STYLE_MULTILINE));
// Add file toolbar to the noth bounds. Toolbar is placed on the first row.
getContentPane().add(fileToolBar, new ToolBarDockConstraints(ToolBarDockConstraints.NORTH, 0, 0));
// Add view toolbar to the noth bounds. Toolbar is placed on the second row.
getContentPane().add(viewToolBar, new ToolBarDockConstraints(ToolBarDockConstraints.NORTH, 1, 0));
// Add main panel to the center
getContentPane().add(jPanelMain, ToolbarDockLayout.Center);
Sample usage 2:
// The following example demonstrates single line dock style for file and view toolbars.
getContentPane().setLayout(new ToolbarDockLayout(this, ToolbarDockLayout.DOCK_STYLE_SINGLE_LINE));
// Add file toolbar to the noth bounds. Toolbar is placed on the first row with row index 0.
getContentPane().add(fileToolBar, ToolbarDockLayout.North);
// Add view toolbar to the noth bounds. Toolbar is placed on the first row with row index 1.
getContentPane().add(viewToolBar, ToolbarDockLayout.North);
// Add main panel to the center
getContentPane().add(jPanelMain, ToolbarDockLayout.Center);
Field Summary |
static java.lang.String |
Center
The center layout constraint (middle of container). |
static int |
DOCK_STYLE_MULTILINE
Multiline dock style. |
static int |
DOCK_STYLE_SINGLE_LINE
Single line dock style. |
static int |
DOCK_STYLE_WRAPPING_MULTILINE
Wrapping multiline dock style. |
static java.lang.String |
East
The east layout constraint (right side of container). |
static int |
HORIZONTAL
Horizontal orientation. |
static int |
MAX_VALUE
The maximum value of index in row at which the toolbar is docked. |
static java.lang.String |
North
The north layout constraint (top of container). |
static java.lang.String |
South
The south layout constraint (bottom of container). |
static int |
VERTICAL
Vertical orientation. |
static java.lang.String |
West
The west layout constraint (left side of container). |
Method Summary |
int |
getHorizontalSpacing()
Returns the horizontal spacing between the content and the West and East docks. |
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 |
setHorizontalSpacing(int spacing)
Specifies the horizontal spacing between the content and the East and West docks. |
void |
setToolBarSpacing(int spacing)
Specifies the spacing between the toolbars at each dock. |
void |
setVerticalSpacing(int spacing)
Specifies 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 |
Methods inherited from interface java.awt.LayoutManager |
addLayoutComponent, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent |
Methods inherited from interface java.awt.LayoutManager2 |
addLayoutComponent, getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, maximumLayoutSize |
DOCK_STYLE_MULTILINE
public static final int DOCK_STYLE_MULTILINE
- Multiline dock style. Used for toolbars placement within several rows.
- See Also:
- Constant Field Values
DOCK_STYLE_WRAPPING_MULTILINE
public static final int DOCK_STYLE_WRAPPING_MULTILINE
- Wrapping multiline dock style. Used for toolbars placement within several rows,
but only if toolbars don't fit the bounds. If all toolbars fit the bounds it works like
DOCK_STYLE_SINGLE_LINE and the row constraint is ignored.
- See Also:
- ToolBarDockConstraints,
Constant Field Values
DOCK_STYLE_SINGLE_LINE
public static final int DOCK_STYLE_SINGLE_LINE
- Single line dock style. Used for toolbars placement within only one row and always ignore row constraint.
- See Also:
- ToolBarDockConstraints,
Constant Field Values
MAX_VALUE
public static final int MAX_VALUE
- The maximum value of index in row at which the toolbar is docked.
- See Also:
- Constant Field Values
HORIZONTAL
public static final int HORIZONTAL
- Horizontal orientation.
- See Also:
- Constant Field Values
VERTICAL
public static final int VERTICAL
- Vertical orientation.
- See Also:
- Constant Field Values
Center
public static final java.lang.String Center
- The center layout constraint (middle of container).
- See Also:
- Constant Field Values
North
public static final java.lang.String North
- The north layout constraint (top of container).
- See Also:
- Constant Field Values
South
public static final java.lang.String South
- The south layout constraint (bottom of container).
- See Also:
- Constant Field Values
West
public static final java.lang.String West
- The west layout constraint (left side of container).
- See Also:
- Constant Field Values
East
public static final java.lang.String East
- The east layout constraint (right side of container).
- See Also:
- Constant Field Values
ToolbarDockLayout
public ToolbarDockLayout(java.awt.Container target)
- Creates a ToolbarDockLayout for the specified container
with a default style: DOCK_STYLE_MULTILINE
- Parameters:
- target - the target container managed by this ToolbarDockLayout
- See Also:
- ToolbarDockLayout(java.awt.Container, int)
ToolbarDockLayout
public ToolbarDockLayout(java.awt.Container target,
int style)
- Creates a ToolbarDockLayout for the specified container with the specified layout style
(DOCK_STYLE_MULTILINE, DOCK_STYLE_WRAPPING_MULTILINE or DOCK_STYLE_SINGLE_LINE).
- Parameters:
- target - the target container managed by this ToolbarDockLayout
- style - dock style
getHorizontalSpacing
public int getHorizontalSpacing()
- Returns the horizontal spacing between the content and the West and East docks.
- Returns:
- the horizontal spacing between the content and the West and East docks.
- See Also:
- setHorizontalSpacing(int)
setHorizontalSpacing
public void setHorizontalSpacing(int spacing)
- Specifies the horizontal spacing between the content and the East and West docks. The default is
0 .
- Parameters:
- spacing - horizontal spacing between the content and the East and West docks.
- See Also:
- getHorizontalSpacing()
getVerticalSpacing
public int getVerticalSpacing()
- Returns the vertical spacing between the content and the North and South docks.
- Returns:
- the vertical spacing between the content and the North and South docks.
- See Also:
- setVerticalSpacing(int)
setVerticalSpacing
public void setVerticalSpacing(int spacing)
- Specifies the vertical spacing between the content and the North and South docks. The default is
0 .
- Parameters:
- spacing - vertical spacing between the content and the North and South docks.
- See Also:
- getVerticalSpacing()
setToolBarSpacing
public void setToolBarSpacing(int spacing)
- Specifies the spacing between the toolbars at each dock. The default is
1 .
- Parameters:
- spacing - spacing between the toolbars at each dock.
- See Also:
- getToolBarSpacing()
getToolBarSpacing
public int getToolBarSpacing()
- Returns the spacing between the toolbars at each dock.
- Returns:
- the spacing between the toolbars at each dock.
- See Also:
- setToolBarSpacing(int)
|