1 |
|
//---PACKAGE DECLARATION--- |
2 |
+ |
package uk.org.iscream.conient; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
|
import javax.swing.*; |
6 |
|
import javax.swing.border.*; |
6 |
– |
import java.awt.Color; |
7 |
– |
|
7 |
|
import java.awt.*; |
8 |
|
import java.awt.event.*; |
10 |
– |
import java.net.*; |
11 |
– |
import java.io.*; |
12 |
– |
import java.util.Date; |
13 |
– |
import java.text.DateFormat; |
14 |
– |
import java.util.Locale; |
9 |
|
|
10 |
|
/** |
11 |
< |
* NASTY AND BASIC, PLEASE DON'T COMPLAIN |
11 |
> |
* This is the main class of the Conient client. |
12 |
|
* |
13 |
+ |
* This sets up the control panel, the data panel |
14 |
+ |
* and its own display. |
15 |
+ |
* |
16 |
|
* @author $Author$ |
17 |
|
* @version $Id$ |
18 |
|
*/ |
19 |
< |
public class SwingClient extends JFrame implements Runnable { |
19 |
> |
public class Conient extends JFrame { |
20 |
|
|
21 |
|
//---FINAL ATTRIBUTES--- |
22 |
|
|
24 |
|
* The current CVS revision of this class |
25 |
|
*/ |
26 |
|
public final String REVISION = "$Revision$"; |
27 |
+ |
|
28 |
+ |
/** |
29 |
+ |
* The initial width of the window |
30 |
+ |
*/ |
31 |
+ |
private final int DEFAULT_WIDTH = 700; |
32 |
|
|
33 |
< |
private final int width = 300; |
34 |
< |
private final int height = 700; |
33 |
> |
/** |
34 |
> |
* The initial height of the window |
35 |
> |
*/ |
36 |
> |
private final int DEFAULT_HEIGHT = 600; |
37 |
|
|
38 |
+ |
/** |
39 |
+ |
* The default configuration fle |
40 |
+ |
* This can be specified on the command line |
41 |
+ |
*/ |
42 |
+ |
public static final String DEFAULT_CONFIG_FILE = "./etc/default.conf"; |
43 |
+ |
|
44 |
+ |
/** |
45 |
+ |
* The time in seconds to display the splash |
46 |
+ |
* screen for |
47 |
+ |
*/ |
48 |
+ |
public static final int DISPLAY_SPLASH_TIME_SECONDS = 3; |
49 |
+ |
|
50 |
|
//---STATIC METHODS--- |
51 |
|
|
52 |
+ |
/** |
53 |
+ |
* The first method that is called. |
54 |
+ |
* Sets up the various panels |
55 |
+ |
* |
56 |
+ |
* @param args the command line arguments |
57 |
+ |
*/ |
58 |
|
public static void main(String[] args) { |
59 |
< |
try { |
60 |
< |
String host = args[0]; |
61 |
< |
int port = 4510; |
62 |
< |
Socket socket = new Socket(host, port); |
63 |
< |
BufferedReader inBound = new BufferedReader(new InputStreamReader(socket.getInputStream())); |
64 |
< |
PrintWriter outBound = new PrintWriter(socket.getOutputStream()); |
65 |
< |
DataReader data = new DataReader(inBound); |
59 |
> |
// get the host from the command line if they gave it |
60 |
> |
String host = null; |
61 |
> |
String configFile = DEFAULT_CONFIG_FILE; |
62 |
> |
if (args.length == 1) { |
63 |
> |
configFile = args[0]; |
64 |
> |
} |
65 |
> |
|
66 |
> |
// start the configuration system |
67 |
> |
Configuration.initialise(configFile); |
68 |
> |
|
69 |
> |
// the data display panel |
70 |
> |
DataPanel data = new DataPanel(); |
71 |
|
|
72 |
< |
SwingClient cli = new SwingClient(data); |
73 |
< |
Thread cliThread = new Thread(cli); |
74 |
< |
cliThread.start(); |
75 |
< |
} catch (Exception e) { |
76 |
< |
System.err.println("ERROR: " + e); |
77 |
< |
} |
72 |
> |
// the control panel |
73 |
> |
ControlPanel control = new ControlPanel(data); |
74 |
> |
|
75 |
> |
// the main frame (passed the two panels) |
76 |
> |
Conient client = new Conient(data, control); |
77 |
> |
conientFrame = (Frame) client; |
78 |
> |
Conient.addMessage("Conient {an i-scream Client} (c) 2001 The i-scream Project (http://www.i-scream.org.uk)"); |
79 |
> |
|
80 |
> |
Conient.addMessage("Conient ready."); |
81 |
> |
|
82 |
|
} |
83 |
|
|
84 |
+ |
/** |
85 |
+ |
* A static accessor, allowing components of the system |
86 |
+ |
* to get hold of the root frame of the system. |
87 |
+ |
* |
88 |
+ |
* see conientFrame attribute for details. |
89 |
+ |
* |
90 |
+ |
* @return the root Conient frame |
91 |
+ |
*/ |
92 |
+ |
public static Frame getFrame() { |
93 |
+ |
return conientFrame; |
94 |
+ |
} |
95 |
+ |
|
96 |
|
//---CONSTRUCTORS--- |
97 |
|
|
98 |
|
/** |
99 |
< |
* Creates a new Swing Client. |
99 |
> |
* Creates a new Swing Client Frame |
100 |
|
*/ |
101 |
< |
public SwingClient(DataReader data) { |
59 |
< |
_data = data; |
101 |
> |
private Conient(JSplitPane data, ControlPanel control) { |
102 |
|
// set up the Frame |
103 |
< |
setTitle("I-Scream Client"); |
104 |
< |
setSize(width, height); |
105 |
< |
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
64 |
< |
Box box = Box.createVerticalBox(); |
65 |
< |
|
66 |
< |
// create the i-scream logo at the top |
67 |
< |
JLabel iscream = new JLabel(new ImageIcon("i-scream.gif")); |
68 |
< |
JLabel comment = new JLabel(" I-Scream Client"); |
69 |
< |
comment.setForeground( new Color(0, 0, 102)); |
70 |
< |
Box header = Box.createHorizontalBox(); |
71 |
< |
header.add(comment); |
72 |
< |
header.add(Box.createHorizontalGlue()); |
73 |
< |
header.add(iscream); |
103 |
> |
super("Conient {an i-scream Client}"); |
104 |
> |
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); |
105 |
> |
setJMenuBar(control.getMenuBar()); |
106 |
|
|
107 |
< |
ImageIcon icon = new ImageIcon("server.gif"); |
108 |
< |
JTabbedPane tabbedPane = new JTabbedPane(); |
109 |
< |
JPanel mainPanel = new JPanel(); |
110 |
< |
mainPanel.setLayout(new GridLayout(21, 1)); |
107 |
> |
// set what happens when the X in the corner is clicked |
108 |
> |
addWindowListener(new WindowAdapter() { |
109 |
> |
public void windowClosing(WindowEvent e) {System.exit(0);} |
110 |
> |
}); |
111 |
|
|
112 |
< |
JPanel panel1 = makeTextPanel("Machine Name : ", _machine_name); |
113 |
< |
JPanel panel2 = makeTextPanel("IP : ", _ip); |
114 |
< |
JPanel panel3 = makeTextPanel("Date : ", _date); |
115 |
< |
JPanel panel4 = makeTextPanel("Sequence Number : ", _seq_no); |
84 |
< |
JPanel panel5 = makeTextPanel("Host Time : ", _sTime); |
85 |
< |
JPanel panel6 = makeTextPanel("Load Average (1 min) : ", _load_load1); |
86 |
< |
JPanel panel7 = makeTextPanel("Load Average (5 min) : ", _load_load5); |
87 |
< |
JPanel panel8 = makeTextPanel("Load Average (15 min) : ", _load_load15); |
88 |
< |
JPanel panel9 = makeTextPanel("Processes Total : ", _processes_total); |
89 |
< |
JPanel panel10 = makeTextPanel("Processes Sleeping : ", _processes_sleeping); |
90 |
< |
JPanel panel11 = makeTextPanel("Processes Zombie : ", _processes_zombie); |
91 |
< |
JPanel panel12 = makeTextPanel("Processes Stopped : ", _processes_stopped); |
92 |
< |
JPanel panel13 = makeTextPanel("CPU % idle : ", _cpu_idle); |
93 |
< |
JPanel panel14 = makeTextPanel("CPU % user : ", _cpu_user); |
94 |
< |
JPanel panel15 = makeTextPanel("CPU % kernel : ", _cpu_kernel); |
95 |
< |
JPanel panel16 = makeTextPanel("CPU % i/o wait : ", _cpu_iowait); |
96 |
< |
JPanel panel17 = makeTextPanel("CPU % swapping : ", _cpu_swap); |
97 |
< |
JPanel panel18 = makeTextPanel("Real Memory : ", _memory_real); |
98 |
< |
JPanel panel19 = makeTextPanel("Real Free : ", _memory_free); |
99 |
< |
JPanel panel20 = makeTextPanel("Swap in use : ", _memory_swapinuse); |
100 |
< |
JPanel panel21 = makeTextPanel("Swap free : ", _memory_swapfree); |
101 |
< |
mainPanel.add(panel1); |
102 |
< |
mainPanel.add(panel2); |
103 |
< |
mainPanel.add(panel3); |
104 |
< |
mainPanel.add(panel4); |
105 |
< |
mainPanel.add(panel5); |
106 |
< |
mainPanel.add(panel6); |
107 |
< |
mainPanel.add(panel7); |
108 |
< |
mainPanel.add(panel8); |
109 |
< |
mainPanel.add(panel9); |
110 |
< |
mainPanel.add(panel10); |
111 |
< |
mainPanel.add(panel11); |
112 |
< |
mainPanel.add(panel12); |
113 |
< |
mainPanel.add(panel13); |
114 |
< |
mainPanel.add(panel14); |
115 |
< |
mainPanel.add(panel15); |
116 |
< |
mainPanel.add(panel16); |
117 |
< |
mainPanel.add(panel17); |
118 |
< |
mainPanel.add(panel18); |
119 |
< |
mainPanel.add(panel19); |
120 |
< |
mainPanel.add(panel20); |
121 |
< |
mainPanel.add(panel21); |
122 |
< |
|
123 |
< |
tabbedPane.addTab("Raptor", icon, mainPanel, "Monitor raptor.ukc.ac.uk"); |
124 |
< |
|
125 |
< |
tabbedPane.setSelectedIndex(0); |
112 |
> |
// add the control pane to the top border |
113 |
> |
getContentPane().add(control, "North"); |
114 |
> |
// add the data pane to the centre |
115 |
> |
getContentPane().add(data); |
116 |
|
|
117 |
< |
// build the frame |
118 |
< |
box.add(header); |
119 |
< |
box.add(tabbedPane); |
120 |
< |
getContentPane().add(box); |
117 |
> |
// setup the status panel |
118 |
> |
JPanel bottom = new JPanel(); |
119 |
> |
bottom.setLayout(new BorderLayout()); |
120 |
> |
_messages.setEditable(false); |
121 |
> |
_messages.setRows(3); |
122 |
> |
JScrollPane messagesPane = new JScrollPane(_messages); |
123 |
> |
messagesPane.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 102)), " Messages ")); |
124 |
> |
bottom.add(messagesPane, "Center"); |
125 |
> |
JPanel statusPanel = new JPanel(); |
126 |
> |
JPanel linkPanel = new JPanel(); |
127 |
> |
linkPanel.setLayout(new GridLayout(1,2)); |
128 |
> |
linkPanel.add(_controlStatus); |
129 |
> |
linkPanel.add(_dataStatus); |
130 |
> |
statusPanel.setLayout(new GridLayout(2,1)); |
131 |
> |
statusPanel.add(linkPanel); |
132 |
> |
statusPanel.add(_queueStatus); |
133 |
> |
bottom.add(statusPanel, "South"); |
134 |
|
|
135 |
< |
// show the window |
136 |
< |
show(); |
137 |
< |
} |
135 |
> |
// add the status panel to the bottom border |
136 |
> |
getContentPane().add(bottom, "South"); |
137 |
> |
|
138 |
> |
// a nice icon for the window |
139 |
> |
setIconImage((new ImageIcon("./resources/server.gif")).getImage()); |
140 |
|
|
141 |
< |
//---PUBLIC METHODS--- |
142 |
< |
|
143 |
< |
public void run() { |
141 |
> |
// and just because we can, a silly splash screen |
142 |
> |
// of the dudes that did this funky gibble |
143 |
> |
Splash splash = new Splash(); |
144 |
> |
splash.show(); |
145 |
> |
// wait |
146 |
|
try { |
147 |
< |
_data.start(); |
148 |
< |
while(true) { |
149 |
< |
synchronized (_data) { |
143 |
< |
_data.wait(); |
144 |
< |
} |
145 |
< |
String xml = _data.getXML(); |
146 |
< |
if (xml == null) { |
147 |
< |
// nothing |
148 |
< |
} else { |
149 |
< |
|
150 |
< |
// Get a string without any null characters in it. |
151 |
< |
// -- maybe String.trim() would be better here ? |
152 |
< |
if (xml.indexOf(0) != -1) { |
153 |
< |
xml = xml.substring(0, xml.indexOf(0)); |
154 |
< |
} |
155 |
< |
else { |
156 |
< |
xml = xml.substring(0, xml.length()); |
157 |
< |
} |
158 |
< |
|
159 |
< |
// Use XMLPacketMaker to make an XMLPacket object. |
160 |
< |
XMLPacketMaker xmlPacketMaker = new XMLPacketMaker(xml); |
161 |
< |
XMLPacket packet = xmlPacketMaker.createXMLPacket(); |
162 |
< |
|
163 |
< |
_machine_name.setText(packet.getParam("packet.attributes.machine_name")); |
164 |
< |
_ip.setText(packet.getParam("packet.attributes.ip")); |
165 |
< |
_date.setText(DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(new Date(Long.parseLong(packet.getParam("packet.attributes.date"))))); |
166 |
< |
_seq_no.setText(packet.getParam("packet.attributes.seq_no")); |
167 |
< |
|
168 |
< |
_sTime.setText(packet.getParam("packet.sTime")); |
169 |
< |
|
170 |
< |
_load_load1.setText(packet.getParam("packet.load.load1")); |
171 |
< |
_load_load5.setText(packet.getParam("packet.load.load5")); |
172 |
< |
_load_load15.setText(packet.getParam("packet.load.load15")); |
173 |
< |
|
174 |
< |
_processes_total.setText(packet.getParam("packet.processes.total")); |
175 |
< |
_processes_sleeping.setText(packet.getParam("packet.processes.sleeping")); |
176 |
< |
_processes_zombie.setText(packet.getParam("packet.processes.zombie")); |
177 |
< |
_processes_stopped.setText(packet.getParam("packet.processes.stopped")); |
178 |
< |
|
179 |
< |
_cpu_idle.setString(packet.getParam("packet.cpu.idle") + "%"); |
180 |
< |
_cpu_idle.setValue(new Double(packet.getParam("packet.cpu.idle")).intValue()); |
181 |
< |
_cpu_user.setString(packet.getParam("packet.cpu.user") + "%"); |
182 |
< |
_cpu_user.setValue(new Double(packet.getParam("packet.cpu.user")).intValue()); |
183 |
< |
_cpu_kernel.setString(packet.getParam("packet.cpu.kernel") + "%"); |
184 |
< |
_cpu_kernel.setValue(new Double(packet.getParam("packet.cpu.kernel")).intValue()); |
185 |
< |
_cpu_iowait.setString(packet.getParam("packet.cpu.iowait") + "%"); |
186 |
< |
_cpu_iowait.setValue(new Double(packet.getParam("packet.cpu.iowait")).intValue()); |
187 |
< |
_cpu_swap.setString(packet.getParam("packet.cpu.swap") + "%"); |
188 |
< |
_cpu_swap.setValue(new Double(packet.getParam("packet.cpu.swap")).intValue()); |
189 |
< |
|
190 |
< |
_memory_real.setText(packet.getParam("packet.memory.real")); |
191 |
< |
_memory_free.setText(packet.getParam("packet.memory.free")); |
192 |
< |
_memory_swapinuse.setText(packet.getParam("packet.memory.swapinuse")); |
193 |
< |
_memory_swapfree.setText(packet.getParam("packet.memory.swapfree")); |
194 |
< |
} |
147 |
> |
Thread.sleep(DISPLAY_SPLASH_TIME_SECONDS * 1000); |
148 |
> |
} catch (InterruptedException e) { |
149 |
> |
// don't do anything, we don't care |
150 |
|
} |
151 |
< |
} catch (Exception e) { |
152 |
< |
System.err.println("ERROR: " + e); |
153 |
< |
} |
151 |
> |
//loose the window |
152 |
> |
splash.dispose(); |
153 |
> |
splash = null; |
154 |
> |
// show the main window |
155 |
> |
show(); |
156 |
|
} |
157 |
|
|
158 |
+ |
//---PUBLIC METHODS--- |
159 |
+ |
|
160 |
|
//---PRIVATE METHODS--- |
161 |
+ |
|
162 |
+ |
//---ACCESSOR/MUTATOR METHODS--- |
163 |
+ |
|
164 |
+ |
/** |
165 |
+ |
* Sets the control link status. |
166 |
+ |
* |
167 |
+ |
* @param status the message |
168 |
+ |
*/ |
169 |
+ |
public static void setControlStatus(String status) { |
170 |
+ |
_controlStatus.setText("Control Link: " + status); |
171 |
+ |
_controlStatus.repaint(); |
172 |
+ |
} |
173 |
|
|
174 |
< |
protected JPanel makeTextPanel(String text, Component item) { |
175 |
< |
JPanel panel = new JPanel(false); |
176 |
< |
JLabel label = new JLabel(text); |
177 |
< |
label.setHorizontalAlignment(JLabel.RIGHT); |
178 |
< |
//item.setHorizontalAlignment(JLabel.LEFT); |
179 |
< |
panel.setLayout(new GridLayout(1, 2)); |
180 |
< |
panel.add(label); |
181 |
< |
panel.add(item); |
211 |
< |
return panel; |
174 |
> |
/** |
175 |
> |
* Sets the data link status. |
176 |
> |
* |
177 |
> |
* @param status the message |
178 |
> |
*/ |
179 |
> |
public static void setDataStatus(String status) { |
180 |
> |
_dataStatus.setText("Data Link: " + status); |
181 |
> |
_dataStatus.repaint(); |
182 |
|
} |
183 |
|
|
184 |
+ |
/** |
185 |
+ |
* Updates the queue status. |
186 |
+ |
* |
187 |
+ |
* @param currentQueue |
188 |
+ |
* @param numElements |
189 |
+ |
*/ |
190 |
+ |
public static void setQueueStatus(int currentQueue, int numElements) { |
191 |
+ |
_queueStatus.setText("Data Queue : " + currentQueue + " Packets Recieved : " + numElements); |
192 |
+ |
_queueStatus.repaint(); |
193 |
+ |
} |
194 |
|
|
195 |
< |
//---ACCESSOR/MUTATOR METHODS--- |
195 |
> |
/** |
196 |
> |
* Adds a system message to the messages list |
197 |
> |
* |
198 |
> |
* @param message the new message |
199 |
> |
*/ |
200 |
> |
public static void addMessage(String message) { |
201 |
> |
_messages.insert(message + "\n", 0); |
202 |
> |
} |
203 |
|
|
204 |
|
//---ATTRIBUTES--- |
218 |
– |
|
219 |
– |
JLabel _machine_name = new JLabel(); |
220 |
– |
JLabel _ip = new JLabel(); |
221 |
– |
JLabel _date = new JLabel(); |
222 |
– |
JLabel _seq_no = new JLabel(); |
205 |
|
|
206 |
< |
JLabel _sTime = new JLabel(); |
206 |
> |
//---STATIC ATTRIBUTES--- |
207 |
|
|
208 |
< |
JLabel _load_load1 = new JLabel(); |
209 |
< |
JLabel _load_load5 = new JLabel(); |
210 |
< |
JLabel _load_load15 = new JLabel(); |
211 |
< |
|
230 |
< |
JLabel _processes_total = new JLabel(); |
231 |
< |
JLabel _processes_sleeping = new JLabel(); |
232 |
< |
JLabel _processes_zombie = new JLabel(); |
233 |
< |
JLabel _processes_stopped = new JLabel(); |
234 |
< |
|
235 |
< |
int min = 0; |
236 |
< |
int max = 100; |
237 |
< |
JProgressBar _cpu_idle = new JProgressBar(JProgressBar.HORIZONTAL, min, max); |
208 |
> |
/** |
209 |
> |
* Displays information about the data link |
210 |
> |
*/ |
211 |
> |
static JLabel _controlStatus = new JLabel("Control Link: Disconnected", JLabel.LEFT); |
212 |
|
{ |
213 |
< |
_cpu_idle.setStringPainted(true); |
213 |
> |
_controlStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); |
214 |
|
} |
215 |
< |
JProgressBar _cpu_user = new JProgressBar(JProgressBar.HORIZONTAL, min, max); |
215 |
> |
|
216 |
> |
/** |
217 |
> |
* Displays information about the data link |
218 |
> |
*/ |
219 |
> |
static JLabel _dataStatus = new JLabel("Data Link: Disconnected", JLabel.LEFT); |
220 |
|
{ |
221 |
< |
_cpu_user.setStringPainted(true); |
221 |
> |
_dataStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); |
222 |
|
} |
223 |
< |
JProgressBar _cpu_kernel = new JProgressBar(JProgressBar.HORIZONTAL, min, max); |
223 |
> |
|
224 |
> |
/** |
225 |
> |
* Displays information about the inbound data queue. |
226 |
> |
*/ |
227 |
> |
static JLabel _queueStatus = new JLabel(" ", JLabel.LEFT); |
228 |
|
{ |
229 |
< |
_cpu_kernel.setStringPainted(true); |
229 |
> |
_queueStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); |
230 |
|
} |
231 |
< |
JProgressBar _cpu_iowait = new JProgressBar(JProgressBar.HORIZONTAL, min, max); |
231 |
> |
|
232 |
> |
/** |
233 |
> |
* The place where system messages are written. |
234 |
> |
*/ |
235 |
> |
static JTextArea _messages = new JTextArea(); |
236 |
|
{ |
237 |
< |
_cpu_iowait.setStringPainted(true); |
237 |
> |
_messages.setLineWrap(true); |
238 |
|
} |
253 |
– |
JProgressBar _cpu_swap = new JProgressBar(JProgressBar.HORIZONTAL, min, max); |
254 |
– |
{ |
255 |
– |
_cpu_swap.setStringPainted(true); |
256 |
– |
} |
239 |
|
|
240 |
< |
JLabel _memory_real = new JLabel(); |
241 |
< |
JLabel _memory_free = new JLabel(); |
242 |
< |
JLabel _memory_swapinuse = new JLabel(); |
243 |
< |
JLabel _memory_swapfree = new JLabel(); |
244 |
< |
DataReader _data; |
240 |
> |
/** |
241 |
> |
* Holds a reference to the root frame for Conient |
242 |
> |
* This is only used by dialogs (specifically the configurationn |
243 |
> |
* dialog) so that it can be modal, please use the accessor. |
244 |
> |
*/ |
245 |
> |
private static Frame conientFrame; |
246 |
|
|
247 |
< |
//---STATIC ATTRIBUTES--- |
248 |
< |
|
249 |
< |
} |
247 |
> |
//---INNER CLASSES---- |
248 |
> |
|
249 |
> |
/** |
250 |
> |
* An inner class to display a splash screen |
251 |
> |
*/ |
252 |
> |
private class Splash extends JWindow { |
253 |
> |
|
254 |
> |
/** |
255 |
> |
* Constructs a new splash screen |
256 |
> |
*/ |
257 |
> |
public Splash() { |
258 |
> |
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); |
259 |
> |
JPanel splash = new JPanel(); |
260 |
> |
splash.setBackground(Color.black); |
261 |
> |
JLabel image = new JLabel((new ImageIcon("./resources/i-scream-splash.gif"))); |
262 |
> |
splash.add(image); |
263 |
> |
setContentPane(splash); |
264 |
> |
Dimension screen = getToolkit().getScreenSize(); |
265 |
> |
pack(); |
266 |
> |
setLocation((screen.width - getSize().width) / 2, |
267 |
> |
(screen.height - getSize().height) / 2); |
268 |
> |
|
269 |
> |
|
270 |
> |
} |
271 |
> |
} |
272 |
> |
} |