|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.AbstractLayout | +--org.eclipse.draw2d.AbstractHintLayout | +--org.eclipse.draw2d.ToolbarLayout
Arranges figures in a single row or column. Orientation can be set to produce either a row or column layout. This layout try to fit all children within the parent's client area. To do this, it compresses the children by some amount, but will not compress them smaller than their minimum size. If a child's preferred size is smaller than the row's or column's minor dimension, the layout can be configured to stretch the child.
Field Summary | |
static int |
ALIGN_BOTTOMRIGHT
|
static int |
ALIGN_CENTER
|
static int |
ALIGN_TOPLEFT
|
protected boolean |
horizontal
|
static boolean |
HORIZONTAL
|
protected boolean |
matchWidth
|
protected int |
minorAlignment
|
protected int |
spacing
|
protected Transposer |
transposer
|
static boolean |
VERTICAL
|
Fields inherited from class org.eclipse.draw2d.AbstractLayout |
preferredSize |
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 container,
int wHint,
int hHint)
Calculates the minimum size of the container based on the given hints. |
protected Dimension |
calculatePreferredSize(IFigure container,
int wHint,
int hHint)
Calculates the preferred size of the container based on the given hints. |
boolean |
isHorizontal()
Returns whether the orientation of the layout is horizontal. |
protected boolean |
isSensitiveHorizontally(IFigure parent)
Returns whether this layout manager is sensitive to changes in the horizontal hint. |
protected boolean |
isSensitiveVertically(IFigure parent)
Returns whether this layout manager is sensitive to changes in the vertical hint. |
void |
layout(IFigure parent)
Lays out the given figure. |
void |
setMatchWidth(boolean match)
Deprecated. use setStretchMinorAxis |
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 |
setStretchMinorAxis(boolean stretch)
Causes children that are smaller in the dimension of the minor axis to be stretched to fill the minor axis. |
void |
setVertical(boolean flag)
Sets the orientation of the children in the ToolbarLayout. |
Methods inherited from class org.eclipse.draw2d.AbstractHintLayout |
getMinimumSize, getPreferredSize, invalidate |
Methods inherited from class org.eclipse.draw2d.AbstractLayout |
calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, 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 int spacing
protected boolean matchWidth
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.
isHorizontal
- false(VERTICAL) will orient children vertically;
true(HORIZONTAL) will orient children horizontally.Method Detail |
public Dimension calculateMinimumSize(IFigure container, int wHint, int hHint)
calculateMinimumSize
in class AbstractHintLayout
container
- The IFigure whose minimum size has to be calculatedwHint
- The width hint (the desired width of the container)hHint
- The height hint (the desired height of the container)
AbstractHintLayout.getMinimumSize(IFigure, int, int)
protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
calculatePreferredSize
in class AbstractLayout
container
- The IFigure whose preferred size has to be calculatedwHint
- The width hint (the desired width of the container)hHint
- The height hint (the desired height of the container)
AbstractHintLayout.getPreferredSize(IFigure, int, int)
public boolean isHorizontal()
true
if the orientation is horizontalprotected boolean isSensitiveHorizontally(IFigure parent)
AbstractHintLayout
true
.
isSensitiveHorizontally
in class AbstractHintLayout
parent
- the layout's container
true
if this layout is sensite to horizontal hint changesorg.eclipse.draw2d.AbstractHintLayout#isSensitiveHorizontally()
protected boolean isSensitiveVertically(IFigure parent)
AbstractHintLayout
true
.
isSensitiveVertically
in class AbstractHintLayout
parent
- the layout's container
true
if this layout is sensite to vertical hint changesorg.eclipse.draw2d.AbstractHintLayout#isSensitiveVertically()
public void layout(IFigure parent)
LayoutManager
parent
- The figureLayoutManager.layout(IFigure)
public 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 setStretchMinorAxis(boolean stretch)
stretch
- whether to stretch childrenpublic void setVertical(boolean flag)
flag
- true
sets orientation to vertical
false
sets oreintation to horizontal
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |