public interface IDrawingDistanceCalculator
IDrawingDistanceCalculator is implemented by a helper class used by HierarchicLayoutCore during the
phase of node placement (i.e. when the final coordinates for all nodes are calculated). INodePlacer 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 ILayoutDataProvider while information
about layers is given through ILayer (describes a single layer of the hierarchic layout) or ILayers
(manages multiple layers of the hierarchic layout).
Implementations not needed any more should be disposed of.
The default implementation used by the HierarchicLayoutCore is DefaultDrawingDistanceCalculator.
| Modifier and Type | Method and Description |
|---|---|
void |
dispose(LayoutGraph graph,
ILayers layers,
ILayoutDataProvider ldp)
Disposes of internal data structures.
|
double |
getMinDistance(LayoutGraph graph,
ILayer layer,
ILayoutDataProvider ldp,
Node left,
Node right)
Main interface method called by
INodePlacer instances to determine the
minimum distance between Nodes of same layer. |
void |
initialize(LayoutGraph graph,
ILayers layers,
ILayoutDataProvider ldp)
Initializes internal data structures.
|
void dispose(LayoutGraph graph, ILayers layers, ILayoutDataProvider ldp)
Implementations should release internally held data structures when they are not needed any more.
graph - the input graph that contains all elements that are used during the node placementlayers - the ILayers object that will be used during subsequent callsldp - the ILayoutDataProvider implementation which provides access to the INodeData
and IEdgeData instancesinitialize(LayoutGraph, ILayers, ILayoutDataProvider)double getMinDistance(LayoutGraph graph, ILayer layer, ILayoutDataProvider ldp, Node left, Node right)
INodePlacer instances to determine the
minimum distance between Nodes of same layer.Node arguments may be null if its border is not of interest. In that case, only the border of the
non-null Node instance should be considered.graph - the input graphlayer - the ILayer object that will be used during subsequent callsldp - the ILayoutDataProvider implementation which provides access to the INodeData
and IEdgeData instancesleft - the left of the two Nodes whose minimum distance is to be determined or null if only the left border of
the right Node is of interestright - the right of the two Nodes whose minimum distance is to be determined or null if only the right border
of the left Node is of interestNodes of the same layervoid initialize(LayoutGraph graph, ILayers layers, ILayoutDataProvider ldp)
Implementations may cache lengthy calculations in the initialization phase.
getMinDistance(LayoutGraph, ILayer, ILayoutDataProvider, Node, Node).graph - the input graph that contains all elements that are used during the node placementlayers - the ILayers object that will be used during subsequent callsldp - the ILayoutDataProvider implementation which provides access to the INodeData
and IEdgeData instancesdispose(LayoutGraph, ILayers, ILayoutDataProvider)