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.
-
actualCourse
- A string with the name of the most recent course chosen, which is used for user information.
-
addNewUserButton
-
-
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.
-
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.
-
CH
- The object that holds the courses related to the teacher and the students registered to the courses in a double nested hashtable.
-
chooseCourseCreateButton
-
-
chooseCourseDeleteButton
-
-
chooseCourseLabel
-
-
chooseCourseList
-
-
chooseCourseOKButton
-
-
chooseCoursePanel
-
-
chooseCourseTextArea
-
-
courseChosenDefaultInfo
- The courseChosenDefaultInfo is shown in the text are in Choose Course panel on viewing the panel.
-
currentTab
- Used by the Info panel.
-
EditCourseTextArea
-
-
editStudentsCancelButton
-
-
editStudentsCommitButton
-
-
editStudentsDeleteButton
-
-
editStudentsEditStudentsButton
-
-
editStudentsLabel
-
-
editStudentsList
-
-
editStudentsNewDataTextField
-
-
editStudentsOldDataLabel
-
-
editStudentsPanel
-
-
editStudentsTextField
-
-
extraPanel
-
-
infoList
-
-
infoOfCourseButton
-
-
infoPanel
-
-
infoShowButton
-
-
infoTextArea
-
-
local
- If this is true the Applet will search information on the local harddisk.
-
newDataLabel
-
-
oldDataLabel
-
-
reagisterStudentsTextField
-
-
registerStudentsClearButton
-
-
registerStudentsLabel
-
-
registerStudentsList
-
-
registerStudentsPanel
-
-
registerStudentsRegisterButton
-
-
registerStudentsTextArea
-
-
removeYourAccessButton
-
-
thePanel
-
-
user
- The username of the user, set on initialization.
-
CreateCourseApplet()
-
-
addNewUserButton_ActionPerformed(ActionEvent)
- Prompts the user with a dialog window to get the username to which access to the actual course should be added.
-
chooseCourseCreateButton_Clicked(ActionEvent)
- 1.
-
chooseCourseDeleteButton_Clicked(ActionEvent)
- 1.
-
chooseCourseList_DblClicked(ActionEvent)
- Does the same as chooseCourseOKButton_Clicked
-
chooseCourseList_ItemStateChanged(ItemEvent)
- Enables the chooseCourseOKButton if there are a course marked in the chooseCourseList.
-
chooseCourseOKButton_Clicked(ActionEvent)
- 1.
-
chooseCoursePanel_GotFocus(FocusEvent)
- Shows information to the user.
-
clearEditStudData()
- Clears the label and the textField.
-
editStudentsCancelButton_Clicked(ActionEvent)
- Cancel the editing of the marked student.
-
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.
-
editStudentsDeleteButton_ActionPerformed(ActionEvent)
- Removes the marked student from the course by calling the server.
-
editStudentsEditStudentsButton_Clicked(ActionEvent)
- Puts the student marked in the editStuentsList into editable mode.
-
editStudentsList_DblClicked(ActionEvent)
- Does the same as the editStudentsEditStudentsButton_Clicked
-
editStudentsList_ItemStateChanged(ItemEvent)
- If a student is marked in the editStudentsList then the edit and delete buttons are enabled, if not they are disabled.
-
editStudentsPanel_GotFocus(FocusEvent)
- Shows information to the user.
-
enableEditStudent(boolean)
- Sets the enable students mode to either true or false, depending on cond.
-
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.
-
getUserName()
- Returns the username of the user.
-
infoList_DblClicked(ActionEvent)
- Set the information in the infoTextArea for the panel selected in the infoList.
-
infoOfCourseButton_ActionPerformed(ActionEvent)
- Calls the server for information about the actual course and displays the answer to the user.
-
infoPanel_GotFocus(FocusEvent)
- Sets the information in the infoTextArea for the panel most recent visited.
-
infoShowButton_Clicked(ActionEvent)
- Does the same as infoList_DblClicked.
-
init()
- This method is called by the browser when the applet starts.
-
myInit()
- Inits the non-graphical parameters/methods and launches the password dialog.
-
registerStudentsClearButton_Clicked(ActionEvent)
- Clears the registerStudentsTextArea.
-
registerStudentsList_DblClicked(ActionEvent)
- Shows the Edit Student panel with the student that was double clicked in the registerStudentsList put into the editStudent mode.
-
registerStudentsPanel_GotFocus(FocusEvent)
- Shows information to the user.
-
registerStudentsRegisterButton_Clicked(ActionEvent)
- Register the students typed into the registerStudentsTextArea on server to the actual course.
-
registerStudentsTextArea_TextValueChanged(TextEvent)
- Enables/disables the registerStudentsClear/Register buttons depending on if the registerStudentsTextArea is emppty or not.
-
removeYourAccessButton_ActionPerformed(ActionEvent)
- 1.
-
updateCourseList()
- Calls CoursesHashtable to get the courses and puts these courses into the chooseCourseList.
-
updateStudentsLists()
- Calls CoursesHashtable to get the students registered for the actual course.
user
private static String user
- The username of the user, set on initialization.
local
protected boolean local
- If this is true the Applet will search information on the local harddisk. This is used for debuging.
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.
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.
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.
actualCourse
private String actualCourse
- A string with the name of the most recent course chosen, which is used for user information.
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.
courseChosenDefaultInfo
private static final String courseChosenDefaultInfo
- The courseChosenDefaultInfo is shown in the text are in Choose Course panel on viewing the panel.
thePanel
TabPanel thePanel
chooseCoursePanel
Panel chooseCoursePanel
chooseCourseList
List chooseCourseList
chooseCourseLabel
Label chooseCourseLabel
chooseCourseDeleteButton
Button chooseCourseDeleteButton
chooseCourseCreateButton
Button chooseCourseCreateButton
chooseCourseTextArea
TextArea chooseCourseTextArea
chooseCourseOKButton
Button chooseCourseOKButton
registerStudentsPanel
Panel registerStudentsPanel
registerStudentsList
List registerStudentsList
registerStudentsLabel
Label registerStudentsLabel
registerStudentsRegisterButton
Button registerStudentsRegisterButton
registerStudentsTextArea
TextArea registerStudentsTextArea
registerStudentsClearButton
Button registerStudentsClearButton
reagisterStudentsTextField
TextField reagisterStudentsTextField
editStudentsPanel
Panel editStudentsPanel
editStudentsList
List editStudentsList
editStudentsEditStudentsButton
Button editStudentsEditStudentsButton
editStudentsLabel
Label editStudentsLabel
editStudentsCommitButton
Button editStudentsCommitButton
editStudentsCancelButton
Button editStudentsCancelButton
oldDataLabel
Label oldDataLabel
newDataLabel
Label newDataLabel
editStudentsOldDataLabel
Label editStudentsOldDataLabel
editStudentsTextField
TextField editStudentsTextField
editStudentsDeleteButton
Button editStudentsDeleteButton
editStudentsNewDataTextField
TextField editStudentsNewDataTextField
infoPanel
Panel infoPanel
infoTextArea
TextArea infoTextArea
infoList
List infoList
infoShowButton
Button infoShowButton
extraPanel
Panel extraPanel
EditCourseTextArea
TextArea EditCourseTextArea
infoOfCourseButton
Button infoOfCourseButton
addNewUserButton
Button addNewUserButton
removeYourAccessButton
Button removeYourAccessButton
CreateCourseApplet
public CreateCourseApplet()
init
public void init()
- This method is called by the browser when the applet starts. Initialize all graphical components.
- Overrides:
- init in class Applet
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.
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.
infoOfCourseButton_ActionPerformed
void infoOfCourseButton_ActionPerformed(ActionEvent event)
- Calls the server for information about the actual course and displays the answer to the user.
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.
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.
infoShowButton_Clicked
void infoShowButton_Clicked(ActionEvent event)
- Does the same as infoList_DblClicked.
infoList_DblClicked
void infoList_DblClicked(ActionEvent event)
- Set the information in the infoTextArea for the panel selected in the infoList.
infoPanel_GotFocus
void infoPanel_GotFocus(FocusEvent event)
- Sets the information in the infoTextArea for the panel most recent visited.
editStudentsPanel_GotFocus
void editStudentsPanel_GotFocus(FocusEvent event)
- Shows information to the user.
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.
editStudentsDeleteButton_ActionPerformed
void editStudentsDeleteButton_ActionPerformed(ActionEvent event)
- Removes the marked student from the course by calling the server.
editStudentsCancelButton_Clicked
void editStudentsCancelButton_Clicked(ActionEvent event)
- Cancel the editing of the marked student.
editStudentsList_DblClicked
void editStudentsList_DblClicked(ActionEvent event)
- Does the same as the editStudentsEditStudentsButton_Clicked
editStudentsEditStudentsButton_Clicked
void editStudentsEditStudentsButton_Clicked(ActionEvent event)
- Puts the student marked in the editStuentsList into editable mode.
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.
clearEditStudData
private void clearEditStudData()
- Clears the label and the textField.
enableEditStudent
private void enableEditStudent(boolean cond)
- Sets the enable students mode to either true or false, depending on cond.
registerStudentsPanel_GotFocus
void registerStudentsPanel_GotFocus(FocusEvent event)
- Shows information to the user.
registerStudentsClearButton_Clicked
void registerStudentsClearButton_Clicked(ActionEvent event)
- Clears the registerStudentsTextArea.
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.
registerStudentsTextArea_TextValueChanged
void registerStudentsTextArea_TextValueChanged(TextEvent event)
- Enables/disables the registerStudentsClear/Register buttons depending on if the registerStudentsTextArea is emppty or not.
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.
chooseCoursePanel_GotFocus
void chooseCoursePanel_GotFocus(FocusEvent event)
- Shows information to the user.
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.
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.
chooseCourseList_ItemStateChanged
void chooseCourseList_ItemStateChanged(ItemEvent event)
- Enables the chooseCourseOKButton if there are a course marked in the chooseCourseList.
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.
chooseCourseList_DblClicked
void chooseCourseList_DblClicked(ActionEvent event)
- Does the same as chooseCourseOKButton_Clicked
updateCourseList
private void updateCourseList()
- Calls CoursesHashtable to get the courses and puts these courses into the chooseCourseList.
updateStudentsLists
void updateStudentsLists()
- Calls CoursesHashtable to get the students registered for the actual course.
Puts the students into the reigsterStudentsList and the editStudentsList.
getUserName
public static String getUserName()
- Returns the username of the user.
All Packages Class Hierarchy This Package Previous Next Index