All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sim.display.SaveDisplay

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----GWin
                                   |
                                   +----Display
                                           |
                                           +----sim.display.SaveDisplay

public class SaveDisplay
extends Display
This Display takes another Display as a parameter, and periodically copies it to the hard drive as a GIF. Other programs can take the series of GIFs and create an animated GIF, FLI, FLC, MOV or other animation.

This code is (c) 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.1, 20 Feb 97
Author:
Leemon Baird

Variable Index

 o animate
 o display
 o file
 o filename
 o fileStream
 o freq
 o max
 o numSaved
 o trigger
 o triggerVar

Constructor Index

 o SaveDisplay()

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 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 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)
The trigger changed the appropriate number of times, so save the GIF to disk.

Variables

 o filename
 protected PString filename
 o trigger
 protected PString trigger
 o freq
 protected IntExp freq
 o max
 protected IntExp max
 o display
 protected Display display[]
 o animate
 protected PBoolean animate
 o numSaved
 protected PInt numSaved
 o file
 protected File file
 o fileStream
 protected FileOutputStream fileStream
 o triggerVar
 protected Pointer triggerVar

Constructors

 o SaveDisplay
 public SaveDisplay()

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

Overrides:
unregister in class Display
 o addMenus
 public void addMenus(MenuBar mb)
add menu items to the window containing this GWin canvas.

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

Overrides:
action in class Component
 o update
 public void update(String changedName,
                    Pointer changedVar,
                    Watchable obj)
The trigger changed the appropriate number of times, so save the GIF to disk.

Overrides:
update 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