16 |
|
* @author $Author$ |
17 |
|
* @version $Id$ |
18 |
|
*/ |
19 |
< |
public class SwingClient extends JFrame { |
19 |
> |
public class Conient extends JFrame { |
20 |
|
|
21 |
|
//---FINAL ATTRIBUTES--- |
22 |
|
|
36 |
|
private final int DEFAULT_HEIGHT = 600; |
37 |
|
|
38 |
|
/** |
39 |
< |
* The i-scream server port |
39 |
> |
* The default configuration fle |
40 |
> |
* This can be specified on the command line |
41 |
|
*/ |
42 |
< |
public static final int PORT = 4510; |
42 |
> |
public static final String DEFAULT_CONFIG_FILE = "./etc/default.conf"; |
43 |
|
|
44 |
|
//---STATIC METHODS--- |
45 |
|
|
52 |
|
public static void main(String[] args) { |
53 |
|
// get the host from the command line if they gave it |
54 |
|
String host = null; |
55 |
+ |
String configFile = DEFAULT_CONFIG_FILE; |
56 |
|
if (args.length == 1) { |
57 |
< |
host = args[0]; |
57 |
> |
configFile = args[0]; |
58 |
|
} |
59 |
+ |
|
60 |
+ |
// start the configuration system |
61 |
+ |
Configuration.initialise(configFile); |
62 |
|
|
63 |
|
// the data display panel |
64 |
|
DataPanel data = new DataPanel(); |
67 |
|
ControlPanel control = new ControlPanel(data); |
68 |
|
|
69 |
|
// the main frame (passed the two panels) |
70 |
< |
SwingClient client = new SwingClient(data, control); |
71 |
< |
SwingClient.addMessage("Conient {an I-scream Client} © 2001 University of Kent & Project I-Scream"); |
72 |
< |
SwingClient.addMessage("Conient ready."); |
70 |
> |
Conient client = new Conient(data, control); |
71 |
> |
Conient.addMessage("Conient {an i-scream Client} © 2001 University of Kent & Project i-scream"); |
72 |
> |
|
73 |
> |
Conient.addMessage("Conient ready."); |
74 |
|
} |
75 |
|
|
76 |
|
|
79 |
|
/** |
80 |
|
* Creates a new Swing Client Frame |
81 |
|
*/ |
82 |
< |
private SwingClient(JPanel data, JPanel control) { |
82 |
> |
private Conient(JPanel data, JPanel control) { |
83 |
|
// set up the Frame |
84 |
< |
super("Conient {an I-scream Client}"); |
84 |
> |
super("Conient {an i-scream Client}"); |
85 |
|
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); |
86 |
|
|
87 |
|
// set what happens when the X in the corner is clicked |
106 |
|
bottom.add(messagesPane, "Center"); |
107 |
|
JPanel statusPanel = new JPanel(); |
108 |
|
JPanel linkPanel = new JPanel(); |
109 |
< |
linkPanel.setLayout(new GridLayout(2,1)); |
109 |
> |
linkPanel.setLayout(new GridLayout(1,2)); |
110 |
|
linkPanel.add(_controlStatus); |
111 |
|
linkPanel.add(_dataStatus); |
112 |
< |
statusPanel.setLayout(new GridLayout(1,3)); |
112 |
> |
statusPanel.setLayout(new GridLayout(2,1)); |
113 |
|
statusPanel.add(linkPanel); |
114 |
|
statusPanel.add(_queueStatus); |
115 |
|
bottom.add(statusPanel, "South"); |
199 |
|
* The place where system messages are written. |
200 |
|
*/ |
201 |
|
static JTextArea _messages = new JTextArea(); |
202 |
+ |
{ |
203 |
+ |
_messages.setLineWrap(true); |
204 |
+ |
} |
205 |
|
} |