|
JAPI 0_6-alpha-2 Yet another Java API API Documentation |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.BorderLayout
net.sf.japi.swing.ToolBarLayout
public class ToolBarLayout
A LayoutManager that manages a layout of a Container similar to BorderLayout but with an important difference, it is possible to
add as many components to a side layout region as you want. The desired purpose is to serve as LayoutManager for containers that shall contain
toolbars. So this is a LayoutManager you always were looking for.
BorderLayout. JToolBar's UI (BasicToolBarUI) directly looks for some features of the class BorderLayout, and if it is not BorderLayout,
it uses some defaults.
This class has been developed to make these defaults work as good as possible.
Though this class doesn't technically replace BorderLayout - neither is this class a subclass of BorderLayout nor does it provide
all methods BorderLayout does - it still does practically.
The constant values BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST, BorderLayout.WEST and BorderLayout.CENTER are references to those of BorderLayout.
The behaviour of BorderLayout.CENTER is that of BorderLayout: only one component can be added, subsequently added components overried all
previously added.
The behaviour of BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST and BorderLayout.WEST differs from BorderLayout. The position and layout
behaviour is the same, with the slight difference that this LayoutManager is able to manage more than on single component in these four regions.
Subsequently added components are placed from the outer to the inner. The first added component is the outmost component of that region, the last
added component is the innermost component of that region. To place a component to the innermost level, simply add it to the same region again.
Placing a component another level than the innermost of its destination region is currently not supported but might well be supported in future.
There are four possible ways of specifying a constraint:
BorderLayoutToolBarLayout.ToolBarConstraintsToolBarLayout.ToolBarConstraints.RegionBorderLayout or it may
be a ToolBarLayout.ToolBarConstraints.
BorderLayout,
JToolBar,
Serialized FormBorderLayout does it., test ToolBarLayout.ToolBarConstraints and ToolBarLayout.ToolBarConstraints.Region| Nested Class Summary | |
|---|---|
static class |
ToolBarLayout.ToolBarConstraints
Class for ToolBarLayout constraints. |
| Field Summary |
|---|
| Fields inherited from class java.awt.BorderLayout |
|---|
AFTER_LAST_LINE, AFTER_LINE_ENDS, BEFORE_FIRST_LINE, BEFORE_LINE_BEGINS, CENTER, EAST, LINE_END, LINE_START, NORTH, PAGE_END, PAGE_START, SOUTH, WEST |
| Constructor Summary | |
|---|---|
ToolBarLayout()
Create a ToolBarLayout with zero gaps. |
|
ToolBarLayout(int hgap,
int vgap)
Create a TooLBarLayout. |
|
| Method Summary | |
|---|---|
void |
addLayoutComponent(Component comp,
Object constraints)
|
void |
addLayoutComponent(String name,
Component comp)
|
float |
getLayoutAlignmentX(Container parent)
|
float |
getLayoutAlignmentY(Container parent)
|
void |
invalidateLayout(Container target)
|
void |
layoutContainer(Container target)
|
Dimension |
maximumLayoutSize(Container target)
|
Dimension |
minimumLayoutSize(Container target)
|
Dimension |
preferredLayoutSize(Container target)
|
void |
removeLayoutComponent(Component comp)
|
String |
toString()
|
| Methods inherited from class java.awt.BorderLayout |
|---|
getConstraints, getHgap, getLayoutComponent, getLayoutComponent, getVgap, setHgap, setVgap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ToolBarLayout()
public ToolBarLayout(int hgap,
int vgap)
hgap - horizontal gap between componentsvgap - vertical gap between components| Method Detail |
|---|
public void addLayoutComponent(String name,
Component comp)
addLayoutComponent in interface LayoutManageraddLayoutComponent in class BorderLayout
public void addLayoutComponent(Component comp,
Object constraints)
addLayoutComponent in interface LayoutManager2addLayoutComponent in class BorderLayoutpublic float getLayoutAlignmentX(Container parent)
getLayoutAlignmentX in interface LayoutManager2getLayoutAlignmentX in class BorderLayoutpublic float getLayoutAlignmentY(Container parent)
getLayoutAlignmentY in interface LayoutManager2getLayoutAlignmentY in class BorderLayoutpublic void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2invalidateLayout in class BorderLayoutpublic void layoutContainer(Container target)
layoutContainer in interface LayoutManagerlayoutContainer in class BorderLayoutpublic Dimension maximumLayoutSize(Container target)
maximumLayoutSize in interface LayoutManager2maximumLayoutSize in class BorderLayoutpublic Dimension minimumLayoutSize(Container target)
minimumLayoutSize in interface LayoutManagerminimumLayoutSize in class BorderLayoutpublic Dimension preferredLayoutSize(Container target)
preferredLayoutSize in interface LayoutManagerpreferredLayoutSize in class BorderLayoutpublic void removeLayoutComponent(Component comp)
removeLayoutComponent in interface LayoutManagerremoveLayoutComponent in class BorderLayoutpublic String toString()
toString in class BorderLayout
|
JAPI Yet another Java API API Documentation |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||