1 32 33 package com.jeantessier.dependencyfinder.gui; 34 35 import javax.swing.table.*; 36 37 import com.jeantessier.dependency.*; 38 39 public class MetricsTableModel extends AbstractTableModel { 40 MetricsGatherer metrics = new MetricsGatherer(); 41 42 public MetricsGatherer getMetrics() { 43 return metrics; 44 } 45 46 public void setMetrics(MetricsGatherer metrics) { 47 this.metrics = metrics; 48 fireTableStructureChanged(); 49 } 50 51 public int getColumnCount() { 52 return MetricsGatherer.getNbCharts(); 53 } 54 55 public int getRowCount() { 56 return getMetrics().getChartMaximum() + 1; 57 } 58 59 public Object getValueAt(int rowIndex, int columnIndex) { 60 return new Long (getMetrics().getChartData(rowIndex)[columnIndex]); 61 } 62 63 public String getColumnName(int column) { 64 return MetricsGatherer.getChartName(column); 65 } 66 } 67 | Popular Tags |