Search this API

y.layout.hierarchic.incremental
Interface DrawingDistanceCalculator

All Known Implementing Classes:
DefaultDrawingDistanceCalculator, TypeBasedDrawingDistanceCalculator

public interface DrawingDistanceCalculator

Interface for a helper class used by HierarchicLayouter during the node placement phase. NodePlacer uses instances that implement this interface to determine the minimum distances between elements in one layer. The default implementation used in the HierarchicLayouter is DefaultDrawingDistanceCalculator.


Method Summary
 void dispose(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
          Called to dispose internal data structures.
 double getMinDistance(LayoutGraph graph, Layer layer, LayoutDataProvider ldp, Node left, Node right)
          Main interface method.
 void initialize(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
          Called to initialize internal data structures.
 

Method Detail

initialize

void initialize(LayoutGraph graph,
                Layers layers,
                LayoutDataProvider ldp)
Called to initialize 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 getMinDistance(LayoutGraph, Layer, LayoutDataProvider, Node, Node).

Parameters:
graph - the graph that contains all elements that are used during the node placement
layers - the Layers object that will be used during subsequent calls
ldp - the LayoutDataProvider that can be used to query information
See Also:
dispose(LayoutGraph, Layers, LayoutDataProvider)

getMinDistance

double getMinDistance(LayoutGraph graph,
                      Layer layer,
                      LayoutDataProvider ldp,
                      Node left,
                      Node right)
Main interface method. Queried by NodePlacer instances to determine the minimum distances between elements in one layer. Note that either of the Node arguments may be null. In that case only the border of the non-null node should be considered.

Parameters:
graph - the graph that contains the nodes
layer - the layer object that contains the nodes
ldp - the LayoutDataProvider that can be used to query information
left - the left one of the two nodes whose minimum distance is to be determined or null if only the left border of the right node is of interest.
right - the right one of the two nodes whose minimum distance is to be determined or null if only the right border of the left node is of interest.

dispose

void dispose(LayoutGraph graph,
             Layers layers,
             LayoutDataProvider ldp)
Called to dispose internal data structures. Implementations should release internally held data structures here.

Parameters:
graph - the graph that contains all elements that are used during the node placement
layers - the Layers object that was used
ldp - the LayoutDataProvider that was used to query information
See Also:
initialize(LayoutGraph, Layers, LayoutDataProvider)

© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.