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


Java RowsSetEvent类代码示例

本文整理汇总了Java中org.cytoscape.model.events.RowsSetEvent的典型用法代码示例。如果您正苦于以下问题:Java RowsSetEvent类的具体用法?Java RowsSetEvent怎么用?Java RowsSetEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RowsSetEvent类属于org.cytoscape.model.events包,在下文中一共展示了RowsSetEvent类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
			
		}
	}
 
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:23,代码来源:DataSeriesVisualPanel.java

示例2: handleEvent

import org.cytoscape.model.events.RowsSetEvent; //导入依赖的package包/类
/**
 * Update UI to match change in node selection.
 */
@Override
public void handleEvent(final RowsSetEvent e) {
	if (listenersEnabled.get()) {	
		if (applicationManager.getCurrentNetwork() == null) return;
		
		boolean isSelection = true;
		for (RowSetRecord change : e.getPayloadCollection()) {
			if (!change.getColumn().equals(CyNetwork.SELECTED)) {
				isSelection = false;
				break;
			}
		}
		
		if (isSelection) {
			System.out.println("Real: Row selection changed event" + ", source: " + e.getSource());
			SwingUtilities.invokeLater(new Runnable() {
				@Override
				public void run() {
					updateFeedbackTableModel();
					updateButtons();
				}
			});
		}
	}
}
 
开发者ID:ls-cwi,项目名称:eXamine,代码行数:29,代码来源:ControlPanel.java

示例3: handleEvent

import org.cytoscape.model.events.RowsSetEvent; //导入依赖的package包/类
@Override
public void handleEvent(RowsSetEvent event) {
    if (nodeTableId == null || !isEnabled) {
        return;
    }

    if (event.getSource()
             .getSUID() != nodeTableId) {
        return;
    }

    int initialSize = nodeSuids.size();
    Collection<RowSetRecord> records = event.getColumnRecords(CyNetwork.SELECTED);
    records.stream()
           .forEach(record -> {
               CyRow row = record.getRow();
               Long suid = row.get(CyNetwork.SUID, Long.class);
               if (Boolean.TRUE.equals(record.getValue())) {
                   nodeSuids.add(suid);
               } else {
                   nodeSuids.removeAll(suid);
               }
           });

    if (nodeSuids.size() != initialSize) {
        notifyListeners();
    }
}
 
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:29,代码来源:SelectionTracker.java

示例4: 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));
		}
	}
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:29,代码来源:ModelManager.java

示例5: handleEvent

import org.cytoscape.model.events.RowsSetEvent; //导入依赖的package包/类
@Override
public void handleEvent(RowsSetEvent rse) {
    if(enable) {
        CyTable table = rse.getSource();
        for (Entry<CyNetwork, ResultPanelController> result : ResultPanelController.panels.entrySet()) {
            CyNetwork network = result.getKey();
            if (table.equals(network.getDefaultNodeTable()) || table.equals(network.getDefaultEdgeTable())) {
                result.getValue().showSelectedElementInfo();
                return;
            }
        }
    }
}
 
开发者ID:juanjoDiaz,项目名称:gfdnet,代码行数:14,代码来源:ClickOnViewListener.java

示例6: handleEvent

import org.cytoscape.model.events.RowsSetEvent; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void handleEvent(RowsSetEvent event) {
    Collection<RowSetRecord> selectedRecords = event.getColumnRecords(CyNetwork.SELECTED);
    if (selectedRecords.isEmpty()) return;

    RowSetRecord value = null;
    for (RowSetRecord record : selectedRecords) {
        if (record.getValue() == Boolean.TRUE)
            value = record;
    }
    if (value == null) return;

    Long suid = value.getRow().get(CyNetwork.SUID, Long.class);
    if (suid == null) return;

    CyTable evTable = getTable("BEL.Evidence", tableManager);
    if (evTable == null) return;

    Collection<CyRow> evidenceRows = evTable.getMatchingRows(EDGE_SUID, suid);
    if (!evidenceRows.isEmpty()) {
        CyRow row = evidenceRows.iterator().next();
        Long networkSUID = row.get(NETWORK_SUID, Long.class);
        CyNetwork cyN = networkManager.getNetwork(networkSUID);
        if (cyN == null) return;
        CyEdge edge = cyN.getEdge(row.get(EDGE_SUID, Long.class));
        if (edge == null) return;

        Evidence[] evidences = belEvidenceMapper.mapFromTable(edge, evTable);
        evidencePanel.update(asList(evidences));
    } else {
        evidencePanel.update(new ArrayList<Evidence>());
    }
}
 
开发者ID:jsongraph,项目名称:jgf-app,代码行数:37,代码来源:EvidencePanelComponent.java

示例7: handleEvent

import org.cytoscape.model.events.RowsSetEvent; //导入依赖的package包/类
@Override
public void handleEvent(RowsSetEvent e) {
	CyNetworkView view = App.cyServices.applicationManager.getCurrentNetworkView();
	if(view == null) return;

	final CyNetwork network = view.getModel();
	if (BioPaxUtil.isFromBiopax(network)) {

		if (!network.getDefaultNodeTable().equals(e.getSource()))
			return;

		CytoPanel eastCytoPanel = App.cyServices.cySwingApplication.getCytoPanel(CytoPanelName.EAST);
		if(eastCytoPanel.getState() != CytoPanelState.DOCK)
			App.cyServices.cySwingApplication.getCytoPanel(CytoPanelName.EAST).setState(CytoPanelState.DOCK);

		//east panel will display info about several nodes selected (not all)
		final Collection<CyNode> selected = new ArrayList<CyNode>();
		for (CyNode node : network.getNodeList()) {
			if (network.getRow(node).get(CyNetwork.SELECTED, Boolean.class)) {
				selected.add(node);
			}
		}

		if (!selected.isEmpty()) {
			// Show the details
			updateNodeDetails(network, selected);
			// If legend is showing, show details
			showDetails();
		}
	}
}
 
开发者ID:PathwayCommons,项目名称:CyPath2,代码行数:32,代码来源:EastCytoPanelComponent.java


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