public class StraightLineEdgeRouter extends AbstractLayoutStage
PortConstraint
s.
StraightLineEdgeRouter
will first invoke the CoreLayout
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
.
Constructor and Description |
---|
StraightLineEdgeRouter()
Creates a new instance of
StraightLineEdgeRouter with an optional
core layout algorithm . |
StraightLineEdgeRouter(ILayoutAlgorithm core)
Creates a new instance of
StraightLineEdgeRouter with an optional
core layout algorithm . |
Modifier and Type | Method and Description |
---|---|
void |
applyLayout(LayoutGraph graph)
Routes the edges as straight-lines from their source to their target after invoking the
core layout algorithm . |
Object |
getAffectedEdgesDpKey()
Gets the key to register a
IDataProvider that provides the selected state of the edges of the graph. |
Object |
getAffectedNodesDpKey()
Gets the key to register a
IDataProvider that provides the selected state of the nodes of the graph. |
Scope |
getScope()
Gets the (sub-)set of edges to be routed.
|
void |
setAffectedEdgesDpKey(Object value)
Sets the key to register a
IDataProvider that provides the selected state of the edges of the graph. |
void |
setAffectedNodesDpKey(Object value)
Sets the key to register a
IDataProvider that provides the selected state of the nodes of the graph. |
void |
setScope(Scope value)
Sets the (sub-)set of edges to be routed.
|
applyLayoutCore, getCoreLayout, setCoreLayout
public StraightLineEdgeRouter()
StraightLineEdgeRouter
with an optional
core layout algorithm
.public StraightLineEdgeRouter(ILayoutAlgorithm core)
StraightLineEdgeRouter
with an optional
core layout algorithm
.core
- The core layout algorithm.public void applyLayout(LayoutGraph graph)
core layout algorithm
.applyLayout
in interface ILayoutAlgorithm
applyLayout
in class AbstractLayoutStage
graph
- the input graphpublic Object getAffectedEdgesDpKey()
IDataProvider
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 IDataProvider
are routed while all other edges are considered to have fixed routes.
IllegalArgumentException
- if the specified key is null
IDataProvider
for the edge selectiongetScope()
,
setAffectedEdgesDpKey(Object)
public Object getAffectedNodesDpKey()
IDataProvider
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 IDataProvider
are routed while all other edges are considered to have fixed routes.
IllegalArgumentException
- if the specified key is null
LayoutKeys.AFFECTED_NODES_DPKEY
IDataProvider
for the node selectiongetScope()
,
setAffectedNodesDpKey(Object)
public Scope getScope()
StraightLineEdgeRouter
will only route those edges and leave the remaining edges unchanged.
IllegalArgumentException
- if the given argument is an unknown specifierScope.ROUTE_ALL_EDGES
getAffectedEdgesDpKey()
,
getAffectedNodesDpKey()
,
setScope(Scope)
public void setAffectedEdgesDpKey(Object value)
IDataProvider
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 IDataProvider
are routed while all other edges are considered to have fixed routes.
IllegalArgumentException
- if the specified key is null
value
- the key to register a IDataProvider
for the edge selectiongetScope()
,
getAffectedEdgesDpKey()
public void setAffectedNodesDpKey(Object value)
IDataProvider
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 IDataProvider
are routed while all other edges are considered to have fixed routes.
IllegalArgumentException
- if the specified key is null
LayoutKeys.AFFECTED_NODES_DPKEY
value
- the key to register a IDataProvider
for the node selectiongetScope()
,
getAffectedNodesDpKey()
public void setScope(Scope value)
StraightLineEdgeRouter
will only route those edges and leave the remaining edges unchanged.
IllegalArgumentException
- if the given argument is an unknown specifierScope.ROUTE_ALL_EDGES
value
- one of the valid scope specifiersgetAffectedEdgesDpKey()
,
getAffectedNodesDpKey()
,
getScope()