de.unifreiburg.twodeedoo.scene.test
Class StubPhasedPuppet

java.lang.Object
  extended by de.unifreiburg.twodeedoo.scene.test.StubPhasedPuppet
All Implemented Interfaces:
IPhasedPuppet, IPuppet, IPainter

public class StubPhasedPuppet
extends java.lang.Object
implements IPhasedPuppet

IPhasedPuppet impl with simple fields behind the setters.

Author:
anton

Field Summary
 
Fields inherited from interface de.unifreiburg.twodeedoo.scene.IPuppet
NULL_OBJECT
 
Constructor Summary
StubPhasedPuppet(int numberOfPhases)
           
 
Method Summary
 int getCurrentPhase()
           
 int getNumberOfPhases()
          How many phases?
 int getX()
          X coordinate
 int getY()
          Y coordinate
 void moveAbs(int x, int y)
          Move the reference point to new coordinates.
 void paint(java.awt.Graphics g)
          Paint something on my coordinates on the given graphics context.
 void removeFromScene()
          Not implemented.
 void setContainingScene(IScene scene)
          Not implemented.
 void setPhase(int phase)
          Which phase to draw from now on
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StubPhasedPuppet

public StubPhasedPuppet(int numberOfPhases)
Method Detail

setPhase

public void setPhase(int phase)
Description copied from interface: IPhasedPuppet
Which phase to draw from now on

Specified by:
setPhase in interface IPhasedPuppet
Parameters:
phase - must be at least 0 and less than IPhasedPuppet.getNumberOfPhases()

getX

public int getX()
Description copied from interface: IPuppet
X coordinate

Specified by:
getX in interface IPuppet
Returns:
x coordinate in scene units

getY

public int getY()
Description copied from interface: IPuppet
Y coordinate

Specified by:
getY in interface IPuppet
Returns:
y coordinate in scene units

moveAbs

public void moveAbs(int x,
                    int y)
Description copied from interface: IPuppet
Move the reference point to new coordinates.

Specified by:
moveAbs in interface IPuppet
Parameters:
x - x coordinate in the scene of my reference point
y - y coordinate in the scene of my reference point.

paint

public void paint(java.awt.Graphics g)
Description copied from interface: IPainter
Paint something on my coordinates on the given graphics context.

Specified by:
paint in interface IPainter
Parameters:
g - some graphics context.

getCurrentPhase

public int getCurrentPhase()
Returns:
the currentPhase

getNumberOfPhases

public int getNumberOfPhases()
Description copied from interface: IPhasedPuppet
How many phases?

Specified by:
getNumberOfPhases in interface IPhasedPuppet
Returns:
number of phases (at least 1)

removeFromScene

public void removeFromScene()
Not implemented.

Specified by:
removeFromScene in interface IPuppet
See Also:
IPuppet.removeFromScene()

setContainingScene

public void setContainingScene(IScene scene)
Not implemented.

Specified by:
setContainingScene in interface IPuppet
Parameters:
scene - the new scene. Could be a non-displaying scene.
See Also:
IPuppet.setContainingScene(de.unifreiburg.twodeedoo.scene.IScene)