|
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.router.polyline.PolylineLayoutStage
public class PolylineLayoutStage
Adds polyline segment to the orthogonal edge paths of a graph.
The current implementation only adds octilinear segments to all orthogonal edges (non-orthogonal edges are completely ignored).
Between two succeeding vertical and
horizontal segments, an octilinear segment is added whose length can be influenced by the
maximum non orthogonal segment ratio
and the
preferred polyline segment length
. The new octilinear segments
keep a minimum distance
between the edges and all nodes in the graph if possible.
Field Summary | |
---|---|
static byte |
ROUTE_ALL_EDGES
Sphere of action specifier. |
static byte |
ROUTE_EDGES_AT_SELECTED_NODES
Sphere of action specifier. |
static byte |
ROUTE_SELECTED_EDGES
Sphere of action specifier. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
PolylineLayoutStage()
|
|
PolylineLayoutStage(Layouter coreLayouter)
Initializes this layout stage with the given core layouter. |
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 |
getMaximumNonOrthogonalSegmentRatio()
Returns the maximum segment length ratio at each end of an orthogonal segment that may get converted into a (non-orthogonal) polyline segment. |
double |
getMinimalNodeToEdgeDistance()
Specifies the minimal distance between edges and node bounds. |
double |
getPreferredPolylineSegmentLength()
Returns the preferred segment length for (non-orthogonal) polyline segments. |
Object |
getSelectedEdgesDpKey()
Returns the data provider key used to look up the selected state of the edges of the graph to be laid out. |
Object |
getSelectedNodesDpKey()
Returns the data provider key used to look up the selected state of the nodes of the graph to be laid out. |
byte |
getSphereOfAction()
Determines the (sub-)set of edges to be routed polylinear. |
void |
setMaximumNonOrthogonalSegmentRatio(double ratio)
Sets the maximum segment length ratio at each end of an orthogonal segment that may get converted into a (non-orthogonal) polyline segment. |
void |
setMinimalNodeToEdgeDistance(double distance)
Specifies the minimal distance between edges and node bounds. |
void |
setPreferredPolylineSegmentLength(double length)
Sets the preferred segment length for (non-orthogonal) polyline segments. |
void |
setSelectedEdgesDpKey(Object selectedEdgesDpKey)
Specifies the data provider key used to look up the selected state of the edges of the graph to be laid out. |
void |
setSelectedNodesDpKey(Object key)
Specifies the data provider key used to look up the selected state of the nodes of the graph to be laid out. |
void |
setSphereOfAction(byte sphere)
Specifies the (sub-)set of edges to be routed polylinear. |
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 byte ROUTE_ALL_EDGES
setSphereOfAction(byte)
,
Constant Field Valuespublic static final byte ROUTE_SELECTED_EDGES
getSelectedEdgesDpKey()
.
Graph.addDataProvider(Object, y.base.DataProvider)
,
setSphereOfAction(byte)
,
Constant Field Valuespublic static final byte ROUTE_EDGES_AT_SELECTED_NODES
getSelectedNodesDpKey()
.
Graph.addDataProvider(Object, y.base.DataProvider)
,
setSphereOfAction(byte)
,
Constant Field ValuesConstructor Detail |
---|
public PolylineLayoutStage(Layouter coreLayouter)
coreLayouter
- The core layouter to wrap with this layout stage.public PolylineLayoutStage()
Method Detail |
---|
public Object getSelectedNodesDpKey()
Layouter.SELECTED_NODES
is used.
If the sphere of action is set to ROUTE_EDGES_AT_SELECTED_NODES
, only edges of selected nodes are routed
while all other edges are considered to have fixed routes.
setSphereOfAction(byte)
,
setSelectedNodesDpKey(Object)
public void setSelectedNodesDpKey(Object key)
Layouter.SELECTED_NODES
is used.
If the sphere of action is set to ROUTE_EDGES_AT_SELECTED_NODES
, only edges of selected nodes are routed
while all other edges are considered to have fixed routes.
IllegalArgumentException
- if the specified key is null
.key
- The data provider key for the node selection.getSphereOfAction()
,
getSelectedNodesDpKey()
public Object getSelectedEdgesDpKey()
Layouter.SELECTED_EDGES
is used.
If the sphere of action is set to ROUTE_SELECTED_EDGES
, only the selected keys are routed while all
other edges are considered to have fixed routes.
getSphereOfAction()
,
setSelectedEdgesDpKey(Object)
public void setSelectedEdgesDpKey(Object selectedEdgesDpKey)
Layouter.SELECTED_EDGES
is used.
If the sphere of action is set to ROUTE_SELECTED_EDGES
, only the selected keys are routed while all
other edges are considered to have fixed routes.
IllegalArgumentException
- if the specified key is null
.selectedEdgesDpKey
- The data provider key for the edge selection.getSphereOfAction()
,
getSelectedEdgesDpKey()
public void setSphereOfAction(byte sphere)
ROUTE_ALL_EDGES
.
IllegalArgumentException
- if the given argument is not one of the above constants.sphere
- One of ROUTE_SELECTED_EDGES
, ROUTE_EDGES_AT_SELECTED_NODES
, and
ROUTE_ALL_EDGES
.getSphereOfAction()
,
getSelectedEdgesDpKey()
,
getSelectedNodesDpKey()
public byte getSphereOfAction()
ROUTE_ALL_EDGES
.
ROUTE_SELECTED_EDGES
, ROUTE_EDGES_AT_SELECTED_NODES
, and
ROUTE_ALL_EDGES
.setSphereOfAction(byte)
,
getSelectedEdgesDpKey()
,
getSelectedNodesDpKey()
public double getMinimalNodeToEdgeDistance()
public void setMinimalNodeToEdgeDistance(double distance)
IllegalArgumentException
- If distance is less than 0.distance
- The minimal distance between edges and node bounds.public double getMaximumNonOrthogonalSegmentRatio()
public void setMaximumNonOrthogonalSegmentRatio(double ratio)
IllegalArgumentException
- If the ratio is out of bounds.ratio
- The maximum polyline segment ratio at each end of an orthogonal segment. The ratio must be between 0
and 0.5.public double getPreferredPolylineSegmentLength()
public void setPreferredPolylineSegmentLength(double length)
IllegalArgumentException
- If length is less than 0.length
- The preferred segment length for (non-orthogonal) polyline segments.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 |