Search in sources :

Example 1 with StyleTable

use of org.vcell.util.gui.StyleTable 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)

Example 2 with StyleTable

use of org.vcell.util.gui.StyleTable in project vcell by virtualcell.

the class BatchRunMSETablePanel method setupTable.

private void setupTable() {
    TableSorter sorter = new TableSorter(mseTableModel);
    table = new StyleTable(sorter);
    table.setCellSelectionEnabled(true);
    sorter.setTableHeader(table.getTableHeader());
    TableColumn nameCol = table.getColumnModel().getColumn(BatchRunMSETableModel.COLUMN_FILE_NAME);
    nameCol.setCellRenderer(new ResultsParamTableRenderer());
    // double precision 6 digits
    TableCellRenderer mseRenderer = new NumericTableCellRenderer();
    for (int i = 1; i < table.getColumnCount(); i++) {
        TableColumn col = table.getColumnModel().getColumn(i);
        col.setPreferredWidth(0);
        col.setCellRenderer(mseRenderer);
    }
    table.addMouseListener(evtHandler);
}
Also used : NumericTableCellRenderer(cbit.vcell.microscopy.gui.NumericTableCellRenderer) TableCellRenderer(javax.swing.table.TableCellRenderer) NumericTableCellRenderer(cbit.vcell.microscopy.gui.NumericTableCellRenderer) StyleTable(org.vcell.util.gui.StyleTable) TableColumn(javax.swing.table.TableColumn)

Example 3 with StyleTable

use of org.vcell.util.gui.StyleTable in project vcell by virtualcell.

the class BatchRunResultsParamTablePanel method setupTable_stat.

private void setupTable_stat() {
    statTablePanel = new AdvancedTablePanel();
    table_stat = new StyleTable();
    table_stat.setModel(statTableModel);
    table_stat.setCellSelectionEnabled(true);
    TableColumn nameCol = table_stat.getColumnModel().getColumn(BatchRunResultsParamTableModel.COLUMN_FILE_NAME);
    nameCol.setCellRenderer(new ResultsParamTableRenderer());
    // set the numeric columns' renders
    // double precision 6 digits
    TableCellRenderer statRenderer = new NumericTableCellRenderer();
    for (int i = 1; i < table_stat.getColumnCount(); i++) {
        TableColumn col = table_stat.getColumnModel().getColumn(i);
        col.setPreferredWidth(0);
        col.setCellRenderer(statRenderer);
    }
    // add table to panel.By default, if you don't place a table in a scroll pane, the table  header  is not  shown. You need to explicitly display it.
    statTablePanel.setTable(table_stat);
    statTablePanel.setLayout(new GridBagLayout());
    GridBagConstraints gc = new GridBagConstraints();
    gc.gridy = 0;
    gc.gridx = 0;
    gc.weightx = 1;
    gc.fill = GridBagConstraints.HORIZONTAL;
    statTablePanel.add(table_stat.getTableHeader(), gc);
    gc.gridy = 1;
    gc.gridx = 0;
    gc.weightx = 1;
    gc.fill = GridBagConstraints.HORIZONTAL;
    statTablePanel.add(table_stat, gc);
}
Also used : NumericTableCellRenderer(cbit.vcell.microscopy.gui.NumericTableCellRenderer) TableCellRenderer(javax.swing.table.TableCellRenderer) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) NumericTableCellRenderer(cbit.vcell.microscopy.gui.NumericTableCellRenderer) AdvancedTablePanel(org.vcell.util.gui.AdvancedTablePanel) StyleTable(org.vcell.util.gui.StyleTable) TableColumn(javax.swing.table.TableColumn)

Example 4 with StyleTable

use of org.vcell.util.gui.StyleTable in project vcell by virtualcell.

the class BatchRunResultsParamTablePanel method setupTable_param.

private void setupTable_param() {
    paramTablePanel = new AdvancedTablePanel();
    TableSorter sorter = new TableSorter(resultsTableModel);
    table_param = new StyleTable(sorter);
    table_param.setCellSelectionEnabled(true);
    sorter.setTableHeader(table_param.getTableHeader());
    // apply table renderer for name column
    TableColumn nameCol = table_param.getColumnModel().getColumn(BatchRunResultsParamTableModel.COLUMN_FILE_NAME);
    ResultsParamTableRenderer resultsParamTableRenderer = new ResultsParamTableRenderer();
    nameCol.setCellRenderer(resultsParamTableRenderer);
    nameCol.setPreferredWidth(75);
    // apply table renderer and table editor for details column
    TableColumn detailsCol = table_param.getColumnModel().getColumn(BatchRunResultsParamTableModel.COLUMN_DETAILS);
    detailsCol.setCellRenderer(resultsParamTableRenderer);
    detailsCol.setPreferredWidth(35);
    // apply table renderer to the rest numeric columns
    // double precision 6 digits
    TableCellRenderer resultsRanderer = new NumericTableCellRenderer();
    table_param.setDefaultRenderer(Double.class, resultsRanderer);
    for (int i = 1; i < table_param.getColumnCount() - 1; i++) {
        TableColumn col = table_param.getColumnModel().getColumn(i);
        col.setPreferredWidth(0);
    }
    ResultsParamTableEditor tableEditor = new ResultsParamTableEditor(table_param);
    tableEditor.addPropertyChangeListener(this);
    detailsCol.setCellEditor(tableEditor);
    // add table to panel.By default, if you don't place a table in a scroll pane, the table  header  is not  shown. You need to explicitly display it.
    paramTablePanel.setTable(table_param);
    paramTablePanel.setLayout(new GridBagLayout());
    GridBagConstraints gc = new GridBagConstraints();
    gc.gridy = 0;
    gc.gridx = 0;
    gc.weightx = 1;
    gc.fill = GridBagConstraints.HORIZONTAL;
    paramTablePanel.add(table_param.getTableHeader(), gc);
    gc.gridy = 1;
    gc.gridx = 0;
    gc.weightx = 1;
    gc.fill = GridBagConstraints.HORIZONTAL;
    paramTablePanel.add(table_param, gc);
}
Also used : NumericTableCellRenderer(cbit.vcell.microscopy.gui.NumericTableCellRenderer) TableCellRenderer(javax.swing.table.TableCellRenderer) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) NumericTableCellRenderer(cbit.vcell.microscopy.gui.NumericTableCellRenderer) AdvancedTablePanel(org.vcell.util.gui.AdvancedTablePanel) StyleTable(org.vcell.util.gui.StyleTable) TableColumn(javax.swing.table.TableColumn)

Example 5 with StyleTable

use of org.vcell.util.gui.StyleTable in project vcell by virtualcell.

the class MSETablePanel method setupTable.

private void setupTable() {
    table = new StyleTable();
    table.setCellSelectionEnabled(true);
    table.setAutoCreateColumnsFromModel(false);
    table.setModel(mseTableModel);
    // double precision 6 digits
    TableCellRenderer mseRenderer = new NumericTableCellRenderer(6);
    TableColumn[] columns = new TableColumn[MSETableModel.NUM_COLUMNS];
    for (int i = 0; i < mseTableModel.getColumnCount(); i++) {
        columns[i] = new TableColumn(i, 0, mseRenderer, null);
        table.addColumn(columns[i]);
    }
    table.addMouseListener(evtHandler);
    scrTable = new JScrollPane(table);
    scrTable.setAutoscrolls(true);
}
Also used : JScrollPane(javax.swing.JScrollPane) NumericTableCellRenderer(cbit.vcell.microscopy.gui.NumericTableCellRenderer) TableCellRenderer(javax.swing.table.TableCellRenderer) NumericTableCellRenderer(cbit.vcell.microscopy.gui.NumericTableCellRenderer) StyleTable(org.vcell.util.gui.StyleTable) TableColumn(javax.swing.table.TableColumn)

Aggregations

StyleTable (org.vcell.util.gui.StyleTable)6 TableColumn (javax.swing.table.TableColumn)5 NumericTableCellRenderer (cbit.vcell.microscopy.gui.NumericTableCellRenderer)4 TableCellRenderer (javax.swing.table.TableCellRenderer)4 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 JScrollPane (javax.swing.JScrollPane)2 AdvancedTablePanel (org.vcell.util.gui.AdvancedTablePanel)2 ColumnGroup (cbit.vcell.microscopy.gui.groupableTableHeader.ColumnGroup)1 GroupableTableColumnModel (cbit.vcell.microscopy.gui.groupableTableHeader.GroupableTableColumnModel)1 GroupableTableHeader (cbit.vcell.microscopy.gui.groupableTableHeader.GroupableTableHeader)1