|
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 tries 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
Constant for bottom-right alignment |
static int |
ALIGN_CENTER
Constant for center alignment |
static int |
ALIGN_TOPLEFT
Constant for top-left alignment |
protected boolean |
horizontal
Orientation of layout |
static boolean |
HORIZONTAL
Constant for horizontal alignment |
protected boolean |
matchWidth
Sets whether children should "stretch" with their container |
protected int |
minorAlignment
Alignment of layout |
protected int |
spacing
Space in pixels between Figures |
protected Transposer |
transposer
Transposer object used in layout calculations |
static boolean |
VERTICAL
Constant for vertical alignment |
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. |
int |
getMinorAlignment()
Returns the minor aligment of the layout. |
int |
getSpacing()
|
boolean |
getStretchMinorAxis()
Returns true if stretch minor axis has been enabled. |
boolean |
isHorizontal()
|
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(boolean) |
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
- whether the children are oriented horizontallyMethod Detail |
public Dimension calculateMinimumSize(IFigure container, int wHint, int hHint)
calculateMinimumSize
in class AbstractHintLayout
container
- the figure 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 figure 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 int getMinorAlignment()
public int getSpacing()
public boolean getStretchMinorAxis()
true
if stretch minor axis has been enabled. The default value is
false.
true
if stretch minor axis is enabledpublic boolean isHorizontal()
protected boolean isSensitiveHorizontally(IFigure parent)
AbstractHintLayout
true
.
isSensitiveHorizontally
in class AbstractHintLayout
parent
- the layout's container
true
if this layout is sensite to horizontal hint changesAbstractHintLayout.isSensitiveHorizontally(IFigure)
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 changesAbstractHintLayout.isSensitiveVertically(IFigure)
public void layout(IFigure parent)
LayoutManager
parent
- The figureLayoutManager.layout(IFigure)
public void setMinorAlignment(int align)
ALIGN_CENTER
, ALIGN_BOTTOMRIGHT
and ALIGN_TOPLEFT
.
align
- the minor alignmentpublic void setSpacing(int space)
space
- the amount of space between childrenpublic void setMatchWidth(boolean match)
setStretchMinorAxis(boolean)
match
- whether to stretch childrenpublic void setStretchMinorAxis(boolean stretch)
stretch
- whether to stretch childrenpublic void setVertical(boolean flag)
flag
- whether the orientation should be vertical
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |