All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class distans.ThreeCrossPanels

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----distans.ThreeCrossPanels

public class ThreeCrossPanels
extends Panel
implements ShowPanelInterface
This class displays QuestionPages of type Cross. Because all subquestions can't be showned at the same screen a card system is used for displaying four at a time. This class also take care of taking the information from the text fields and putting it into the data structures. The name Three should be changed to X


Variable Index

 o ad
A refernece to a student answer object, this is only used by the ReadAnswer Applet
 o cardNo
The number of the current card beeing displayed, 0-
 o cp
An array with the CrossPanels.
 o crossPanel1
The first of the CrossPanels, the panels have individual references beacuse they were created by VisualCafe
 o crossPanel2
 o crossPanel3
 o crossPanel4
 o noOfPanels
The number of CrossPanels 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 CROSS

Constructor Index

 o ThreeCrossPanels()
Constructor, creates the four CrossPanels.

Method Index

 o addNotify()
Adds all the graphical components
 o getPreferredSize()
 o initRead()
Sets the CrossPanels 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 saveCurrentCardRead()
Saves the grade given by the teatcher in the AnswerData object.
 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 crossPanel1
 CrossPanel crossPanel1
The first of the CrossPanels, the panels have individual references beacuse they were created by VisualCafe

 o crossPanel2
 CrossPanel crossPanel2
 o crossPanel3
 CrossPanel crossPanel3
 o crossPanel4
 CrossPanel crossPanel4
 o pd
 private PageData pd
A reference to the page currently beeing displayed, the PageData must be of type CROSS

 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-

 o cp
 private CrossPanel cp[]
An array with the CrossPanels.

 o noOfPanels
 static final int noOfPanels
The number of CrossPanels on each card, even though the name of this class says two more than two could be possible.

Constructors

 o ThreeCrossPanels
 public ThreeCrossPanels()
Constructor, creates the four CrossPanels.

Methods

 o initRead
 public void initRead()
Sets the CrossPanels to not editabel, used when working with ReadAnswerApplet

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

Overrides:
show in class Component
 o validateAndHide
 public void validateAndHide()
Calls validateCard and hides the Panel

See Also:
validateCard
 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 putPage
 public void putPage(PageData pd,
                     AnswerData ad)
 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 saveCurrentCardRead
 private boolean saveCurrentCardRead()
Saves the grade given by the teatcher in the AnswerData object.

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

 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Container
 o addNotify
 public void addNotify()
Adds all the graphical components

Overrides:
addNotify in class Panel

All Packages  Class Hierarchy  This Package  Previous  Next  Index