| 162 |
|
addVisibleDataComponent(processesData, new ProcessesDataComponent("Zombie", "packet.processes.zombie")); |
| 163 |
|
processesData.add(Box.createGlue()); |
| 164 |
|
_center.add(processesData); |
| 165 |
< |
|
| 166 |
< |
|
| 167 |
< |
|
| 168 |
< |
// theses next two are DataComponents, but not VisibleDataComponents |
| 169 |
< |
// this is because they hold the value but do NOT display it |
| 170 |
< |
StorageTotalDataComponent totalMem = new StorageTotalDataComponent("Total Memory", "packet.memory.total"); |
| 171 |
< |
addDataComponent(totalMem); |
| 172 |
< |
StorageTotalDataComponent totalSwap = new StorageTotalDataComponent("Total Swap", "packet.swap.total"); |
| 173 |
< |
addDataComponent(totalSwap); |
| 174 |
< |
|
| 165 |
> |
|
| 166 |
|
_center.add(new javax.swing.JLabel("--- Memory ---")); |
| 167 |
|
|
| 168 |
|
// these next two are passed the non-visible datacomponents |
| 169 |
|
JPanel memory = new JPanel(); |
| 170 |
|
memory.setLayout(new BoxLayout(memory, BoxLayout.Y_AXIS)); |
| 171 |
< |
addVisibleDataComponent(memory, new StorageFreeDataComponent("Memory in use", "packet.memory.free","Mb", totalMem)); |
| 172 |
< |
addVisibleDataComponent(memory, new StorageFreeDataComponent("Swap in use", "packet.swap.free", "Mb", totalSwap)); |
| 171 |
> |
addVisibleDataComponent(memory, new StorageDataComponent("Memory in use", "packet.memory.free", "packet.memory.total","Mb")); |
| 172 |
> |
addVisibleDataComponent(memory, new StorageDataComponent("Swap in use", "packet.swap.free", "packet.swap.total", "Mb")); |
| 173 |
> |
// theses next two are DataComponents, but not VisibleDataComponents |
| 174 |
> |
// this is because they hold the value but do NOT display it |
| 175 |
> |
// just so we ignore the data, because the StorageDataComponent handles it |
| 176 |
> |
addDataComponent(new StringDataComponent("packet.memory.total", "packet.memory.total")); |
| 177 |
> |
addDataComponent(new StringDataComponent("packet.swap.total", "packet.swap.total")); |
| 178 |
> |
|
| 179 |
|
_center.add(memory); |
| 180 |
|
|
| 181 |
|
_center.add(new javax.swing.JLabel("--- Users ---")); |
| 279 |
|
if(_components.containsKey(dataKey)) { |
| 280 |
|
|
| 281 |
|
try { |
| 282 |
< |
((DataComponent) _components.get(dataKey)).setValue(packet.getParam(dataKey)); |
| 282 |
> |
((DataComponent) _components.get(dataKey)).setValue(packet); |
| 283 |
|
} catch (DataFormatException e) { |
| 284 |
|
Conient.addMessage("WARNING{host display}: " + e.getMessage()); |
| 285 |
|
displaySucessful = false; |
| 340 |
|
diskNumber = diskNumber + attribute.charAt(pos); |
| 341 |
|
pos++; |
| 342 |
|
} |
| 343 |
< |
DiskInformationDataComponent device = new DiskInformationDataComponent("Disk device", "packet.disk.p" + diskNumber + ".attributes.name"); |
| 344 |
< |
addDataComponent(device); |
| 345 |
< |
DiskInformationDataComponent mountPoint = new DiskInformationDataComponent("Disk mount point", "packet.disk.p" + diskNumber + ".attributes.mount"); |
| 349 |
< |
addDataComponent(mountPoint); |
| 350 |
< |
StorageTotalDataComponent total = new StorageTotalDataComponent("Disk total", "packet.disk.p" + diskNumber + ".attributes.kbytes"); |
| 351 |
< |
addDataComponent(total); |
| 352 |
< |
DiskFreeDataComponent free = new DiskFreeDataComponent("Space in use", "packet.disk.p" + diskNumber + ".attributes.avail", "Mb", 1024, total, mountPoint, device); |
| 353 |
< |
addVisibleDataComponent(_disks, free); |
| 343 |
> |
String devAttribute = "packet.disk.p" + diskNumber + ".attributes.name"; |
| 344 |
> |
String mountAttribute = "packet.disk.p" + diskNumber + ".attributes.mount"; |
| 345 |
> |
String totalAttribute = "packet.disk.p" + diskNumber + ".attributes.kbytes"; |
| 346 |
|
|
| 347 |
+ |
// the only visible component |
| 348 |
+ |
String availAttribute = "packet.disk.p" + diskNumber + ".attributes.avail"; |
| 349 |
+ |
DiskDataComponent disk = new DiskDataComponent("Disk", availAttribute, totalAttribute, mountAttribute, devAttribute , "Mb", 1024); |
| 350 |
+ |
addVisibleDataComponent(_disks, disk); |
| 351 |
+ |
|
| 352 |
|
// currently this data isn't useful, so we don't display it |
| 353 |
|
// but we add it so that it is forgotten about |
| 354 |
+ |
addDataComponent(new StringDataComponent(devAttribute, devAttribute)); |
| 355 |
+ |
addDataComponent(new StringDataComponent(mountAttribute, mountAttribute)); |
| 356 |
+ |
addDataComponent(new StringDataComponent(totalAttribute, totalAttribute)); |
| 357 |
|
addDataComponent(new StringDataComponent("packet.disk.p" + diskNumber + ".used", "packet.disk.p" + diskNumber + ".attributes.used")); |
| 358 |
|
} |
| 359 |
|
|
| 378 |
|
serviceType = serviceType + attribute.charAt(pos); |
| 379 |
|
pos++; |
| 380 |
|
} |
| 381 |
< |
StringDataComponent serviceStatus = new StringDataComponent(serviceType + " service status", "packet.services." + serviceType + ".attributes.status"); |
| 382 |
< |
addDataComponent(serviceStatus); |
| 381 |
> |
|
| 382 |
> |
String statusAttribute = "packet.services." + serviceType + ".attributes.status"; |
| 383 |
> |
// we hide this as the service data component uses this attribute |
| 384 |
> |
addDataComponent(new StringDataComponent(serviceType + " service status", statusAttribute)); |
| 385 |
|
|
| 386 |
< |
ServiceDataComponent service = new ServiceDataComponent(serviceType, "packet.services." + serviceType + ".attributes.message", serviceStatus); |
| 386 |
> |
ServiceDataComponent service = new ServiceDataComponent(serviceType, "packet.services." + serviceType + ".attributes.message", statusAttribute); |
| 387 |
|
addVisibleDataComponent(_services, service); |
| 388 |
|
} |
| 389 |
|
|