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

Constructor Index

 o PlotXY()

Method Index

 o addDataPoint(double, double)
function addDataPoint add a new data point and redraw the whole graph
 o addRect(double, double)
function addRect adds rect.
 o autoscaleBounds(PDouble, PDouble, PDouble, PDouble)
Put preferred autoscaling bounds into the variables pointed to by these four pointers.
 o 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)
 o getParameters(int)
Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
 o initialize(int)
Initialize, either partially or completely.
 o mergeRect(int, int, int)
function mergeRect Merges the two given rects with array indices rect1 and rect2 into new array element newRect
 o reOrg()
function reOrg Reorganizes the arrays when nRects has reached maxNRects.val by merging pairs of rects.
 o setWatchManager(WatchManager, String)
Remember the WatchManager for this object and create the window.
 o unregister(String)
One of the watched variables has been unregistered.
 o update(String, Pointer, Watchable)
One of the watched variables has changed, so look at it and others.

Constructors

 o PlotXY
 public PlotXY()

Methods

 o 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
 o 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
 o unregister
 public void unregister(String watchedVar)
One of the watched variables has been unregistered.

Overrides:
unregister in class Plot
 o 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
 o addDataPoint
 public void addDataPoint(double newX,
                          double newY)
function addDataPoint add a new data point and redraw the whole graph

 o addRect
 public void addRect(double newX,
                     double newY)
function addRect adds rect. (represented by one point) to end of (global) arrays

 o 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

 o 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

 o 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
 o 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
 o 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