net.sourceforge.olduvai.treejuxtaposer.drawer
Class RangeInTree

java.lang.Object
  extended by net.sourceforge.olduvai.accordiondrawer.DrawableRange
      extended by net.sourceforge.olduvai.treejuxtaposer.drawer.RangeInTree
All Implemented Interfaces:
java.lang.Comparable

public class RangeInTree
extends DrawableRange

A class representing a range (ordered pair (min,max)) of TreeNode indices in a Tree. Extension of RangeInTree, with a drawer for identification.

Author:
Tamara Munzner, Serdar Tasiran, Li Zhang, Yunhong Zhou

Field Summary
protected  AccordionTreeDrawer atd
          Drawer for this range.
static boolean doAdj
          if true, adjacent ranges are equal, and will be combined.
 
Fields inherited from class net.sourceforge.olduvai.accordiondrawer.DrawableRange
drawer, group, max, min
 
Constructor Summary
RangeInTree(int minimum, int maximum, AccordionTreeDrawer t)
          Basic constructor.
 
Method Summary
 int compareTo(java.lang.Object o)
          Special comparator: overlaps are equal, even adjacent non-overlaps if doAdj is true.
 boolean equals(java.lang.Object o)
          Equality function that uses the overlap comparator.
 double getSize(SplitAxis splitAxis, int frameNum)
          Get the world-space size for this range.
 RangeInTree getSplitLineRange(int xy, boolean horiz)
          Convert the RangeInTree of leaf indices into a RangeInTree of split line indices.
 AccordionTreeDrawer getTree()
          Get the drawer for this range
 java.lang.String toString()
          Debug string for this range.
 
Methods inherited from class net.sourceforge.olduvai.accordiondrawer.DrawableRange
getAD, getGroup, getMax, getMin, rangeLength, setGroup, setMax, setMin
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

atd

protected AccordionTreeDrawer atd
Drawer for this range.


doAdj

public static boolean doAdj
if true, adjacent ranges are equal, and will be combined. false is for proper matching for cell overlaps.

Constructor Detail

RangeInTree

public RangeInTree(int minimum,
                   int maximum,
                   AccordionTreeDrawer t)
Basic constructor.

Parameters:
minimum - minimum index of the range
maximum - maximum index of the range
t - drawer for this range.
Method Detail

getTree

public AccordionTreeDrawer getTree()
Get the drawer for this range

Returns:
Drawer atd

toString

public java.lang.String toString()
Debug string for this range.

Overrides:
toString in class java.lang.Object
Returns:
drawer key, min, and max for this range

getSize

public double getSize(SplitAxis splitAxis,
                      int frameNum)
Get the world-space size for this range. Used to determine squishability of ranges in grow function.

Parameters:
splitAxis - Axis used to get size of the range
frameNum - current frame
Returns:
world-space size for this range of split lines

compareTo

public int compareTo(java.lang.Object o)
Special comparator: overlaps are equal, even adjacent non-overlaps if doAdj is true. Will save equal values if RangeList.returnObject is true.


equals

public boolean equals(java.lang.Object o)
Equality function that uses the overlap comparator.

Specified by:
equals in class DrawableRange
Parameters:
o - other rangeInTree to test for overlap.
Returns:
true if ranges overlap, otherwise false.

getSplitLineRange

public RangeInTree getSplitLineRange(int xy,
                                     boolean horiz)
Convert the RangeInTree of leaf indices into a RangeInTree of split line indices.

Parameters:
xy - 0 for X, 1 for Y
horiz - redundant?
Returns:
RangeInTree of split lines in the given direction