Remarks
IDrawingDistanceCalculator is implemented by a helper class used by HierarchicalLayout during the phase of node placement (i.e. when the final coordinates for all nodes are calculated). ICoordinateAssigner uses instances of this interface to determine the minimum distances between elements that belong to the same layer.
Information about graph elements (i.e. nodes or edges) is given using a HierarchicalLayoutContext while information about layers is given through HierarchicalLayoutLayer (describes a single layer of the hierarchical layout) or layers (the list of layers of the hierarchical layout).
Implementations not needed anymore should be disposed of using method dispose.
The default implementation used by the HierarchicalLayout is DrawingDistanceCalculator.
Members
Methods
Disposes of internal data structures.
Parameters
- graph: LayoutGraph
- the input graph that contains all elements that are used during the node placement
- layoutContext: HierarchicalLayoutContext
- the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances, as well as the layers instance that will be used during subsequent calls.
See Also
API
- initialize
Implemented in
DrawingDistanceCalculator.disposeMain interface method called by ICoordinateAssigner instances to determine the minimum distance between LayoutNodes of the same layer.
null if its border is not of interest. In that case, only the border of the non-null LayoutNode instance should be considered.Parameters
- graph: LayoutGraph
- the input graph
- layer: HierarchicalLayoutLayer
- the layer object that will be used during subsequent calls
- layoutContext: HierarchicalLayoutContext
- the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances
- left: LayoutNode
- the left of the two LayoutNodes whose minimum distance is to be determined or
nullif only the left border of the right LayoutNode is of interest - right: LayoutNode
- the right of the two LayoutNodes whose minimum distance is to be determined or
nullif only the right border of the left LayoutNode is of interest
Return Value
- number
- the minimum distance between two LayoutNodes of the same layer
Implemented in
DrawingDistanceCalculator.getMinimumDistanceInitializes internal data structures.
Parameters
- graph: LayoutGraph
- the input graph that contains all elements that are used during the node placement
- layoutContext: HierarchicalLayoutContext
- The HierarchicalLayoutContext instance which provides access to context information for the graph elements.
See Also
API
- dispose