This class is an abstract implementation of the IPortConstraintOptimizer interface that minimizes the effort required to modify the port assignment after the sequencing phase of hierarchic layout algorithm.
Remarks
- Restores temporarily all same-layer edges which are not currently present in the layout graph at this time of the layout algorithm.
- Invokes the hook in which the custom port assignment should be done.
- Restores the original state of the layout graph by removing the temporary same-layer edges added in Step
1
.
Default Values of Properties
layoutOrientation | TOP_TO_BOTTOM
| The layout orientation is top-to-bottom. |
mirrorMode | BOTTOM_TO_TOP
| Layout orientation |
Type Details
- yfiles module
- layout-hierarchic
- yfiles-umd modules
- layout-familytree, layout-hierarchic, layout-radial, layout
- Legacy UMD name
- yfiles.hierarchic.PortConstraintOptimizerBase
Constructors
Creates a new PortConstraintOptimizerBase instance with default settings.
Properties
Gets or sets the layout orientation.
Remarks
Default Value
See Also
Gets or sets the mirror mask that defines which orientations should be mirrored.
Remarks
90
, 180
or 270
degrees. Afterwards, the graph can be mirrored at the x-axis (for horizontal layout orientations) or y-axis (for vertical layout orientations). Which directions are mirrored can be defined by the given mask.Default Value
See Also
Methods
insertSameLayerStructures
(graph: LayoutGraph, layers: ILayers, ldp: ILayoutDataProvider, itemFactory: IItemFactory) : PortConstraintOptimizerSameLayerDataInserts a same-layer edge structure for each same-layer edge of the original graph.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layers - ILayers
- the given ILayers instance holding the layering information
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- itemFactory - IItemFactory
- the factory that sets the temporary port constraints
See Also
(s,t)
consists of a temporary node w
and edges (s,w)
and (t,w)
.optimizeAfterLayering
(graph: LayoutGraph, layers: ILayers, ldp: ILayoutDataProvider, itemFactory: IItemFactory)Assigns new temporary port constraints after the nodes have been assigned to layers.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layers - ILayers
- the given ILayers instance holding the layering information
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- itemFactory - IItemFactory
- the factory that sets the temporary port constraints
See Also
Implements
optimizeAfterSequencing
(graph: LayoutGraph, layers: ILayers, ldp: ILayoutDataProvider, itemFactory: IItemFactory)Assigns new temporary port constraints after the order of the nodes in each layer has been determined.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layers - ILayers
- the given ILayers instance holding the layering information
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- itemFactory - IItemFactory
- the factory that sets the temporary port constraints
See Also
Implements
optimizeAfterSequencingForAllNodes
(inEdgeOrder: IComparer<Object>, outEdgeOrder: IComparer<Object>, graph: LayoutGraph, layers: ILayers, ldp: ILayoutDataProvider, itemFactory: IItemFactory)Assigns new temporary port constraints after the order of the nodes in each layer has been determined.
Remarks
More precisely, it is called after the sequence of the nodes has been determined. It invokes optimizeAfterSequencingForSingleNode for every node of the original layout graph and omits the nodes of the same-layer structures.
Incoming and outgoing edges are sorted using IComparer<T> instances which define the preferred ordering of the incoming and outgoing edges from left to right.
Parameters
A map of options to pass to the method.
- inEdgeOrder - IComparer<Object>
- a given IComparer<T> instance for incoming edges
- outEdgeOrder - IComparer<Object>
- a given IComparer<T> instance for outgoing edges
- graph - LayoutGraph
- the input graph
- layers - ILayers
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- itemFactory - IItemFactory
- the factory that sets the temporary port constraints
See Also
optimizeAfterSequencingForSingleNode
(node: YNode, inEdgeOrder: IComparer<Object>, outEdgeOrder: IComparer<Object>, graph: LayoutGraph, ldp: ILayoutDataProvider, itemFactory: IItemFactory)Assigns new temporary port constraints to a given node of the graph after the order of the nodes in each layer has been determined.
Remarks
More precisely, it is called after the sequence of the nodes has been determined.
Incoming and outgoing edges are sorted using IComparer<T> instances which define the preferred ordering of the incoming and outgoing edges from left to right.
Parameters
A map of options to pass to the method.
- node - YNode
- the original node to set temporary port constraints
- inEdgeOrder - IComparer<Object>
- a given IComparer<T> instance for incoming edges
- outEdgeOrder - IComparer<Object>
- a given IComparer<T> instance for outgoing edges
- graph - LayoutGraph
- the input graph
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- itemFactory - IItemFactory
- the factory that sets the temporary port constraints
See Also
removeSameLayerStructures
(sameLayerData: PortConstraintOptimizerSameLayerData, graph: LayoutGraph, ldp: ILayoutDataProvider, itemFactory: IItemFactory)Removes the same-layer edge structure created using insertSameLayerStructures.
Parameters
A map of options to pass to the method.
- sameLayerData - PortConstraintOptimizerSameLayerData
- a given PortConstraintOptimizerSameLayerData instance holding the information about the same-layer structures.
- graph - LayoutGraph
- the input graph
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- itemFactory - IItemFactory
- the factory that sets the temporary port constraints