Class DefaultLayouter
- java.lang.Object
-
- org.eclipse.gef.cloudio.internal.ui.layout.DefaultLayouter
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringX_AXIS_VARIATIONstatic java.lang.StringY_AXIS_VARIATION
-
Constructor Summary
Constructors Constructor Description DefaultLayouter(int i, int j)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PointgetInitialOffset(Word word, Rectangle cloudArea)Calculates the initial offset of the given word, within the bounds of the specified rectangle.booleanlayout(Point offset, Word word, Rectangle cloudArea, CloudMatrix mainTree)Tries to position the given word in the given area.voidsetOption(java.lang.String optionName, java.lang.Object object)Set Layouter-specific options.
-
-
-
Field Detail
-
X_AXIS_VARIATION
public static final java.lang.String X_AXIS_VARIATION
- See Also:
- Constant Field Values
-
Y_AXIS_VARIATION
public static final java.lang.String Y_AXIS_VARIATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInitialOffset
public Point getInitialOffset(Word word, Rectangle cloudArea)
Description copied from interface:ILayouterCalculates the initial offset of the given word, within the bounds of the specified rectangle. The layout algorithm will try to find a matching position around the initial offset.- Specified by:
getInitialOffsetin interfaceILayouter- Returns:
- the initial offset for the given word
-
layout
public boolean layout(Point offset, Word word, Rectangle cloudArea, CloudMatrix mainTree)
Tries to position the given word in the given area. First a start point is chosen, then theRectTreeof the word and the main area is used to detect whether the word can be placed at the given position, or not. If not, the current point is moved slightly in a spiral manner, similar to the approach of Wordle.
-
setOption
public void setOption(java.lang.String optionName, java.lang.Object object)Description copied from interface:ILayouterSet Layouter-specific options. SeeDefaultLayouteras an example.
-
-