当前位置: 首页>>代码示例>>Java>>正文


Java UnitDefinition.getId方法代码示例

本文整理汇总了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;
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:35,代码来源:UnitDefinitionTable.java

示例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");
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:37,代码来源:Units.java

示例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);
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:17,代码来源:Units.java


注:本文中的org.sbml.jsbml.UnitDefinition.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。