public class SeriesParallelLayout extends MultiStageLayout
SeriesParallelLayout
is suitable for the visualization of circuits, call trees or flowcharts.
From the recursive structure of series-parallel graphs, the layout algorithm retrieves a decomposition tree where each
node represents one of the decomposition types. Then, this tree is traversed recursively from bottom to top, aligning
subgraphs above (series) or next to (parallel) each other until the whole graph is arranged. The edges are routed when
both end nodes are placed. Different routing styles
can be used.
To avoid moving all nodes several times and to be aware of the area that the subtrees occupy, the layout algorithm keeps track of the shape of the subtrees. These shapes are moved and merged during the layout calculation. The layout algorithm also stores the connections between nodes and nodes that haven't already been placed in these shapes.
SeriesParallelLayout
can take strong
PortConstraint
s into account. It will connect the edges to the specified locations,
the directions, however, will be ignored.
Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole
series-parallel subgraph. Otherwise, the group nodes may overlap with each other or with other nodes. Edges which are
connected to non-empty group nodes are not allowed. Furthermore, the user may specify minimum size constraints for each
group node using IDataProvider
key GroupingKeys.MINIMUM_NODE_SIZE_DPKEY
.
The layout algorithm can be configured to reserve space for node labels and to place the edge labels along the edge such
that the labels won't overlap with other graph elements. Edge labels are placed according to the information stored in a
PreferredPlacementDescriptor
instance. However, labels that should be centered between source and target are
placed close to the target node, unless this edge connects to the local source and sink of a subgraph.
Parallel subgraphs can be aligned in different ways. Depending on the node sizes, a different alignment can increase the compactness of the layout.
The way in which edges are distributed around their incident nodes is computed by an instance of
IPortAssignment
. The default assignment
is able to consider
PortConstraint
s and edge groups.
The From Sketch mode
allows to take the initial locations of the nodes into account.
However, the layout algorithm won't insert crossings because it maintains the order of children of each node.
SeriesParallelLayout
supports custom sorting of the outgoing edges of a node. A Comparator
can be
assigned individually for the nodes using a IDataProvider
registered with key
OUT_EDGE_COMPARATOR_DPKEY
. For all nodes for which the IDataProvider
returns null
, the
layout algorithm falls back to the default comparator
.
By default, this layout algorithm can only handle graphs with a series-parallel structure. To apply it to a general
graph, general graph handling
needs to be activated. Then, the layout
algorithm will temporarily add and/or remove some edges from the input graph until a series-parallel graph is obtained.
The edges that were removed will be routed separately afterwards.
Modifier and Type | Field and Description |
---|---|
static EdgeDpKey<EdgeLayoutDescriptor> |
EDGE_LAYOUT_DESCRIPTOR_DPKEY
A
DataProvider key for storing individual settings for edges
If no edge layout descriptor is mapped for an edge, a default edge layout descriptor will be obtained by method
DefaultEdgeLayoutDescriptor . |
static IEdgeLabelLayoutDpKey<Boolean> |
NON_SERIES_PARALLEL_EDGE_LABELS_DPKEY
A
DataProvider key for marking edge labels of non-series-parallel edges
|
static NodeDpKey<Comparator<Object>> |
OUT_EDGE_COMPARATOR_DPKEY
A
DataProvider key for assigning different orderings for outgoing edges of the nodes
If the Comparator associated with a node is null , the outgoing edges maintain their initial order. |
static NodeDpKey<IPortAssignment> |
PORT_ASSIGNMENT_DPKEY
A
DataProvider key for providing an individual port distribution at nodes
If there is no IPortAssignment specified for a node, the layout algorithm uses the
default assignment . |
Constructor and Description |
---|
SeriesParallelLayout()
Creates a new
SeriesParallelLayout instance with default settings. |
Modifier and Type | Method and Description |
---|---|
void |
applyLayoutCore(LayoutGraph graph)
Calculates a series-parallel layout for the given graph.
|
EdgeLayoutDescriptor |
getDefaultEdgeLayoutDescriptor()
Gets the
EdgeLayoutDescriptor instance used for all those edges that do not have a specific layout descriptor
assigned. |
Comparator<Object> |
getDefaultOutEdgeComparator()
Gets the default
Comparator used for sorting the outgoing edges incident to nodes that do not have a specific
Comparator . |
IPortAssignment |
getDefaultPortAssignment()
Gets the default
IPortAssignment used for those nodes that do not have their own specific instance. |
double |
getMinimumEdgeToEdgeDistance()
Gets the minimum distance between edges.
|
double |
getMinimumNodeToEdgeDistance()
Gets the minimum distance between nodes and edges.
|
double |
getMinimumNodeToNodeDistance()
Gets the minimum distance between nodes.
|
double |
getMinimumPolylineSegmentLength()
Gets the minimum vertical distance of the edge segments that are not orthogonal.
|
double |
getMinimumSlope()
Gets the minimum slope which a non-orthogonal edge segment should have.
|
ILayoutAlgorithm |
getNonSeriesParallelEdgeLabelingAlgorithm()
Gets the labeling algorithm that is applied to all edge labels that belong to non-series-parallel edges.
|
Object |
getNonSeriesParallelEdgeLabelSelectionKey()
Gets the key to register a
IDataProvider that is used by the non-series-parallel edge labeling algorithm
to determine which edge labels it should place. |
ILayoutAlgorithm |
getNonSeriesParallelEdgeRouter()
Gets the edge routing algorithm used for the edges of a general graph that are not part of the series-parallel subgraph
whose layout is calculated.
|
Object |
getNonSeriesParallelEdgesDpKey()
Gets the key to register a
IDataProvider that is used for marking non-series-parallel edges. |
double |
getPreferredOctilinearSegmentLength()
Gets the preferred length for non-orthogonal segments in octilinear edge routes.
|
RoutingStyle |
getRoutingStyle()
Gets the currently used routing style for edges.
|
double |
getVerticalAlignment()
Gets the vertical alignment of parallel subgraphs.
|
boolean |
isConsiderNodeLabels()
Gets whether or not the layout algorithm reserves space for node labels to avoid overlaps.
|
boolean |
isFromSketchMode()
Gets whether or not to take the coordinates of the input diagram into account when arranging the nodes.
|
boolean |
isGeneralGraphHandling()
Gets whether or not the layout algorithm can handle general graphs.
|
boolean |
isIntegratedEdgeLabeling()
Gets whether or not the layout algorithm will place edge labels and reserve space for them.
|
static boolean |
isSeriesParallelGraph(Graph graph)
Determines whether or not the given graph has a series-parallel structure.
|
void |
setComponentLayoutEnabled(boolean value)
Sets whether or not the
ILayoutStage used for arranging the components of the graph is
activated. |
void |
setConsiderNodeLabels(boolean value)
Sets whether or not the layout algorithm reserves space for node labels to avoid overlaps.
|
void |
setDefaultEdgeLayoutDescriptor(EdgeLayoutDescriptor value)
Sets the
EdgeLayoutDescriptor instance used for all those edges that do not have a specific layout descriptor
assigned. |
void |
setDefaultOutEdgeComparator(Comparator<Object> value)
Sets the default
Comparator used for sorting the outgoing edges incident to nodes that do not have a specific
Comparator . |
void |
setDefaultPortAssignment(IPortAssignment value)
Sets the default
IPortAssignment used for those nodes that do not have their own specific instance. |
void |
setFromSketchMode(boolean value)
Sets whether or not to take the coordinates of the input diagram into account when arranging the nodes.
|
void |
setGeneralGraphHandling(boolean value)
Sets whether or not the layout algorithm can handle general graphs.
|
void |
setIntegratedEdgeLabeling(boolean value)
Sets whether or not the layout algorithm will place edge labels and reserve space for them.
|
void |
setMinimumEdgeToEdgeDistance(double value)
Sets the minimum distance between edges.
|
void |
setMinimumNodeToEdgeDistance(double value)
Sets the minimum distance between nodes and edges.
|
void |
setMinimumNodeToNodeDistance(double value)
Sets the minimum distance between nodes.
|
void |
setMinimumPolylineSegmentLength(double value)
Sets the minimum vertical distance of the edge segments that are not orthogonal.
|
void |
setMinimumSlope(double value)
Sets the minimum slope which a non-orthogonal edge segment should have.
|
void |
setNonSeriesParallelEdgeLabelingAlgorithm(ILayoutAlgorithm value)
Sets the labeling algorithm that is applied to all edge labels that belong to non-series-parallel edges.
|
void |
setNonSeriesParallelEdgeLabelSelectionKey(Object value)
Sets the key to register a
IDataProvider that is used by the non-series-parallel edge labeling algorithm
to determine which edge labels it should place. |
void |
setNonSeriesParallelEdgeRouter(ILayoutAlgorithm value)
Sets the edge routing algorithm used for the edges of a general graph that are not part of the series-parallel subgraph
whose layout is calculated.
|
void |
setNonSeriesParallelEdgesDpKey(Object value)
Sets the key to register a
IDataProvider that is used for marking non-series-parallel edges. |
void |
setPreferredOctilinearSegmentLength(double value)
Sets the preferred length for non-orthogonal segments in octilinear edge routes.
|
void |
setRoutingStyle(RoutingStyle value)
Sets the currently used routing style for edges.
|
void |
setSelfLoopRouterEnabled(boolean value)
Sets whether or not the
ILayoutStage used for routing self-loops is activated. |
void |
setVerticalAlignment(double value)
Sets the vertical alignment of parallel subgraphs.
|
appendStage, applyLayout, checkNodeSize, disableAllStages, getComponentLayout, getHideGroupsStage, getLabeling, getLayoutOrientation, getOrientationLayout, getParallelEdgeRouter, getSelfLoopRouter, getSubgraphLayout, isComponentLayoutEnabled, isHideGroupsStageEnabled, isLabelingEnabled, isOrientationLayoutEnabled, isParallelEdgeRouterEnabled, isSelfLoopRouterEnabled, isSubgraphLayoutEnabled, prependStage, removeStage, setComponentLayout, setHideGroupsStage, setHideGroupsStageEnabled, setLabeling, setLabelingEnabled, setLayoutOrientation, setOrientationLayout, setOrientationLayoutEnabled, setParallelEdgeRouter, setParallelEdgeRouterEnabled, setSelfLoopRouter, setSubgraphLayout, setSubgraphLayoutEnabled
public static final EdgeDpKey<EdgeLayoutDescriptor> EDGE_LAYOUT_DESCRIPTOR_DPKEY
DataProvider
key for storing individual settings for edges
If no edge layout descriptor is mapped for an edge, a default edge layout descriptor will be obtained by method
DefaultEdgeLayoutDescriptor
.
getDefaultEdgeLayoutDescriptor()
public static final IEdgeLabelLayoutDpKey<Boolean> NON_SERIES_PARALLEL_EDGE_LABELS_DPKEY
DataProvider
key for marking edge labels of non-series-parallel edges
NonSeriesParallelEdgeLabelSelectionKey
. During the
layout, a IDataProvider
marking the non-series-parallel edges will automatically be registered with the graph.
Thus, data provided by the user registered with this specific key is ignored.setNonSeriesParallelEdgeLabelSelectionKey(Object)
,
setNonSeriesParallelEdgeLabelingAlgorithm(ILayoutAlgorithm)
public static final NodeDpKey<Comparator<Object>> OUT_EDGE_COMPARATOR_DPKEY
DataProvider
key for assigning different orderings for outgoing edges of the nodes
If the Comparator
associated with a node is null
, the outgoing edges maintain their initial order.
Comparator
s are only used for the series-parallel part of the graph. Non-series-parallel
edges are not included and will be routed by the
edge router for non-series-parallel edges
.getDefaultOutEdgeComparator()
public static final NodeDpKey<IPortAssignment> PORT_ASSIGNMENT_DPKEY
DataProvider
key for providing an individual port distribution at nodes
If there is no IPortAssignment
specified for a node, the layout algorithm uses the
default assignment
.
getDefaultPortAssignment()
public SeriesParallelLayout()
SeriesParallelLayout
instance with default settings.public void applyLayoutCore(LayoutGraph graph)
applyLayoutCore
in class MultiStageLayout
InvalidGraphStructureException
- if the graph is not series-parallelgraph
- the input graphpublic EdgeLayoutDescriptor getDefaultEdgeLayoutDescriptor()
EdgeLayoutDescriptor
instance used for all those edges that do not have a specific layout descriptor
assigned.IllegalArgumentException
- if the specified EdgeLayoutDescriptor
is null
EdgeLayoutDescriptor
EdgeLayoutDescriptor
instanceEDGE_LAYOUT_DESCRIPTOR_DPKEY
,
setDefaultEdgeLayoutDescriptor(EdgeLayoutDescriptor)
public Comparator<Object> getDefaultOutEdgeComparator()
Comparator
used for sorting the outgoing edges incident to nodes that do not have a specific
Comparator
.
Such a comparator is defined using a IDataProvider
registered with the graph with key
OUT_EDGE_COMPARATOR_DPKEY
.
null
.DefaultOutEdgeComparator
. The order of the edges is used along with a special PortConstraint
and edge group handling.Comparator
for outgoing edgessetDefaultOutEdgeComparator(Comparator)
public IPortAssignment getDefaultPortAssignment()
IPortAssignment
used for those nodes that do not have their own specific instance.
A IPortAssignment
instance is defined using a IDataProvider
registered with the graph with key
PORT_ASSIGNMENT_DPKEY
.
IllegalArgumentException
- if null
is specifiedDefaultPortAssignment
. All ports are distributed
on the borders of the
nodes.setDefaultPortAssignment(IPortAssignment)
public double getMinimumEdgeToEdgeDistance()
This distance needs to be non-negative.
IllegalArgumentException
- if the specified distance is smaller than 0
setMinimumEdgeToEdgeDistance(double)
public double getMinimumNodeToEdgeDistance()
This distance needs to be non-negative.
IllegalArgumentException
- if the specified distance is smaller than 0
setMinimumNodeToEdgeDistance(double)
public double getMinimumNodeToNodeDistance()
This distance needs to be non-negative.
IllegalArgumentException
- if the specified distance is smaller than 0
setMinimumNodeToNodeDistance(double)
public double getMinimumPolylineSegmentLength()
The distance needs to be non-negative.
IllegalArgumentException
- if the specified length is smaller than 0
routing style
is
RoutingStyle.POLYLINE
.setMinimumSlope(double)
,
setRoutingStyle(RoutingStyle)
,
RoutingStyle.POLYLINE
,
setMinimumPolylineSegmentLength(double)
public double getMinimumSlope()
A higher minimum slope prevents those segments in very wide graphs from becoming nearly horizontal. The slope needs to have a non-negative value.
IllegalArgumentException
- if the specified slope is smaller than 0
routing style
is
RoutingStyle.POLYLINE
.setMinimumPolylineSegmentLength(double)
,
setRoutingStyle(RoutingStyle)
,
RoutingStyle.POLYLINE
,
setMinimumSlope(double)
public ILayoutAlgorithm getNonSeriesParallelEdgeLabelingAlgorithm()
edge label selection key
to determine which edge labels it should place. Otherwise, the labeling algorithm might place all labels, including
those that belong to actual series-parallel edges.GenericLabeling
setGeneralGraphHandling(boolean)
,
setNonSeriesParallelEdgeLabelSelectionKey(Object)
,
setNonSeriesParallelEdgeLabelingAlgorithm(ILayoutAlgorithm)
public Object getNonSeriesParallelEdgeLabelSelectionKey()
IDataProvider
that is used by the non-series-parallel edge labeling algorithm
to determine which edge labels it should place.
During the layout, a IDataProvider
with this key will be registered with the graph. It will mark all
IEdgeLabelLayout
s that belong to non-series-parallel edges. A specified custom
non-series-parallel edge labeling algorithm needs to obey this selection. If using GenericLabeling
as labeling algorithm, set this key as value of property
AffectedLabelsDpKey
.
The labeling algorithm set as default is already configured such that it uses the correct selection key.
non-series-parallel edge labeling algorithm
but no edge label selection key, then the labeling algorithm might place all labels, including those that belong to
actual series-parallel edges.NON_SERIES_PARALLEL_EDGE_LABELS_DPKEY
IDataProvider
keysetNonSeriesParallelEdgeLabelingAlgorithm(ILayoutAlgorithm)
,
setNonSeriesParallelEdgeLabelSelectionKey(Object)
public ILayoutAlgorithm getNonSeriesParallelEdgeRouter()
IllegalArgumentException
- if null
is specifiedselection key
is set.EdgeRouter
setGeneralGraphHandling(boolean)
,
setNonSeriesParallelEdgesDpKey(Object)
,
setNonSeriesParallelEdgeRouter(ILayoutAlgorithm)
public Object getNonSeriesParallelEdgesDpKey()
IDataProvider
that is used for marking non-series-parallel edges.
This key is used for determining the edges that are not part of the series-parallel structure in a general graph, such that the specified non-series-parallel edge router only routes marked edges.
IllegalArgumentException
- if the given key is set to null
IDataProvider
using the specified
key.setGeneralGraphHandling(boolean)
,
setNonSeriesParallelEdgeRouter(ILayoutAlgorithm)
,
setNonSeriesParallelEdgesDpKey(Object)
public double getPreferredOctilinearSegmentLength()
If there is not enough space, those segments may be shorter than the specified length. The length needs to be non-negative.
IllegalArgumentException
- if the specified length is smaller than 0
routing style
is
RoutingStyle.OCTILINEAR
.setRoutingStyle(RoutingStyle)
,
RoutingStyle.OCTILINEAR
,
setPreferredOctilinearSegmentLength(double)
public RoutingStyle getRoutingStyle()
GeneralGraphHandling
is enabled.RoutingStyle.ORTHOGONAL
setRoutingStyle(RoutingStyle)
public double getVerticalAlignment()
The alignment is defined by a ratio:
0
means that nodes are top-aligned0.5
means that nodes are center-aligned1
means that nodes are bottom-aligned[0,1]
will be matched with the nearest interval end.[0,1]
setVerticalAlignment(double)
public boolean isConsiderNodeLabels()
labeling algorithm
will be
overwritten and when disabling it, any currently specified labeling algorithm will be disabled via property
LabelingEnabled
. Therefore, it is recommended to only use this
convenience property instead of manually changing the mentioned other properties.false
. Node labels are not considered.true
if node labels are considered, false
otherwisesetConsiderNodeLabels(boolean)
public boolean isFromSketchMode()
The order of edges incident to the same source node will remain the same as in the original layout.
comparators
will be ignored if From Sketch mode is enabled.false
. The initial coordinates of the nodes are not considered.true
if input coordinates are considered, false
otherwisesetFromSketchMode(boolean)
public boolean isGeneralGraphHandling()
General graphs are required to be transformed before being laid out (by adding or removing some edges) such that they
satisfy the criteria of a series-parallel graph. After the layout, the graph will be restored and the initial edges
which weren't included in the series-parallel graph are routed by a separate
edge routing algorithm
. Furthermore, the labels of these
edges are placed by a customizable
edge labeling algorithm
.
false
. Only series-parallel graphs are handled.true
if general graphs should be handled, false
otherwisesetGeneralGraphHandling(boolean)
public boolean isIntegratedEdgeLabeling()
labeling algorithm
will be
overwritten and when disabling it, any currently specified labeling algorithm will be disabled via property
LabelingEnabled
. Therefore, it is recommended to only use this
convenience property instead of manually changing the mentioned other properties.false
. Integrated edge labeling is disabled.true
if edge labels should be placed, false
otherwisesetIntegratedEdgeLabeling(boolean)
public static final boolean isSeriesParallelGraph(Graph graph)
The current implementation detects the series-parallel graph structure in linear time.
graph
- the input graphtrue
if the given graph is series-parallel, false
otherwisepublic void setComponentLayoutEnabled(boolean value)
ILayoutStage
used for arranging the components of the graph is
activated.setComponentLayoutEnabled
in class MultiStageLayout
SeriesParallelLayout
can only handle single components. Disabling ComponentLayout
will lead to errors during execution.true
. The stage that arranges connected graph components is activated.value
- true
if the stage that arranges the graph components is activated, false
otherwiseMultiStageLayout.isComponentLayoutEnabled()
,
MultiStageLayout.setComponentLayout(com.yworks.yfiles.layout.ILayoutStage)
,
ComponentLayout
public void setConsiderNodeLabels(boolean value)
labeling algorithm
will be
overwritten and when disabling it, any currently specified labeling algorithm will be disabled via property
LabelingEnabled
. Therefore, it is recommended to only use this
convenience property instead of manually changing the mentioned other properties.false
. Node labels are not considered.value
- true
if node labels are considered, false
otherwiseisConsiderNodeLabels()
public void setDefaultEdgeLayoutDescriptor(EdgeLayoutDescriptor value)
EdgeLayoutDescriptor
instance used for all those edges that do not have a specific layout descriptor
assigned.IllegalArgumentException
- if the specified EdgeLayoutDescriptor
is null
EdgeLayoutDescriptor
value
- the current EdgeLayoutDescriptor
instanceEDGE_LAYOUT_DESCRIPTOR_DPKEY
,
getDefaultEdgeLayoutDescriptor()
public void setDefaultOutEdgeComparator(Comparator<Object> value)
Comparator
used for sorting the outgoing edges incident to nodes that do not have a specific
Comparator
.
Such a comparator is defined using a IDataProvider
registered with the graph with key
OUT_EDGE_COMPARATOR_DPKEY
.
null
.DefaultOutEdgeComparator
. The order of the edges is used along with a special PortConstraint
and edge group handling.value
- the default Comparator
for outgoing edgesgetDefaultOutEdgeComparator()
public void setDefaultPortAssignment(IPortAssignment value)
IPortAssignment
used for those nodes that do not have their own specific instance.
A IPortAssignment
instance is defined using a IDataProvider
registered with the graph with key
PORT_ASSIGNMENT_DPKEY
.
IllegalArgumentException
- if null
is specifiedDefaultPortAssignment
. All ports are distributed
on the borders of the
nodes.value
- the port assignmentgetDefaultPortAssignment()
public void setFromSketchMode(boolean value)
The order of edges incident to the same source node will remain the same as in the original layout.
comparators
will be ignored if From Sketch mode is enabled.false
. The initial coordinates of the nodes are not considered.value
- true
if input coordinates are considered, false
otherwiseisFromSketchMode()
public void setGeneralGraphHandling(boolean value)
General graphs are required to be transformed before being laid out (by adding or removing some edges) such that they
satisfy the criteria of a series-parallel graph. After the layout, the graph will be restored and the initial edges
which weren't included in the series-parallel graph are routed by a separate
edge routing algorithm
. Furthermore, the labels of these
edges are placed by a customizable
edge labeling algorithm
.
false
. Only series-parallel graphs are handled.value
- true
if general graphs should be handled, false
otherwiseisGeneralGraphHandling()
public void setIntegratedEdgeLabeling(boolean value)
labeling algorithm
will be
overwritten and when disabling it, any currently specified labeling algorithm will be disabled via property
LabelingEnabled
. Therefore, it is recommended to only use this
convenience property instead of manually changing the mentioned other properties.false
. Integrated edge labeling is disabled.value
- true
if edge labels should be placed, false
otherwiseisIntegratedEdgeLabeling()
public void setMinimumEdgeToEdgeDistance(double value)
This distance needs to be non-negative.
IllegalArgumentException
- if the specified distance is smaller than 0
value
- the minimum distance between edgesgetMinimumEdgeToEdgeDistance()
public void setMinimumNodeToEdgeDistance(double value)
This distance needs to be non-negative.
IllegalArgumentException
- if the specified distance is smaller than 0
value
- the minimum distance between nodes and edgesgetMinimumNodeToEdgeDistance()
public void setMinimumNodeToNodeDistance(double value)
This distance needs to be non-negative.
IllegalArgumentException
- if the specified distance is smaller than 0
value
- the minimum distance between nodesgetMinimumNodeToNodeDistance()
public void setMinimumPolylineSegmentLength(double value)
The distance needs to be non-negative.
IllegalArgumentException
- if the specified length is smaller than 0
routing style
is
RoutingStyle.POLYLINE
.value
- the minimum vertical distancesetMinimumSlope(double)
,
setRoutingStyle(RoutingStyle)
,
RoutingStyle.POLYLINE
,
getMinimumPolylineSegmentLength()
public void setMinimumSlope(double value)
A higher minimum slope prevents those segments in very wide graphs from becoming nearly horizontal. The slope needs to have a non-negative value.
IllegalArgumentException
- if the specified slope is smaller than 0
routing style
is
RoutingStyle.POLYLINE
.value
- the minimum slope for a non-orthogonal segmentsetMinimumPolylineSegmentLength(double)
,
setRoutingStyle(RoutingStyle)
,
RoutingStyle.POLYLINE
,
getMinimumSlope()
public void setNonSeriesParallelEdgeLabelingAlgorithm(ILayoutAlgorithm value)
edge label selection key
to determine which edge labels it should place. Otherwise, the labeling algorithm might place all labels, including
those that belong to actual series-parallel edges.GenericLabeling
value
- the labeling algorithm used for edge labels of non-series-parallel edgessetGeneralGraphHandling(boolean)
,
setNonSeriesParallelEdgeLabelSelectionKey(Object)
,
getNonSeriesParallelEdgeLabelingAlgorithm()
public void setNonSeriesParallelEdgeLabelSelectionKey(Object value)
IDataProvider
that is used by the non-series-parallel edge labeling algorithm
to determine which edge labels it should place.
During the layout, a IDataProvider
with this key will be registered with the graph. It will mark all
IEdgeLabelLayout
s that belong to non-series-parallel edges. A specified custom
non-series-parallel edge labeling algorithm needs to obey this selection. If using GenericLabeling
as labeling algorithm, set this key as value of property
AffectedLabelsDpKey
.
The labeling algorithm set as default is already configured such that it uses the correct selection key.
non-series-parallel edge labeling algorithm
but no edge label selection key, then the labeling algorithm might place all labels, including those that belong to
actual series-parallel edges.NON_SERIES_PARALLEL_EDGE_LABELS_DPKEY
value
- the non-series-parallel edge label selection IDataProvider
keysetNonSeriesParallelEdgeLabelingAlgorithm(ILayoutAlgorithm)
,
getNonSeriesParallelEdgeLabelSelectionKey()
public void setNonSeriesParallelEdgeRouter(ILayoutAlgorithm value)
IllegalArgumentException
- if null
is specifiedselection key
is set.EdgeRouter
value
- the edge routing algorithm applied to the non-series-parallel edgessetGeneralGraphHandling(boolean)
,
setNonSeriesParallelEdgesDpKey(Object)
,
getNonSeriesParallelEdgeRouter()
public void setNonSeriesParallelEdgesDpKey(Object value)
IDataProvider
that is used for marking non-series-parallel edges.
This key is used for determining the edges that are not part of the series-parallel structure in a general graph, such that the specified non-series-parallel edge router only routes marked edges.
IllegalArgumentException
- if the given key is set to null
IDataProvider
using the specified
key.value
- the selection keysetGeneralGraphHandling(boolean)
,
setNonSeriesParallelEdgeRouter(ILayoutAlgorithm)
,
getNonSeriesParallelEdgesDpKey()
public void setPreferredOctilinearSegmentLength(double value)
If there is not enough space, those segments may be shorter than the specified length. The length needs to be non-negative.
IllegalArgumentException
- if the specified length is smaller than 0
routing style
is
RoutingStyle.OCTILINEAR
.value
- the preferred length for non-orthogonal segments in octilinear edge routessetRoutingStyle(RoutingStyle)
,
RoutingStyle.OCTILINEAR
,
getPreferredOctilinearSegmentLength()
public void setRoutingStyle(RoutingStyle value)
GeneralGraphHandling
is enabled.RoutingStyle.ORTHOGONAL
value
- the routing style for the edgesgetRoutingStyle()
public void setSelfLoopRouterEnabled(boolean value)
ILayoutStage
used for routing self-loops is activated.setSelfLoopRouterEnabled
in class MultiStageLayout
SeriesParallelLayout
cannot handle self-loops. Disabling SelfLoopRouter
will
lead to errors during execution.true
. The stage that routes self-loops is activated.value
- true
if the stage responsible for routing self-loops is activated, false
otherwiseMultiStageLayout.isSelfLoopRouterEnabled()
,
MultiStageLayout.setSelfLoopRouter(com.yworks.yfiles.layout.ILayoutStage)
,
SelfLoopRouter
public void setVerticalAlignment(double value)
The alignment is defined by a ratio:
0
means that nodes are top-aligned0.5
means that nodes are center-aligned1
means that nodes are bottom-aligned[0,1]
will be matched with the nearest interval end.value
- the vertical alignment ratio from interval [0,1]
getVerticalAlignment()