ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/conient/uk/org/iscream/cms/conient/QueueFrame.java
(Generate patch)

Comparing projects/cms/source/conient/uk/org/iscream/cms/conient/QueueFrame.java (file contents):
Revision 1.5 by ajm, Tue Feb 27 23:31:32 2001 UTC vs.
Revision 1.6 by ajm, Thu Mar 1 15:48:22 2001 UTC

# Line 60 | Line 60 | public class QueueFrame extends JFrame {
60      public boolean update(XMLPacket packet) {
61          // iterate over the packets data
62          boolean displaySucessful = true;
63 <        String queueName = packet.getParam("packet.attributes.name");
63 >        String queueHashCode = packet.getParam("packet.attributes.hashCode");
64  
65          // if there are no components looking after this data
66          // create a new StringDataComponent for it
67 <        if(!_queues.containsKey(queueName)) {
67 >        if(!_queues.containsKey(queueHashCode)) {
68              addQueue(packet);
69          }
70  
# Line 84 | Line 84 | public class QueueFrame extends JFrame {
84      private void addQueue(XMLPacket packet) {
85          HashMap newQueue = new HashMap();
86          String queueName = packet.getParam("packet.attributes.name");
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          newQueue.put("packet.attributes.name", new StringDataComponent("Name", "packet.attributes.name"));
# Line 102 | Line 103 | public class QueueFrame extends JFrame {
103              // don't care
104          }
105          pack();
106 <        _queues.put(queueName, newQueue);
106 >        _queues.put(queueHashCode, newQueue);
107      }
108          
109      private void updateQueueInformation(XMLPacket packet) throws DataFormatException {
110 <        String queueName = packet.getParam("packet.attributes.name");
110 >        String queueHashCode = packet.getParam("packet.attributes.hashCode");
111          
112          // if it was a shutdown packet, remove the display
113          if (packet.getParam("packet.attributes.shutdown") != null) {
114              // *** !!! MAY NOT BE SWING SAFE !!! ***
115 <            JPanel temp = (JPanel)_queuesDisplays.get(queueName);
115 >            JPanel temp = (JPanel)_queuesDisplays.get(queueHashCode);
116              temp.setVisible(false);
117              _content.remove(temp);
118              _queuesDisplays.remove(temp);
# Line 119 | Line 120 | public class QueueFrame extends JFrame {
120  
121          // else update the display
122          } else {
123 <            HashMap components = (HashMap) _queues.get(queueName);
123 >            HashMap components = (HashMap) _queues.get(queueHashCode);
124              Set packetSet = packet.getSet();
125              Iterator i = packetSet.iterator();
126              while (i.hasNext()) {
# Line 132 | Line 133 | public class QueueFrame extends JFrame {
133                          VisibleDataComponent queue = new StringDataComponent("Current length of " + dataKey.substring(dataKey.lastIndexOf('.') + 1), dataKey);
134                          components.put(dataKey, queue);
135                          try {
136 <                           SwingSafeAdd task = new SwingSafeAdd((JPanel)_queuesDisplays.get(queueName), queue);
136 >                            SwingSafeAdd task = new SwingSafeAdd((JPanel)_queuesDisplays.get(queueHashCode), queue);
137                              SwingUtilities.invokeAndWait(task);
138                          } catch (Exception e) {
139                              // don't care

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines