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.
-
auto
-
-
currentPage
- The title of the currently selected QuestionPage
-
currentPanel
- A Panel that implements interface ShowPanelInterface.
-
currentType
- The currentType of QuestionPage
-
deleteButton
-
-
dl
- The Dataloader object responsible for communication with the server as well as having references to the data stuctures.
-
Group1
-
-
label3
-
-
msgBox
- A message box, used to display small messages.
-
NA
-
-
NC
-
-
nextButton
-
-
NW
-
-
pageSelect
-
-
prevButton
-
-
pw
- The password dialog
-
random
-
-
send
-
-
sendButton
-
-
showPageButton
-
-
subject
- The subject selected at the beginning by the user
-
threeCrossPanels1
-
-
titleField
-
-
twoAltPanels1
-
-
wPanel
- The panel used for displaying QuestionPages of type written
-
MakePageApplet()
-
-
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
-
deletePage_Clicked(ActionEvent)
- Delets a QuestionPage from the data structures.
-
getPageURL(String)
- Calculates the URL for a pageTitle.
-
init()
- This method is called by the browser when the applet starts.
-
initPages()
- Adds QuestionPages already created for the given subject to the page select list
This is only called on startup
-
makeNewAlt()
- Creates a new "New Alternative" item and adds it to the selection list
-
makeNewCross()
- Creates a new "New Cross" item and adds it to the selection list
-
makeNewWritten()
- Creates a new "New Written" item and adds it to the selection list
-
nextButton_Clicked(ActionEvent)
- This is called when the user clicks on the ">" button.
-
prevButton_Clicked(ActionEvent)
- This is called when the user clicks on the "<" button.
-
putPage(String)
- Puts a new QuestionPage on the screen.
-
random_Clicked(ActionEvent)
- This is called when the random button is clicked.
-
random_ClickedNoEvent()
- This method randomly assign answers to the subquestion, currently only cross type question pages needs randomly assignment.
-
select_Clicked(ActionEvent)
- Called when the user has selected a QuestionPage in the selection list.
-
sendButton_Clicked(ActionEvent)
- Displays a warning dialog, and does some checks before calling the
DataLoader to send the page to the server.
-
setAllEnable(boolean)
- Help method for setting the buttons enabled or not enabled.
-
showPageButton_Clicked(ActionEvent)
- This method is called when the user clicks on the show page button.
-
titleField_EnterHit()
- Sets the title for the currentPage
currentPage
private String currentPage
- The title of the currently selected QuestionPage
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 ">" & "<".
currentType
private int currentType
- The currentType of QuestionPage
subject
public String subject
- The subject selected at the beginning by the user
dl
private DataLoader dl
- The Dataloader object responsible for communication with the server as well as having references to the data stuctures.
pw
private pwBean pw
- The password dialog
wPanel
private writtenPanel wPanel
- The panel used for displaying QuestionPages of type written
NC
static final String NC
NA
static final String NA
NW
static final String NW
msgBox
private MsgBox msgBox
- A message box, used to display small messages.
random
Button random
threeCrossPanels1
ThreeCrossPanels threeCrossPanels1
titleField
TextField titleField
label3
Label label3
sendButton
Button sendButton
pageSelect
List pageSelect
nextButton
Button nextButton
prevButton
Button prevButton
auto
Checkbox auto
Group1
CheckboxGroup Group1
send
Checkbox send
twoAltPanels1
TwoAltPanels twoAltPanels1
showPageButton
Button showPageButton
deleteButton
Button deleteButton
MakePageApplet
public MakePageApplet()
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,
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
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
prevButton_Clicked
void prevButton_Clicked(ActionEvent event)
- This is called when the user clicks on the "<" button.
currentPanel.showPrevCard() is then called.
nextButton_Clicked
void nextButton_Clicked(ActionEvent event)
- This is called when the user clicks on the ">" button.
currentPanel.showNextCard() is then called.
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()
random_ClickedNoEvent
void random_ClickedNoEvent()
- This method randomly assign answers to the subquestion, currently only cross type question pages needs randomly assignment.
titleField_EnterHit
void titleField_EnterHit()
- Sets the title for the currentPage
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.
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.
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
initPages
public void initPages()
- Adds QuestionPages already created for the given subject to the page select list
This is only called on startup
makeNewCross
public void makeNewCross()
- Creates a new "New Cross" item and adds it to the selection list
makeNewAlt
public void makeNewAlt()
- Creates a new "New Alternative" item and adds it to the selection list
makeNewWritten
public void makeNewWritten()
- Creates a new "New Written" item and adds it to the selection list
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.
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.
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