org.graffiti.plugins.algorithms.reingoldtilford
Class ContourNodeList

java.lang.Object
  extended by org.graffiti.plugins.algorithms.reingoldtilford.ContourNodeList
Direct Known Subclasses:
TranslatedContourNodeList

public abstract class ContourNodeList
extends Object

Subclasses of ContourNodeList represent contour lines of tree layouts. The contour nodes that constitute this contour cannot be accessed directly but by the use of ContourNodeIterator. The start of the contour lines and the origin of the contour node coordinates are considered to be the top left corner of the Node that is the root of the Tree to which this ContourNodeList belongs.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner

Constructor Summary
ContourNodeList()
           
 
Method Summary
 org.graffiti.plugins.algorithms.reingoldtilford.ContourCombinationInfo calculateCombination(double extraShift, ContourNodeList leftContourOfRightNode)
          Compares two contour lines.
abstract  ContourNodeIterator getFirst()
          Returns an new iterator pointing to the first contour node in this contour.
 String toString()
          Returns the coordinates of the contour nodes as a String.
 void writeToDebugImage(org.graffiti.plugins.tools.debug.DebugImage image, double xOrigin, double yOrigin)
          Draws this contour line in a DebugImage.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContourNodeList

public ContourNodeList()
Method Detail

getFirst

public abstract ContourNodeIterator getFirst()
Returns an new iterator pointing to the first contour node in this contour.

Returns:
an new iterator pointing to the first contour node in this contour.

calculateCombination

public final org.graffiti.plugins.algorithms.reingoldtilford.ContourCombinationInfo calculateCombination(double extraShift,
                                                                                                         ContourNodeList leftContourOfRightNode)
Compares two contour lines. This contour line is considered to be the right contour of a (relatively) left tree layout. leftContourOfRightNode is considered to be the left contour of a (relatively) right tree layout. Both contour lines are considered to start at the same coordinate. The ContourCombinationInfo.shift field of the returned ContourCombinationInfo denotes how far the right tree must be moved horizontally to the right so that both tree layouts contact but do not intersect. extraShift is added to shift in order to reflect the position of the root nodes within their tree layout and to enforce a minimal horizontal distance between the tree layouts. The ContourCombinationInfo.connectionNode field contains information for the combination of both tree layouts. The ContourCombinationInfo.comparedHeights field tells if a (or which) tree layout is of greater height.

Parameters:
extraShift - is added to the shift field of the returned ContourCombinationInfo.
leftContourOfRightNode - the left contour of the right tree layout. this is interpreted as the right contour of the left tree layout.
Returns:
a ContourCombinationInfo with information for the combination of two tree layouts.
See Also:
Tree

toString

public String toString()
Returns the coordinates of the contour nodes as a String.

Overrides:
toString in class Object

writeToDebugImage

public void writeToDebugImage(org.graffiti.plugins.tools.debug.DebugImage image,
                              double xOrigin,
                              double yOrigin)
Draws this contour line in a DebugImage.

Parameters:
image - the image in which is drawn.
xOrigin - the x-coordinate in the image where the contour line shall start.
yOrigin - the y-coordinate in the image where the contour line shall start.


Generated at 2012-05-30 11:01:25 PM CEST