Class PositionedSceneElement

java.lang.Object
  extended by PositionedSceneElement

public class PositionedSceneElement
extends Object

Class that represents a positioned scene element

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
PositionedSceneElement(Picture heldPic)
          Make a new element with a picture as input, and next as null.
 
Method Summary
 PositionedSceneElement copy()
           
 void drawFromMeOn(Picture bg)
          Method to draw from this node on in the list, using blueScreen.
 PositionedSceneElement getNext()
          Method to get the next element
 Picture getPicture()
          Returns the picture in the node.
 void insertAfter(PositionedSceneElement node)
          Insert the input node after this node.
 PositionedSceneElement last()
          Method to get the last element
 void remove(PositionedSceneElement node)
          Method to remove a node from a list, fixing links appropriately.
 void replace(Picture oldPic, Picture newPic)
          Replace the one picture with the other picture in all the elements from me on.
 void setNext(PositionedSceneElement nextOne)
          Method to set the next element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionedSceneElement

public PositionedSceneElement(Picture heldPic)
Make a new element with a picture as input, and next as null.

Parameters:
heldPic - Picture for element to hold
Method Detail

setNext

public void setNext(PositionedSceneElement nextOne)
Method to set the next element

Parameters:
nextOne - next element in list

getNext

public PositionedSceneElement getNext()
Method to get the next element

Returns:
the next element in the list

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(PositionedSceneElement node)
Method to remove a node from a list, fixing links appropriately.

Parameters:
node - element to remove from list.

insertAfter

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

Parameters:
node - element to insert after this.

copy

public PositionedSceneElement copy()

replace

public void replace(Picture oldPic,
                    Picture newPic)
Replace the one picture with the other picture in all the elements from me on. Decide two pictures are equal if come from same filename

Parameters:
oldPic - Picture to be replaced
newPic - Picture to put in its place

last

public PositionedSceneElement last()
Method to get the last element

Returns:
the last element in the list