All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class DopplerProgram.Doppler

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----DopplerProgram.Doppler

public class Doppler
extends Frame
implements Runnable, WindowListener, ActionListener
An applet that demonstrates Doppler properties. This java program has been written to run in both an applet and as a program. To run in an applet, create a "window opener" that will instantiate a new Frame class using Doppler as that class. Or simply run the program from the prompt using $java Doppler


Variable Index

 o inApplet
 o percentage

Constructor Index

 o Doppler(Image, Image, boolean)
Creates a new Doppler object with its buttons and stuff.

Method Index

 o actionPerformed(ActionEvent)
Method to implement ActionListener.
 o main(String[])
Method to invoke as a program.
 o paint(Graphics)
Calls update to eliminate flashing
 o run()
starts the animation of applet and starts the Radiator thread.
 o start()
Overrides start to implement Runnable interface since it's an animation.
 o update(Graphics)
Overrides update method to eliminate flashing
 o windowActivated(WindowEvent)
Method to implement WindowListener.
 o windowClosed(WindowEvent)
Method to implement WindowListener.
 o windowClosing(WindowEvent)
Method to implement WindowListener to close window
 o windowDeactivated(WindowEvent)
Method to implement WindowListener.
 o windowDeiconified(WindowEvent)
Method to implement WindowListener.
 o windowIconified(WindowEvent)
Method to implement WindowListener.
 o windowOpened(WindowEvent)
Method to implement WindowListener.
 o writeName(Graphics, Dimension)
Writes my name and current speed for galaxy

Variables

 o inApplet
 public boolean inApplet
 o percentage
 public int percentage

Constructors

 o Doppler
 public Doppler(Image _earthImage,
                Image _galaxyImage,
                boolean _inApplet)
Creates a new Doppler object with its buttons and stuff.

Methods

 o start
 public void start()
Overrides start to implement Runnable interface since it's an animation. You know... if the universe extends a big bang object then the 4th dimension implements runnable too. Then it must have a start.

 o run
 public void run()
starts the animation of applet and starts the Radiator thread.

 o update
 public void update(Graphics g)
Overrides update method to eliminate flashing

Overrides:
update in class Container
 o writeName
 public void writeName(Graphics g,
                       Dimension d)
Writes my name and current speed for galaxy

 o paint
 public void paint(Graphics g)
Calls update to eliminate flashing

Overrides:
paint in class Container
 o actionPerformed
 public void actionPerformed(ActionEvent e)
Method to implement ActionListener. Listens for buttons and menu.

 o windowClosing
 public void windowClosing(WindowEvent e)
Method to implement WindowListener to close window

 o windowClosed
 public void windowClosed(WindowEvent e)
Method to implement WindowListener. Does nothing.

 o windowDeiconified
 public void windowDeiconified(WindowEvent e)
Method to implement WindowListener. Does nothing.

 o windowActivated
 public void windowActivated(WindowEvent e)
Method to implement WindowListener. Does nothing.

 o windowIconified
 public void windowIconified(WindowEvent e)
Method to implement WindowListener. Does nothing.

 o windowOpened
 public void windowOpened(WindowEvent e)
Method to implement WindowListener. Does nothing.

 o windowDeactivated
 public void windowDeactivated(WindowEvent e)
Method to implement WindowListener. Does nothing.

 o main
 public static void main(String args[])
Method to invoke as a program.


All Packages  Class Hierarchy  This Package  Previous  Next  Index