use of cbit.vcell.microscopy.gui.NumericTableCellRenderer 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);
}
use of cbit.vcell.microscopy.gui.NumericTableCellRenderer 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);
}
use of cbit.vcell.microscopy.gui.NumericTableCellRenderer 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);
}
use of cbit.vcell.microscopy.gui.NumericTableCellRenderer 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);
}
Aggregations