GUI Class Reference

Collaboration diagram for GUI:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Insets getInsets ()
void scrollToBottom ()
void traceMessage (String message, boolean error)
void traceProgressMessage (String message, boolean result)
String getScreenName ()
void checkScreen (String screenName)

Static Public Member Functions

static GUI getInstance ()

Protected Member Functions

 GUI ()

Private Attributes

JPanel mainPanel = new JPanel(new BorderLayout())
JPanel topPanel = new JPanel(new BorderLayout())
JPanel screenPanel = new JPanel(new BorderLayout())
JLabel title
JTextField screenField = new JTextField(6)
JButton screenButton = new JButton("Start")
JTextArea status = new JTextArea()
JScrollPane statusScroll
String screenName = ""
String encoding = "ISO-8859-1"

Static Private Attributes

static GUI instance = null

Detailed Description

The GUI class builds a GUI to accept the users choice of screen configuration and output status messages.

Author:
Nick Day, "UniVote" Final Year Project, Lancaster University

Definition at line 16 of file GUI.java.


Constructor & Destructor Documentation

GUI.GUI  )  [protected]
 

Builds the GUI and makes it visible to the user, centered on the screen.

Definition at line 69 of file GUI.java.

References checkScreen(), screenButton, screenField, screenName, and screenPanel.

Referenced by getInstance().

Here is the call graph for this function:


Member Function Documentation

void GUI.checkScreen String  screenName  ) 
 

Checks if the specified screen exists. If it does exist then the Bluetooth class is instantiated. Otherwise an error message is outputted to the status text area.

Parameters:
screenName The screen name to check.
See also:
Bluetooth.getInstance

Definition at line 203 of file GUI.java.

Referenced by GUI().

Insets GUI.getInsets  ) 
 

Gets the insets on this window for neater appearance.

Returns:
The insets on this window.

Definition at line 58 of file GUI.java.

static GUI GUI.getInstance  )  [static]
 

Enforces the Singleton pattern to ensure only a single instance of this class exists. Returns the instance of this class if it is instantiated, otherwise it returns a new instantiation of this class.

Returns:
An instance of this class.

Definition at line 43 of file GUI.java.

References GUI(), and instance.

Referenced by Bluetooth.Bluetooth(), BluetoothClient.BluetoothClient(), BluetoothConnectionListener.BluetoothConnectionListener(), and Database.Database().

Here is the call graph for this function:

String GUI.getScreenName  ) 
 

Returns the screen name entered by the user.

Returns:
screenName The screen name entered by the user.

Definition at line 188 of file GUI.java.

Referenced by Database.getQuestions().

void GUI.scrollToBottom  ) 
 

Scrolls to the bottom of the status text area.

Definition at line 117 of file GUI.java.

void GUI.traceMessage String  message,
boolean  error
 

Outputs a message (with the current time) to the status text area.

Parameters:
message The message to output.
error Specify if this message is erroneous.

Definition at line 130 of file GUI.java.

Referenced by Bluetooth.initialiseStack(), Server.main(), BluetoothConnectionListener.run(), and BluetoothClient.run().

void GUI.traceProgressMessage String  message,
boolean  result
 

Outputs a progress message (with the current time) to the status text area.

Parameters:
message The message to output.
result Specify if this message is the description of the progress operation, or the result of it.
false: operation description
true: result of operation

Definition at line 162 of file GUI.java.

Referenced by Database.getQuestions(), and Bluetooth.initialiseStack().


Member Data Documentation

String GUI.encoding = "ISO-8859-1" [private]
 

Definition at line 33 of file GUI.java.

GUI GUI.instance = null [static, private]
 

Definition at line 19 of file GUI.java.

Referenced by getInstance().

JPanel GUI.mainPanel = new JPanel(new BorderLayout()) [private]
 

Definition at line 20 of file GUI.java.

JButton GUI.screenButton = new JButton("Start") [private]
 

Definition at line 27 of file GUI.java.

Referenced by GUI().

JTextField GUI.screenField = new JTextField(6) [private]
 

Definition at line 26 of file GUI.java.

Referenced by GUI().

String GUI.screenName = "" [private]
 

Definition at line 32 of file GUI.java.

Referenced by GUI().

JPanel GUI.screenPanel = new JPanel(new BorderLayout()) [private]
 

Definition at line 22 of file GUI.java.

Referenced by GUI().

JTextArea GUI.status = new JTextArea() [private]
 

Definition at line 28 of file GUI.java.

JScrollPane GUI.statusScroll [private]
 

Initial value:

 new JScrollPane(status, 
                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, 
                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER)

Definition at line 29 of file GUI.java.

JLabel GUI.title [private]
 

Initial value:

 new JLabel("<html><font size=5 color=#CC0000>" +
                "<b>UniVote</b></font><br><font size=3 color=#333333>Server " +
                "Application</font></html>")

Definition at line 23 of file GUI.java.

JPanel GUI.topPanel = new JPanel(new BorderLayout()) [private]
 

Definition at line 21 of file GUI.java.


The documentation for this class was generated from the following file:
Generated on Mon Mar 13 22:04:07 2006 for UniVote Server Application by  doxygen 1.4.6