Search in sources :

Example 1 with GroupableTableColumnModel

use of cbit.vcell.microscopy.gui.groupableTableHeader.GroupableTableColumnModel 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);
}
Also used : JScrollPane(javax.swing.JScrollPane) GroupableTableColumnModel(cbit.vcell.microscopy.gui.groupableTableHeader.GroupableTableColumnModel) StyleTable(org.vcell.util.gui.StyleTable) ColumnGroup(cbit.vcell.microscopy.gui.groupableTableHeader.ColumnGroup) TableColumn(javax.swing.table.TableColumn) GroupableTableHeader(cbit.vcell.microscopy.gui.groupableTableHeader.GroupableTableHeader)

Aggregations

ColumnGroup (cbit.vcell.microscopy.gui.groupableTableHeader.ColumnGroup)1 GroupableTableColumnModel (cbit.vcell.microscopy.gui.groupableTableHeader.GroupableTableColumnModel)1 GroupableTableHeader (cbit.vcell.microscopy.gui.groupableTableHeader.GroupableTableHeader)1 JScrollPane (javax.swing.JScrollPane)1 TableColumn (javax.swing.table.TableColumn)1 StyleTable (org.vcell.util.gui.StyleTable)1