All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class primitives.frames.Frames

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----primitives.frames.Frames

public abstract class Frames
extends Applet
implements Runnable, MouseListener
Frames is an abstract applet class which provides a standart GUI and provides common methods used by its ofsprings. A Frames consists of a predefined number of frames with a label attached to each frame. The number of frames created depends on the parameter frames passed to the Frames object from the applet Tag on the html source. To set the labels under each frame set the label-iparameter. Another common task provided by the Frames class is the creation of a thread which carries the refreshing of the Frames objects located in the same html page of this object.


Variable Index

 o frameNumber
Number of frames contained by the applet.
 o frames
Array of DrawFrame Objects
 o index
[?]
 o j
 o labels
Array of the Label objects.
 o run
A Frames objects signals the refreshing thread it should call its changeFrames method by setting this flag to true.
 o t
a thread object used to refresh Frames object located in appletContext of this object.
 o threadSuspended
Deprecated.
 o waitFor
Number of miliseconds to wait between refreshing the Frames object for which run=true.

Constructor Index

 o Frames()

Method Index

 o changeFrames()
changeFrames is repeatedly called by the run method every period stated by the waitFor field.
 o destory()
Clears memory set for awt objects associated with this Frames class object.
 o getParam(String, int)
Returns parses a given applet Tag parameter to an integer value.
 o init()
creates a Frames object with a number of DrawFrame and Labels set by the "frames" parameter of the applet Tag.
 o mouseClicked(MouseEvent)
a mouse click switch the values of the run field.
 o mouseEntered(MouseEvent)
Not implemented.
 o mouseExited(MouseEvent)
Not implemented.
 o mousePressed(MouseEvent)
Not implemented.
 o mouseReleased(MouseEvent)
Not implemented.
 o run()
calls the changeFrame method of all Frames object on this appletContext with the run flag set to true.
 o start()
Deprecated.
 o startThread()
activates the static thread t.
 o stop()
sets the thread t to null, this ensurse that the thread t will be envoced by a Frames object of the current appletContext.

Variables

 o labels
 public Label labels[]
Array of the Label objects.

 o frames
 public DrawFrame frames[]
Array of DrawFrame Objects

See Also:
DrawFrame
 o frameNumber
 public int frameNumber
Number of frames contained by the applet. [should be hidden.]

 o index
 protected int index
[?]

 o waitFor
 protected int waitFor
Number of miliseconds to wait between refreshing the Frames object for which run=true.

See Also:
run
 o run
 public boolean run
A Frames objects signals the refreshing thread it should call its changeFrames method by setting this flag to true.

See Also:
changeFrames
 o j
 int j
 o t
 protected static Thread t
a thread object used to refresh Frames object located in appletContext of this object. declaring t static assures only one thread is created to refresh all applets.

 o threadSuspended
 public boolean threadSuspended
Note: threadSuspended is deprecated.

Constructors

 o Frames
 public Frames()

Methods

 o startThread
 protected void startThread()
activates the static thread t. you can set a "waitFor" parameter at the applet Tag to specify the number of milliseconds to wait between refresh.

 o run
 public void run()
calls the changeFrame method of all Frames object on this appletContext with the run flag set to true.

See Also:
changeFrames
 o init
 public void init()
creates a Frames object with a number of DrawFrame and Labels set by the "frames" parameter of the applet Tag.

Overrides:
init in class Applet
 o changeFrames
 protected void changeFrames()
changeFrames is repeatedly called by the run method every period stated by the waitFor field. every object inherting from Frames and needs to updated should override this method. The changeFrames method of class Frames does nothing.

See Also:
run
 o getParam
 protected int getParam(String name,
                        int defValue)
Returns parses a given applet Tag parameter to an integer value. If there is no parameter with the given name or the value of the parameter is not a valid integer a default value is returned.

Parameters:
name - the parameter name.
defValue - a default integer value.
Returns:
the integer value associated with name.
 o start
 public void start()
Note: start() is deprecated.

Overrides:
start in class Applet
 o stop
 public void stop()
sets the thread t to null, this ensurse that the thread t will be envoced by a Frames object of the current appletContext. Also frees memory associated by the graphic buffers of the fraemes[].drawArea members.

Overrides:
stop in class Applet
 o destory
 public void destory()
Clears memory set for awt objects associated with this Frames class object.

 o mouseClicked
 public void mouseClicked(MouseEvent m)
a mouse click switch the values of the run field.

See Also:
run
 o mousePressed
 public void mousePressed(MouseEvent e)
Not implemented.

 o mouseReleased
 public void mouseReleased(MouseEvent e)
Not implemented.

 o mouseEntered
 public void mouseEntered(MouseEvent e)
Not implemented.

 o mouseExited
 public void mouseExited(MouseEvent e)
Not implemented.


All Packages  Class Hierarchy  This Package  Previous  Next  Index