All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.player.DrawingCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----pinball.player.DrawingCanvas

public class DrawingCanvas
extends Canvas
Draws the frame from the camera on the screen. It also draws various lines to indicate different zones on the screen. As well, it draws the locations of the ball and the flippers.


Variable Index

 o atx
Xoffset of image.
 o aty
Yoffset of image.
 o buffer
The current information buffer.
 o buffinfo
The information in the buffer.
 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 stub
The stub which contains various lines from the strategy to be drawn to the screen.
 o width
The x size of the canvas (image).

Constructor Index

 o DrawingCanvas()
Used in the extended classed.
 o DrawingCanvas(int, int)
Initalize the DrawingBoard.

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 setStub(Stub)
Setup the stub from the system.
 o update(Graphics)
Called when the window is updated.
 o updateFrame(BufferInfo)
Update the image's data.

Variables

 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 buffer
 protected Buffer buffer
The current information buffer.

 o buffinfo
 protected BufferInfo buffinfo
The information in the buffer.

 o aty
 protected int aty
Yoffset of image.

 o atx
 protected int atx
Xoffset of image.

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

 o frameBuffer
 protected Image frameBuffer
The image to draw to.

 o stub
 protected Stub stub
The stub which contains various lines from the strategy to be drawn to the screen. Used to show how the strategy chooses to flip.

Constructors

 o DrawingCanvas
 public DrawingCanvas(int w,
                      int h)
Initalize the DrawingBoard.

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

Methods

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

 o setStub
 public void setStub(Stub stub)
Setup the stub from the system.

Parameters:
stub - the stub from the system.
 o updateFrame
 public void updateFrame(BufferInfo buffinfo)
Update the image's data. Draw to the off screen image.

Parameters:
buffinfo - the buffer information that has the image.
 o paint
 public void paint(Graphics g)
Draw the images.

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

Parameters:
g - Where to draw to.
Overrides:
update in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
Method used in creating the canvas. Sets up the size.

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

Returns:
the dimension for the canvas.
Overrides:
getMinimumSize in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index