|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage y.layout.OrientationLayouter
public class OrientationLayouter
A layout stage that performs changes the orientation of the layout that another algorithm calculates.
For all CanonicMultiStageLayouter
s it is highly recommended to use
CanonicMultiStageLayouter.getOrientationLayouter()
for layout orientation changes and not to wrap
the CanonicMultiStageLayouter
with an OrientationLayouter
, which may cause unwanted
artifacts.
Nested Class Summary | |
---|---|
class |
OrientationLayouter.Transformer
Class that provides a method for transferring a point to its final position. |
Field Summary | |
---|---|
static int |
MIRROR_BOTTOM_TO_TOP
Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis. |
static int |
MIRROR_LEFT_TO_RIGHT
Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis. |
static int |
MIRROR_NONE
Constant that can be used to prevent any mirroring of layout orientations. |
static int |
MIRROR_RIGHT_TO_LEFT
Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis. |
static int |
MIRROR_TOP_TO_BOTTOM
Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at their corresponding axis. |
Fields inherited from interface y.layout.LayoutOrientation |
---|
BOTTOM_TO_TOP, LEFT_TO_RIGHT, RIGHT_TO_LEFT, TOP_TO_BOTTOM |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
OrientationLayouter()
Instantiates a new OrientationLayouter. |
|
OrientationLayouter(byte orientation)
Instantiates a new OrientationLayouter with a given orientation. |
|
OrientationLayouter(Layouter coreLayouter)
Instantiates a new OrientationLayouter. the core layout routine will be delegated to the given layouter. |
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Returns true iff the given graph can be laid
out by this algorithm. |
protected void |
completeOrientationChange(LayoutGraph graph)
Method that will be called after the core layouter has been activated. |
protected YPoint |
completeTransform(YPoint p)
Transforms a point for the completion phase. |
YInsets |
createOrientedInsets(Insets insets)
Deprecated. Use createOrientedInsets(y.geom.YInsets) instead. |
YInsets |
createOrientedInsets(YInsets insets)
Create and return an insets object that is a geometric transform of the given insets. |
YDimension |
createOrientedNodeSize(YDimension nodeSize)
Create and return an YDimension object that is a geometric transform of the given size. |
void |
doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. |
int |
getMirrorMask()
Returns the mirror mask, that defines which orientations this layouter shall mirror. |
byte |
getOrientation()
Returns the orientation of the layout. |
boolean |
isConsiderEdgeLabelsEnabled()
Returns whether or not the position of the edge labels should be changed during orientation change. |
boolean |
isHorizontalOrientation()
Returns whether or not the set orientation is a horizontal orientation, i.e. one of LayoutOrientation.LEFT_TO_RIGHT or
LayoutOrientation.RIGHT_TO_LEFT . |
boolean |
isOrientationMirrored(byte orientation)
This method will return whether the layouter will mirror the graph for a given layout orientation. |
protected void |
prepareOrientationChange(LayoutGraph graph)
Method that will be called before the core layouter gets activated. |
protected YPoint |
prepareTransform(YPoint p)
Transforms a point for the preparation phase. |
void |
setConsiderEdgeLabelsEnabled(boolean enabled)
Specifies whether or not the position of the edge labels should be changed during orientation change. |
void |
setMirrorMask(int mirrorMask)
Specifies the mirror mask, that defines which orientations this layouter shall mirror. |
void |
setOrientation(byte orientation)
Sets the orientation of the layout. |
protected YPoint |
transform(YPoint p,
boolean prepare)
Transforms a point for the preparation or completion phase. |
Methods inherited from class y.layout.AbstractLayoutStage |
---|
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MIRROR_NONE
public static final int MIRROR_TOP_TO_BOTTOM
public static final int MIRROR_RIGHT_TO_LEFT
public static final int MIRROR_BOTTOM_TO_TOP
public static final int MIRROR_LEFT_TO_RIGHT
Constructor Detail |
---|
public OrientationLayouter(Layouter coreLayouter)
public OrientationLayouter()
public OrientationLayouter(byte orientation)
setOrientation(byte)
Method Detail |
---|
public void setOrientation(byte orientation)
LayoutOrientation.TOP_TO_BOTTOM
is set.
orientation
- one of LayoutOrientation.TOP_TO_BOTTOM
,
LayoutOrientation.LEFT_TO_RIGHT
, LayoutOrientation.RIGHT_TO_LEFT
, and
LayoutOrientation.BOTTOM_TO_TOP
.public byte getOrientation()
setOrientation(byte)
public int getMirrorMask()
By default a mirror mask is set, where LayoutOrientation.BOTTOM_TO_TOP
, will be mirrored at the y-Axis.
MIRROR_BOTTOM_TO_TOP
,
MIRROR_LEFT_TO_RIGHT
,
MIRROR_RIGHT_TO_LEFT
,
MIRROR_TOP_TO_BOTTOM
public void setMirrorMask(int mirrorMask)
By default a mirror mask is set, where LayoutOrientation.BOTTOM_TO_TOP
, will be mirrored at the y-Axis.
mirrorMask
- the mask, that determines which layout orientations shall be mirrored.MIRROR_BOTTOM_TO_TOP
,
MIRROR_LEFT_TO_RIGHT
,
MIRROR_RIGHT_TO_LEFT
,
MIRROR_TOP_TO_BOTTOM
public boolean isHorizontalOrientation()
LayoutOrientation.LEFT_TO_RIGHT
or
LayoutOrientation.RIGHT_TO_LEFT
.
public boolean isConsiderEdgeLabelsEnabled()
true
.
true
if the position of the edge labels should be changed; false
otherwise.public void setConsiderEdgeLabelsEnabled(boolean enabled)
true
.
enabled
- true
if the position of the edge labels should be changed; false
otherwise.public boolean canLayout(LayoutGraph graph)
Layouter
true
iff the given graph can be laid
out by this algorithm. Calling doLayout
with
the given graph as its argument will only success if
this method returns true
.
canLayout
in interface Layouter
public void doLayout(LayoutGraph graph)
Layouter
doLayout
in interface Layouter
public boolean isOrientationMirrored(byte orientation)
orientation
- the layout orientation, for which to check the mirror state.
protected void prepareOrientationChange(LayoutGraph graph)
protected void completeOrientationChange(LayoutGraph graph)
prepareOrientationChange(LayoutGraph)
.
protected YPoint transform(YPoint p, boolean prepare)
prepare
- if true
then the transformation
is for the preparation phase, otherwise for the completion phase.prepareTransform(YPoint)
,
completeTransform(YPoint)
protected YPoint prepareTransform(YPoint p)
prepareOrientationChange(LayoutGraph)
protected YPoint completeTransform(YPoint p)
completeOrientationChange(LayoutGraph)
public YInsets createOrientedInsets(Insets insets)
createOrientedInsets(y.geom.YInsets)
instead.
public YInsets createOrientedInsets(YInsets insets)
public YDimension createOrientedNodeSize(YDimension nodeSize)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |