Package org.opensourcephysics.display
Class DrawableGroup
java.lang.Object
org.opensourcephysics.display.DrawableGroup
- All Implemented Interfaces:
Drawable
Draws a group of shapes.
- Version:
- 1.0
- Author:
- Wolfgang Christian
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDrawable(Drawable drawable) Adds a drawable object to the drawable list.voiddraw(DrawingPanel panel, Graphics g) Draws the shapes in the drawable list.doublegetTheta()Gets the rotation angle in radians.doublegetX()Gets the x location.doublegetY()Gets the y location.voidsetTheta(double _theta) Sets the rotation angle in radians.voidsetX(double _x) Sets the x coordinate.voidsetXY(double _x, double _y) Sets the x and y coordinates.voidsetY(double _y) Sets the y coordinate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Drawable
isInteractive
-
Field Details
-
x
protected double x -
y
protected double y -
theta
protected double theta -
drawableList
-
-
Constructor Details
-
DrawableGroup
public DrawableGroup()
-
-
Method Details
-
addDrawable
Adds a drawable object to the drawable list.- Parameters:
drawable-
-
draw
Draws the shapes in the drawable list. -
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-
-