Class DrawableGroup

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

public class DrawableGroup extends Object implements Drawable
Draws a group of shapes.
Version:
1.0
Author:
Wolfgang Christian
  • Field Details

    • x

      protected double x
    • y

      protected double y
    • theta

      protected double theta
    • drawableList

      protected ArrayList<Drawable> drawableList
  • Constructor Details

    • DrawableGroup

      public DrawableGroup()
  • Method Details

    • addDrawable

      public void addDrawable(Drawable drawable)
      Adds a drawable object to the drawable list.
      Parameters:
      drawable -
    • draw

      public void draw(DrawingPanel panel, 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 -