org.opensourcephysics.display
Class TrailBezier

java.lang.Object
  extended byorg.opensourcephysics.display.TrailBezier
All Implemented Interfaces:
Drawable, Measurable

public class TrailBezier
extends java.lang.Object
implements Measurable

TrailBezier defines a trail of points connected by a Bezier spline. This object is often used to show the path of a moving object.


Field Summary
 java.awt.Color color
           
 
Constructor Summary
TrailBezier()
           
 
Method Summary
 void addPoint(double x, double y)
          Adds a point to the trail.
 void clear()
          Clears all points from the trail.
 void closeTrail()
           
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Draw the trail on the panel.
static XML.ObjectLoader getLoader()
          Returns the XML.ObjectLoader for this class.
 double getXMax()
          Gets the maximum x value in the trail.
 double getXMin()
          Gets the minimum x value in the trail.
 double getYMax()
          Gets the maximum y value in the trail.
 double getYMin()
          Gets the minimum y value in the trail.
 boolean isMeasured()
          Determines if this trail scales the drawing panel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

color

public java.awt.Color color
Constructor Detail

TrailBezier

public TrailBezier()
Method Detail

addPoint

public void addPoint(double x,
                     double y)
Adds a point to the trail.

Parameters:
x - double
y - double

closeTrail

public void closeTrail()

clear

public void clear()
Clears all points from the trail.


draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Draw the trail on the panel.

Specified by:
draw in interface Drawable
Parameters:
g -
panel -

getLoader

public static XML.ObjectLoader getLoader()
Returns the XML.ObjectLoader for this class.

Returns:
the object loader

isMeasured

public boolean isMeasured()
Determines if this trail scales the drawing panel.

Specified by:
isMeasured in interface Measurable
Returns:
boolean

getXMin

public double getXMin()
Gets the minimum x value in the trail.

Specified by:
getXMin in interface Measurable
Returns:
double

getXMax

public double getXMax()
Gets the maximum x value in the trail.

Specified by:
getXMax in interface Measurable
Returns:
double

getYMin

public double getYMin()
Gets the minimum y value in the trail.

Specified by:
getYMin in interface Measurable
Returns:
double

getYMax

public double getYMax()
Gets the maximum y value in the trail.

Specified by:
getYMax in interface Measurable
Returns:
double