Class Wall

java.lang.Object
  extended by BoxedBallsObject
      extended by StationaryObject
          extended by Wall
All Implemented Interfaces:
DrawableFigure, Polygon

public class Wall
extends StationaryObject
implements Polygon

Creates a stationary object "Wall," which is a polygon, and implements interface Polygon.


Field Summary
 
Fields inherited from class StationaryObject
STATIONARY_OBJECT_MASS, STATIONARY_OBJECT_VELOCITY
 
Constructor Summary
Wall()
          initializes Wall as a rectangle with all coordinates at (0,0)
Wall(String s, Color c, int[] newXPolygon, int[] newYPolygon, int newNumberOfPoints)
          Creates a polygonal wall.
 
Method Summary
 void draw(Graphics canvas)
          Draws the wall onto Graphics object canvas
 int[] getXCoordinates()
           
 int[] getYCoordinates()
           
 void setCoordinates(int[] x, int[] y, int n)
          sets coordinates of polygon
 
Methods inherited from class StationaryObject
getColor, getMass, getXVelocity, getYVelocity
 
Methods inherited from class BoxedBallsObject
getName, setColor, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Wall

public Wall()
initializes Wall as a rectangle with all coordinates at (0,0)


Wall

public Wall(String s,
            Color c,
            int[] newXPolygon,
            int[] newYPolygon,
            int newNumberOfPoints)
Creates a polygonal wall.

Parameters:
name - s, color c
newXPolygon - an array of x values
newYPolygon - an array of y values
Method Detail

setCoordinates

public void setCoordinates(int[] x,
                           int[] y,
                           int n)
Description copied from interface: Polygon
sets coordinates of polygon

Specified by:
setCoordinates in interface Polygon

getXCoordinates

public int[] getXCoordinates()

getYCoordinates

public int[] getYCoordinates()

draw

public void draw(Graphics canvas)
Draws the wall onto Graphics object canvas

Specified by:
draw in interface DrawableFigure