All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class distans.CreateCourseApplet

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

public class CreateCourseApplet
extends Applet
The CreateCourseApplet is the Applet that lets the user create/edit courses and the students registered to them.
When starting the Applet the following is done.
1. The password dialog is shown, and when an correct username/password is typed in the applet is initialized
2. The courses that a user has access to (can edit) are shown in the Choose Course panel, which is the default panel on startup.
3. Before any course is choosen or created the only panels that the user can view are the: Choose Course and Info panels.


Variable Index

 o actualCourse
A string with the name of the most recent course chosen, which is used for user information.
 o addNewUserButton
 o CCD
A dialog object used for prompting to the user that is created on startup and then used for all the dialogs which uses pop-up windows.
 o CCDL
The CreateCourseDataLoader object is responsible for communication with the server as well as having references to the data stuctures and the reponsability to perform some calculations, such as sorting vectors.
 o CH
The object that holds the courses related to the teacher and the students registered to the courses in a double nested hashtable.
 o chooseCourseCreateButton
 o chooseCourseDeleteButton
 o chooseCourseLabel
 o chooseCourseList
 o chooseCourseOKButton
 o chooseCoursePanel
 o chooseCourseTextArea
 o courseChosenDefaultInfo
The courseChosenDefaultInfo is shown in the text are in Choose Course panel on viewing the panel.
 o currentTab
Used by the Info panel.
 o EditCourseTextArea
 o editStudentsCancelButton
 o editStudentsCommitButton
 o editStudentsDeleteButton
 o editStudentsEditStudentsButton
 o editStudentsLabel
 o editStudentsList
 o editStudentsNewDataTextField
 o editStudentsOldDataLabel
 o editStudentsPanel
 o editStudentsTextField
 o extraPanel
 o infoList
 o infoOfCourseButton
 o infoPanel
 o infoShowButton
 o infoTextArea
 o local
If this is true the Applet will search information on the local harddisk.
 o newDataLabel
 o oldDataLabel
 o reagisterStudentsTextField
 o registerStudentsClearButton
 o registerStudentsLabel
 o registerStudentsList
 o registerStudentsPanel
 o registerStudentsRegisterButton
 o registerStudentsTextArea
 o removeYourAccessButton
 o thePanel
 o user
The username of the user, set on initialization.

Constructor Index

 o CreateCourseApplet()

Method Index

 o addNewUserButton_ActionPerformed(ActionEvent)
Prompts the user with a dialog window to get the username to which access to the actual course should be added.
 o chooseCourseCreateButton_Clicked(ActionEvent)
1.
 o chooseCourseDeleteButton_Clicked(ActionEvent)
1.
 o chooseCourseList_DblClicked(ActionEvent)
Does the same as chooseCourseOKButton_Clicked
 o chooseCourseList_ItemStateChanged(ItemEvent)
Enables the chooseCourseOKButton if there are a course marked in the chooseCourseList.
 o chooseCourseOKButton_Clicked(ActionEvent)
1.
 o chooseCoursePanel_GotFocus(FocusEvent)
Shows information to the user.
 o clearEditStudData()
Clears the label and the textField.
 o editStudentsCancelButton_Clicked(ActionEvent)
Cancel the editing of the marked student.
 o editStudentsCommitButton_Clicked(ActionEvent)
Checks the new information given about an edited student to see that the syntax is correct.
Checks to see if the cedula of the edited student is the same as before the editing and if so just writes over the old information of the student and if not removes the old student data and register the new student data.
Updates the new information given about the edited student in the CoursesHashtable and the applets student lists.
 o editStudentsDeleteButton_ActionPerformed(ActionEvent)
Removes the marked student from the course by calling the server.
 o editStudentsEditStudentsButton_Clicked(ActionEvent)
Puts the student marked in the editStuentsList into editable mode.
 o editStudentsList_DblClicked(ActionEvent)
Does the same as the editStudentsEditStudentsButton_Clicked
 o editStudentsList_ItemStateChanged(ItemEvent)
If a student is marked in the editStudentsList then the edit and delete buttons are enabled, if not they are disabled.
 o editStudentsPanel_GotFocus(FocusEvent)
Shows information to the user.
 o enableEditStudent(boolean)
Sets the enable students mode to either true or false, depending on cond.
 o extraPanel_FocusLost(FocusEvent)
If the user has removed its access to the actual course, then the Edit Course panel is set to disabled on user leaving.
 o getUserName()
Returns the username of the user.
 o infoList_DblClicked(ActionEvent)
Set the information in the infoTextArea for the panel selected in the infoList.
 o infoOfCourseButton_ActionPerformed(ActionEvent)
Calls the server for information about the actual course and displays the answer to the user.
 o infoPanel_GotFocus(FocusEvent)
Sets the information in the infoTextArea for the panel most recent visited.
 o infoShowButton_Clicked(ActionEvent)
Does the same as infoList_DblClicked.
 o init()
This method is called by the browser when the applet starts.
 o myInit()
Inits the non-graphical parameters/methods and launches the password dialog.
 o registerStudentsClearButton_Clicked(ActionEvent)
Clears the registerStudentsTextArea.
 o registerStudentsList_DblClicked(ActionEvent)
Shows the Edit Student panel with the student that was double clicked in the registerStudentsList put into the editStudent mode.
 o registerStudentsPanel_GotFocus(FocusEvent)
Shows information to the user.
 o registerStudentsRegisterButton_Clicked(ActionEvent)
Register the students typed into the registerStudentsTextArea on server to the actual course.
 o registerStudentsTextArea_TextValueChanged(TextEvent)
Enables/disables the registerStudentsClear/Register buttons depending on if the registerStudentsTextArea is emppty or not.
 o removeYourAccessButton_ActionPerformed(ActionEvent)
1.
 o updateCourseList()
Calls CoursesHashtable to get the courses and puts these courses into the chooseCourseList.
 o updateStudentsLists()
Calls CoursesHashtable to get the students registered for the actual course.

Variables

 o user
 private static String user
The username of the user, set on initialization.

 o local
 protected boolean local
If this is true the Applet will search information on the local harddisk. This is used for debuging.

 o CCDL
 private CreateCourseDataLoader CCDL
The CreateCourseDataLoader object is responsible for communication with the server as well as having references to the data stuctures and the reponsability to perform some calculations, such as sorting vectors.

 o CH
 private CoursesHashtable CH
The object that holds the courses related to the teacher and the students registered to the courses in a double nested hashtable.
On startup the courses are put into the CoursesHashtable and then when a course is chosen, the students for that course are fetched from the server and put into the hashtable too, thus the next time the students of the course are to be called, no new fetching from the server is needed.

 o CCD
 private CCDBean CCD
A dialog object used for prompting to the user that is created on startup and then used for all the dialogs which uses pop-up windows.

 o actualCourse
 private String actualCourse
A string with the name of the most recent course chosen, which is used for user information.

 o currentTab
 private String currentTab
Used by the Info panel. The most recent panel is saved into the currentTab string, so that the Info panel when viewed show information about the most recent panel viewed.

 o courseChosenDefaultInfo
 private static final String courseChosenDefaultInfo
The courseChosenDefaultInfo is shown in the text are in Choose Course panel on viewing the panel.

 o thePanel
 TabPanel thePanel
 o chooseCoursePanel
 Panel chooseCoursePanel
 o chooseCourseList
 List chooseCourseList
 o chooseCourseLabel
 Label chooseCourseLabel
 o chooseCourseDeleteButton
 Button chooseCourseDeleteButton
 o chooseCourseCreateButton
 Button chooseCourseCreateButton
 o chooseCourseTextArea
 TextArea chooseCourseTextArea
 o chooseCourseOKButton
 Button chooseCourseOKButton
 o registerStudentsPanel
 Panel registerStudentsPanel
 o registerStudentsList
 List registerStudentsList
 o registerStudentsLabel
 Label registerStudentsLabel
 o registerStudentsRegisterButton
 Button registerStudentsRegisterButton
 o registerStudentsTextArea
 TextArea registerStudentsTextArea
 o registerStudentsClearButton
 Button registerStudentsClearButton
 o reagisterStudentsTextField
 TextField reagisterStudentsTextField
 o editStudentsPanel
 Panel editStudentsPanel
 o editStudentsList
 List editStudentsList
 o editStudentsEditStudentsButton
 Button editStudentsEditStudentsButton
 o editStudentsLabel
 Label editStudentsLabel
 o editStudentsCommitButton
 Button editStudentsCommitButton
 o editStudentsCancelButton
 Button editStudentsCancelButton
 o oldDataLabel
 Label oldDataLabel
 o newDataLabel
 Label newDataLabel
 o editStudentsOldDataLabel
 Label editStudentsOldDataLabel
 o editStudentsTextField
 TextField editStudentsTextField
 o editStudentsDeleteButton
 Button editStudentsDeleteButton
 o editStudentsNewDataTextField
 TextField editStudentsNewDataTextField
 o infoPanel
 Panel infoPanel
 o infoTextArea
 TextArea infoTextArea
 o infoList
 List infoList
 o infoShowButton
 Button infoShowButton
 o extraPanel
 Panel extraPanel
 o EditCourseTextArea
 TextArea EditCourseTextArea
 o infoOfCourseButton
 Button infoOfCourseButton
 o addNewUserButton
 Button addNewUserButton
 o removeYourAccessButton
 Button removeYourAccessButton

Constructors

 o CreateCourseApplet
 public CreateCourseApplet()

Methods

 o init
 public void init()
This method is called by the browser when the applet starts. Initialize all graphical components.

Overrides:
init in class Applet
 o myInit
 private void myInit()
Inits the non-graphical parameters/methods and launches the password dialog.
Loads the subjects taken from the password dialog into the chooseCourseList.
Loads the names of the panels into the InfoList from the Class Info. Sets the default viewed panel (Choose Course) and disables the Register Students, Edit Students and Edit Course panels.

 o extraPanel_FocusLost
 void extraPanel_FocusLost(FocusEvent event)
If the user has removed its access to the actual course, then the Edit Course panel is set to disabled on user leaving.

 o infoOfCourseButton_ActionPerformed
 void infoOfCourseButton_ActionPerformed(ActionEvent event)
Calls the server for information about the actual course and displays the answer to the user.

 o addNewUserButton_ActionPerformed
 void addNewUserButton_ActionPerformed(ActionEvent event)
Prompts the user with a dialog window to get the username to which access to the actual course should be added. Then calls the server to perform the add access procedures.

 o removeYourAccessButton_ActionPerformed
 void removeYourAccessButton_ActionPerformed(ActionEvent event)
1. Prompts the user with a dialog window to make sure the user wants to remove its access from the actual course. 2. Calls the server to perform the procedures of removing access from the user. 3. Removes the actual course from the chooseCourseList.

 o infoShowButton_Clicked
 void infoShowButton_Clicked(ActionEvent event)
Does the same as infoList_DblClicked.

 o infoList_DblClicked
 void infoList_DblClicked(ActionEvent event)
Set the information in the infoTextArea for the panel selected in the infoList.

 o infoPanel_GotFocus
 void infoPanel_GotFocus(FocusEvent event)
Sets the information in the infoTextArea for the panel most recent visited.

 o editStudentsPanel_GotFocus
 void editStudentsPanel_GotFocus(FocusEvent event)
Shows information to the user.

 o editStudentsList_ItemStateChanged
 void editStudentsList_ItemStateChanged(ItemEvent event)
If a student is marked in the editStudentsList then the edit and delete buttons are enabled, if not they are disabled.

 o editStudentsDeleteButton_ActionPerformed
 void editStudentsDeleteButton_ActionPerformed(ActionEvent event)
Removes the marked student from the course by calling the server.

 o editStudentsCancelButton_Clicked
 void editStudentsCancelButton_Clicked(ActionEvent event)
Cancel the editing of the marked student.

 o editStudentsList_DblClicked
 void editStudentsList_DblClicked(ActionEvent event)
Does the same as the editStudentsEditStudentsButton_Clicked

 o editStudentsEditStudentsButton_Clicked
 void editStudentsEditStudentsButton_Clicked(ActionEvent event)
Puts the student marked in the editStuentsList into editable mode.

 o editStudentsCommitButton_Clicked
 void editStudentsCommitButton_Clicked(ActionEvent event)
Checks the new information given about an edited student to see that the syntax is correct.
Checks to see if the cedula of the edited student is the same as before the editing and if so just writes over the old information of the student and if not removes the old student data and register the new student data.
Updates the new information given about the edited student in the CoursesHashtable and the applets student lists.

 o clearEditStudData
 private void clearEditStudData()
Clears the label and the textField.

 o enableEditStudent
 private void enableEditStudent(boolean cond)
Sets the enable students mode to either true or false, depending on cond.

 o registerStudentsPanel_GotFocus
 void registerStudentsPanel_GotFocus(FocusEvent event)
Shows information to the user.

 o registerStudentsClearButton_Clicked
 void registerStudentsClearButton_Clicked(ActionEvent event)
Clears the registerStudentsTextArea.

 o registerStudentsRegisterButton_Clicked
 void registerStudentsRegisterButton_Clicked(ActionEvent event)
Register the students typed into the registerStudentsTextArea on server to the actual course.
Update the CoursesHashtable and the students list for the course with the new students.

 o registerStudentsTextArea_TextValueChanged
 void registerStudentsTextArea_TextValueChanged(TextEvent event)
Enables/disables the registerStudentsClear/Register buttons depending on if the registerStudentsTextArea is emppty or not.

 o registerStudentsList_DblClicked
 void registerStudentsList_DblClicked(ActionEvent event)
Shows the Edit Student panel with the student that was double clicked in the registerStudentsList put into the editStudent mode.

 o chooseCoursePanel_GotFocus
 void chooseCoursePanel_GotFocus(FocusEvent event)
Shows information to the user.

 o chooseCourseCreateButton_Clicked
 void chooseCourseCreateButton_Clicked(ActionEvent event)
1. Prompts the user with a dialog window for the user to type the name of the new course he/she would like.
2. Checks that there is not a course with the same name already existing (for the moment just the courses that the user has access to).
3. Creates the course on server.
4. Sets the actual course to be the created one.
5. Updates the coursesHashtable and the chooseCourseList with the new course.

 o chooseCourseDeleteButton_Clicked
 void chooseCourseDeleteButton_Clicked(ActionEvent event)
1. Prompts the user with a dialog window for the user to accept/cancel the deletion of the course marked in the chooseCourseList.
2. Deletes the course from server.
3. Sets the actual course to be the last choosen one.
4. Updates the coursesHashtable and the chooseCourseList with the deleted course removed.

 o chooseCourseList_ItemStateChanged
 void chooseCourseList_ItemStateChanged(ItemEvent event)
Enables the chooseCourseOKButton if there are a course marked in the chooseCourseList.

 o chooseCourseOKButton_Clicked
 void chooseCourseOKButton_Clicked(ActionEvent event)
1. Fill up the coursesHashtable with the students for the course if not already done. 2. Enable the Register Students, Edit Students and the Edit Course panels. 3. Update the student lists in the Register Students and Edit Students panels.

 o chooseCourseList_DblClicked
 void chooseCourseList_DblClicked(ActionEvent event)
Does the same as chooseCourseOKButton_Clicked

 o updateCourseList
 private void updateCourseList()
Calls CoursesHashtable to get the courses and puts these courses into the chooseCourseList.

 o updateStudentsLists
 void updateStudentsLists()
Calls CoursesHashtable to get the students registered for the actual course. Puts the students into the reigsterStudentsList and the editStudentsList.

 o getUserName
 public static String getUserName()
Returns the username of the user.


All Packages  Class Hierarchy  This Package  Previous  Next  Index