All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class MyPackage.MyApplet

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

public class MyApplet
extends Applet
This class implements the Graphical User Interface and the function to
perform the various operation 

Version:
1.0
Author:
Vicky Shiv

Variable Index

 o arandom
Varible for the Randon number
 o b_reload
Awt Componet Button for Reloading the number
 o b_return
Awt Componet Button for Closing the Applet
 o b_start
Awt Componet Button for Starting the Execution of the Thread
 o choicemode
Awt Componet Choice of the Mode
 o choicethread
Awt Componet Choice of the number of Thread
 o currentpos
Varible for the Current Postion being executed by Thread
 o firsttextfield
Awt Componet TextField for storing first Vector
 o firsttime
Awt Componet TextField for storing Synchronous Time
 o l_async
Awt Componet Label for Asynchronous Time
 o l_first
Awt Componet Label for first Vector
 o l_mode
Awt Componet Label for the Mode
 o l_output
Awt Componet Label for output Vector
 o l_product
Awt Componet Label for Scalar Product
 o l_second
Awt Componet Label for second Vector
 o l_sync
Awt Componet Label for Synchronous Time
 o l_thread
Awt Componet Label for the Thread
 o mstring
Variable to store the mode of execution
 o outputtextfield
Awt Componet TextField for storing output Vector
 o scalarproduct
Varible for the Storing Scalar Product in Synchronous mode
 o secondtextfield
Awt Componet TextField for storing second Vector
 o secondtime
Awt Componet TextField for storing Asynchronous Time
 o tf_scalarproduct
Awt Componet TextField for scalar Product
 o tstring
Varible to Store the no of Threads

Constructor Index

 o MyApplet()

Method Index

 o b_reload_MousePress(MouseEvent)
A Method for the MouseAdapater.
 o b_return_MousePress(MouseEvent)
A Method for the MouseAdapater.
 o b_start_MousePress(MouseEvent)
A Method for the MouseAdapater.
 o CalculateProduct(Color)
This Function will Calculate the Product of two Vector field.
 o GenerateColor(int)
This will assign a unique color to the each Thread
 o init()
This Function Initalized the Applet

Variables

 o choicemode
 private Choice choicemode
Awt Componet Choice of the Mode

 o choicethread
 private Choice choicethread
Awt Componet Choice of the number of Thread

 o l_thread
 private Label l_thread
Awt Componet Label for the Thread

 o l_mode
 private Label l_mode
Awt Componet Label for the Mode

 o b_reload
 public Button b_reload
Awt Componet Button for Reloading the number

 o b_return
 public Button b_return
Awt Componet Button for Closing the Applet

 o b_start
 public Button b_start
Awt Componet Button for Starting the Execution of the Thread

 o firsttextfield
 private TextField firsttextfield[]
Awt Componet TextField for storing first Vector

 o secondtextfield
 private TextField secondtextfield[]
Awt Componet TextField for storing second Vector

 o outputtextfield
 private TextField outputtextfield[]
Awt Componet TextField for storing output Vector

 o firsttime
 private TextField firsttime[]
Awt Componet TextField for storing Synchronous Time

 o secondtime
 private TextField secondtime[]
Awt Componet TextField for storing Asynchronous Time

 o l_first
 private Label l_first
Awt Componet Label for first Vector

 o l_second
 private Label l_second
Awt Componet Label for second Vector

 o l_output
 private Label l_output
Awt Componet Label for output Vector

 o l_sync
 private Label l_sync
Awt Componet Label for Synchronous Time

 o l_async
 private Label l_async
Awt Componet Label for Asynchronous Time

 o tf_scalarproduct
 private TextField tf_scalarproduct
Awt Componet TextField for scalar Product

 o l_product
 private Label l_product
Awt Componet Label for Scalar Product

 o arandom
 private Random arandom
Varible for the Randon number

 o tstring
 private String tstring
Varible to Store the no of Threads

 o mstring
 private String mstring
Variable to store the mode of execution

 o currentpos
 private static int currentpos
Varible for the Current Postion being executed by Thread

 o scalarproduct
 private int scalarproduct
Varible for the Storing Scalar Product in Synchronous mode

Constructors

 o MyApplet
 public MyApplet()

Methods

 o init
 public void init()
This Function Initalized the Applet

Overrides:
init in class Applet
 o b_start_MousePress
 public void b_start_MousePress(MouseEvent event)
A Method for the MouseAdapater. Invoke When user Pressed the Start Button

 o b_reload_MousePress
 public void b_reload_MousePress(MouseEvent event)
A Method for the MouseAdapater. Invoke When user Pressed the Load Button

 o b_return_MousePress
 void b_return_MousePress(MouseEvent event)
A Method for the MouseAdapater. Invoke When user Pressed the Return Button

 o CalculateProduct
 public synchronized boolean CalculateProduct(Color c)
This Function will Calculate the Product of two Vector field. Only one thread at a time can enter this Function

Parameters:
Color - Specific Color assign to each thread
Returns:
boolean It will return true if all the Vector field are not Calculated else return False
 o GenerateColor
 public Color GenerateColor(int i)
This will assign a unique color to the each Thread

Parameters:
integer - the no value represented by thread
Returns:
Color Unique Color assign to the Thread

All Packages  Class Hierarchy  This Package  Previous  Next  Index
1