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


Java CyNetwork.getRow方法代码示例

本文整理汇总了Java中org.cytoscape.model.CyNetwork.getRow方法的典型用法代码示例。如果您正苦于以下问题:Java CyNetwork.getRow方法的具体用法?Java CyNetwork.getRow怎么用?Java CyNetwork.getRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.cytoscape.model.CyNetwork的用法示例。


在下文中一共展示了CyNetwork.getRow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: set

import org.cytoscape.model.CyNetwork; //导入方法依赖的package包/类
public static void set(CyNetwork network, CyIdentifiable entry, String tableName, String name, Object value, Class<?> type) {
	CyRow row = network.getRow(entry, tableName);
	CyTable table = row.getTable();
	CyColumn column = table.getColumn(name);
	if (value != null) {
		if (column == null) {
			if (value instanceof List) {
				table.createListColumn(name, type, false);
			}
			else if (value instanceof Collection) {
				throw new IllegalArgumentException("Arrt. values collection is not a List: "
						+ value.getClass().getSimpleName());
			}
			else {
				table.createColumn(name, type, false);
			}
		}
		row.set(name, value);
	}
}
 
开发者ID:cytoscape,项目名称:biopax,代码行数:21,代码来源:AttributeUtil.java

示例2: valueChanged

import org.cytoscape.model.CyNetwork; //导入方法依赖的package包/类
@Override
public void valueChanged(ListSelectionEvent e) {
	if(e.getValueIsAdjusting())
		return;
	
	ClusterTableModel model = (ClusterTableModel)table.getModel();
	AnnotationSet annotationSet = model.getAnnotationSet();
	if(annotationSet == null)
		return;
	
	Set<CyNode> nodesToSelect = 
		Arrays.stream(table.getSelectedRows())
		.map(table::convertRowIndexToModel)
		.mapToObj(model::getCluster)
		.flatMap(c -> c.getNodes().stream())
		.collect(Collectors.toSet());
	
	CyNetwork network = annotationSet.getParent().getNetwork();
	
	for(CyNode node : network.getNodeList()) {
		CyRow row = network.getRow(node);
		
		// Test if the node is already in the correct state, don't fire unnecessary events
		boolean select = nodesToSelect.contains(node);
		if(!Boolean.valueOf(select).equals(row.get(CyNetwork.SELECTED, Boolean.class))) {
			row.set(CyNetwork.SELECTED, select);
		}
	}
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:30,代码来源:ClusterTableSelectionListener.java

示例3: makeLabel

import org.cytoscape.model.CyNetwork; //导入方法依赖的package包/类
@Override
public String makeLabel(CyNetwork network, Collection<CyNode> nodes, String labelColumn) {
	CyNode node = nodes.stream().findFirst().get();
	CyRow row = network.getRow(node);
	String label = row.get(CyNetwork.NAME, String.class);
	return label;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:8,代码来源:SimpleLabelMaker.java

示例4: createNode

import org.cytoscape.model.CyNetwork; //导入方法依赖的package包/类
public static CyNode createNode(CyNetwork network, String name, String cluster) {
	CyNode node = network.addNode();
	CyRow row = network.getRow(node);
	row.set(CyNetwork.NAME, name);
	row.set(CLUSTER_COL, cluster);
	return node;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:8,代码来源:NetworkTestUtil.java

示例5: getNodeName

import org.cytoscape.model.CyNetwork; //导入方法依赖的package包/类
public static String getNodeName(CyNode node, CyNetwork network){
	String name = "";
	CyRow row = network.getRow(node);		
	Map<String,Object> values = row.getAllValues();
	name = network.getRow(node).get("name", String.class);
	return name;
}
 
开发者ID:sysbio-curie,项目名称:DeDaL,代码行数:8,代码来源:GraphCreator.java


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