CSE115.ShapeWorld.BouncyShapes
Class Lab4BouncingTriangle

java.lang.Object
  extended by NGP.Graphics.Shape
      extended by NGP.Graphics.RectangularShape
          extended by NGP.Graphics.FilledRectangularShape
              extended by CSE115.Graphics.FilledTriangle
                  extended by CSE115.ShapeWorld.BouncyShapes.Lab4BouncingTriangle
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener, Colorable, Graphic, Locatable, Reactor, Rotatable, Sizeable

public class Lab4BouncingTriangle
extends FilledTriangle

A triangle that bounces around on an applet.

Author:
Adrienne Decker

Field Summary
 
Fields inherited from interface NGP.Colorable
DEFAULT_GRAY
 
Constructor Summary
Lab4BouncingTriangle()
          Creates a new Triangle instance.
 
Method Summary
 void setRotationSpeed(RotationSpeed speed)
          Sets the rate of rotation for the triangle
 void setSize(Size size)
          Sets the size of the Triangle
 void setVelocity(Velocity velocity)
          Sets the velocity of the triangle
 
Methods inherited from class NGP.Graphics.FilledRectangularShape
actualPaint
 
Methods inherited from class NGP.Graphics.RectangularShape
getDimension, getLocation, setCenterLocation, setDimension, setLocation, unwrap, wrap
 
Methods inherited from class NGP.Graphics.Shape
contains, drag, getBounds, getCenterLocation, getColor, getDrawingPanel, getRotation, hide, intersects, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, react, setColor, setDrawingPanel, setRotation, show
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lab4BouncingTriangle

public Lab4BouncingTriangle()
Creates a new Triangle instance.

Method Detail

setSize

public void setSize(Size size)
Sets the size of the Triangle

Parameters:
size - - the size to make the triangle

setVelocity

public void setVelocity(Velocity velocity)
Sets the velocity of the triangle

Parameters:
velocity - - the speed at which the triangle should move

setRotationSpeed

public void setRotationSpeed(RotationSpeed speed)
Sets the rate of rotation for the triangle

Parameters:
speed - - the speed at which the triangle should rotate