Class OvalSlider

java.lang.Object
  |
  +--OvalSlider

public class OvalSlider
extends java.lang.Object

This class is used in the Plays put on by homework 3. All the changes necessary for homework 3 should be made in this class. At the minimum, you must turn in your modified version of this OvalSlider.java file. If you would like to do extensions and fancy Actors beyond what is required, you should duplicate this file, rename the copy to your new class name and then build whatever new capabilities that you can imagine into the new class. If you do this, you will need to construct one or more property files in the cast directory that use your new class name.


Constructor Summary
OvalSlider(java.util.Map pMap)
          Create a new OvalSlider, given a property Map that defines various aspects of the shape and the sliding.
 
Method Summary
 void addTo(GWindow w)
          Add the shape to the window
 void doAction(Stage stage)
          Every time the clock ticks, this method is called to perform an action.
 void removeFromWindow()
          Remove the shape from the window
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OvalSlider

public OvalSlider(java.util.Map pMap)
Create a new OvalSlider, given a property Map that defines various aspects of the shape and the sliding.

The following key words and values are implemented for use in the property file that defines each OvalSlider.

Parameters:
pMap - the property Map that defines the specific characteristics of this OvalSlider.
Method Detail

addTo

public void addTo(GWindow w)
Add the shape to the window

Parameters:
w - the window that we are using for this animation

doAction

public void doAction(Stage stage)
Every time the clock ticks, this method is called to perform an action. In our case the action is to slide around the screen. We use the getX() and getY() methods to find out where the shape is right now and then adjust the direction of motion if we are hitting a boundary.

Parameters:
stage - the stage on which we are performing.

removeFromWindow

public void removeFromWindow()
Remove the shape from the window



Generated by BlueJ