Package | com.yworks.yfiles.layout.seriesparallel |
Class | public class SeriesParallelLayouter |
Inheritance | SeriesParallelLayouter CanonicMultiStageLayouter YObject Object |
Series parallel graphs are directed graphs with a single source (node without incoming edges) and a single sink (node without outgoing edges) that are build using only the following two rules:
Features:
PortConstraint
s will fix the end point. However, the direction of the PortConstraint
will be the graph's flow directionSee also
Property | Defined By | ||
---|---|---|---|
componentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph. | CanonicMultiStageLayouter | ||
componentLayouterEnabled : Boolean
Getter:
Returns whether or not ComponentLayouter is enabled. | CanonicMultiStageLayouter | ||
considerNodeLabels : Boolean
Specifies whether or not node labels are considered. | SeriesParallelLayouter | ||
defaultEdgeLayoutDescriptor : EdgeLayoutDescriptor
Specifies the default com.yworks.yfiles.layout.seriesparallel.EdgeLayoutDescriptor. | SeriesParallelLayouter | ||
defaultOutEdgeComparator : Comparator
Getter:
Returns the default java.util.Comparator that will be used for those nodes, that don't have their own specific instance set via appropriate DataProvider (PORT_ASSIGNMENT_DPKEY). | SeriesParallelLayouter | ||
defaultPortAssignment : PortAssignment
Specifies the default com.yworks.yfiles.layout.seriesparallel.PortAssignment that will be used for those nodes, that don't have their own specific instance set via the appropriate DataProvider (PORT_ASSIGNMENT_DPKEY). | SeriesParallelLayouter | ||
fromSketchModeEnabled : Boolean
Specifies whether or not to take the coordinates of the input diagram into account when arranging the nodes. | SeriesParallelLayouter | ||
generalGraphHandling : Boolean
Specifies whether or not general graphs are handled by this layouter. | SeriesParallelLayouter | ||
groupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm. | CanonicMultiStageLayouter | ||
hideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins. | CanonicMultiStageLayouter | ||
integratedEdgeLabeling : Boolean
Specifies whether or not integrated edge labeling is enabled. | SeriesParallelLayouter | ||
labelLayouter : LayoutStage
Getter:
Returns the algorithm used for placing labels. | CanonicMultiStageLayouter | ||
labelLayouterEnabled : Boolean
Getter:
Returns whether or not LabelLayouter is enabled. | CanonicMultiStageLayouter | ||
layoutOrientation : int
Specifies the main layout orientation. | CanonicMultiStageLayouter | ||
minimumEdgeToEdgeDistance : Number
Specifies the minimum distance between edges. | SeriesParallelLayouter | ||
minimumNodeToEdgeDistance : Number
Specifies the minimum distance between nodes and edges. | SeriesParallelLayouter | ||
minimumNodeToNodeDistance : Number
Specifies the minimum distance between nodes. | SeriesParallelLayouter | ||
minimumPolylineSegmentLength : Number
Specifies the minimum segment length for a polyline edge segment. | SeriesParallelLayouter | ||
minimumSlope : Number
Specifies the minimum slope which a polyline edge segment should have. | SeriesParallelLayouter | ||
nonSeriesParallelEdgeRouter : Layouter
Specifies the edge router used for edges of a general graph that are not part of the series-parallel subgraph whose layout is calculated. | SeriesParallelLayouter | ||
nonSeriesParallelEdgesDpKey : Object
Specifies the key that is used to mark non-series-parallel edges. | SeriesParallelLayouter | ||
orientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout. | CanonicMultiStageLayouter | ||
orientationLayouterEnabled : Boolean
Getter:
Returns whether or not the OrientationLayouter is enabled. | CanonicMultiStageLayouter | ||
parallelEdgeLayouter : LayoutStage
Getter:
Returns the LayoutStage responsible for routing parallel edges. | CanonicMultiStageLayouter | ||
parallelEdgeLayouterEnabled : Boolean
Getter:
Returns whether or not the ParallelEdgeLayouter is enabled. | CanonicMultiStageLayouter | ||
preferredOctilinearSegmentLength : Number
Specifies the preferred length for non-orthogonal segments in octilinear edge routes. | SeriesParallelLayouter | ||
routingStyle : int
Specifies the currently used routing style for edges. | SeriesParallelLayouter | ||
selfLoopLayouter : LayoutStage
Getter:
Returns the LayoutStage used for routing Self-loops. | CanonicMultiStageLayouter | ||
selfLoopLayouterEnabled : Boolean
Getter:
Returns whether or not the SelfLoopLayouter is enabled. | CanonicMultiStageLayouter | ||
subgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph. | CanonicMultiStageLayouter | ||
subgraphLayouterEnabled : Boolean
Getter:
Returns whether or not the SubgraphLayouter is enabled. | CanonicMultiStageLayouter | ||
verticalAlignment : Number
Specifies the vertical alignment of parallel subgraphs. | SeriesParallelLayouter |
Method | Defined By | ||
---|---|---|---|
SeriesParallelLayouter(init:Boolean = true)
Creates a new SeriesParallelLayouter with default settings. | SeriesParallelLayouter | ||
appendStage(stage:LayoutStage):void
Appends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
Returns a layout for the given layout graph. | CanonicMultiStageLayouter | ||
Returns a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
canLayout(graph:LayoutGraph):Boolean
Tests whether or not the given graph can be laid out by this layouter. | CanonicMultiStageLayouter | ||
canLayoutCore(graph:LayoutGraph):Boolean [override]
Checks whether or not the given graph is series-parallel and can be layouted by com.yworks.yfiles.layout.seriesparallel.SeriesParallelLayouter. | SeriesParallelLayouter | ||
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph. | CanonicMultiStageLayouter | ||
Calculates a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
doLayoutCore(graph:LayoutGraph):void [override]
Calculates a series-parallel layout for the given graph. | SeriesParallelLayouter | ||
enableOnlyCore():void
Disables all layout stages and performs only the core layouter. | CanonicMultiStageLayouter | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | SeriesParallelLayouter | ||
hashCode():int | YObject | ||
isSeriesParallelGraph(graph:Graph):Boolean [static]
Determines whether or not the given graph has a series-parallel structure. | SeriesParallelLayouter | ||
[static]
Creates a new SeriesParallelLayouter with default settings. | SeriesParallelLayouter | ||
prependStage(stage:LayoutStage):void
Prepends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
removeStage(stage:LayoutStage):void
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage(). | CanonicMultiStageLayouter |
Method | Defined By | ||
---|---|---|---|
checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero. | CanonicMultiStageLayouter | ||
checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero. | CanonicMultiStageLayouter | ||
CanonicMultiStageLayouter | |||
initSeriesParallelLayouter():void
Initializes this object. | SeriesParallelLayouter |
Constant | Defined By | ||
---|---|---|---|
EDGE_LAYOUT_DESCRIPTOR_DPKEY : String = y.layout.seriesparallel.SeriesParallelLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY [static]
com.yworks.yfiles.base.DataProvider key used to store the com.yworks.yfiles.layout.seriesparallel.EdgeLayoutDescriptor for each edge. | SeriesParallelLayouter | ||
OUT_EDGE_COMPARATOR_DPKEY : Object = y.layout.seriesparallel.SeriesParallelLayouter.OUT_EDGE_COMPARATOR_DPKEY [static]
DataProvider key that can be registered with the graph to provide each node with its own java.util.Comparator instance that will be used to sort the outgoing edges. | SeriesParallelLayouter | ||
PORT_ASSIGNMENT_DPKEY : Object = y.layout.tree.GenericTreeLayouter.PORT_ASSIGNMENT_DPKEY [static]
DataProvider key that can be registered with the graph to provide each node with its own com.yworks.yfiles.layout.seriesparallel.PortAssignment instance. | SeriesParallelLayouter | ||
ROUTING_STYLE_OCTILINEAR : int = 1 [static]
Style constant describing an octilinear edge style. | SeriesParallelLayouter | ||
ROUTING_STYLE_ORTHOGONAL : int = 0 [static]
Style constant describing an orthogonal edge style. | SeriesParallelLayouter | ||
ROUTING_STYLE_POLYLINE : int = 2 [static]
Style constant describing an polyline edge style. | SeriesParallelLayouter |
considerNodeLabels | property |
considerNodeLabels:Boolean
Specifies whether or not node labels are considered. If enabled, the layouter will reserve space for the node labels to avoid overlaps.
By default, node labels are not considered.
public function get considerNodeLabels():Boolean
public function set considerNodeLabels(value:Boolean):void
defaultEdgeLayoutDescriptor | property |
defaultEdgeLayoutDescriptor:EdgeLayoutDescriptor
Specifies the default com.yworks.yfiles.layout.seriesparallel.EdgeLayoutDescriptor. This instance is used for all those edges, that do not have a specific layout descriptor assigned.
public function get defaultEdgeLayoutDescriptor():EdgeLayoutDescriptor
public function set defaultEdgeLayoutDescriptor(value:EdgeLayoutDescriptor):void
See also
defaultOutEdgeComparator | property |
defaultOutEdgeComparator:Comparator
Getter: Returns the default java.util.Comparator that will be used for those nodes, that don't have their own specific instance set via appropriate DataProvider (PORT_ASSIGNMENT_DPKEY).
By default, com.yworks.yfiles.layout.seriesparallel.DefaultOutEdgeComparator is used which uses the edge order of the graph along with a special com.yworks.yfiles.layout.PortConstraint and edge group handling.
Setter: Specifies the default java.util.Comparator that will be used for those nodes, that don't have their own specific instance set via the appropriate DataProvider.By default, com.yworks.yfiles.layout.seriesparallel.DefaultOutEdgeComparator is used which uses the edge order of the graph along with a special com.yworks.yfiles.layout.PortConstraint and edge group handling.
If you simply want to use the graph's current edge order you can set the default comparator to null
.
public function get defaultOutEdgeComparator():Comparator
public function set defaultOutEdgeComparator(value:Comparator):void
See also
defaultPortAssignment | property |
defaultPortAssignment:PortAssignment
Specifies the default com.yworks.yfiles.layout.seriesparallel.PortAssignment that will be used for those nodes, that don't have their own specific instance set via the appropriate DataProvider (PORT_ASSIGNMENT_DPKEY).
By default, all ports are placed in the center of the node.
public function get defaultPortAssignment():PortAssignment
public function set defaultPortAssignment(value:PortAssignment):void
See also
fromSketchModeEnabled | property |
fromSketchModeEnabled:Boolean
Specifies whether or not to take the coordinates of the input diagram into account when arranging the nodes. The order of edges with the same source node will stay the same an in the original layout.
Note that previously specified comparators (OUT_EDGE_COMPARATOR_DPKEY) will be ignored if from-sketch-mode is activated.
By default this feature is disabled.
public function get fromSketchModeEnabled():Boolean
public function set fromSketchModeEnabled(value:Boolean):void
See also
generalGraphHandling | property |
generalGraphHandling:Boolean
Specifies whether or not general graphs are handled by this layouter.
If general graphs are handled, they will be transformed before layout to fit the criteria of series-parallel graphs. After layout, they will be restored and the edges which weren't series-parallel are routed by an nonSeriesParallelEdgeRouter edge router}.
By default only series-parallel graphs are handled.
public function get generalGraphHandling():Boolean
public function set generalGraphHandling(value:Boolean):void
See also
integratedEdgeLabeling | property |
integratedEdgeLabeling:Boolean
Specifies whether or not integrated edge labeling is enabled. If enabled, the layouter will place edge labels and reserve space for them.
By default, integrated edge labeling is disabled.
public function get integratedEdgeLabeling():Boolean
public function set integratedEdgeLabeling(value:Boolean):void
minimumEdgeToEdgeDistance | property |
minimumEdgeToEdgeDistance:Number
Specifies the minimum distance between edges.
By default the distance between edges is 5
.
public function get minimumEdgeToEdgeDistance():Number
public function set minimumEdgeToEdgeDistance(value:Number):void
minimumNodeToEdgeDistance | property |
minimumNodeToEdgeDistance:Number
Specifies the minimum distance between nodes and edges.
By default the distance between nodes and edges is 10
.
public function get minimumNodeToEdgeDistance():Number
public function set minimumNodeToEdgeDistance(value:Number):void
minimumNodeToNodeDistance | property |
minimumNodeToNodeDistance:Number
Specifies the minimum distance between nodes.
By default the distance between nodes is 10
.
public function get minimumNodeToNodeDistance():Number
public function set minimumNodeToNodeDistance(value:Number):void
minimumPolylineSegmentLength | property |
minimumPolylineSegmentLength:Number
Specifies the minimum segment length for a polyline edge segment. This distance will only be considered when the routing style property is set to polyline edge routes.
By default, this distance is 30.
public function get minimumPolylineSegmentLength():Number
public function set minimumPolylineSegmentLength(value:Number):void
See also
minimumSlope | property |
minimumSlope:Number
Specifies the minimum slope which a polyline edge segment should have. A higher minimum slope prevents polyline segments in very wide graphs to get nearly horizontal. This distance will only be considered when the routing style property is set to polyline edge routes.
By default, the minimum slope is 0.25.
public function get minimumSlope():Number
public function set minimumSlope(value:Number):void
See also
nonSeriesParallelEdgeRouter | property |
nonSeriesParallelEdgeRouter:Layouter
Specifies the edge router used for edges of a general graph that are not part of the series-parallel subgraph whose layout is calculated. It is required that a suitable selection key (nonSeriesParallelEdgesDpKey) is used.
By default com.yworks.yfiles.layout.router.polyline.EdgeRouter is used.
public function get nonSeriesParallelEdgeRouter():Layouter
public function set nonSeriesParallelEdgeRouter(value:Layouter):void
See also
nonSeriesParallelEdgesDpKey | property |
nonSeriesParallelEdgesDpKey:Object
Specifies the key that is used to mark non-series-parallel edges. Note that this layouter automatically marks these edges and registers the DataProvider using the specified key. This key is used to determine the edges that are not part of the series-parallel structure in a general graph, so the specified non-series parallel edge router should only route marked edges.
public function get nonSeriesParallelEdgesDpKey():Object
public function set nonSeriesParallelEdgesDpKey(value:Object):void
See also
preferredOctilinearSegmentLength | property |
preferredOctilinearSegmentLength:Number
Specifies the preferred length for non-orthogonal segments in octilinear edge routes. This segment length will only be considered when the routing style property is set to octilinear edge routes.
By default, the preferred length is 10.
public function get preferredOctilinearSegmentLength():Number
public function set preferredOctilinearSegmentLength(value:Number):void
See also
routingStyle | property |
routingStyle:int
Specifies the currently used routing style for edges. Note that the routing style has no effect on non-series-parallel (generalGraphHandling) edges.
By default, edges are routed orthogonally.
public function get routingStyle():int
public function set routingStyle(value:int):void
See also
verticalAlignment | property |
verticalAlignment:Number
Specifies the vertical alignment of parallel subgraphs.
A value of 0
means nodes are top aligned; a value of 1
means nodes are bottom aligned; a value of 0.5
means nodes are center aligned. Values outside the interval [0,1]
will be matched with the nearest interval end.
In grouped graphs, the vertical alignment only applies to parallel subgraphs that belong to the same group.
By default the subgraphs are center aligned.
public function get verticalAlignment():Number
public function set verticalAlignment(value:Number):void
SeriesParallelLayouter | () | Constructor |
public function SeriesParallelLayouter(init:Boolean = true)
Creates a new SeriesParallelLayouter with default settings.
Parametersinit:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
canLayoutCore | () | method |
override public function canLayoutCore(graph:LayoutGraph):Boolean
Checks whether or not the given graph is series-parallel and can be layouted by com.yworks.yfiles.layout.seriesparallel.SeriesParallelLayouter.
Parameters
graph:LayoutGraph — the graph to be checked.
|
Boolean — true if the given graph is series-parallel, false otherwise.
|
See also
doLayoutCore | () | method |
override public function doLayoutCore(graph:LayoutGraph):void
Calculates a series-parallel layout for the given graph.
Parameters
graph:LayoutGraph — the graph to be layouted.
|
InvalidGraphStructureException — if the graph is not series-parallel.
|
getClass | () | method |
override public function getClass():Class
ReturnsClass |
initSeriesParallelLayouter | () | method |
protected final function initSeriesParallelLayouter():void
Initializes this object. See the documentation of the corresponding factory method newSeriesParallelLayouter()
for details.
See also
isSeriesParallelGraph | () | method |
public static function isSeriesParallelGraph(graph:Graph):Boolean
Determines whether or not the given graph has a series-parallel structure.
The current implementation detects the series-parallel graph structure in linear runtime.
Parameters
graph:Graph — the graph to be checked.
|
Boolean — true if the given graph is series-parallel, false otherwise.
|
newSeriesParallelLayouter | () | method |
public static function newSeriesParallelLayouter():SeriesParallelLayouter
Creates a new SeriesParallelLayouter with default settings.
ReturnsSeriesParallelLayouter |
EDGE_LAYOUT_DESCRIPTOR_DPKEY | Constant |
public static const EDGE_LAYOUT_DESCRIPTOR_DPKEY:String = y.layout.seriesparallel.SeriesParallelLayouter.EDGE_LAYOUT_DESCRIPTOR_DPKEY
com.yworks.yfiles.base.DataProvider key used to store the com.yworks.yfiles.layout.seriesparallel.EdgeLayoutDescriptor for each edge. If there is no descriptor mapped for an edge, the default descriptor is used.
See also
OUT_EDGE_COMPARATOR_DPKEY | Constant |
public static const OUT_EDGE_COMPARATOR_DPKEY:Object = y.layout.seriesparallel.SeriesParallelLayouter.OUT_EDGE_COMPARATOR_DPKEY
DataProvider key that can be registered with the graph to provide each node with its own java.util.Comparator instance that will be used to sort the outgoing edges.
If the Comparator
associated with a node is null
, the outgoing edges are not sorted.
Note that the order cannot be kept in all cases because the target nodes may not be completely independent.
For general graphs the comparators 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 (nonSeriesParallelEdgeRouter).
See also
PORT_ASSIGNMENT_DPKEY | Constant |
public static const PORT_ASSIGNMENT_DPKEY:Object = y.layout.tree.GenericTreeLayouter.PORT_ASSIGNMENT_DPKEY
DataProvider key that can be registered with the graph to provide each node with its own com.yworks.yfiles.layout.seriesparallel.PortAssignment instance.
See also
ROUTING_STYLE_OCTILINEAR | Constant |
public static const ROUTING_STYLE_OCTILINEAR:int = 1
Style constant describing an octilinear edge style. If this style is used, edges will have horizontal, vertical and 45-degree sloped segments.
See also
ROUTING_STYLE_ORTHOGONAL | Constant |
public static const ROUTING_STYLE_ORTHOGONAL:int = 0
Style constant describing an orthogonal edge style. If this style is used, edges will have only horizontal or vertical segments.
See also
ROUTING_STYLE_POLYLINE | Constant |
public static const ROUTING_STYLE_POLYLINE:int = 2
Style constant describing an polyline edge style. If this style is used, edges will have vertical and sloped segments.
See also