Search in sources :

Example 1 with DataType

use of cbit.vcell.biomodel.meta.MiriamManager.DataType in project vcell by virtualcell.

the class MIRIAMAnnotationEditor method getJComboBoxURI.

/**
 * This method initializes jComboBoxURI
 *
 * @return javax.swing.JComboBox
 */
private JComboBox getJComboBoxURI() {
    if (jComboBoxURI == null) {
        jComboBoxURI = new JComboBox();
        DefaultComboBoxModel defaultComboBoxModel = new DefaultComboBoxModel();
        for (DataType dataType : vcMetaData.getMiriamManager().getAllDataTypes().values()) {
            defaultComboBoxModel.addElement(dataType);
        }
        jComboBoxURI.setModel(defaultComboBoxModel);
        jComboBoxURI.setRenderer(new DefaultListCellRenderer() {

            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                return super.getListCellRendererComponent(list, ((DataType) value).getDataTypeName(), index, isSelected, cellHasFocus);
            }
        });
    }
    return jComboBoxURI;
}
Also used : JComboBox(javax.swing.JComboBox) DefaultListCellRenderer(javax.swing.DefaultListCellRenderer) DataType(cbit.vcell.biomodel.meta.MiriamManager.DataType) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) Component(java.awt.Component) JList(javax.swing.JList)

Aggregations

DataType (cbit.vcell.biomodel.meta.MiriamManager.DataType)1 Component (java.awt.Component)1 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)1 DefaultListCellRenderer (javax.swing.DefaultListCellRenderer)1 JComboBox (javax.swing.JComboBox)1 JList (javax.swing.JList)1