All Packages Class Hierarchy This Package Previous Next Index
Class sim.display.Graph3D
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----GWin
|
+----Display
|
+----sim.display.Graph3D
- public class Graph3D
- extends Display
Display a scalar function of 2 variables as a 3D plot
of the cube appear at desired locations on the screen.
This code is (c) 1996,1997,1998 Leemon Baird and Ansgar Laubsch
<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.6 19 June 98
- Author:
- Leemon Baird, Ansgar Laubsch
-
Graph3D()
-
-
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)
- function drawAll
Show a 3D surface plot of the heights in data[][],
with the origin at (ax,ay), the X axis corner at (bx,by),
the Z axis corner at (cx,cy), and the Y axis corner at (dx,dy).
-
drawCubeOutlines(Graphics, int, int, boolean, double[][][][])
- function drawCubeOutlines
Draw outlines of Cube
part = 1 draws backpart
part = 2 draws frontpart
mode = 1 draws outlines normally
mode = 2 erases outlines
numbers = true prints numbers & names of axis
numbers = false does not print any numbers and names of axis
-
getParameters(int)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
-
initialize(int)
- Initialize, either partially or completely.
-
keyDown(Event, int)
- respond to the menu choices chosen with the keyboard
-
mark(Graphics, double, double, double, double, double, double)
- function mark
Draws one mark onto the screen
-
mouseDown(Event, int, int)
- function mouseDown
Event Handling for pressing mouse button
-
mouseDrag(Event, int, int)
- function mouseDrag
Event Handling for dragging Mouse
-
mouseUp(Event, int, int)
- funtion mouseUp
Event Handling for releasing mouseButton
-
rescale(double[][][][])
- function rescale
Rescales given cube in 'array' to fit in viewScreen rect
-
setWatchManager(WatchManager, String)
- Remember the WatchManager for this object and create the window.
-
update(String, Pointer, Watchable)
- The variable changed, so redraw
-
xs(double, double, double, double[][][][])
- fucntion xs
calculates screen-x-coordinate from space coordinates of a point
-
ys(double, double, double, double[][][][])
- function ys
calculates screen-y-coordinate from space coordinates of a point
Graph3D
public Graph3D()
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
keyDown
public boolean keyDown(Event e,
int key)
- respond to the menu choices chosen with the keyboard
- Overrides:
- keyDown in class Component
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
drawAll
public synchronized void drawAll(Graphics g)
- function drawAll
Show a 3D surface plot of the heights in data[][],
with the origin at (ax,ay), the X axis corner at (bx,by),
the Z axis corner at (cx,cy), and the Y axis corner at (dx,dy).
- Overrides:
- drawAll in class Display
xs
public int xs(double x,
double y,
double height,
double corner[][][][])
- fucntion xs
calculates screen-x-coordinate from space coordinates of a point
ys
public int ys(double x,
double y,
double height,
double corner[][][][])
- function ys
calculates screen-y-coordinate from space coordinates of a point
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- function mouseDown
Event Handling for pressing mouse button
- Overrides:
- mouseDown in class Component
mouseDrag
public boolean mouseDrag(Event e,
int x,
int y)
- function 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
drawCubeOutlines
public void drawCubeOutlines(Graphics g,
int part,
int mode,
boolean numbers,
double corner[][][][])
- function drawCubeOutlines
Draw outlines of Cube
part = 1 draws backpart
part = 2 draws frontpart
mode = 1 draws outlines normally
mode = 2 erases outlines
numbers = true prints numbers & names of axis
numbers = false does not print any numbers and names of axis
mark
public void mark(Graphics g,
double x0,
double y0,
double xa,
double ya,
double xb,
double yb)
- function mark
Draws one mark onto the screen
rescale
public void rescale(double array[][][][])
- function rescale
Rescales given cube in 'array' to fit in viewScreen rect
destroy
public void destroy()
- ensure the function approximator has its destroy() called too
- Overrides:
- destroy 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