|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTreeDraw.TreeDrawingInstructions
class TreeDrawingInstructions
Instances of this class are trees which contain useful information to draw a LabelledTree. The structure of a TreeDrawingInstructions instance is the same as that of its associated Tree instance, but each TreeDrawingInstructions node contains four useful parameters to draw a tree node: center, width, offset and childOffset. Parameter semantics is as follows: center: X coord of tree's center width: rightmost X coord of tree offset: X coord of tree's root childOffset: X coord of tree's leftmost child
Field Summary | |
---|---|
private double |
center
|
private double |
childOffset
|
private TreeDrawingInstructions[] |
children
The instructions to draw this tree's children. |
private double |
offset
|
private LabelledTree |
tree
The labelled tree to draw. |
private double |
width
|
Constructor Summary | |
---|---|
TreeDrawingInstructions(LabelledTree tree,
TreeDrawingInstructions[] children,
double offset,
double childOffset,
double center,
double width)
Creates a TreeDrawingInstructions instance from its attributes. |
Method Summary | |
---|---|
double |
getCenter()
|
Tree |
getChild(int i)
Returns the ith child of this instructions node. |
double |
getChildOffset()
|
java.lang.String |
getLabel()
Returns this instructions node's tree's root node's label. |
double |
getOffset()
|
LabelledTree |
getTree()
Returns the labelled tree to draw. |
double |
getWidth()
|
int |
numChildren()
Returns the number of children of this instructions node. |
java.lang.String |
toString()
Returns a string representation of this instruction tree. |
private void |
toStringAux(int nestLevel,
java.lang.StringBuffer toAppendTo)
Auxilliary method for toString() implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private LabelledTree tree
private double center
private double width
private double offset
private double childOffset
private TreeDrawingInstructions[] children
Constructor Detail |
---|
public TreeDrawingInstructions(LabelledTree tree, TreeDrawingInstructions[] children, double offset, double childOffset, double center, double width)
tree
- children
- offset
- childOffset
- center
- width
- Method Detail |
---|
public double getChildOffset()
public LabelledTree getTree()
public double getCenter()
public double getOffset()
public double getWidth()
public int numChildren()
numChildren
in interface Tree
public Tree getChild(int i)
getChild
in interface Tree
public java.lang.String getLabel()
private void toStringAux(int nestLevel, java.lang.StringBuffer toAppendTo)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |