121 |
|
}); |
122 |
|
_north.add(info); |
123 |
|
|
124 |
< |
addVisibleDataComponent(_center, new DateDataComponent("Host Time", "packet.attributes.date")); |
124 |
> |
JPanel date = new JPanel(); |
125 |
> |
addVisibleDataComponent(date, new DateDataComponent("Host Time", "packet.attributes.date")); |
126 |
> |
_center.add(date); |
127 |
|
|
128 |
|
_center.add(new javax.swing.JLabel("--- CPU ---")); |
129 |
|
|
176 |
|
addVisibleDataComponent(memory, new StorageFreeDataComponent("Memory in use", "packet.memory.free","Mb", totalMem)); |
177 |
|
addVisibleDataComponent(memory, new StorageFreeDataComponent("Swap in use", "packet.swap.free", "Mb", totalSwap)); |
178 |
|
_center.add(memory); |
179 |
+ |
|
180 |
|
_center.add(new javax.swing.JLabel("--- Users ---")); |
181 |
< |
addVisibleDataComponent(_center, new StringDataComponent("Number of users", "packet.users.count")); |
182 |
< |
UsersDataComponent users = new UsersDataComponent("User List", "packet.users.list"); |
183 |
< |
addVisibleDataComponent(_center, users); |
181 |
> |
JPanel users = new JPanel(); |
182 |
> |
addVisibleDataComponent(users, new StringDataComponent("Number of users", "packet.users.count")); |
183 |
> |
UsersDataComponent userList = new UsersDataComponent("User List", "packet.users.list"); |
184 |
> |
addVisibleDataComponent(users, userList); |
185 |
> |
_center.add(users); |
186 |
|
|
187 |
|
_center.add(new javax.swing.JLabel("--- Disks ---")); |
188 |
|
_disks = new JPanel(); |
220 |
|
if(_heartbeatTimerThread == null){ |
221 |
|
_heartbeatTimerThread = new Thread(_heartbeatTimer); |
222 |
|
_heartbeatTimerThread.start(); |
223 |
+ |
} |
224 |
+ |
// iterate over the packets data |
225 |
+ |
Set packetSet = packet.getSet(); |
226 |
+ |
Iterator i = packetSet.iterator(); |
227 |
+ |
while (i.hasNext()) { |
228 |
+ |
String dataKey = (String) i.next(); |
229 |
+ |
|
230 |
+ |
// if there are no components looking after this data |
231 |
+ |
// create a new StringDataComponent for it |
232 |
+ |
if(!_components.containsKey(dataKey)) { |
233 |
+ |
addVisibleDataComponent(_center, new StringDataComponent(dataKey, dataKey)); |
234 |
+ |
} |
235 |
+ |
|
236 |
+ |
// try and update the component, if it doesn't like what it gets |
237 |
+ |
// warn the user and set that this was an unsucessful display |
238 |
+ |
try { |
239 |
+ |
((DataComponent) _components.get(dataKey)).setValue(packet.getParam(dataKey)); |
240 |
+ |
} catch (DataFormatException e) { |
241 |
+ |
Conient.addMessage("WARNING{host display}: " + e.getMessage()); |
242 |
+ |
displaySucessful = false; |
243 |
+ |
} |
244 |
|
} |
245 |
|
|
246 |
|
// must be a normal data packet, update the display |