Class ClientDisplay

java.lang.Object
  |
  +--ClientDisplay

public class ClientDisplay
extends java.lang.Object

A GUI for the election client. It asks the user for the name of an election, gets the candidate list, allows the user to vote, then displays the receipt (server acknowledgement). It does all this by making calls to methods of the Client class, and passing itself as an argument so that the client can display its results.

The methods of this class are called by the client to display results on the GUI. For example, the processing will start out like this:

   // user enters an election name
   // display sets itself up to show the candidate list
   client.displayCandidates(election, display);
             {
               // get the candidate list from the server
               while (not all candidates displayed)
                 display.putCandidate(nextcandidate);
             }
   // display continues ...
   


Nested Class Summary
 class ClientDisplay.ChooseElectionButtonListener
           
 class ClientDisplay.VoteButtonListener
           
 
Method Summary
 void chooseCandidate(java.lang.String election)
           
 void chooseElection(java.lang.String title)
           
 void error(java.lang.String text)
           
 void notify(java.lang.String text)
           
 void putCandidate(java.lang.String candidate)
           
 void putReceipt(java.lang.String election, java.lang.String candidate)
           
 void run()
           
 void start()
           
 void vote(javax.swing.JFrame window, java.lang.String election, java.lang.String candidate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

error

public void error(java.lang.String text)

notify

public void notify(java.lang.String text)

putCandidate

public void putCandidate(java.lang.String candidate)

putReceipt

public void putReceipt(java.lang.String election,
                       java.lang.String candidate)

chooseCandidate

public void chooseCandidate(java.lang.String election)

vote

public void vote(javax.swing.JFrame window,
                 java.lang.String election,
                 java.lang.String candidate)

chooseElection

public void chooseElection(java.lang.String title)

run

public void run()

start

public void start()