1 |
|
//---PACKAGE DECLARATION--- |
2 |
< |
package uk.ac.ukc.iscream.conient; |
2 |
> |
package uk.org.iscream.conient; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
< |
import uk.ac.ukc.iscream.util.*; |
6 |
< |
import uk.ac.ukc.iscream.conient.datacomponents.*; |
5 |
> |
import uk.org.iscream.util.*; |
6 |
> |
import uk.org.iscream.conient.datacomponents.*; |
7 |
|
import javax.swing.*; |
8 |
|
import javax.swing.border.*; |
9 |
|
import java.util.*; |
87 |
|
String queueHashCode = packet.getParam("packet.attributes.hashCode"); |
88 |
|
VisibleDataComponent date = new DateDataComponent("Last timestamp", "packet.attributes.date"); |
89 |
|
VisibleDataComponent total = new StringDataComponent("Total queued to date", "packet.queue.attributes.total"); |
90 |
– |
VisibleDataComponent hashCode = new StringDataComponent("Internal hash code", "packet.attributes.hashCode"); |
90 |
|
newQueue.put("packet.attributes.name", new StringDataComponent("Name", "packet.attributes.name")); |
91 |
|
newQueue.put("packet.queue.attributes.total", total); |
92 |
|
newQueue.put("packet.attributes.date", date); |
94 |
– |
newQueue.put("packet.attributes.hashCode", hashCode); |
93 |
|
JPanel newQueueDisplay = new JPanel(); |
94 |
|
newQueueDisplay.setLayout(new BoxLayout(newQueueDisplay, BoxLayout.Y_AXIS)); |
95 |
|
newQueueDisplay.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 102)), queueName)); |
96 |
|
newQueueDisplay.add(date); |
97 |
|
newQueueDisplay.add(total); |
98 |
< |
newQueueDisplay.add(hashCode); |
101 |
< |
_queuesDisplays.put(queueName, newQueueDisplay); |
98 |
> |
_queuesDisplays.put(queueHashCode, newQueueDisplay); |
99 |
|
try { |
100 |
|
SwingSafeAdd task = new SwingSafeAdd(_content, newQueueDisplay); |
101 |
|
SwingUtilities.invokeAndWait(task); |
128 |
|
// if there are no components looking after this data |
129 |
|
// create a new StringDataComponent for it |
130 |
|
if(!components.containsKey(dataKey)) { |
131 |
< |
// check if its a disk drive, if it is then we need to deal with it |
131 |
> |
// check if its a queue, if it is then we need to deal with it |
132 |
|
if(dataKey.startsWith("packet.queue.attributes.queue")) { |
133 |
|
VisibleDataComponent queue = new StringDataComponent("Current length of " + dataKey.substring(dataKey.lastIndexOf('.') + 1), dataKey); |
134 |
|
components.put(dataKey, queue); |
136 |
|
SwingSafeAdd task = new SwingSafeAdd((JPanel)_queuesDisplays.get(queueHashCode), queue); |
137 |
|
SwingUtilities.invokeAndWait(task); |
138 |
|
} catch (Exception e) { |
139 |
< |
// don't care |
139 |
> |
// if there was a problem |
140 |
> |
System.err.println("ERROR Failed To Add Component - " + e); |
141 |
|
} |
142 |
|
pack(); |
143 |
|
} |