Search in sources :

Example 1 with AnalysisTaskComboBoxModel

use of org.vcell.optimization.gui.AnalysisTaskComboBoxModel in project vcell by virtualcell.

the class ParameterEstimationPanel method getAnalysisTaskComboBox.

private javax.swing.JComboBox getAnalysisTaskComboBox() {
    if (taskComboBox == null) {
        taskComboBox = new javax.swing.JComboBox();
        taskComboBox.setRenderer(new DefaultListCellRenderer() {

            public java.awt.Component getListCellRendererComponent(javax.swing.JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                if (value instanceof AnalysisTask) {
                    AnalysisTask analysisTask = (AnalysisTask) value;
                    setText(analysisTask.getName());
                } else {
                    setText((value == null) ? "" : value.toString());
                }
                return this;
            }
        });
        taskComboBox.setEnabled(false);
        analysisTaskComboBoxModel = new AnalysisTaskComboBoxModel();
        taskComboBox.setModel(analysisTaskComboBoxModel);
    }
    return taskComboBox;
}
Also used : DefaultListCellRenderer(javax.swing.DefaultListCellRenderer) AnalysisTask(cbit.vcell.modelopt.AnalysisTask) JComboBox(javax.swing.JComboBox) AnalysisTaskComboBoxModel(org.vcell.optimization.gui.AnalysisTaskComboBoxModel)

Aggregations

AnalysisTask (cbit.vcell.modelopt.AnalysisTask)1 DefaultListCellRenderer (javax.swing.DefaultListCellRenderer)1 JComboBox (javax.swing.JComboBox)1 AnalysisTaskComboBoxModel (org.vcell.optimization.gui.AnalysisTaskComboBoxModel)1