|
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.StraightLineEdgeRouter
public class StraightLineEdgeRouter
This edge routing algorithm routes edges as straight-lines considering the specified PortConstraints.
The edges connect to their ports with straight-lines. This may lead to edges crossing nodes.
StraightLineEdgeRouter will first invoke the AbstractLayoutStage.getCoreLayouter() if one exists. Then, it will remove
all bends from the edges and will place the ports either on the center of the nodes or at a location specified by a
PortConstraint.

| Field Summary | |
|---|---|
static byte |
ROUTE_ALL_EDGES
A scope specifier which defines that all edges of the input graph will be routed. |
static byte |
ROUTE_EDGES_AT_SELECTED_NODES
A scope specifier which defines that only edges incident to selected nodes will be routed. |
static byte |
ROUTE_SELECTED_EDGES
A scope specifier which defines that only the selected edges of the input graph will be routed. |
| Fields inherited from interface y.layout.Layouter |
|---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
| Constructor Summary | |
|---|---|
StraightLineEdgeRouter()
Creates a new instance of StraightLineEdgeRouter with default settings. |
|
StraightLineEdgeRouter(Layouter core)
Creates a new instance of StraightLineEdgeRouter using the given
core layout algorithm. |
|
| Method Summary | |
|---|---|
boolean |
canLayout(LayoutGraph graph)
Accepts all graphs that are accepted by the core layout algorithm. |
void |
doLayout(LayoutGraph graph)
Routes the edges as straight-lines from their source to their target after invoking the core layout algorithm. |
java.lang.Object |
getSelectedEdgesDpKey()
Returns the key to register a DataProvider that provides the selected state of the edges of the graph. |
java.lang.Object |
getSelectedNodesDpKey()
Returns the key to register a DataProvider that provides the selected state of the nodes of the graph. |
byte |
getSphereOfAction()
Returns the (sub-)set of edges to be routed. |
void |
setSelectedEdgesDpKey(java.lang.Object selectedEdgesDpKey)
Specifies the key to register a DataProvider that provides the selected state of the edges of the graph. |
void |
setSelectedNodesDpKey(java.lang.Object key)
Specifies the key to register a DataProvider that provides the selected state of the nodes of the graph. |
void |
setSphereOfAction(byte scope)
Specifies the (sub-)set of edges to be routed. |
| 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 StraightLineEdgeRouter(Layouter core)
StraightLineEdgeRouter using the given
core layout algorithm.
core - the core layout algorithmpublic StraightLineEdgeRouter()
StraightLineEdgeRouter with default settings.
| Method Detail |
|---|
public byte getSphereOfAction()
StraightLineEdgeRouter will only route those edges and leave the remaining edges unchanged.
setSphereOfAction(byte),
getSelectedEdgesDpKey(),
getSelectedNodesDpKey()public void setSphereOfAction(byte scope)
StraightLineEdgeRouter will only route those edges and leave the remaining edges unchanged.
ROUTE_ALL_EDGESscope - one of the valid scope specifiers
java.lang.IllegalArgumentException - if the given argument is an unknown specifiergetSelectedEdgesDpKey(),
getSelectedNodesDpKey()public java.lang.Object getSelectedNodesDpKey()
DataProvider that provides the selected state of the nodes of the graph.
If the scope only includes edges at selected nodes, only edges of the
nodes marked in this DataProvider are routed while all other edges are considered to have fixed routes.
DataProvider for the node selectionsetSelectedNodesDpKey(Object),
getSphereOfAction()public void setSelectedNodesDpKey(java.lang.Object key)
DataProvider that provides the selected state of the nodes of the graph.
If the scope only includes edges at selected nodes, only edges of the
nodes marked in this DataProvider are routed while all other edges are considered to have fixed routes.
Layouter.SELECTED_NODESkey - the key to register a DataProvider for the node selection
java.lang.IllegalArgumentException - if the specified key is nullgetSelectedNodesDpKey(),
getSphereOfAction()public java.lang.Object getSelectedEdgesDpKey()
DataProvider that provides the selected state of the edges of the graph.
If the scope only includes selected edges, only edges of the nodes marked in this
DataProvider are routed while all other edges are considered to have fixed routes.
DataProvider for the edge selectionsetSelectedEdgesDpKey(Object),
getSphereOfAction()public void setSelectedEdgesDpKey(java.lang.Object selectedEdgesDpKey)
DataProvider that provides the selected state of the edges of the graph.
If the scope only includes selected edges, only edges of the nodes marked in this
DataProvider are routed while all other edges are considered to have fixed routes.
Layouter.SELECTED_EDGESselectedEdgesDpKey - the key to register a DataProvider for the edge selection
java.lang.IllegalArgumentException - if the specified key is nullgetSelectedEdgesDpKey(),
getSphereOfAction()public boolean canLayout(LayoutGraph graph)
core layout algorithm.
graph - the input graph
true if there is no core layout algorithm or the core layout algorithm can handle the given
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 | ||||||||