All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ps1.ps1

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----ps1.ps1

public class ps1
extends Applet
implements MouseListener

Variable Index

 o acat
 o akatt
 o akatt2
 o back
 o backgrd
The ps1 class extends Applet and implements MouseListener This class initializes the applet and acts as the image observer.
 o chands
 o clk
 o clock
 o numsprites
 o pf
 o raster
 o rcat

Constructor Index

 o ps1()

Method Index

 o init()
This method initializes the applet, creates sprites and adds them to the playfield.
 o mouseClicked(MouseEvent)
This method handles mouse click events.
 o mouseEntered(MouseEvent)
This method handles the event when the mouse enters the side of the applet
 o mouseExited(MouseEvent)
This method handles the event when the mouse enters the side of the applet
 o mousePressed(MouseEvent)
This method handles mouse pressed events.
 o mouseReleased(MouseEvent)
This method handles the event when the mouse is released
 o paint(Graphics)
paints graphics on the applet
 o update(Graphics)
updates the graphics

Variables

 o backgrd
 String backgrd
The ps1 class extends Applet and implements MouseListener This class initializes the applet and acts as the image observer.

6.837 Problem set #1

 o clk
 String clk
 o raster
 Raster raster
 o acat
 AnimatedSprite acat
 o rcat
 AnimatedSprite rcat
 o akatt
 AnimatedSprite akatt
 o akatt2
 AnimatedSprite akatt2
 o chands
 AnimatedSprite chands
 o clock
 Sprite clock
 o pf
 Playfield pf
 o back
 Image back
 o numsprites
 int numsprites

Constructors

 o ps1
 public ps1()

Methods

 o init
 public void init()
This method initializes the applet, creates sprites and adds them to the playfield.

Overrides:
init in class Applet
 o paint
 public void paint(Graphics g)
paints graphics on the applet

Overrides:
paint in class Container
 o update
 public void update(Graphics g)
updates the graphics

Overrides:
update in class Container
 o mouseClicked
 public void mouseClicked(MouseEvent event)
This method handles mouse click events. If the mouse is clicked on an existing sprite, it will either move to the next track for that animated sprite, or restart the current track. If the mouse is not clicked on an existing sprite, then a running cat is created at the location where the mouse was clicked.

 o mousePressed
 public void mousePressed(MouseEvent event)
This method handles mouse pressed events.

 o mouseEntered
 public void mouseEntered(MouseEvent event)
This method handles the event when the mouse enters the side of the applet

 o mouseExited
 public void mouseExited(MouseEvent event)
This method handles the event when the mouse enters the side of the applet

 o mouseReleased
 public void mouseReleased(MouseEvent event)
This method handles the event when the mouse is released


All Packages  Class Hierarchy  This Package  Previous  Next  Index