本文整理汇总了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);
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}