All Packages Class Hierarchy This Package Previous Next Index
Class sim.display.Graph2D
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----GWin
|
+----Display
|
+----sim.display.Graph2D
- public class Graph2D
- extends Display
This Display maintains a square window which contains a Plot or
multiple Plots. The user can zoom in and reset with the mouse and
menu. The refresh rate of redrawing can be different from the
rate at which the Plot samples and stores data. The entire Display
can be forced to redraw by clicking on it.
This code is (c) 1996,1997 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.01 2 June 97
- Author:
- Leemon Baird
-
origMaxX
- Max value of x to plot originally (menu item "top level" returns to this)
-
origMaxY
- Max value of y to plot originally (menu item "top level" returns to this)
-
origMinX
- Min value of x to plot originally (menu item "top level" returns to this)
-
origMinY
- Min value of y to plot originally (menu item "top level" returns to this)
-
trigger
- Variable whose changes trigger updates of the graph
-
triggerFreq
- How many times the trigger variable must change to cause an update
-
triggerVar
-
-
Graph2D()
-
-
action(Event, Object)
- respond to the menu choices
-
addMenus(MenuBar)
- add menu items to the window containing this GWin canvas.
-
destroy()
- ensure the function approximator has its destroy() called too
-
drawAll(Graphics)
- Override this to draw directly to the display.
-
getParameters(int)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
-
initialize(int)
- Initialize, either partially or completely.
-
mouseDown(Event, int, int)
- function mouseDown
Event Handling for pressing mouseButton
-
mouseDrag(Event, int, int)
- mouseDrag
Event Handling for dragging Mouse
-
mouseUp(Event, int, int)
- funtion mouseUp
Event Handling for releasing mouseButton
-
setWatchManager(WatchManager, String)
- Remember the WatchManager for this object and create the window.
-
update(String, Pointer, Watchable)
- The variable changed, so redraw
origMinX
protected NumExp origMinX
- Min value of x to plot originally (menu item "top level" returns to this)
origMaxX
protected NumExp origMaxX
- Max value of x to plot originally (menu item "top level" returns to this)
origMinY
protected NumExp origMinY
- Min value of y to plot originally (menu item "top level" returns to this)
origMaxY
protected NumExp origMaxY
- Max value of y to plot originally (menu item "top level" returns to this)
trigger
protected PString trigger
- Variable whose changes trigger updates of the graph
triggerFreq
protected IntExp triggerFreq
- How many times the trigger variable must change to cause an update
triggerVar
protected Pointer triggerVar
Graph2D
public Graph2D()
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 Display
- See Also:
- getParameters
addMenus
public void addMenus(MenuBar mb)
- add menu items to the window containing this GWin canvas.
- Overrides:
- addMenus in class GWin
action
public boolean action(Event e,
Object w)
- respond to the menu choices
- Overrides:
- action in class Component
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 Display
update
public void update(String changedName,
Pointer changedVar,
Watchable obj)
- The variable changed, so redraw
- Overrides:
- update in class Display
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- function mouseDown
Event Handling for pressing mouseButton
- Overrides:
- mouseDown in class Component
mouseDrag
public boolean mouseDrag(Event e,
int x,
int y)
- mouseDrag
Event Handling for dragging Mouse
- Overrides:
- mouseDrag in class Component
mouseUp
public boolean mouseUp(Event e,
int x,
int y)
- funtion mouseUp
Event Handling for releasing mouseButton
- Overrides:
- mouseUp in class Component
destroy
public void destroy()
- ensure the function approximator has its destroy() called too
- Overrides:
- destroy in class Display
drawAll
public void drawAll(Graphics g)
- Override this to draw directly to the display.
- Overrides:
- drawAll in class Display
initialize
public void initialize(int level)
- Initialize, either partially or completely.
- Overrides:
- initialize in class Display
- See Also:
- initialize
All Packages Class Hierarchy This Package Previous Next Index