All Packages Class Hierarchy This Package Previous Next Index
Class sim.display.Plot
java.lang.Object
|
+----sim.display.Plot
- public abstract class Plot
- extends Object
- implements Parsable, Watchable, Watcher
Classes inheriting from Plot represent one layer in a Graph2D display,
or one layer on the bottom of the cube in a Graph3D display.
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:
- 1.0 15 May 97
- Author:
- Leemon Baird
-
parentDisplay
- the Display that this plot will be drawn on
-
watchManager
- the WatchManager that this class registers with
-
wmName
- the prefix for all registered variables
-
Plot()
-
-
autoscaleBounds(PDouble, PDouble, PDouble, PDouble)
- Put preferred autoscaling bounds into the variables pointed to by these
four pointers.
-
BNF(int)
- Return the BNF description of how to parse the parameters of this object.
-
destroy()
- Clean up threads, Graphics contexts, etc., and let owned objects do the same
-
drawAll(Graphics, double, double, double, double, int, int, int, int, int, int)
- Draw the plot.
-
getName()
- Return the variable "name" that was passed into setWatchManager
-
getParameters(int)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
-
getWatchManager()
- Get the WatchManager being used
-
initialize(int)
- Initialize, either partially or completely.
-
parse(Parser, int)
- Parse the input file to get the parameters for this object.
-
setWatchManager(WatchManager, String)
- Remember the WatchManager for this object and create the window.
-
unparse(Unparser, int)
- Output a description of this object that can be parsed with parse().
-
unregister(String)
- One of the watched variables has been unregistered.
-
update(String, Pointer, Watchable)
- Record any data being watched, but don't redraw the screen.
watchManager
protected WatchManager watchManager
- the WatchManager that this class registers with
wmName
protected String wmName
- the prefix for all registered variables
parentDisplay
public Display parentDisplay
- the Display that this plot will be drawn on
Plot
public Plot()
update
public void update(String changedName,
Pointer changedVar,
Watchable obj)
- Record any data being watched, but don't redraw the screen.
This is called whenever a trigger variable is changed for the Nth time.
If not overridden, it assumes a parameter was changed, and just
redraws the screen.
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.
getName
public String getName()
- Return the variable "name" that was passed into setWatchManager
getWatchManager
public WatchManager getWatchManager()
- Get the WatchManager being used
unregister
public void unregister(String watchedVar)
- One of the watched variables has been unregistered.
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.
destroy
public void destroy()
- Clean up threads, Graphics contexts, etc., and let owned objects do the same
getParameters
public Object[][] getParameters(int lang)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
- See Also:
- getParameters
BNF
public String BNF(int lang)
- Return the BNF description of how to parse the parameters of this object.
unparse
public void unparse(Unparser u,
int lang)
- Output a description of this object that can be parsed with parse().
parse
public Object parse(Parser p,
int lang) throws ParserException
- Parse the input file to get the parameters for this object.
- Throws: ParserException
- parser didn't find the required token
drawAll
public abstract void drawAll(Graphics g,
double xMin,
double xMax,
double yMin,
double yMax,
int startX,
int startY,
int xAxisX,
int xAxisY,
int yAxisX,
int yAxisY)
- Draw the plot.
The region of mathematical space to draw is (xMin,yMin)-(xMax,yMax), where
(xMin,yMin) is plotted at screen coordinates (startX,startY), and
(xMax,yMin) is plotted at screen coordinates (xAxisX,xAxisY), and
(xMin,yMax) is plotted at screen coordinates (yAxisX,yAxisY).
initialize
public void initialize(int level)
- Initialize, either partially or completely.
- See Also:
- initialize
All Packages Class Hierarchy This Package Previous Next Index