|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.hierarchic.incremental.SelfloopCalculator
public class SelfloopCalculator
This class calculates bend points for self-loops routed in orthogonal or octilinear fashion.
It is used during the layout phase of HierarchicLayouter
, but can be used as a stand-alone tool.
Field Summary | |
---|---|
static java.lang.Object |
IS_OCTILINEAR_DPKEY
A DataProvider key for specifying whether or not an edge is octilinear
|
static java.lang.Object |
MINIMUM_EDGE_DISTANCE_DPKEY
A DataProvider key for specifying the minimum distance to the next edge or node side
|
static java.lang.Object |
MINIMUM_FIRST_SEGMENT_LENGTH_DPKEY
A DataProvider key for specifying the minimum length of the first segment of each edge
|
static java.lang.Object |
MINIMUM_LAST_SEGMENT_LENGTH_DPKEY
A DataProvider key for specifying the minimum length of the last segment of each edge
|
static java.lang.Object |
MINIMUM_NODE_DISTANCE_DPKEY
A DataProvider key for defining for each node a minimum distance to the self-loop edges
|
static java.lang.Object |
MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DPKEY
A DataProvider key for specifying the minimum length of the octilinear segments of an octilinear edge
|
Constructor Summary | |
---|---|
SelfloopCalculator(double minFirstSegmentLength,
double minEdgeDistance)
Creates a new instance of SelfloopCalculator using the given parameters. |
Method Summary | |
---|---|
void |
calculateSelfLoops(LayoutGraph graph,
Node node,
DataProvider spc,
DataProvider tpc)
Calculates all self-loops at the given node of the given input graph. |
void |
calculateSelfLoops(LayoutGraph graph,
Node node,
YList selfLoops,
DataProvider spc,
DataProvider tpc)
Convenience method that calculates a list of self-loops that belong to a given node. |
protected double |
getMinimumDistance(LayoutGraph graph,
Edge edge)
Returns the minimum length between two edges associated with the given edge. |
protected double |
getMinimumFirstSegmentLength(LayoutGraph graph,
Edge edge)
Returns the minimum length of the first segment of the given edge. |
protected double |
getMinimumLastSegmentLength(LayoutGraph graph,
Edge edge)
Returns the minimum length of the last segment of the given edge. |
protected double |
getMinimumNodeDistance(LayoutGraph graph,
Node node)
Returns the minimum distance between two nodes associated with the given node. |
protected double |
getMinimumOctilinearSegmentLength(LayoutGraph graph,
Edge edge)
Returns the minimum octilinear segment length of the given edge. |
protected boolean |
isOctilinearEdge(LayoutGraph graph,
Edge edge)
Returns whether or not the given edge is octilinear. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Object MINIMUM_NODE_DISTANCE_DPKEY
DataProvider
key for defining for each node a minimum distance to the self-loop edges
public static final java.lang.Object IS_OCTILINEAR_DPKEY
DataProvider
key for specifying whether or not an edge is octilinear
public static final java.lang.Object MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DPKEY
DataProvider
key for specifying the minimum length of the octilinear segments of an octilinear edge
public static final java.lang.Object MINIMUM_FIRST_SEGMENT_LENGTH_DPKEY
DataProvider
key for specifying the minimum length of the first segment of each edge
public static final java.lang.Object MINIMUM_LAST_SEGMENT_LENGTH_DPKEY
DataProvider
key for specifying the minimum length of the last segment of each edge
public static final java.lang.Object MINIMUM_EDGE_DISTANCE_DPKEY
DataProvider
key for specifying the minimum distance to the next edge or node side
Constructor Detail |
---|
public SelfloopCalculator(double minFirstSegmentLength, double minEdgeDistance)
SelfloopCalculator
using the given parameters.
minFirstSegmentLength
- the minimum length of the first and last segment of an orthogonally routed self-loopminEdgeDistance
- the minimum distance between a pair of self-loopsMethod Detail |
---|
public void calculateSelfLoops(LayoutGraph graph, Node node, DataProvider spc, DataProvider tpc)
The current port positions will be used for determining the start and end ports.
The DataProvider
instances hold information about the source/target ports of the edges and can be used for
specifying the direction of first and last segments.
graph
- the input graphnode
- the node whose self-loops will be routedspc
- the DataProvider
that returns the PortConstraint
object associated with the source
ports of the edgestpc
- the DataProvider
that returns the PortConstraint
object associated with the target
ports of the edgespublic void calculateSelfLoops(LayoutGraph graph, Node node, YList selfLoops, DataProvider spc, DataProvider tpc)
The current port positions will be used for determining the start and end ports.
The DataProvider
instances hold information about the source/target ports of the edges and can be used for
specifying the direction of first and last segments.
graph
- the input graphnode
- the node whose self-loops will be routedselfLoops
- a list of Edge
s that will be routedspc
- the DataProvider
that returns the PortConstraint
object associated with the source
ports of the edgestpc
- the DataProvider
that returns the PortConstraint
object associated with the target
ports of the edgesprotected double getMinimumFirstSegmentLength(LayoutGraph graph, Edge edge)
The value is fetched from the corresponding DataProvider
registered with the graph with key
MINIMUM_FIRST_SEGMENT_LENGTH_DPKEY
.
graph
- the input graphedge
- the given edge
protected boolean isOctilinearEdge(LayoutGraph graph, Edge edge)
The value is fetched from the corresponding DataProvider
registered with the graph with key
IS_OCTILINEAR_DPKEY
.
graph
- the input graphedge
- the given edge
true
if the edge is octilinear, false
otherwiseprotected double getMinimumOctilinearSegmentLength(LayoutGraph graph, Edge edge)
The value is fetched from the corresponding DataProvider
registered with the graph with key
MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DPKEY
.
graph
- the input graphedge
- the given edge
protected double getMinimumLastSegmentLength(LayoutGraph graph, Edge edge)
The value is fetched from the corresponding DataProvider
registered with the graph with key
MINIMUM_LAST_SEGMENT_LENGTH_DPKEY
.
graph
- the input graphedge
- the given edge
protected double getMinimumDistance(LayoutGraph graph, Edge edge)
The value is fetched from the corresponding DataProvider
registered with the graph with key
MINIMUM_EDGE_DISTANCE_DPKEY
.
graph
- the input graphedge
- the given edge
protected double getMinimumNodeDistance(LayoutGraph graph, Node node)
The value is fetched from the corresponding DataProvider
registered with the graph with key
MINIMUM_NODE_DISTANCE_DPKEY
.
graph
- the input graphnode
- the given node
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |