All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.monsterworks.GradeComputer



java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----com.monsterworks.GradeComputer

public class GradeComputer
extends java.applet.Applet
implements java.awt.event.ActionListener, java.awt.event.ItemListener
This class implements a simple calculator allowing students to predict final grades. This class assumes that the student will have a number of tasks which are each worth a certain number of points and at the end of the semester, final grades are determined by the total number of points the student has earned.

The following parameters need to be set for the applet to work correctly:
totalTasks - the total number of tasks to be completed
namenumber - the name of task number number
valuenumber is the point value of task number number
A - the cutoff for an A
B - the cutoff for a B
C - the cutoff for a C
D - the cutoff for a D

Version:
1.0
Author:
Aaron Montgomery

Constructor Index

 o GradeComputer()

Method Index

 o actionPerformed(ActionEvent)
This handles event dispatching (and processing) for the "Compute Goals" button.
 o add(Component, int, int, int, int)
Deprecated.
 o addCheckbox(Checkbox, int, int, int, int)
This is a convenience method for adding checkboxes to the main panel.
 o getParameter(String)
This method finds the parameter or throws a NullPointerException.
 o init()
Initializes the applet, it will throw a NullPointerException if a parameter is missing
 o isValid()
Confirms the validity of the checkboxe settings.
 o itemStateChanged(ItemEvent)
This handles event dispatching (and processing) for the checkboxes.

Constructors

 o GradeComputer


 public GradeComputer()

Methods

 o getParameter


 public java.lang.String getParameter(java.lang.String name)
This method finds the parameter or throws a NullPointerException.

Parameters:
name - is the name of the parameter
Overrides:
getParameter in class java.applet.Applet
 o init


 public void init()
Initializes the applet, it will throw a NullPointerException if a parameter is missing

Overrides:
init in class java.applet.Applet
 o add


 public void add(java.awt.Component inComponent,
                 int inRow,
                 int inColumn,
                 int inWidth,
                 int inHeight)
Note: add() is deprecated. This is a convenience method for adding elements to the main panel.

Parameters:
inComponent - is the component to be added
inRow - is the row in which to add the component
inColumn - is the column in which to add the component
inWidth - is the width of the component
inHeight - is the height of the componenet
 o addCheckbox


 public void addCheckbox(java.awt.Checkbox inCheckbox,
                         int inRow,
                         int inColumn,
                         int inWidth,
                         int inHeight)
This is a convenience method for adding checkboxes to the main panel. It sets the listener of the checkbox to be the applet.

Parameters:
inCheckbox - is the checkbox to be added
inRow - is the row in which to add the component
inColumn - is the column in which to add the component
inWidth - is the width of the component
inHeight - is the height of the componenet
 o isValid


 public boolean isValid()
Confirms the validity of the checkboxe settings.

Returns:
s true if the checkboxes are valid
Overrides:
isValid in class java.awt.Component
 o actionPerformed


 public void actionPerformed(java.awt.event.ActionEvent inActionEvent)
This handles event dispatching (and processing) for the "Compute Goals" button.

Parameters:
inActionEvent - is the event which is being handled
 o itemStateChanged


 public void itemStateChanged(java.awt.event.ItemEvent inItemEvent)
This handles event dispatching (and processing) for the checkboxes.

Parameters:
inItemEvent - is the event which is being handled



All Packages  Class Hierarchy  This Package  Previous  Next  Index