CSE115.Fly
Class RepelBehaviour

java.lang.Object
  extended byNGP.Timer
      extended byCSE115.Fly.MoveBehaviour
          extended byCSE115.Fly.RepelBehaviour
All Implemented Interfaces:
ActionListener, EventListener

public class RepelBehaviour
extends MoveBehaviour


Field Summary
 
Fields inherited from class CSE115.Fly.MoveBehaviour
areaOfMovement
 
Constructor Summary
RepelBehaviour(int delay, Rectangle area)
          Creates an object of this class
 
Method Summary
 void activate()
          Moves the Movables away from repelling shapes
 void add(Movable movable, Shape repellingShape)
          Adds to list of Movables
 void remove(Movable movable)
          Removes from list of Movables
 
Methods inherited from class CSE115.Fly.MoveBehaviour
getTheta, placeWithinBounds
 
Methods inherited from class NGP.Timer
actionPerformed, getDelay, setDelay, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepelBehaviour

public RepelBehaviour(int delay,
                      Rectangle area)
Creates an object of this class

Parameters:
delay - inverse of speed
area - bounding area within which Movables are moved
Method Detail

add

public void add(Movable movable,
                Shape repellingShape)
Adds to list of Movables

Parameters:
movable - Movable to be added

remove

public void remove(Movable movable)
Removes from list of Movables

Parameters:
movable - Movable to be removed

activate

public void activate()
Moves the Movables away from repelling shapes