|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.AbstractLayoutStage
y.layout.router.polyline.PolylineLayoutStage
public class PolylineLayoutStage
PolylineLayoutStage extends the orthogonal edge paths with polyline segments.
The current implementation only adds octilinear segments to all orthogonal edges. Non-orthogonal edges are completely
ignored.
An octilinear segment is added between two consecutive vertical and horizontal segments. The length of an octilinear
segment can be influenced by the maximum non-orthogonal segment ratio
and the preferred polyline segment length. The new octilinear
segments maintain a minimum distance between the edges and all nodes in
the graph if possible.
![]() |
![]() |
| Field Summary | |
|---|---|
static byte |
ROUTE_ALL_EDGES
A scope specifier which defines that all edges of the input graph will be adjusted. |
static byte |
ROUTE_EDGES_AT_SELECTED_NODES
A scope specifier which defines that only edges incident to selected nodes will be adjusted. |
static byte |
ROUTE_SELECTED_EDGES
A scope specifier which defines that only the selected edges of the input graph will be adjusted. |
| Fields inherited from interface y.layout.Layouter |
|---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
| Constructor Summary | |
|---|---|
PolylineLayoutStage()
Creates a new instance of PolylineLayoutStage with default settings. |
|
PolylineLayoutStage(Layouter coreLayouter)
Creates a new instance of PolylineLayoutStage using the given
core layout algorithm. |
|
| Method Summary | |
|---|---|
boolean |
canLayout(LayoutGraph graph)
Accepts all graphs that can be handled by the core layout algorithm. |
void |
doLayout(LayoutGraph graph)
Adds polyline segments to the edge routes produced by the core layout algorithm. |
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()
Returns the minimum distance between edges and node bounds. |
double |
getPreferredPolylineSegmentLength()
Returns the preferred segment length for (non-orthogonal) polyline segments. |
java.lang.Object |
getSelectedEdgesDpKey()
Returns the DataProvider key used for looking up the selected state of the edges of the graph to be laid out. |
java.lang.Object |
getSelectedNodesDpKey()
Returns the DataProvider key used for looking up the selected state of the nodes of the graph to be laid out. |
byte |
getSphereOfAction()
Returns the (sub-)set of edges to be routed in a polyline fashion. |
void |
setMaximumNonOrthogonalSegmentRatio(double ratio)
Specifies 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 minimum distance between edges and node bounds. |
void |
setPreferredPolylineSegmentLength(double length)
Specifies the preferred segment length for (non-orthogonal) polyline segments. |
void |
setSelectedEdgesDpKey(java.lang.Object selectedEdgesDpKey)
Specifies the DataProvider key used for looking up the selected state of the edges of the graph to be laid out. |
void |
setSelectedNodesDpKey(java.lang.Object key)
Specifies the DataProvider key used for looking up the selected state of the nodes of the graph to be laid out. |
void |
setSphereOfAction(byte scope)
Specifies the (sub-)set of edges to be routed in a polyline fashion. |
| 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
The selection state of an edge is determined by a boolean value returned
by a DataProvider registered with key getSelectedEdgesDpKey().
All other non-selected edges will be considered to have fixed routes.
setSphereOfAction(byte),
setSelectedEdgesDpKey(Object),
Constant Field Valuespublic static final byte ROUTE_EDGES_AT_SELECTED_NODES
The selection state of a node is determined by a boolean value returned
by a DataProvider registered with key getSelectedNodesDpKey().
All other edges that are incident to non-selected nodes will be considered to have fixed routes.
setSphereOfAction(byte),
setSelectedNodesDpKey(Object),
Constant Field Values| Constructor Detail |
|---|
public PolylineLayoutStage(Layouter coreLayouter)
PolylineLayoutStage using the given
core layout algorithm.
coreLayouter - the core layout routinepublic PolylineLayoutStage()
PolylineLayoutStage with default settings.
| Method Detail |
|---|
public java.lang.Object getSelectedNodesDpKey()
DataProvider key used for looking up the selected state of the nodes of the graph to be laid out.
If the scope 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.
DataProvider key for the node selectionsetSelectedNodesDpKey(Object),
getSphereOfAction()public void setSelectedNodesDpKey(java.lang.Object key)
DataProvider key used for looking up the selected state of the nodes of the graph to be laid out.
If the scope 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.
Layouter.SELECTED_NODESkey - the DataProvider key for the node selection
java.lang.IllegalArgumentException - if the specified key is nullgetSelectedNodesDpKey(),
getSphereOfAction()public java.lang.Object getSelectedEdgesDpKey()
DataProvider key used for looking up the selected state of the edges of the graph to be laid out.
If the scope is set to ROUTE_SELECTED_EDGES, only the
selected edges are routed, while all other edges are considered to have fixed routes.
DataProvider key for the edge selectionsetSelectedEdgesDpKey(Object),
getSphereOfAction()public void setSelectedEdgesDpKey(java.lang.Object selectedEdgesDpKey)
DataProvider key used for looking up the selected state of the edges of the graph to be laid out.
If the scope is set to ROUTE_SELECTED_EDGES, only the
selected edges are routed, while all other edges are considered to have fixed routes.
Layouter.SELECTED_EDGESselectedEdgesDpKey - the DataProvider key for the edge selection
java.lang.IllegalArgumentException - if the specified key is nullgetSelectedEdgesDpKey(),
getSphereOfAction()public void setSphereOfAction(byte scope)
ROUTE_ALL_EDGES. All edges are routed.scope - one of the default scope values
java.lang.IllegalArgumentException - if the given argument is none of the predefined scope valuesgetSelectedEdgesDpKey(),
getSelectedNodesDpKey()public byte getSphereOfAction()
getSelectedEdgesDpKey(),
getSelectedNodesDpKey(),
setSphereOfAction(byte)public double getMinimalNodeToEdgeDistance()
Values should be greater than or equal to 0.
setMinimalNodeToEdgeDistance(double)public void setMinimalNodeToEdgeDistance(double distance)
Values should be greater than or equal to 0.
distance - the minimum distance between edges and node bounds
java.lang.IllegalArgumentException - if the distance is negativepublic double getMaximumNonOrthogonalSegmentRatio()
The ratio must be between 0 and 0.5.
[0,0.5]setMaximumNonOrthogonalSegmentRatio(double)public void setMaximumNonOrthogonalSegmentRatio(double ratio)
The ratio must be between 0 and 0.5.
ratio - a value from the interval [0,0.5]
java.lang.IllegalArgumentException - if the ratio does not lie within [0,0.5] intervalpublic double getPreferredPolylineSegmentLength()
Values should be greater than or equal to 0.
setPreferredPolylineSegmentLength(double)public void setPreferredPolylineSegmentLength(double length)
Values should be greater than or equal to 0.
length - the preferred segment length for (non-orthogonal) polyline segments
java.lang.IllegalArgumentException - if the length is negativepublic boolean canLayout(LayoutGraph graph)
core layout algorithm.
If there is no core layout algorithm, all graphs are accepted.
graph - the input graph
true if there is no core layout algorithm or the core layout algorithm accepts the graph,
false otherwiseLayouter.doLayout(LayoutGraph)public void doLayout(LayoutGraph graph)
core layout algorithm.
graph - the input graphLayouter.canLayout(LayoutGraph)
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||