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

Comparing projects/cms/source/conient/uk/org/iscream/cms/conient/HostDisplayPanel.java (file contents):
Revision 1.18 by ajm, Tue Feb 6 00:08:18 2001 UTC vs.
Revision 1.19 by ajm, Mon Feb 12 13:32:13 2001 UTC

# Line 121 | Line 121 | public class HostDisplayPanel extends JPanel {
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          
# Line 174 | Line 176 | public class HostDisplayPanel extends JPanel {
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();
# Line 215 | Line 220 | public class HostDisplayPanel extends 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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines