|
Draw2d 3.9.0.201305060205 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.AbstractLayout
org.eclipse.draw2d.AbstractHintLayout
org.eclipse.draw2d.OrderedLayout
org.eclipse.draw2d.FlowLayout
public class FlowLayout
Lays out children in rows or columns, wrapping when the current row/column is filled. The aligment and spacing of rows in the parent can be configured. The aligment and spacing of children within a row can be configured.
Nested Class Summary | |
---|---|
protected class |
FlowLayout.WorkingData
Holds the necessary information for layout calculations. |
Field Summary | |
---|---|
static int |
ALIGN_LEFTTOP
Deprecated. Use OrderedLayout.ALIGN_TOPLEFT instead. |
static int |
ALIGN_RIGHTBOTTOM
Deprecated. Use OrderedLayout.ALIGN_BOTTOMRIGHT instead. |
protected FlowLayout.WorkingData |
data
|
protected boolean |
fill
Deprecated. Use OrderedLayout.setStretchMinorAxis(boolean) and
OrderedLayout.isStretchMinorAxis() instead. |
protected int |
majorAlignment
Deprecated. Use getMajorAlignment() and
setMajorAlignment(int) instead. |
protected int |
majorSpacing
Deprecated. Use getMajorSpacing() and
setMajorSpacing(int) instead. |
protected int |
minorSpacing
Deprecated. Use getMinorSpacing() and
setMinorSpacing(int) instead. |
Fields inherited from class org.eclipse.draw2d.OrderedLayout |
---|
ALIGN_BOTTOMRIGHT, ALIGN_CENTER, ALIGN_TOPLEFT, horizontal, HORIZONTAL, minorAlignment, transposer, VERTICAL |
Fields inherited from class org.eclipse.draw2d.AbstractLayout |
---|
isObservingVisibility, preferredSize |
Constructor Summary | |
---|---|
FlowLayout()
Constructs a FlowLayout with horizontal orientation. |
|
FlowLayout(boolean isHorizontal)
Constructs a FlowLayout whose orientation is given in the input. |
Method Summary | |
---|---|
protected Dimension |
calculatePreferredSize(IFigure container,
int wHint,
int hHint)
Calculates the preferred size of the given figure, using width and height hints. |
protected Dimension |
getChildSize(IFigure child,
int wHint,
int hHint)
Provides the given child's preferred size. |
protected int |
getDefaultOrientation()
Returns PositionConstants.HORIZONTAL by default. |
int |
getMajorAlignment()
Returns the alignment used for an entire row/column. |
int |
getMajorSpacing()
Returns the spacing in pixels to be used between children in the direction parallel to the layout's orientation. |
int |
getMinorSpacing()
Returns the spacing to be used between children within a row/column. |
protected void |
initRow()
Initializes the state of row data, which is internal to the layout process. |
protected void |
initVariables(IFigure parent)
Initializes state data for laying out children, based on the Figure given as input. |
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. |
boolean |
isStretchMinorAxis()
Overwritten to guarantee backwards compatibility with fill
field. |
void |
layout(IFigure parent)
Lays out the given figure. |
protected void |
layoutRow(IFigure parent)
Layouts one row of components. |
protected void |
setBoundsOfChild(IFigure parent,
IFigure child,
Rectangle bounds)
Sets the given bounds for the child figure input. |
void |
setMajorAlignment(int align)
Sets the alignment for an entire row/column within the parent figure. |
void |
setMajorSpacing(int n)
Sets the spacing in pixels to be used between children in the direction parallel to the layout's orientation. |
void |
setMinorSpacing(int n)
Sets the spacing to be used between children within a row/column. |
void |
setStretchMinorAxis(boolean value)
Overwritten to guarantee backwards compatibility with fill
field. |
Methods inherited from class org.eclipse.draw2d.OrderedLayout |
---|
getMinorAlignment, isHorizontal, setHorizontal, setMinorAlignment |
Methods inherited from class org.eclipse.draw2d.AbstractHintLayout |
---|
calculateMinimumSize, getMinimumSize, getPreferredSize, invalidate |
Methods inherited from class org.eclipse.draw2d.AbstractLayout |
---|
calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getPreferredSize, invalidate, isObservingVisibility, remove, setConstraint, setObserveVisibility |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ALIGN_LEFTTOP
OrderedLayout.ALIGN_TOPLEFT
instead.
public static final int ALIGN_RIGHTBOTTOM
OrderedLayout.ALIGN_BOTTOMRIGHT
instead.
protected FlowLayout.WorkingData data
protected boolean fill
OrderedLayout.setStretchMinorAxis(boolean)
and
OrderedLayout.isStretchMinorAxis()
instead.
protected int majorAlignment
getMajorAlignment()
and
setMajorAlignment(int)
instead.
protected int majorSpacing
getMajorSpacing()
and
setMajorSpacing(int)
instead.
protected int minorSpacing
getMinorSpacing()
and
setMinorSpacing(int)
instead.
Constructor Detail |
---|
public FlowLayout()
public FlowLayout(boolean isHorizontal)
isHorizontal
- true
if the layout should be horizontalMethod Detail |
---|
protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
AbstractLayout
calculatePreferredSize
in class AbstractLayout
container
- The figurewHint
- The width hinthHint
- The height hint
AbstractLayout.calculatePreferredSize(IFigure,
int, int)
protected Dimension getChildSize(IFigure child, int wHint, int hHint)
child
- the Figure whose preferred size needs to be calculatedwHint
- the width hinthHint
- the height hint
protected int getDefaultOrientation()
PositionConstants.HORIZONTAL
by default.
getDefaultOrientation
in class OrderedLayout
PositionConstants.HORIZONTAL
or
PositionConstants.VERTICAL
OrderedLayout.getDefaultOrientation()
public int getMajorAlignment()
Possible values are :
public int getMajorSpacing()
public int getMinorSpacing()
protected void initRow()
protected void initVariables(IFigure parent)
parent
- the parent figureprotected 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 boolean isStretchMinorAxis()
fill
field.
isStretchMinorAxis
in class OrderedLayout
OrderedLayout.isStretchMinorAxis()
public void layout(IFigure parent)
LayoutManager
parent
- The figureLayoutManager.layout(IFigure)
protected void layoutRow(IFigure parent)
parent
- the parent figureprotected void setBoundsOfChild(IFigure parent, IFigure child, Rectangle bounds)
parent
- the parent figurechild
- the child figurebounds
- the size of the child to be setpublic void setMajorAlignment(int align)
Possible values are :
align
- the major alignmentpublic void setMajorSpacing(int n)
n
- the major spacingpublic void setMinorSpacing(int n)
n
- the minor spacingpublic void setStretchMinorAxis(boolean value)
fill
field.
setStretchMinorAxis
in class OrderedLayout
value
- whether children should be stretched in the minor axis.OrderedLayout.setStretchMinorAxis(boolean)
|
Draw2d 3.9.0.201305060205 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |