本文整理汇总了Java中org.cytoscape.model.events.RowsSetEvent.containsColumn方法的典型用法代码示例。如果您正苦于以下问题:Java RowsSetEvent.containsColumn方法的具体用法?Java RowsSetEvent.containsColumn怎么用?Java RowsSetEvent.containsColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cytoscape.model.events.RowsSetEvent
的用法示例。
在下文中一共展示了RowsSetEvent.containsColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleEvent
import org.cytoscape.model.events.RowsSetEvent; //导入方法依赖的package包/类
@Override
public void handleEvent(RowsSetEvent e) {
if (!e.containsColumn(CyNetwork.SELECTED) || ignoreSelection)
{
return;
}
CyNetwork currentNetwork = cyApplicationManager.getCurrentNetwork();
if(currentNetwork == null
|| e.getSource().equals(currentNetwork.getTable(CyNode.class, CyNetwork.LOCAL_ATTRS))
|| e.getSource().equals(currentNetwork.getTable(CyEdge.class, CyNetwork.LOCAL_ATTRS)))
{
updateVisual();
//TODO the above is very inefficient, replace with maintaining the list of selected nodes with
// for (RowSetRecord record: e.getColumnRecords(CyNetwork.SELECTED)) {
// Long suid = record.getRow().get(CyIdentifiable.SUID, Long.class);
// Boolean value = (Boolean)record.getValue();
}
}
示例2: handleEvent
import org.cytoscape.model.events.RowsSetEvent; //导入方法依赖的package包/类
@Override
public void handleEvent(RowsSetEvent e) {
if(safeRunner.shouldIgnore(EventType.SELECTION)) {
return;
}
if(!e.containsColumn(CyNetwork.SELECTED))
return;
Optional<AnnotationSet> active = getActiveNetworkViewSet().flatMap(NetworkViewSet::getActiveAnnotationSet);
if(active.isPresent()) {
AnnotationSet annotationSet = active.get();
CyNetwork network = annotationSet.getParent().getNetwork();
if(network.getDefaultNodeTable().equals(e.getSource())) {
List<Cluster> selectedClusters = new ArrayList<>();
List<CyNode> selectedNodes = CyTableUtil.getNodesInState(network, CyNetwork.SELECTED, true);
for(Cluster cluster : annotationSet.getClusters()) {
if(selectedNodes.containsAll(cluster.getNodes())) {
selectedClusters.add(cluster);
}
}
// Fire event even when selectedClusters is empty
postEventOffEDT(new ModelEvents.ClustersSelected(annotationSet, selectedClusters));
}
}
}