This class implements a LayoutStage that can be used to adjust the final port
assignments after a layout has been calculated.
Namespace: yWorks.yFiles.LayoutAssembly: yWorks.yFilesWPF.Algorithms (in yWorks.yFilesWPF.Algorithms.dll) Version: 2.2.0.2 (2.2.0.2)
Syntax
| C# |
|---|
public class PortCalculator : AbstractLayoutStage, ILayoutStage, ILayouter |
| Visual Basic |
|---|
Public Class PortCalculator _ Inherits AbstractLayoutStage _ Implements ILayoutStage, ILayouter |
Remarks
This class implements a LayoutStage that can be used to adjust the final port
assignments after a layout has been calculated. This can be useful if the port
assignment calculated by the layout algorithm is insufficient. This stage uses
IDataProvider
instances bound to the graph using the keys defined in
the
IIntersectionCalculator
interface to calculate the new port offsets.
For each edge in the LayoutGraph instance the
DataProviders are queried for an implementation of the
IIntersectionCalculator
interface. If the result is non-nullNothingnullptra null reference (Nothing in Visual Basic),
that implementation will be queried and if the result of the query is
non-nullNothingnullptra null reference (Nothing in Visual Basic), the returned point will be applied to the edge layout.
For this layout stage to work use
PrependStage(ILayoutStage)
or
PrependStage(ILayoutStage)
to add this layout stage and register appropriate
IDataProvider
implementations to the graph using the keys defined in
IIntersectionCalculator
.
Note, that this class will not change the coordinates of a port if it is
associated with a strong port constraint.
Inheritance Hierarchy
System..::..Object
yWorks.yFiles.Layout..::..AbstractLayoutStage
yWorks.yFiles.Layout..::..PortCalculator
yWorks.yFiles.Layout..::..AbstractLayoutStage
yWorks.yFiles.Layout..::..PortCalculator