use of cbit.vcell.microscopy.gui.groupableTableHeader.GroupableTableHeader in project vcell by virtualcell.
the class AnalysisResultsTablePanel method setupTable.
private void setupTable() {
table = new StyleTable();
table.setCellSelectionEnabled(true);
table.setAutoCreateColumnsFromModel(false);
table.setModel(anaTableModel);
table.setColumnModel(new GroupableTableColumnModel());
table.setTableHeader(new GroupableTableHeader((GroupableTableColumnModel) table.getColumnModel()));
// 4 digits double precision
AnalysisTableRenderer tableCellRenderer = new AnalysisTableRenderer(4);
TableColumn[] columns = new TableColumn[AnalysisTableModel.NUM_COLUMNS];
for (int i = 0; i < anaTableModel.getColumnCount(); i++) {
columns[i] = new TableColumn(i, 0, tableCellRenderer, null);
table.addColumn(columns[i]);
}
GroupableTableColumnModel cm = (GroupableTableColumnModel) table.getColumnModel();
ColumnGroup group_df1 = new ColumnGroup(new GroupableTableCellRenderer(), "Diffusion with one diffusing component (DF1)");
group_df1.add(cm.getColumn(AnalysisTableModel.COLUMN_DIFF_ONE_PARAMETER_VAL));
group_df1.add(cm.getColumn(AnalysisTableModel.COLUMN_DIFF_ONE_CI));
group_df1.add(cm.getColumn(AnalysisTableModel.COLUMN_DIFF_ONE_CI_PLOT));
ColumnGroup group_df2 = new ColumnGroup(new GroupableTableCellRenderer(), "Diffusion with two diffusing components (DF2)");
group_df2.add(cm.getColumn(AnalysisTableModel.COLUMN_DIFF_TWO_PARAMETER_VAL));
group_df2.add(cm.getColumn(AnalysisTableModel.COLUMN_DIFF_TWO_CI));
group_df2.add(cm.getColumn(AnalysisTableModel.COLUMN_DIFF_TWO_CI_PLOT));
ColumnGroup group_koff = new ColumnGroup(new GroupableTableCellRenderer(), "Reaction Only Off Rate (KOff)");
group_koff.add(cm.getColumn(AnalysisTableModel.COLUMN_KOFF_PARAMETER_VAL));
group_koff.add(cm.getColumn(AnalysisTableModel.COLUMN_KOFF_CI));
group_koff.add(cm.getColumn(AnalysisTableModel.COLUMN_KOFF_CI_PLOT));
cm.addColumnGroup(group_df1);
cm.addColumnGroup(group_df2);
cm.addColumnGroup(group_koff);
// set special editor for confidence interval plot columns
AnalysisTableEditor ciPlotTableEditor = new AnalysisTableEditor(table);
ciPlotTableEditor.addPropertyChangeListener(this);
TableColumn diffOneCIPlotCol = table.getColumnModel().getColumn(AnalysisTableModel.COLUMN_DIFF_ONE_CI_PLOT);
diffOneCIPlotCol.setCellEditor(ciPlotTableEditor);
diffOneCIPlotCol.setPreferredWidth(68);
diffOneCIPlotCol.setMaxWidth(68);
TableColumn diffTwoCIPlotCol = table.getColumnModel().getColumn(AnalysisTableModel.COLUMN_DIFF_TWO_CI_PLOT);
diffTwoCIPlotCol.setCellEditor(ciPlotTableEditor);
diffTwoCIPlotCol.setPreferredWidth(68);
diffTwoCIPlotCol.setMaxWidth(68);
TableColumn koffCIPlotCol = table.getColumnModel().getColumn(AnalysisTableModel.COLUMN_KOFF_CI_PLOT);
koffCIPlotCol.setCellEditor(ciPlotTableEditor);
koffCIPlotCol.setPreferredWidth(68);
koffCIPlotCol.setMaxWidth(68);
table.addMouseListener(evtHandler);
scrTable = new JScrollPane(table);
scrTable.setAutoscrolls(true);
}
Aggregations