Class DRE_Rslt

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----DRE_Rslt

public class DRE_Rslt
extends Applet
implements ActionListener
The main class of the DRE_Rslt applet.


Variable Index

 o calcResultsArea
TextArea that is used to display results of the calculation or status.
 o colors
Array that contains colors that is used when a color selection is made from the pop-up menu.
 o iMemSize
Preset size of the memory use in recalling the previous DRE Calculations.
 o lightBlue
User-defined color to match the colorscheme in the Data area of the HTML page.
 o menu
Name of the pop-up menu.
 o menuNames
Array that contain items that are present when the pop-up menu is invoked.
 o numColors
Preset qty of colors that is available in changing the background of the applet.
 o numErrAfter
Input (E2 = faults after project/activity is finished) from HTML page.
 o numErrBefore
Input (E1 = faults during project/activity) from HTML page.
 o numSubmitted
Variable to check applet has just been created if value is zero.
 o projectName
Input from the HTML page the describes the project/activity.
 o vDREMemory
Vector used to contain various objects with corresponding DRE data.

Constructor Index

 o DRE_Rslt()

Method Index

 o actionPerformed(ActionEvent)
Interpret command from pop-up menu based on the index value of the item selected.
 o clearContents()
Method that clears the calcResultsArea TextArea contents.
 o computeDRE(float, float)
Method that computes the DRE value based on the data passed by showResults().
 o createPopUpMenu()
Method that is called to create the pop-up menu.
 o findIndex(String)
Method that finds the equivalent index of the command from menuNames array based on the string passed during the mouse event (selection from pop-up menu).
 o getVal(String, int, int)
Method that is called from the HTML document.
 o init()
Method that is called to initialize layout when applet is created.
 o noResults()
Method that is called when there's no useful information that can be displayed in the calcResulsArea TextArea by displaying a " No info..." message.
 o processMouseEvent(MouseEvent)
Method that is called to process a mouse event.
 o showResults(String, int, int)
Show calculation results in calcResultsArea TextArea.
 o storeData()
Save the current data from the HTML in memory, i.e., in memObject, which is then stored in Vector vDREMemory.

Variables

 o projectName
 private String projectName
Input from the HTML page the describes the project/activity.

 o numErrBefore
 private int numErrBefore
Input (E1 = faults during project/activity) from HTML page.

 o numErrAfter
 private int numErrAfter
Input (E2 = faults after project/activity is finished) from HTML page.

 o numSubmitted
 private int numSubmitted
Variable to check applet has just been created if value is zero.

 o iMemSize
 private int iMemSize
Preset size of the memory use in recalling the previous DRE Calculations.

 o vDREMemory
 private Vector vDREMemory
Vector used to contain various objects with corresponding DRE data.

 o calcResultsArea
 private TextArea calcResultsArea
TextArea that is used to display results of the calculation or status.

 o numColors
 private int numColors
Preset qty of colors that is available in changing the background of the applet.

 o menuNames
 private String menuNames[]
Array that contain items that are present when the pop-up menu is invoked.

 o lightBlue
 private Color lightBlue
User-defined color to match the colorscheme in the Data area of the HTML page.

 o colors
 private Color colors[]
Array that contains colors that is used when a color selection is made from the pop-up menu.

 o menu
 private PopupMenu menu
Name of the pop-up menu.

Constructors

 o DRE_Rslt
 public DRE_Rslt()

Methods

 o init
 public void init()
Method that is called to initialize layout when applet is created.

Overrides:
init in class Applet
 o getVal
 public void getVal(String desc1,
                    int val1,
                    int val2)
Method that is called from the HTML document.

Parameters:
desc1 - Input from the HTML page the describes the project/activity.
val1 - Input (E1 = faults during project/activity) from HTML page.
val2 - Input (E2 = faults after project/activity is finished) from HTML page.
 o storeData
 private void storeData()
Save the current data from the HTML in memory, i.e., in memObject, which is then stored in Vector vDREMemory.

 o showResults
 private void showResults(String pName,
                          int err1,
                          int err2)
Show calculation results in calcResultsArea TextArea.

Parameters:
pName - Input description of the project or activity.
err1 - Input E1, which is the qty of discovered faults within project/activity.
err2 - Input E2, which is the qty of discovered faullts after project/activity is finished.
 o computeDRE
 private float computeDRE(float errBefore,
                          float errAfter)
Method that computes the DRE value based on the data passed by showResults().

Parameters:
errBefore - Input E1, which is the qty of discovered faults within project/activity.
errAfter - Input E2, which is the qty of discovered faullts after project/activity is finished.
Returns:
The Defect Removal Efficiency of a certain project/activity.
 o createPopUpMenu
 private void createPopUpMenu()
Method that is called to create the pop-up menu.

 o processMouseEvent
 public void processMouseEvent(MouseEvent event)
Method that is called to process a mouse event.

Overrides:
processMouseEvent in class Component
 o actionPerformed
 public void actionPerformed(ActionEvent event)
Interpret command from pop-up menu based on the index value of the item selected.

 o findIndex
 private int findIndex(String itemName)
Method that finds the equivalent index of the command from menuNames array based on the string passed during the mouse event (selection from pop-up menu).

Parameters:
itemName - String returned from the pop-up menu by a mouse event.
Returns:
The index of the item in the menuNames array.
 o clearContents
 private void clearContents()
Method that clears the calcResultsArea TextArea contents.

 o noResults
 public void noResults()
Method that is called when there's no useful information that can be displayed in the calcResulsArea TextArea by displaying a " No info..." message.