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.


Variable Index

 o ad
A refernece to a student answer object, this is only used by the ReadAnswer Applet
 o ap
An array with the AltPanels.
 o cardNo
The number of the current card beeing displayed, 0-
 o noOfPanels
The number of AltPanels on each card, even though the name of this class says two more than two could be possible.
 o pd
A reference to the page currently beeing displayed, the PageData must be of type ALT

Constructor Index

 o TwoAltPanels()
Constructor adds the two AltPanels using a flowLayout

Method Index

 o addNotify()
 o initRead()
Sets the AltPanels to not editabel, used when working with ReadAnswerApplet
 o putPage(PageData)
Call this method to display the first card of a new page.
 o putPage(PageData, AnswerData)
 o saveCurrentCard()
Saves the information of the current card in PageData
 o show()
Not used just calls the super class (Panel)
 o showCurrentCard()
Shows the current card by changing the text in the two AltPanels.
 o showNextCard()
Saves the information of the old card in the data structures and displays the next card.
 o showPrevCard()
Saves the information of the old card in the data structures and displays the previous card.
 o validateAndHide()
Calls validateCard and hides the Panel
 o validateCard()
Saves the current card by calling saveCurrentCard()

Variables

 o 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.

 o ap
 private AltPanel ap[]
An array with the AltPanels.

 o pd
 private PageData pd
A reference to the page currently beeing displayed, the PageData must be of type ALT

 o ad
 private AnswerData ad
A refernece to a student answer object, this is only used by the ReadAnswer Applet

 o cardNo
 private int cardNo
The number of the current card beeing displayed, 0-

Constructors

 o TwoAltPanels
 public TwoAltPanels()
Constructor adds the two AltPanels using a flowLayout

Methods

 o putPage
 public void putPage(PageData pd,
                     AnswerData ad)
 o 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.

 o show
 public void show()
Not used just calls the super class (Panel)

Overrides:
show in class Component
 o validateCard
 public void validateCard()
Saves the current card by calling saveCurrentCard()

 o 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.

 o showNextCard
 public void showNextCard()
Saves the information of the old card in the data structures and displays the next card.

 o 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
 o showPrevCard
 public void showPrevCard()
Saves the information of the old card in the data structures and displays the previous card.

 o validateAndHide
 public void validateAndHide()
Calls validateCard and hides the Panel

See Also:
validateCard
 o initRead
 public void initRead()
Sets the AltPanels to not editabel, used when working with ReadAnswerApplet

 o addNotify
 public void addNotify()
Overrides:
addNotify in class Panel

All Packages  Class Hierarchy  This Package  Previous  Next  Index