本文整理汇总了Java中org.sbml.jsbml.UnitDefinition.getId方法的典型用法代码示例。如果您正苦于以下问题:Java UnitDefinition.getId方法的具体用法?Java UnitDefinition.getId怎么用?Java UnitDefinition.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sbml.jsbml.UnitDefinition
的用法示例。
在下文中一共展示了UnitDefinition.getId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTableModelWithUnitDefinitions
import org.sbml.jsbml.UnitDefinition; //导入方法依赖的package包/类
/**
* Gets the table model with unit definitions.
*
* @param loud the loud
* @return the table model with unit definitions
*/
private MyTableModel getTableModelWithUnitDefinitions(ListOf<UnitDefinition> loud){
int max = memberList.size();
Object[][] data = new Object[max][header.length];
for(int i = 0; i < max; i++){
UnitDefinition ud = (UnitDefinition) memberList.get(i);
data[i][0] = ud.getId();
data[i][1] = unitsToString(ud.getListOfUnits());
}
MyTableModel tm = new MyTableModel(data, header) {
private static final long serialVersionUID = 1L;
@Override
public Class<?> getColumnClass(int Column) {
switch (Column) {
case 0: // id
case 1: // units
return String.class;
default:
return String.class;
}
}
};
tm.setColumnIdentifiers(header);
return tm;
}
示例2: Units
import org.sbml.jsbml.UnitDefinition; //导入方法依赖的package包/类
public Units(BioModel gcm, ModelEditor modelEditor) {
super(new BorderLayout());
this.bioModel = gcm;
this.modelEditor = modelEditor;
Model model = gcm.getSBMLDocument().getModel();
addUnit = new JButton("Add Unit");
removeUnit = new JButton("Remove Unit");
editUnit = new JButton("Edit Unit");
unitDefs = new JList();
ListOf<UnitDefinition> listOfUnits = model.getListOfUnitDefinitions();
String[] units = new String[model.getUnitDefinitionCount()];
for (int i = 0; i < model.getUnitDefinitionCount(); i++) {
UnitDefinition unit = listOfUnits.get(i);
units[i] = unit.getId();
// GET OTHER THINGS
}
JPanel addRem = new JPanel();
addRem.add(addUnit);
addRem.add(removeUnit);
addRem.add(editUnit);
addUnit.addActionListener(this);
removeUnit.addActionListener(this);
editUnit.addActionListener(this);
JLabel panelLabel = new JLabel("List of Units:");
JScrollPane scroll = new JScrollPane();
scroll.setMinimumSize(new Dimension(260, 220));
scroll.setPreferredSize(new Dimension(276, 152));
scroll.setViewportView(unitDefs);
edu.utah.ece.async.ibiosim.dataModels.biomodel.util.Utility.sort(units);
unitDefs.setListData(units);
unitDefs.setSelectedIndex(0);
unitDefs.addMouseListener(this);
this.add(panelLabel, "North");
this.add(scroll, "Center");
this.add(addRem, "South");
}
示例3: refreshUnitsPanel
import org.sbml.jsbml.UnitDefinition; //导入方法依赖的package包/类
/**
* Refresh units panel
*/
public void refreshUnitsPanel() {
Model model = bioModel.getSBMLDocument().getModel();
ListOf<UnitDefinition> listOfUnits = model.getListOfUnitDefinitions();
String[] units = new String[model.getUnitDefinitionCount()];
for (int i = 0; i < model.getUnitDefinitionCount(); i++) {
UnitDefinition unit = listOfUnits.get(i);
units[i] = unit.getId();
// GET OTHER THINGS
}
edu.utah.ece.async.ibiosim.dataModels.biomodel.util.Utility.sort(units);
unitDefs.setListData(units);
unitDefs.setSelectedIndex(0);
}