All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class primitives.frames.CanvasArea

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----primitives.frames.CanvasArea

public class CanvasArea
extends Canvas
A class which encapsulates the drawing on a canvas. The paint method calls the redraw method of the MachineListener interface associated with this canvas. associate a MachineListener interface by the setCurrentObject method. A double buffer is used to preform drawings the graphic context of this buffer is passed to the redraw method of the MachineListener interface.

See Also:
MachineListener

Variable Index

 o backBuffer
The memory set for the backbuffer.
 o backBufferG
The graphic context of backBuffer.
 o machine
The interface to call its redraw method from the paint method of this object.

Constructor Index

 o CanvasArea()

Method Index

 o finalize()
 o freeBuffers()
clears the memory associated with the backbuffer objects.
 o paint(Graphics)
calls the redraw method of the machine member.
 o setCurrentObject(MachineListener)
sets the MachineListener object to be called by the paint method of this object.
 o update(Graphics)
overrides update method of Canvas class.

Variables

 o backBuffer
 Image backBuffer
The memory set for the backbuffer. [should be private member]

 o backBufferG
 public Graphics backBufferG
The graphic context of backBuffer. [should be private]

 o machine
 public MachineListener machine
The interface to call its redraw method from the paint method of this object.

See Also:
MachineListener

Constructors

 o CanvasArea
 public CanvasArea()

Methods

 o finalize
 public void finalize() throws Throwable
Throws: Throwable
.
Overrides:
finalize in class Object
See Also:
freeBuffers
 o freeBuffers
 void freeBuffers()
clears the memory associated with the backbuffer objects.

 o update
 public synchronized void update(Graphics g)
overrides update method of Canvas class. calls paint method immidiatly.

Overrides:
update in class Component
 o paint
 public synchronized void paint(Graphics g)
calls the redraw method of the machine member. Passing to this method the graphic context of the buffer.

Overrides:
paint in class Canvas
 o setCurrentObject
 public void setCurrentObject(MachineListener obj)
sets the MachineListener object to be called by the paint method of this object.

Parameters:
obj - the Machinelistener object to associate.
See Also:
Machinelistener

All Packages  Class Hierarchy  This Package  Previous  Next  Index