Class VBranch

java.lang.Object
  extended by DrawableNode
      extended by Branch
          extended by VBranch

public class VBranch
extends Branch

Class that uses vertical spacing between children with a gap between children as well

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
VBranch(int spacing)
          Construct a branch with children and next as null
 
Method Summary
 void drawWith(Turtle turtle)
          Ask all our children to draw, then let the next node draw
 String toString()
          Method to return a string with information about this branch
 
Methods inherited from class Branch
addChild, getFirstChild
 
Methods inherited from class DrawableNode
add, drawOn, getNext, insertAfter, last, remove, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VBranch

public VBranch(int spacing)
Construct a branch with children and next as null

Parameters:
spacing - the gap to use
Method Detail

toString

public String toString()
Method to return a string with information about this branch

Overrides:
toString in class Branch
Returns:
the information string

drawWith

public void drawWith(Turtle turtle)
Ask all our children to draw, then let the next node draw

Overrides:
drawWith in class Branch
Parameters:
turtle - the Turtle to draw with