I

IDrawingDistanceCalculator

This interface determines the minimum distances between elements that belong to the same layer.
Inheritance Hierarchy

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

No filters for this type

Methods

Disposes of internal data structures.
Implementations should release internally held data structures when they are not needed anymore.
abstract

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
Main interface method called by ICoordinateAssigner instances to determine the minimum distance between LayoutNodes of the same layer.
One of LayoutNode arguments may be null if its border is not of interest. In that case, only the border of the non-null LayoutNode instance should be considered.
abstract

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 null if 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 null if only the right border of the left LayoutNode is of interest

Return Value

number
the minimum distance between two LayoutNodes of the same layer
Initializes internal data structures.
Implementations may cache lengthy calculations in the initialization phase.
It is guaranteed that the graph will not be changed during subsequent calls to getMinimumDistance.
Implementations should dispose of internally held data structures when they are not needed any more.
abstract

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