|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.display.AbstractTrail
org.opensourcephysics.display.TrailBezier
org.opensourcephysics.display.TrailSmart
public class TrailSmart
TrailSmart adds points to a Bezier trail only if the new point deviates from a straight line. The smart trail algorithm minimizes the number of points drawn.
| Field Summary |
|---|
| Fields inherited from class org.opensourcephysics.display.AbstractTrail |
|---|
closed, color, drawingStroke, enableMeasure, numpts, xmax, xmaxLogscale, xmin, xminLogscale, ymax, ymaxLogscale, ymin, yminLogscale |
| Constructor Summary | |
|---|---|
TrailSmart()
|
|
| Method Summary | |
|---|---|
void |
addPoint(double x,
double y)
Adds a point to the trail. |
protected void |
drawPathEnd(DrawingPanel panel,
java.awt.Graphics2D g2)
Draws the points that have not yet been added to the Bezier spline. |
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. |
void |
setMaxError(double max)
Sets the maximum error. |
| Methods inherited from class org.opensourcephysics.display.TrailBezier |
|---|
clear, closeTrail, draw, getLoader, isMeasured, setSlack |
| Methods inherited from class org.opensourcephysics.display.AbstractTrail |
|---|
getNumberOfPoints, getStroke, getXMaxLogscale, getXMinLogscale, getYMaxLogscale, getYMinLogscale, setDashedStroke, setMeasured, setStroke |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TrailSmart()
| Method Detail |
|---|
public void setMaxError(double max)
max - double
public void addPoint(double x,
double y)
addPoint in class TrailBezierx - doubley - double
protected void drawPathEnd(DrawingPanel panel,
java.awt.Graphics2D g2)
drawPathEnd in class TrailBezierpanel - DrawingPanelg2 - Graphics2Dpublic double getXMin()
getXMin in interface MeasurablegetXMin in class TrailBezierpublic double getXMax()
getXMax in interface MeasurablegetXMax in class TrailBezierpublic double getYMin()
getYMin in interface MeasurablegetYMin in class TrailBezierpublic double getYMax()
getYMax in interface MeasurablegetYMax in class TrailBezier
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||