All Packages Class Hierarchy This Package Previous Next Index
Class sim.display.PlotXY
java.lang.Object
|
+----sim.display.Plot
|
+----sim.display.PlotXY
- public class PlotXY
- extends Plot
This Plot records (x,y) pairs and plots then, with or without symbols,
either connected by lines or not, with one color for lines and another
for filling the symbols.
This code is (c) 1996,1997 Ansgar Laubsch and Leemon Baird
<leemon@cs.cmu.edu>,
http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
- Version:
- 2.0, 15 May 97
- Author:
- Ansgar Laubsch, Leemon Baird
-
PlotXY()
-
-
addDataPoint(double, double)
- function addDataPoint
add a new data point and redraw the whole graph
-
addRect(double, double)
- function addRect
adds rect.
-
autoscaleBounds(PDouble, PDouble, PDouble, PDouble)
- Put preferred autoscaling bounds into the variables pointed to by these
four pointers.
-
drawAll(Graphics, double, double, double, double, int, int, int, int, int, int)
- draws 2D-Plot of data in global arrays (min/max, first/last X/Y)
-
getParameters(int)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
-
initialize(int)
- Initialize, either partially or completely.
-
mergeRect(int, int, int)
- function mergeRect
Merges the two given rects with array indices rect1 and rect2
into new array element newRect
-
reOrg()
- function reOrg
Reorganizes the arrays when nRects has reached maxNRects.val
by merging pairs of rects.
-
setWatchManager(WatchManager, String)
- Remember the WatchManager for this object and create the window.
-
unregister(String)
- One of the watched variables has been unregistered.
-
update(String, Pointer, Watchable)
- One of the watched variables has changed, so look at it and others.
PlotXY
public PlotXY()
getParameters
public Object[][] getParameters(int lang)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
- Overrides:
- getParameters in class Plot
- See Also:
- getParameters
setWatchManager
public void setWatchManager(WatchManager wm,
String name)
- Remember the WatchManager for this object and create the window.
After everything is parsed and windows are created, all experiments
are given a watchManager by Simulator, then it starts giving each
Display a watchManager. This is where
the Display should register each variable it wants to watch.
- Overrides:
- setWatchManager in class Plot
unregister
public void unregister(String watchedVar)
- One of the watched variables has been unregistered.
- Overrides:
- unregister in class Plot
update
public void update(String changedName,
Pointer changedVar,
Watchable obj)
- One of the watched variables has changed, so look at it and others.
- Overrides:
- update in class Plot
addDataPoint
public void addDataPoint(double newX,
double newY)
- function addDataPoint
add a new data point and redraw the whole graph
addRect
public void addRect(double newX,
double newY)
- function addRect
adds rect. (represented by one point) to end of (global) arrays
reOrg
public void reOrg()
- function reOrg
Reorganizes the arrays when nRects has reached maxNRects.val
by merging pairs of rects. into one rect.
=> new array-size = nRects / 2
mergeRect
public void mergeRect(int rect1,
int rect2,
int newRect)
- function mergeRect
Merges the two given rects with array indices rect1 and rect2
into new array element newRect
drawAll
public void drawAll(Graphics g,
double xMin,
double xMax,
double yMin,
double yMax,
int startX,
int startY,
int xAxisX,
int xAxisY,
int yAxisX,
int yAxisY)
- draws 2D-Plot of data in global arrays (min/max, first/last X/Y)
- Overrides:
- drawAll in class Plot
autoscaleBounds
public void autoscaleBounds(PDouble xMin,
PDouble xMax,
PDouble yMin,
PDouble yMax)
- Put preferred autoscaling bounds into the variables pointed to by these
four pointers. Change the variables only if the bounds should be
expanded to be larger than what the variables already say.
- Overrides:
- autoscaleBounds in class Plot
initialize
public void initialize(int level)
- Initialize, either partially or completely.
- Overrides:
- initialize in class Plot
- See Also:
- initialize
All Packages Class Hierarchy This Package Previous Next Index