Class ServerDisplay

java.lang.Object
  |
  +--ServerDisplay

public class ServerDisplay
extends java.lang.Object

A GUI for the election server manager.

This is what the election official interacts with. When it has to do some work, the GUI calls a Server method. As part of its processing, the server then calls some mixture of the appropriate "put..." routines to display the results of the operation. The particular display implementation does the work it needs to maintain state between calls by the server itself. A typical interaction might be:

   // user asks to close an election
   // display sets itself up to show the list of candidates 
   server.closeElection(election, display);
         {
           // ...
           display.putTitle("Results for election");
           // ...
           display.putWinner(...);
           // etc
         }
   // display cleans up state from displaying the election results
   


Nested Class Summary
 class ServerDisplay.CloseElectionButtonListener
           
 class ServerDisplay.CloseWindowListener
           
 class ServerDisplay.ExitButtonListener
           
 class ServerDisplay.OpenElectionButtonListener
           
 class ServerDisplay.ViewElectionButtonListener
           
 class ServerDisplay.VoteTable
           
 
Method Summary
 void closeElection(java.lang.String election)
           
 void error(java.lang.String text)
           
 void notify(java.lang.String text)
           
 void openElection(java.lang.String election)
           
 void putCandidate(java.lang.String name, int votes)
           
 void putElection(java.lang.String name)
           
 void putTitle(java.lang.String title)
           
 void putWinner(java.lang.String name, int votes)
           
 void run()
           
 void start()
           
 void viewElection(java.lang.String election)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

putTitle

public void putTitle(java.lang.String title)

putWinner

public void putWinner(java.lang.String name,
                      int votes)

putCandidate

public void putCandidate(java.lang.String name,
                         int votes)

putElection

public void putElection(java.lang.String name)

error

public void error(java.lang.String text)

notify

public void notify(java.lang.String text)

openElection

public void openElection(java.lang.String election)

closeElection

public void closeElection(java.lang.String election)

viewElection

public void viewElection(java.lang.String election)

run

public void run()

start

public void start()