org.opensourcephysics.display
Class DrawableGroup

java.lang.Object
  extended by org.opensourcephysics.display.DrawableGroup
All Implemented Interfaces:
Drawable

public class DrawableGroup
extends java.lang.Object
implements Drawable

Draws a group of shapes.

Version:
1.0
Author:
Wolfgang Christian

Field Summary
protected  java.util.ArrayList<Drawable> drawableList
           
protected  double theta
           
protected  double x
           
protected  double y
           
 
Constructor Summary
DrawableGroup()
           
 
Method Summary
 void addDrawable(Drawable drawable)
          Adds a drawable object to the drawable list.
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Draws the shapes in the drawable list.
 double getTheta()
          Gets the rotation angle in radians.
 double getX()
          Gets the x location.
 double getY()
          Gets the y location.
 void setTheta(double _theta)
          Sets the rotation angle in radians.
 void setX(double _x)
          Sets the x coordinate.
 void setXY(double _x, double _y)
          Sets the x and y coordinates.
 void setY(double _y)
          Sets the y coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected double x

y

protected double y

theta

protected double theta

drawableList

protected java.util.ArrayList<Drawable> drawableList
Constructor Detail

DrawableGroup

public DrawableGroup()
Method Detail

addDrawable

public void addDrawable(Drawable drawable)
Adds a drawable object to the drawable list.

Parameters:
drawable -

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Draws the shapes in the drawable list.

Specified by:
draw in interface Drawable
Parameters:
panel - the drawing panel
g - the graphics context

setXY

public void setXY(double _x,
                  double _y)
Sets the x and y coordinates.

Parameters:
_x - double
_y - double

setX

public void setX(double _x)
Sets the x coordinate.

Parameters:
_x -

getX

public double getX()
Gets the x location.

Returns:
x

getY

public double getY()
Gets the y location.

Returns:
y

setY

public void setY(double _y)
Sets the y coordinate.

Parameters:
_y -

getTheta

public double getTheta()
Gets the rotation angle in radians.

Returns:
theta

setTheta

public void setTheta(double _theta)
Sets the rotation angle in radians.

Parameters:
_theta -