|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.eclipse.draw2d.AbstractLayout
|
+--org.eclipse.draw2d.ToolbarLayout
Layout manager that provides toolbar-like behavior. When horizontally oriented, children will be placed horizontally adjacent to each other. When vertically oriented, children will be placed vertically adjacent to each other. In each case, children will be separated by the number of pixels specified with the setSpacing(int) method. If the field matchWidth is set to true, horizontally oriented children will stretch themselves vertically to fit available height. Vertically oriented children will stretch themselves horizontally to fit available width. Children will be stretched (or shrunk) in both horizontal and vertical directions upon resize until maximum or minimum sizes are reached.
| Field Summary | |
static int |
ALIGN_BOTTOMRIGHT
|
static int |
ALIGN_CENTER
|
static int |
ALIGN_TOPLEFT
|
protected boolean |
horizontal
|
static boolean |
HORIZONTAL
|
protected int |
minorAlignment
|
protected Transposer |
transposer
|
static boolean |
VERTICAL
|
| Constructor Summary | |
ToolbarLayout()
Constructs a vertically oriented ToolbarLayout with child spacing of 0 pixels, matchWidth true, and
ALIGN_TOPLEFT alignment. |
|
ToolbarLayout(boolean isHorizontal)
Constructs a ToolbarLayout with a specified orientation. |
|
| Method Summary | |
Dimension |
calculateMinimumSize(IFigure parent)
Calculates and returns the minimum size of the container given as input. |
protected Dimension |
calculatePreferredSize(IFigure parent)
Calculates and returns the preferred size of the container given as input. |
Dimension |
getMinimumSize(IFigure container)
Returns the minimum size of the given figure. |
void |
invalidate()
Removes all cached information for all figures this LayoutManager is responsible for. |
boolean |
isHorizontal()
Returns whether the orientation of the layout is horizontal or not. |
void |
layout(IFigure parent)
Lays out the given figure. |
void |
setMatchWidth(boolean match)
Sets children's width (if vertically oriented) or height (if horizontally oriented) to stretch with their container |
void |
setMinorAlignment(int align)
Sets the alignment of the children contained in the layout. |
void |
setSpacing(int space)
Sets the amount of space between children |
void |
setVertical(boolean flag)
Sets the orientation of the children in the ToolbarLayout. |
| Methods inherited from class org.eclipse.draw2d.AbstractLayout |
calculatePreferredSize, getBorderPreferredSize, getConstraint, getPreferredSize, getPreferredSize, invalidate, remove, setConstraint |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean horizontal
protected int minorAlignment
public static final int ALIGN_CENTER
public static final int ALIGN_TOPLEFT
public static final int ALIGN_BOTTOMRIGHT
public static final boolean HORIZONTAL
public static final boolean VERTICAL
protected Transposer transposer
| Constructor Detail |
public ToolbarLayout()
true, and
ALIGN_TOPLEFT alignment.public ToolbarLayout(boolean isHorizontal)
false,
and ALIGN_TOPLEFT alignment.isHorizonal - false(VERTICAL) will orient children
vertically
true(HORIZONTAL) will orient children
horizontally.| Method Detail |
public Dimension calculateMinimumSize(IFigure parent)
figure - Figure whose preferred size is required.public Dimension getMinimumSize(IFigure container)
AbstractLayoutgetMinimumSize in class AbstractLayoutpublic void invalidate()
AbstractLayoutinvalidate in class AbstractLayoutprotected Dimension calculatePreferredSize(IFigure parent)
calculatePreferredSize in class AbstractLayoutfigure - Figure whose preferred size is required.public boolean isHorizontal()
public void layout(IFigure parent)
LayoutManagerpublic void setMinorAlignment(int align)
align - 0 (ALIGN_CENTER), 1 (ALIGN_TOPLEFT)
2 (ALIGN_BOTTOMRIGHT)public void setSpacing(int space)
space - The amount of space between children.public void setMatchWidth(boolean match)
match - true will stretch the children,
false will notpublic void setVertical(boolean flag)
flag - true sets orientation to vertical
false sets oreintation to horizontal
|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||