All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.log.ViewerCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----pinball.log.ViewerCanvas

public class ViewerCanvas
extends Canvas
Used to display the frame from the log file.


Variable Index

 o frameBuffer
The image to draw to.
 o graphicsContext
Where to draw to off screen.
 o height
The y size of the canvas (image).
 o model
The greyscale values for the painting of the image.
 o myImage
The image from the camera.
 o width
The x size of the canvas (image).

Constructor Index

 o ViewerCanvas()
Used in the extended classed.
 o ViewerCanvas(int, int)
Initalize with the size and create the color table.

Method Index

 o getMinimumSize()
Method used in creating the canvas.
 o getPreferredSize()
Method used in creating the canvas.
 o makeImage()
Make the off screen image to draw to.
 o paint(Graphics)
Draw the images.
 o setFlippers(Point, Point)
Set the locations of the flippers.
 o update(Graphics)
Called when the window is updated.
 o updateFrame(CameraFrame, int, int)
Update the image's data.

Variables

 o myImage
 protected Image myImage
The image from the camera.

 o model
 protected ColorModel model
The greyscale values for the painting of the image.

 o width
 protected int width
The x size of the canvas (image).

 o height
 protected int height
The y size of the canvas (image).

 o graphicsContext
 protected Graphics graphicsContext
Where to draw to off screen.

 o frameBuffer
 protected Image frameBuffer
The image to draw to.

Constructors

 o ViewerCanvas
 public ViewerCanvas(int w,
                     int h)
Initalize with the size and create the color table.

Parameters:
w - width of the image.
h - height of the image.
 o ViewerCanvas
 public ViewerCanvas()
Used in the extended classed.

Methods

 o makeImage
 public void makeImage()
Make the off screen image to draw to.

 o updateFrame
 public void updateFrame(CameraFrame frame,
                         int x,
                         int y)
Update the image's data. Draw to the off screen image.

Parameters:
frame - the camera's frame.
x - the ball's x location.
y - the ball's y location.
 o paint
 public void paint(Graphics g)
Draw the images.

Overrides:
paint in class Canvas
 o update
 public void update(Graphics g)
Called when the window is updated.

Overrides:
update in class Component
 o setFlippers
 public void setFlippers(Point left,
                         Point right)
Set the locations of the flippers.

Parameters:
left - left flipper's location.
right - right flipper's location.
 o getPreferredSize
 public Dimension getPreferredSize()
Method used in creating the canvas. Sets up the size.

Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Method used in creating the canvas. Sets up the size.

Overrides:
getMinimumSize in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index