Class LayeredSceneElement

java.lang.Object
  extended byLayeredSceneElement

public class LayeredSceneElement
extends Object


Constructor Summary
LayeredSceneElement(Picture heldPic, int xpos, int ypos)
          Make a new element with a picture as input, and next as null, to be drawn at given x,y
 
Method Summary
 void add(LayeredSceneElement node)
          Add the input node after the last node in this list.
 void drawFromMeOn(Picture bg)
          Method to draw from this node on in the list, using bluescreen.
 LayeredSceneElement getNext()
           
 Picture getPicture()
          Returns the picture in the node.
 void insertAfter(LayeredSceneElement node)
          Insert the input node after this node.
 LayeredSceneElement last()
          Return the last element in the list
 void remove(LayeredSceneElement node)
          Method to remove node from list, fixing links appropriately.
 LayeredSceneElement reverse()
          Reverse the list starting at this, and return the last element of the list.
 void setNext(LayeredSceneElement 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
 

Constructor Detail

LayeredSceneElement

public LayeredSceneElement(Picture heldPic,
                           int xpos,
                           int ypos)
Make a new element with a picture as input, and next as null, to be drawn at given x,y

Parameters:
heldPic - Picture for element to hold
xpos - x position desired for element
ypos - y position desired for element
Method Detail

setNext

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

Parameters:
nextOne - next element in list

getNext

public LayeredSceneElement getNext()

getPicture

public Picture getPicture()
Returns the picture in the node.

Returns:
the picture in the node

drawFromMeOn

public void drawFromMeOn(Picture bg)
Method to draw from this node on in the list, using bluescreen. Each new element has it's lower-left corner at the lower-right of the previous node. Starts drawing from left-bottom

Parameters:
bg - Picture to draw drawing on

remove

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

Parameters:
node - element to remove from list.

last

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


reverse

public LayeredSceneElement reverse()
Reverse the list starting at this, and return the last element of the list. The last element becomes the FIRST element of the list, and THIS points to null.


add

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

Parameters:
node - element to insert after this.

insertAfter

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

Parameters:
node - element to insert after this.