Class ParticleFrame

All Implemented Interfaces:
ClipboardOwner, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, AppFrame, Hidable

public class ParticleFrame extends DrawingFrame
A DrawingFrame that displays particles. Particle locations are specified using a Point2D. The default particle drawing shape is a circle.
Version:
1.0
Author:
W. Christian
See Also:
  • Constructor Details

    • ParticleFrame

      public ParticleFrame(String xlabel, String ylabel, String frameTitle)
      Constructs the ParticleFrame with the given labels and frame title.
      Parameters:
      xlabel - String
      ylabel - String
      frameTitle - String
  • Method Details

    • checkIndex

      protected org.opensourcephysics.frames.ParticleFrame.Particles checkIndex(int index)
      Ensures capacity
      Parameters:
      index -
    • addParticle

      public void addParticle(int i, Point2D point)
      Adds a particle to the frame.
      Parameters:
      i -
      point -
    • addParicle

      public void addParicle(int i, Point2D[] points)
      Adds an array of particles to the frame.
      Parameters:
      i -
      points -
    • setDrawingShape

      public void setDrawingShape(int i, Interactive shape)
      Sets the drawing shape for the particles.
      Parameters:
      i -
      shape - Interactive
    • clearDrawables

      public void clearDrawables()
      Cleares drawable objects added by the user from this frame and clears the particles.
      Overrides:
      clearDrawables in class DrawingFrame
    • clearData

      public void clearData()
      Clears all particles from this frame.
      Overrides:
      clearData in class OSPFrame