All Packages Class Hierarchy This Package Previous Next Index
Class distans.TwoAltPanels
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----distans.TwoAltPanels
- public class TwoAltPanels
- extends Panel
- implements ShowPanelInterface
This class displays QuestionPAges of type ALT. Because all subquestions can't be showned at the same screen
A card system is used for displaying two at a time. This class also take care of taking the information from the text fields
and putting it into the data structures.
-
ad
- A refernece to a student answer object, this is only used by the ReadAnswer Applet
-
ap
- An array with the AltPanels.
-
cardNo
- The number of the current card beeing displayed, 0-
-
noOfPanels
- The number of AltPanels on each card, even though the name of this class says two more than two could be possible.
-
pd
- A reference to the page currently beeing displayed, the PageData must be of type
ALT
-
TwoAltPanels()
- Constructor adds the two AltPanels using a flowLayout
-
addNotify()
-
-
initRead()
- Sets the AltPanels to not editabel, used when working with ReadAnswerApplet
-
putPage(PageData)
- Call this method to display the first card of a new page.
-
putPage(PageData, AnswerData)
-
-
saveCurrentCard()
- Saves the information of the current card in PageData
-
show()
- Not used just calls the super class (Panel)
-
showCurrentCard()
- Shows the current card by changing the text in the two AltPanels.
-
showNextCard()
- Saves the information of the old card in the data structures and displays the next card.
-
showPrevCard()
- Saves the information of the old card in the data structures and displays the previous card.
-
validateAndHide()
- Calls validateCard and hides the Panel
-
validateCard()
- Saves the current card by calling saveCurrentCard()
noOfPanels
static final int noOfPanels
- The number of AltPanels on each card, even though the name of this class says two more than two could be possible.
ap
private AltPanel ap[]
- An array with the AltPanels.
pd
private PageData pd
- A reference to the page currently beeing displayed, the PageData must be of type
ALT
ad
private AnswerData ad
- A refernece to a student answer object, this is only used by the ReadAnswer Applet
cardNo
private int cardNo
- The number of the current card beeing displayed, 0-
TwoAltPanels
public TwoAltPanels()
- Constructor adds the two AltPanels using a flowLayout
putPage
public void putPage(PageData pd,
AnswerData ad)
putPage
public void putPage(PageData pd)
- Call this method to display the first card of a new page.
The old page current card is saved with a call to vaildateCard.
show
public void show()
- Not used just calls the super class (Panel)
- Overrides:
- show in class Component
validateCard
public void validateCard()
- Saves the current card by calling saveCurrentCard()
showCurrentCard
private void showCurrentCard()
- Shows the current card by changing the text in the two AltPanels.
The text displayed depends if it should display text for editing/creating pages or the students answers.
showNextCard
public void showNextCard()
- Saves the information of the old card in the data structures and displays the next card.
saveCurrentCard
private boolean saveCurrentCard()
- Saves the information of the current card in PageData
- Returns:
- false if not all the text fields in the two AltPanels are filled, true otherwise
showPrevCard
public void showPrevCard()
- Saves the information of the old card in the data structures and displays the previous card.
validateAndHide
public void validateAndHide()
- Calls validateCard and hides the Panel
- See Also:
- validateCard
initRead
public void initRead()
- Sets the AltPanels to not editabel, used when working with ReadAnswerApplet
addNotify
public void addNotify()
- Overrides:
- addNotify in class Panel
All Packages Class Hierarchy This Package Previous Next Index