|
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.GraphLayoutLineWrapper
public class GraphLayoutLineWrapper
A layout stage that can be used to "line-wrap" or "column-wrap" a graph layout. This stage both supports wrapping a layout at a given width (height) or wrapping the layout at a specific width (height) automatically so that the overall resulting aspect ratio will be close to a specifiable value.
setFixedWidthLineBreaks(boolean)
,
setFixedWidth(double)
,
setTargetRatio(double)
,
setColumnMode(boolean)
Field Summary |
---|
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
GraphLayoutLineWrapper()
|
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Returns true iff the given graph can be laid
out by this algorithm. |
void |
doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. |
double |
getEdgeSpacing()
Returns the space between edges that should be used for the additional routing. |
double |
getFixedWidth()
Returns the desired width of the lines to use if setFixedWidthLineBreaks(boolean) is set to
true . |
double |
getSpacing()
Gets the space between adjacent lines of the wrapped graph layout. |
double |
getTargetRatio()
Gets the desired target aspect ratio the algorithm should try to generate. |
boolean |
isColumnMode()
Determines whether this algorithm should not wrap lines or rows, but columns. |
boolean |
isFixedWidthLineBreaks()
Returns whether the algorithm should use the fixed width
to determine line breaks. |
boolean |
isMirroringEnabled()
Returns whether lines should be going from left to right and right to left in an alternating fashion. |
void |
setColumnMode(boolean columnMode)
Sets whether this algorithm should not wrap lines or rows, but columns. |
void |
setEdgeSpacing(double edgeSpacing)
Sets the space between edges that should be used for the additional routing. |
void |
setFixedWidth(double fixedWidth)
Sets the desired width of the lines to use if setFixedWidthLineBreaks(boolean) is set to
true . |
void |
setFixedWidthLineBreaks(boolean fixedWidthLineBreaks)
Determines whether the algorithm should use the fixed width
to determine line breaks. |
void |
setMirroringEnabled(boolean mirroringEnabled)
Determines whether lines should be going from left to right and right to left in an alternating fashion. |
void |
setSpacing(double spacing)
Sets the space between adjacent lines of the wrapped graph layout. |
void |
setTargetRatio(double targetRatio)
Sets the desired target aspect ratio the algorithm should try to generate. |
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 |
Constructor Detail |
---|
public GraphLayoutLineWrapper()
Method Detail |
---|
public double getEdgeSpacing()
5
.
public void setEdgeSpacing(double edgeSpacing)
5
.
edgeSpacing
- The space between edges.public boolean isColumnMode()
true
, the layout will be wrapped vertically and new columns will
be appended to the right of the first column.
The setFixedWidth(double)
property will be interpreted as a fixed height, in that case, of course.
The default is false
.
public void setColumnMode(boolean columnMode)
true
, the layout will be wrapped vertically and new columns will
be appended to the right of the first column.
The setFixedWidth(double)
property will be interpreted as a fixed height, in that case, of course.
The default is false
.
columnMode
- whether to use a column wrapping mode instead of a row wrapping.public double getSpacing()
10
.
public void setSpacing(double spacing)
10
.
spacing
- the new space between the lines.public boolean isMirroringEnabled()
true
every second line will be rotated 180 degrees and
ports will be adjusted correspondingly.
The default is true
public boolean isFixedWidthLineBreaks()
fixed width
to determine line breaks.
The default is false
.
setFixedWidth(double)
,
setTargetRatio(double)
public void setFixedWidthLineBreaks(boolean fixedWidthLineBreaks)
fixed width
to determine line breaks.
The default is false
.
fixedWidthLineBreaks
- whether to use a fixed line width.setFixedWidth(double)
,
setTargetRatio(double)
public double getTargetRatio()
setFixedWidthLineBreaks(boolean)
is set to false
.
The default is 1.0d
.
width/height
.public void setTargetRatio(double targetRatio)
setFixedWidthLineBreaks(boolean)
is set to false
.
The default is 1.0d
.
targetRatio
- The desired target aspect ratio in terms of width/height
.public double getFixedWidth()
setFixedWidthLineBreaks(boolean)
is set to
true
.
Note that the algorithm will not necessarily be able to satisfy very small values since the nodes need to
fit into a line completely.
The default is 500
setFixedWidthLineBreaks(boolean)
public void setFixedWidth(double fixedWidth)
setFixedWidthLineBreaks(boolean)
is set to
true
.
Note that the algorithm will not necessarily be able to satisfy very small values since the nodes need to
fit into a line completely.
The default is 500
fixedWidth
- the width of the lines.setFixedWidthLineBreaks(boolean)
public void setMirroringEnabled(boolean mirroringEnabled)
true
every second line will be rotated 180 degrees and
ports will be adjusted correspondingly.
The default is true
mirroringEnabled
- Whether to rotate every second line by 180 degrees.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
.
public void doLayout(LayoutGraph graph)
Layouter
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |