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

Constructor Index

 o Graph3D()

Method Index

 o action(Event, Object)
respond to the menu choices
 o addMenus(MenuBar)
add menu items to the window containing this GWin canvas.
 o destroy()
ensure the function approximator has its destroy() called too
 o 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).
 o 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
 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 keyDown(Event, int)
respond to the menu choices chosen with the keyboard
 o mark(Graphics, double, double, double, double, double, double)
function mark Draws one mark onto the screen
 o mouseDown(Event, int, int)
function mouseDown Event Handling for pressing mouse button
 o mouseDrag(Event, int, int)
function mouseDrag Event Handling for dragging Mouse
 o mouseUp(Event, int, int)
funtion mouseUp Event Handling for releasing mouseButton
 o rescale(double[][][][])
function rescale Rescales given cube in 'array' to fit in viewScreen rect
 o setWatchManager(WatchManager, String)
Remember the WatchManager for this object and create the window.
 o update(String, Pointer, Watchable)
The variable changed, so redraw
 o xs(double, double, double, double[][][][])
fucntion xs calculates screen-x-coordinate from space coordinates of a point
 o ys(double, double, double, double[][][][])
function ys calculates screen-y-coordinate from space coordinates of a point

Constructors

 o Graph3D
 public Graph3D()

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 Display
See Also:
getParameters
 o addMenus
 public void addMenus(MenuBar mb)
add menu items to the window containing this GWin canvas.

Overrides:
addMenus in class GWin
 o keyDown
 public boolean keyDown(Event e,
                        int key)
respond to the menu choices chosen with the keyboard

Overrides:
keyDown in class Component
 o action
 public boolean action(Event e,
                       Object w)
respond to the menu choices

Overrides:
action in class Component
 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 Display
 o update
 public void update(String changedName,
                    Pointer changedVar,
                    Watchable obj)
The variable changed, so redraw

Overrides:
update in class Display
 o 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
 o xs
 public int xs(double x,
               double y,
               double height,
               double corner[][][][])
fucntion xs calculates screen-x-coordinate from space coordinates of a point

 o ys
 public int ys(double x,
               double y,
               double height,
               double corner[][][][])
function ys calculates screen-y-coordinate from space coordinates of a point

 o mouseDown
 public boolean mouseDown(Event e,
                          int x,
                          int y)
function mouseDown Event Handling for pressing mouse button

Overrides:
mouseDown in class Component
 o mouseDrag
 public boolean mouseDrag(Event e,
                          int x,
                          int y)
function mouseDrag Event Handling for dragging Mouse

Overrides:
mouseDrag in class Component
 o mouseUp
 public boolean mouseUp(Event e,
                        int x,
                        int y)
funtion mouseUp Event Handling for releasing mouseButton

Overrides:
mouseUp in class Component
 o 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

 o 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

 o rescale
 public void rescale(double array[][][][])
function rescale Rescales given cube in 'array' to fit in viewScreen rect

 o destroy
 public void destroy()
ensure the function approximator has its destroy() called too

Overrides:
destroy in class Display
 o 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