public void setMetricsResults(MetricDisplaySpecification displaySpecification, MetricsRun run) {
   final MetricCategory[] categories = MetricCategory.values();
   for (final MetricCategory category : categories) {
     final JTable table = tables.get(category);
     final String type = MetricsCategoryNameUtil.getShortNameForCategory(category);
     final MetricTableSpecification tableSpecification =
         displaySpecification.getSpecification(category);
     final MetricsResult results = run.getResultsForCategory(category);
     final MetricTableModel model = new MetricTableModel(results, type, tableSpecification);
     table.setModel(model);
     final Container tab = table.getParent().getParent();
     if (model.getRowCount() == 0) {
       tabbedPane.remove(tab);
       continue;
     }
     final String longName = MetricsCategoryNameUtil.getLongNameForCategory(category);
     tabbedPane.add(tab, longName);
     final MyColumnListener columnListener = new MyColumnListener(tableSpecification, table);
     final TableColumnModel columnModel = table.getColumnModel();
     columnModel.addColumnModelListener(columnListener);
     final int columnCount = columnModel.getColumnCount();
     for (int i = 0; i < columnCount; i++) {
       final TableColumn column = columnModel.getColumn(i);
       column.addPropertyChangeListener(columnListener);
     }
     setRenderers(table, type);
     setColumnWidths(table, tableSpecification);
   }
 }
 public void removeDiffOverlay(MetricDisplaySpecification displaySpecification) {
   final MetricCategory[] categories = MetricCategory.values();
   for (final MetricCategory category : categories) {
     final JTable table = tables.get(category);
     final MetricTableModel model = (MetricTableModel) table.getModel();
     model.setPrevResults(null);
     final Container tab = table.getParent().getParent();
     if (model.getRowCount() == 0) {
       tabbedPane.remove(tab);
       continue;
     }
     final String longName = MetricsCategoryNameUtil.getLongNameForCategory(category);
     tabbedPane.add(tab, longName);
     final String shortName = MetricsCategoryNameUtil.getShortNameForCategory(category);
     setRenderers(table, shortName);
     final MetricTableSpecification specification =
         displaySpecification.getSpecification(category);
     setColumnWidths(table, specification);
   }
   hasOverlay = false;
 }
예제 #3
0
 /**
  * Method for removing a Panel by object reference
  *
  * @param object The object to remove
  */
 public void removePanel(GPropertiesPanel object) {
   pane.remove(object);
   objects.remove(object);
 }
예제 #4
0
 /**
  * Method for removing a Panel by index reference
  *
  * @param index The index of the object to remove
  */
 public void removePanel(int index) {
   pane.remove((GPropertiesPanel) objects.get(index));
   objects.remove(index);
 }