Class DrawableNode

java.lang.Object
  extended byDrawableNode
Direct Known Subclasses:
Branch, PictNode

public abstract class DrawableNode
extends Object

Stuff that all nodes and branches in the scene tree know.


Field Summary
 DrawableNode next
          The next branch/node/whatever to process
 
Constructor Summary
DrawableNode()
          Constructor for DrawableNode just sets next to null
 
Method Summary
 void add(DrawableNode node)
          Add the input node after the last node in this list.
 void drawOn(Picture bg)
          Draw on the given picture
abstract  void drawWith(Turtle t)
          Use the given turtle to draw oneself
 DrawableNode getNext()
           
 void insertAfter(DrawableNode node)
          Insert the input node after this node.
 DrawableNode last()
          Return the last element in the list
 void remove(DrawableNode node)
          Method to remove node from list, fixing links appropriately.
 void setNext(DrawableNode nextOne)
          Methods to set and get next elements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

public DrawableNode next
The next branch/node/whatever to process

Constructor Detail

DrawableNode

public DrawableNode()
Constructor for DrawableNode just sets next to null

Method Detail

setNext

public void setNext(DrawableNode nextOne)
Methods to set and get next elements

Parameters:
nextOne - next element in list

getNext

public DrawableNode getNext()

drawWith

public abstract void drawWith(Turtle t)
Use the given turtle to draw oneself

Parameters:
t - the Turtle to draw with

drawOn

public void drawOn(Picture bg)
Draw on the given picture


remove

public void remove(DrawableNode node)
Method to remove node from list, fixing links appropriately.

Parameters:
node - element to remove from list.

insertAfter

public void insertAfter(DrawableNode node)
Insert the input node after this node.

Parameters:
node - element to insert after this.

last

public DrawableNode last()
Return the last element in the list


add

public void add(DrawableNode node)
Add the input node after the last node in this list.

Parameters:
node - element to insert after this.