|
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.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.
Field Summary | |
static int |
ALIGN_CENTER
Constant to specify components to be aligned in the center |
static int |
ALIGN_LEFTTOP
Constant to specify components to be aligned on the left/top |
static int |
ALIGN_RIGHTBOTTOM
Constant to specify components to be aligned on the right/bottom |
protected boolean |
fill
The property that determines whether leftover space at the end of a row/column should be filled by the last item in that row/column. |
protected boolean |
horizontal
The horizontal property. |
static boolean |
HORIZONTAL
Constant to specify components should be layed out horizontally |
protected int |
majorAlignment
The alignment along the major axis. |
protected int |
majorSpacing
The spacing along the major axis. |
protected int |
minorAlignment
The alignment along the minor axis. |
protected int |
minorSpacing
The spacing along the minor axis. |
protected Transposer |
transposer
The transposer used in converting horizontal layout to vertical. |
static boolean |
VERTICAL
Constant to specify components should be layed out vertically |
Fields inherited from class org.eclipse.draw2d.AbstractLayout |
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. |
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 |
getMinorAlignment()
Returns the alignment used for children within a row/column. |
int |
getMinorSpacing()
Returns the spacing to be used between children within a row/column |
boolean |
isHorizontal()
Returns true if 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. |
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 |
setHorizontal(boolean flag)
Sets the orientation of the layout. |
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 |
setMinorAlignment(int align)
Sets the alignment to be used within a row/column. |
void |
setMinorSpacing(int n)
Sets the spacing to be used between children within a row/column. |
void |
setStretchMinorAxis(boolean value)
Sets flag based on layout orientation. |
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, remove, setConstraint |
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_CENTER
public static final int ALIGN_LEFTTOP
public static final int ALIGN_RIGHTBOTTOM
public static final boolean HORIZONTAL
public static final boolean VERTICAL
protected boolean horizontal
protected boolean fill
protected Transposer transposer
protected int majorAlignment
protected int minorAlignment
protected int minorSpacing
protected int majorSpacing
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
public int getMajorAlignment()
Possible values are :
public int getMajorSpacing()
public int getMinorAlignment()
Possible values are :
public int getMinorSpacing()
public boolean isHorizontal()
true
if the orientation of the layout is horizontal.
true
if the orientation of the layout 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 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)
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 setStretchMinorAxis(boolean value)
value
- fill state desiredpublic void setHorizontal(boolean flag)
flag
- true
if this layout should be horizontalpublic void setMajorAlignment(int align)
Possible values are :
align
- the major alignmentpublic void setMajorSpacing(int n)
n
- the major spacingpublic void setMinorAlignment(int align)
Possible values are :
align
- the minor alignmentpublic void setMinorSpacing(int n)
n
- the minor spacing
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |