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 TypeMethodDescriptionvoid
addDrawable
(Drawable drawable) Adds a drawable object to the drawable list.void
draw
(DrawingPanel panel, 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
Methods 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
-
-