Commit in lcsim/src/org/lcsim/plugin/browser on MAIN
CalorimeterHitTableModel.java+55-531.3 -> 1.4
Added units to column headings.  Added columns for corrected energy and time.

lcsim/src/org/lcsim/plugin/browser
CalorimeterHitTableModel.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- CalorimeterHitTableModel.java	13 Sep 2005 17:42:57 -0000	1.3
+++ CalorimeterHitTableModel.java	13 Sep 2005 18:05:44 -0000	1.4
@@ -15,57 +15,59 @@
  */
 class CalorimeterHitTableModel extends AbstractTableModel implements EventBrowserTableModel
 {
-   private List hits;
-   private LCMetaData meta;
-   private CalorimeterIDDecoder decoder;
-   private static final String[] defaultColumns = {"energy","x","y","z"};
-   private List<String> columns;
-   private static final ScientificFormat format = new ScientificFormat();
-
-   public boolean canDisplay(Class c)
-   {
-      return CalorimeterHit.class.isAssignableFrom(c);
-   }
-   public void setData(LCMetaData meta, List hits)
-   {
-      this.hits = hits;
-      this.meta = meta;
-      this.decoder = (CalorimeterIDDecoder) meta.getIDDecoder();
-      List oldColumns = columns;
-      columns = new ArrayList<String>();
-      for (int i=0; i<decoder.getFieldCount(); i++) columns.add("id: " + decoder.getFieldName(i));
-      for (int i=0; i<defaultColumns.length; i++) columns.add(defaultColumns[i]);
-      if (columns.equals(oldColumns)) fireTableDataChanged();
-      else super.fireTableStructureChanged();
-   }
-   public int getRowCount()
-   {
-      return hits == null ? 0 : hits.size();
-   }
-   public int getColumnCount()
-   {
-      return columns.size();
-   }
-   public String getColumnName(int index)
-   {
-      return columns.get(index);
-   }
-   public Class getColumnClass(int row)
-   {
-      return row < decoder.getFieldCount() ? Integer.class : Double.class;
-   }
-   public Object getValueAt(int row, int column)
-   {
-      CalorimeterHit hit = (CalorimeterHit) hits.get(row);
-      decoder.setID(hit.getCellID());
-      if (column < decoder.getFieldCount()) return decoder.getValue(column);
-      else switch (column-decoder.getFieldCount())
-      {
-         case 0: return hit.getRawEnergy();
-         case 1: return decoder.getX();
-         case 2: return decoder.getY();
-         case 3: return decoder.getZ();
-         default: return " ";
-      }
-   }
+    private List hits;
+    private LCMetaData meta;
+    private CalorimeterIDDecoder decoder;
+    private static final String[] defaultColumns = {"raw energy (GeV)","corrected energy (GeV)","x (mm)","y (mm)","z (mm)", "time (ns)"};
+    private List<String> columns;
+    private static final ScientificFormat format = new ScientificFormat();
+    
+    public boolean canDisplay(Class c)
+    {
+        return CalorimeterHit.class.isAssignableFrom(c);
+    }
+    public void setData(LCMetaData meta, List hits)
+    {
+        this.hits = hits;
+        this.meta = meta;
+        this.decoder = (CalorimeterIDDecoder) meta.getIDDecoder();
+        List oldColumns = columns;
+        columns = new ArrayList<String>();
+        for (int i=0; i<decoder.getFieldCount(); i++) columns.add("id: " + decoder.getFieldName(i));
+        for (int i=0; i<defaultColumns.length; i++) columns.add(defaultColumns[i]);
+        if (columns.equals(oldColumns)) fireTableDataChanged();
+        else super.fireTableStructureChanged();
+    }
+    public int getRowCount()
+    {
+        return hits == null ? 0 : hits.size();
+    }
+    public int getColumnCount()
+    {
+        return columns.size();
+    }
+    public String getColumnName(int index)
+    {
+        return columns.get(index);
+    }
+    public Class getColumnClass(int row)
+    {
+        return row < decoder.getFieldCount() ? Integer.class : Double.class;
+    }
+    public Object getValueAt(int row, int column)
+    {
+        CalorimeterHit hit = (CalorimeterHit) hits.get(row);
+        decoder.setID(hit.getCellID());
+        if (column < decoder.getFieldCount()) return decoder.getValue(column);
+        else switch (column-decoder.getFieldCount())
+        {
+            case 0: return hit.getRawEnergy();
+            case 1: return hit.getCorrectedEnergy();
+            case 2: return decoder.getX();
+            case 3: return decoder.getY();
+            case 4: return decoder.getZ();
+            case 5: return hit.getTime();
+            default: return " ";
+        }
+    }
 }
CVSspam 0.2.8