All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class distans.MakePageApplet

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

public class MakePageApplet
extends Applet
The MakePageApplet is the Applet that lets the user create/edit QuestionPages. When starting the Applet the following is done.
1. The password dialog is shown, which the user except for username/password confirmation uses to choose a subject.
2. The Information of already existing QuestionPages is loaded from the server.


Variable Index

 o auto
 o currentPage
The title of the currently selected QuestionPage
 o currentPanel
A Panel that implements interface ShowPanelInterface.
 o currentType
The currentType of QuestionPage
 o deleteButton
 o dl
The Dataloader object responsible for communication with the server as well as having references to the data stuctures.
 o Group1
 o label3
 o msgBox
A message box, used to display small messages.
 o NA
 o NC
 o nextButton
 o NW
 o pageSelect
 o prevButton
 o pw
The password dialog
 o random
 o send
 o sendButton
 o showPageButton
 o subject
The subject selected at the beginning by the user
 o threeCrossPanels1
 o titleField
 o twoAltPanels1
 o wPanel
The panel used for displaying QuestionPages of type written

Constructor Index

 o MakePageApplet()

Method Index

 o auto_ItemStateChanged(ItemEvent)
This is called when the user clicks on one of the feedback buttons The current pages feedback is set accordingly to the current radiobutton selection auto/send
 o deletePage_Clicked(ActionEvent)
Delets a QuestionPage from the data structures.
 o getPageURL(String)
Calculates the URL for a pageTitle.
 o init()
This method is called by the browser when the applet starts.
 o initPages()
Adds QuestionPages already created for the given subject to the page select list This is only called on startup
 o makeNewAlt()
Creates a new "New Alternative" item and adds it to the selection list
 o makeNewCross()
Creates a new "New Cross" item and adds it to the selection list
 o makeNewWritten()
Creates a new "New Written" item and adds it to the selection list
 o nextButton_Clicked(ActionEvent)
This is called when the user clicks on the ">" button.
 o prevButton_Clicked(ActionEvent)
This is called when the user clicks on the "<" button.
 o putPage(String)
Puts a new QuestionPage on the screen.
 o random_Clicked(ActionEvent)
This is called when the random button is clicked.
 o random_ClickedNoEvent()
This method randomly assign answers to the subquestion, currently only cross type question pages needs randomly assignment.
 o select_Clicked(ActionEvent)
Called when the user has selected a QuestionPage in the selection list.
 o sendButton_Clicked(ActionEvent)
Displays a warning dialog, and does some checks before calling the DataLoader to send the page to the server.
 o setAllEnable(boolean)
Help method for setting the buttons enabled or not enabled.
 o showPageButton_Clicked(ActionEvent)
This method is called when the user clicks on the show page button.
 o titleField_EnterHit()
Sets the title for the currentPage

Variables

 o currentPage
 private String currentPage
The title of the currently selected QuestionPage

 o currentPanel
 private ShowPanelInterface currentPanel
A Panel that implements interface ShowPanelInterface. The Panel is currently one of the following ThreeCrossPanel TwoALtPanel or WrittenPAnel. The Panel handles flipping between the subquestions i.e. button ">" & "<".

 o currentType
 private int currentType
The currentType of QuestionPage

 o subject
 public String subject
The subject selected at the beginning by the user

 o dl
 private DataLoader dl
The Dataloader object responsible for communication with the server as well as having references to the data stuctures.

 o pw
 private pwBean pw
The password dialog

 o wPanel
 private writtenPanel wPanel
The panel used for displaying QuestionPages of type written

 o NC
 static final String NC
 o NA
 static final String NA
 o NW
 static final String NW
 o msgBox
 private MsgBox msgBox
A message box, used to display small messages.

 o random
 Button random
 o threeCrossPanels1
 ThreeCrossPanels threeCrossPanels1
 o titleField
 TextField titleField
 o label3
 Label label3
 o sendButton
 Button sendButton
 o pageSelect
 List pageSelect
 o nextButton
 Button nextButton
 o prevButton
 Button prevButton
 o auto
 Checkbox auto
 o Group1
 CheckboxGroup Group1
 o send
 Checkbox send
 o twoAltPanels1
 TwoAltPanels twoAltPanels1
 o showPageButton
 Button showPageButton
 o deleteButton
 Button deleteButton

Constructors

 o MakePageApplet
 public MakePageApplet()

Methods

 o showPageButton_Clicked
 void showPageButton_Clicked(ActionEvent event)
This method is called when the user clicks on the show page button. It will open a new browser window with the current QuestionPage. This only works on browsers supporting multiple windows,

 o getPageURL
 private String getPageURL(String pageTitle)
Calculates the URL for a pageTitle. Uses parameter webDirectory and javaScriptDir in the HTML page containing the Applet.

Parameters:
pageTitle - the pageTitle which address in the server wants to be known.
Returns:
the URL to the server address
 o auto_ItemStateChanged
 void auto_ItemStateChanged(ItemEvent event)
This is called when the user clicks on one of the feedback buttons The current pages feedback is set accordingly to the current radiobutton selection auto/send

 o prevButton_Clicked
 void prevButton_Clicked(ActionEvent event)
This is called when the user clicks on the "<" button. currentPanel.showPrevCard() is then called.

 o nextButton_Clicked
 void nextButton_Clicked(ActionEvent event)
This is called when the user clicks on the ">" button. currentPanel.showNextCard() is then called.

 o random_Clicked
 void random_Clicked(ActionEvent event)
This is called when the random button is clicked. The Applet then randomly assigns answer number for all the subquestions. The random button is only meaningful for crosspages and are thus disabled when another page type is beeing displayed. Uses the help method random_ClickedNoEvent()

 o random_ClickedNoEvent
 void random_ClickedNoEvent()
This method randomly assign answers to the subquestion, currently only cross type question pages needs randomly assignment.

 o titleField_EnterHit
 void titleField_EnterHit()
Sets the title for the currentPage

 o sendButton_Clicked
 void sendButton_Clicked(ActionEvent event)
Displays a warning dialog, and does some checks before calling the DataLoader to send the page to the server.

 o select_Clicked
 void select_Clicked(ActionEvent event)
Called when the user has selected a QuestionPage in the selection list. Sets the currentPage to the selected one.

 o init
 public void init()
This method is called by the browser when the applet starts. All graphical components are added here, even though all three Panels are added to the Applet they are not visible.

Overrides:
init in class Applet
 o initPages
 public void initPages()
Adds QuestionPages already created for the given subject to the page select list This is only called on startup

 o makeNewCross
 public void makeNewCross()
Creates a new "New Cross" item and adds it to the selection list

 o makeNewAlt
 public void makeNewAlt()
Creates a new "New Alternative" item and adds it to the selection list

 o makeNewWritten
 public void makeNewWritten()
Creates a new "New Written" item and adds it to the selection list

 o putPage
 public void putPage(String pageTitle)
Puts a new QuestionPage on the screen. If the new QuestionPage is of a different page type than then the old, the old one is hidden and the new one shown. Some buttons enable mode are changed depending on the QuestionPage. e.g. only pages of type Cross will have the RandomButton enabled.

Parameters:
pageTitle - the page to display.
 o deletePage_Clicked
 private void deletePage_Clicked(ActionEvent e)
Delets a QuestionPage from the data structures. If the page is saved on the server the server is also called. Displays a warning box first.

 o setAllEnable
 private void setAllEnable(boolean enabl)
Help method for setting the buttons enabled or not enabled.


All Packages  Class Hierarchy  This Package  Previous  Next  Index