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.
-
atx
- Xoffset of image.
-
aty
- Yoffset of image.
-
buffer
- The current information buffer.
-
buffinfo
- The information in the buffer.
-
frameBuffer
- The image to draw to.
-
graphicsContext
- Where to draw to off screen.
-
height
- The y size of the canvas (image).
-
model
- The greyscale values for the painting of the image.
-
stub
- The stub which contains various lines from the strategy to be drawn
to the screen.
-
width
- The x size of the canvas (image).
-
DrawingCanvas()
- Used in the extended classed.
-
DrawingCanvas(int, int)
-
Initalize the DrawingBoard.
-
getMinimumSize()
-
Method used in creating the canvas.
-
getPreferredSize()
-
Method used in creating the canvas.
-
makeImage()
- Make the off screen image to draw to.
-
paint(Graphics)
- Draw the images.
-
setStub(Stub)
-
Setup the stub from the system.
-
update(Graphics)
- Called when the window is updated.
-
updateFrame(BufferInfo)
- Update the image's data.
model
protected ColorModel model
- The greyscale values for the painting of the image.
width
protected int width
- The x size of the canvas (image).
height
protected int height
- The y size of the canvas (image).
buffer
protected Buffer buffer
- The current information buffer.
buffinfo
protected BufferInfo buffinfo
- The information in the buffer.
aty
protected int aty
- Yoffset of image.
atx
protected int atx
- Xoffset of image.
graphicsContext
protected Graphics graphicsContext
- Where to draw to off screen.
frameBuffer
protected Image frameBuffer
- The image to draw to.
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.
DrawingCanvas
public DrawingCanvas(int w,
int h)
- Initalize the DrawingBoard.
- Parameters:
- w - width of the image.
- h - height of the image.
DrawingCanvas
public DrawingCanvas()
- Used in the extended classed.
makeImage
public void makeImage()
- Make the off screen image to draw to.
setStub
public void setStub(Stub stub)
- Setup the stub from the system.
- Parameters:
- stub - the stub from the system.
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.
paint
public void paint(Graphics g)
- Draw the images.
- Parameters:
- g - Where to draw to.
- Overrides:
- paint in class Canvas
update
public void update(Graphics g)
- Called when the window is updated.
- Parameters:
- g - Where to draw to.
- Overrides:
- update in class Component
getPreferredSize
public Dimension getPreferredSize()
- Method used in creating the canvas. Sets up the size.
- Returns:
- the minimum size.
- Overrides:
- getPreferredSize in class Component
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