FrameBuffer
Class.
GraphicsWindow
Class.
GraphicsPane
Class.
They are described below.
FrameBuffer
class is a simulation of a frame buffer
in a graphis card. In essence, this class is an encapsulation of a
rectangular array of pixels. A FrameBuffer
object
contains 501x501 pixels, with the lower left corner at -250,-250 and
the upper left corner at 250,250.
The FrameBuffer
class has the following methods
of consequence:
clear(Color c)
method fills all of the
pixels in the FrameBuffer
with the given Color
.
(Note: The Color
class is in the package
java.awt
. So, any class that uses it must include
import java.awt.Color;
before the class declaration.)
setPixel(int x, int y, Color c)
sets the
color of the given pixel.
show()
method causes the FrameBuffer
to show itself "on screen".
GraphicsWindow
is a GUI window that contains
a FrameBuffer
object.
The GraphicsWindow
class has the following methods
of consequence:
GraphicsWindow
object. Regardless of its size,
this window will have a 501x501 pixel FrameBuffer
.
As much of the FrameBuffer
as possible will be displayed
if the window is too small.
getFrameBuffer()
method returns the
FrameBuffer
object associated with this window.
Copyright 2007