|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.smardec.asc.xmlbars.toolbar.layouts.ToolbarDockLayout
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). |
Constructor Summary | |
ToolbarDockLayout(java.awt.Container target)
Creates a ToolbarDockLayout for the specified container with a default style: DOCK_STYLE_MULTILINE |
|
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 ). |
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 |
Field Detail |
public static final int DOCK_STYLE_MULTILINE
public static final int DOCK_STYLE_WRAPPING_MULTILINE
DOCK_STYLE_SINGLE_LINE
and the row constraint is ignored.
ToolBarDockConstraints
,
Constant Field Valuespublic static final int DOCK_STYLE_SINGLE_LINE
ToolBarDockConstraints
,
Constant Field Valuespublic static final int MAX_VALUE
public static final int HORIZONTAL
public static final int VERTICAL
public static final java.lang.String Center
public static final java.lang.String North
public static final java.lang.String South
public static final java.lang.String West
public static final java.lang.String East
Constructor Detail |
public ToolbarDockLayout(java.awt.Container target)
DOCK_STYLE_MULTILINE
target
- the target container managed by this ToolbarDockLayoutToolbarDockLayout(java.awt.Container, int)
public ToolbarDockLayout(java.awt.Container target, int style)
DOCK_STYLE_MULTILINE
, DOCK_STYLE_WRAPPING_MULTILINE
or DOCK_STYLE_SINGLE_LINE
).
target
- the target container managed by this ToolbarDockLayoutstyle
- dock styleMethod Detail |
public int getHorizontalSpacing()
setHorizontalSpacing(int)
public void setHorizontalSpacing(int spacing)
0
.
spacing
- horizontal spacing between the content and the East and West docks.getHorizontalSpacing()
public int getVerticalSpacing()
setVerticalSpacing(int)
public void setVerticalSpacing(int spacing)
0
.
spacing
- vertical spacing between the content and the North and South docks.getVerticalSpacing()
public void setToolBarSpacing(int spacing)
1
.
spacing
- spacing between the toolbars at each dock.getToolBarSpacing()
public int getToolBarSpacing()
setToolBarSpacing(int)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |