コード例 #1
0
 public Object getValueAt(int row, int column) {
   synchronized (allocations) {
     Allocation[] ary = getAllocationArray();
     if (row >= ary.length) return null;
     Allocation a = ary[row];
     AllocationResult ar = a.getEstimatedResult();
     switch (column) {
       case 0: // The task id
         return a.getTask().getUID();
       case 1: // The failed status
         return ar.isSuccess() ? "Succeeded" : "Failed";
       case 2: // The confidence rating
         return confidenceFormat.format(ar.getConfidenceRating());
     }
     return "???";
   }
 }
コード例 #2
0
 private void checkAllocations(Enumeration en) {
   while (en.hasMoreElements()) {
     Allocation alloc = (Allocation) en.nextElement();
     AllocationResult ar = alloc.getEstimatedResult();
     if (ar != null) {
       if (!allocations.contains(alloc)) {
         allocations.add(alloc);
         tableModel.fireTableDataChanged();
       } else {
         tableModel.fireTableDataChanged();
       }
       if (ar.isSuccess()) {
         removeAlert(alloc);
       } else {
         createAlert(alloc);
       }
     } else {
       removeAllocation(alloc);
     }
   }
 }