|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.ode.OrbitPoints2D
public class OrbitPoints2D
This class really just represents a list of points that can be drawn as dots or a connected sequence of line segments. It is possible to add points and have those points show up in a View without redrawing the entire contents of the View. (The new points are just added to the existing bitmap in the View.) This class is meant for storing the points on the soltion curve of an ODE in two dimensions.
Field Summary | |
---|---|
static int |
DOTS
A constant for selecting whether the points should be drawn as individual dots or should be connectined by lines. |
static int |
LINES
A constant for selecting whether the points should be drawn as individual dots or should be connectined by lines. |
Constructor Summary | |
---|---|
OrbitPoints2D()
|
Method Summary | |
---|---|
boolean |
addNow(View view,
java.awt.geom.Point2D pt)
Adds a point to the list, and show the new point in the specified view. |
boolean |
addNow(View view,
java.awt.geom.Point2D[] pts)
Adds an array full of specified points to the list, and shows them in the specfied view. |
void |
addPoint(java.awt.geom.Point2D pt)
Adds a specified point to the end of the list. |
void |
addPoints(java.awt.geom.Point2D[] pts)
Adds all the points from an array to the curve by calling addPoint(Point2D) for
each element in the array. |
void |
clear()
Removes all points from the list. |
void |
draw(java.awt.Graphics2D g,
View view,
Transform transform)
Draws the entire list of points. |
void |
drawPoint(View view,
int index)
Draws the point at the specified index, with a connecting line to the preceding point if appropriate. |
java.awt.Color |
getColor()
Get the color that will be used to draw the points. |
double |
getDotDiameter()
Returns the diameter of the dots that are used to draw points, when the draw style is DOTS . |
java.awt.geom.Point2D |
getPoint(int i)
Gets the i-th point from the list. |
int |
getPointCount()
Returns the number of points currently in the list. |
int |
getStyle()
Get the style used to draw the points, either OrbitPoint2D.LINES or OrbitPoint2D.DOTS. |
void |
setColor(java.awt.Color color)
Set the color that will be used to draw the points. |
void |
setDotDiameter(double dotDiameter)
Sets diameter of the dots that are used to draw points, when the draw style is DOTS . |
void |
setStyle(int style)
Set the style used to draw the points, either OrbitPoint2D.LINES or OrbitPoint2D.DOTS. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LINES
public static final int DOTS
Constructor Detail |
---|
public OrbitPoints2D()
Method Detail |
---|
public int getPointCount()
public java.awt.geom.Point2D getPoint(int i)
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
public int getStyle()
public void setStyle(int style)
public double getDotDiameter()
DOTS
.
setDotDiameter(double)
public void setDotDiameter(double dotDiameter)
DOTS
. The diameter is specified in pixels. Values
less than 1 are quitely changed to 1.
public void clear()
public void addPoint(java.awt.geom.Point2D pt)
addNow(View, Point2D)
public void addPoints(java.awt.geom.Point2D[] pts)
addPoint(Point2D)
for
each element in the array. The value of pts must be non-null. A class that
uses this method should make sure that any View that contains the orbit is redrawn.
NOTE: Null values IN THE ARRAY will not cause an error. They will simply produce breaks in the curve.
addNow(View, Point2D[])
public boolean addNow(View view, java.awt.geom.Point2D pt)
view
- The view where the point is to immediately appear. If this is null, the
point is still added to the list, but no immediately visible changes are made.pt
- The point to be added. A null value is not an error; it will just cause a
gap in the curve.public boolean addNow(View view, java.awt.geom.Point2D[] pts)
view
- The view where the point is to immediately appear. If this is null, the
point is still added to the list, but no immediately visible changes are made.pts
- The points to be added. The value must be non-null. A null value in this array
is not an error; it will just cause a gap in the curve.public void drawPoint(View view, int index)
public void draw(java.awt.Graphics2D g, View view, Transform transform)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |