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


Java CyApplicationManager.getCurrentNetworkView方法代码示例

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


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

示例1: makeMap

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
public void makeMap (CyApplicationManager manager){

		netMap=new HashMap<String,List<Double>>();
		networkView = manager.getCurrentNetworkView();
		network = manager.getCurrentNetwork();
		nameNetwork = network.getRow(network).get("name", String.class);
		//System.out.println("curr net 2 one" + network);
		List<CyNode> nodes = network.getNodeList();
		//networkView.setVisualProperty(BasicVisualLexicon.NETWORK_CENTER_X_LOCATION, 0.0);
		//networkView.setVisualProperty(BasicVisualLexicon.NETWORK_CENTER_Y_LOCATION, 0.0);


		for (CyNode node: nodes ){
			String name = network.getRow(node).get("name", String.class);
			nodeView= networkView.getNodeView(node) ;
			List<Double> XY = new ArrayList<Double>();
			Double xref = nodeView.getVisualProperty(BasicVisualLexicon.NODE_X_LOCATION);
			Double yref = nodeView.getVisualProperty(BasicVisualLexicon.NODE_Y_LOCATION);

			XY.add(xref);
			XY.add(yref);
			netMap.put(name, XY);
		}
	}
 
开发者ID:sysbio-curie,项目名称:DeDaL,代码行数:25,代码来源:DedalMethods.java

示例2: checkNetwork

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
public static boolean checkNetwork(CyApplicationManager applicationManager) {
    boolean result = false;
    
    CyNetworkView view = applicationManager.getCurrentNetworkView();
    CyNetwork network = applicationManager.getCurrentNetwork();
        
    // Cannot continue if either of these is null.
    if (network == null || view == null) {
        JOptionPane.showMessageDialog(
                null,
                "No network and/or view to link to.",
                "Missing network",
                JDialog.ERROR);
    } else {
        result = true;
    }
    
    return result;
}
 
开发者ID:ls-cwi,项目名称:eXamine,代码行数:20,代码来源:Util.java

示例3: CreateAnnotationSetDialog

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
@Inject
public CreateAnnotationSetDialog(JFrame jFrame, CyApplicationManager appManager) {
	super(jFrame, true);
	setTitle("AutoAnnotate: Create Annotation Set");
	this.networkView = appManager.getCurrentNetworkView();
	setMinimumSize(new Dimension(500, 400));
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:8,代码来源:CreateAnnotationSetDialog.java

示例4: addNodes

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
/**
 * @desc - Adds nodes to the protein network from the information returned by the Slim* run.
 * @param uniprotIDs - list of all Uniprot IDs input to the returned run.
 * @param nodeIds - map linking all selected Uniprot IDs to their CyNodes, for easy access to the network.
 * @param newNetwork - CyNetwork of the network being altered.
 * @param networkViewManager - NetworkViewManager for the network being altered. Initialised in CyActivator.
 * @param manager - CyApplicationManager for the network being altered. Initialised in CyActivator.
 */
public void addNodes (List<String> uniprotIDs, Map<String, CyNode> nodeIds, CyNetwork newNetwork,
                      CyNetworkViewManager networkViewManager, CyApplicationManager manager) {

    // Add network view
    final Collection<CyNetworkView> views = networkViewManager.getNetworkViews(newNetwork);
    CyNetworkView myView = null;
    if(views.size() != 0) {
        myView = views.iterator().next();
    }

    if (myView == null) {
        // create a new view for my network
        myView = networkViewFactory.createNetworkView(newNetwork);
        networkViewManager.addNetworkView(myView);
    } else {
        System.out.println("networkView already existed.");
    }

    CyNetworkView networkView =  manager.getCurrentNetworkView();
    for (Object o : nodeIds.entrySet()) {
        Map.Entry pairs = (Map.Entry) o;
        CyNode node = (CyNode) pairs.getValue();
        View<CyNode> nodeView = networkView.getNodeView(node);
        nodeView.setLockedValue(BasicVisualLexicon.NODE_SHAPE, NodeShapeVisualProperty.ELLIPSE);
        nodeView.setLockedValue(BasicVisualLexicon.NODE_BORDER_PAINT, Color.BLACK);
        nodeView.setLockedValue(BasicVisualLexicon.NODE_SIZE, 60.0);
    }
}
 
开发者ID:passeridae,项目名称:SLiMscape,代码行数:37,代码来源:AlterGraph.java

示例5: EasyModePanel

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
@Inject
public EasyModePanel(@Assisted CreateAnnotationSetDialog parent, CyApplicationManager appManager) {
	this.networkView = appManager.getCurrentNetworkView();
	this.parent = parent;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:6,代码来源:EasyModePanel.java

示例6: NormalModePanel

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
@Inject
public NormalModePanel(@Assisted CreateAnnotationSetDialog parent, CyApplicationManager appManager) {
	this.networkView = appManager.getCurrentNetworkView();
	this.parent = parent;
	
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:7,代码来源:NormalModePanel.java

示例7: testExportThenImport

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
@Test
public void testExportThenImport(CyApplicationManager appManager, ModelManager modelManager, ModelTablePersistor persistor) {
	CyNetworkView networkView = appManager.getCurrentNetworkView();
	assertEquals(1, modelManager.getNetworkViewSets().size());
	
	// We will export the model, then import it back, and the result should be the same as what we started with.
	persistor.exportModel();

	// clear the manager
	NetworkViewAboutToBeDestroyedEvent event = new NetworkViewAboutToBeDestroyedEvent(mock(CyNetworkViewManager.class), networkView);
	modelManager.handleEvent(event);
	assertEquals(0, modelManager.getNetworkViewSets().size());
	
	persistor.importModel();

	assertEquals(1, modelManager.getNetworkViewSets().size());
	
	NetworkViewSet nvs = modelManager.getNetworkViewSet(networkView);
	List<AnnotationSet> annotationSets = new ArrayList<>(nvs.getAnnotationSets());
	annotationSets.sort(Comparator.comparing(AnnotationSet::getName));
	assertEquals(2, annotationSets.size());
	
	AnnotationSet as1 = annotationSets.get(0);
	assertEquals("as1", as1.getName());
	assertEquals("lc1", as1.getLabelColumn());
	assertTrue(as1.isActive());
	
	AnnotationSet as2 = annotationSets.get(1);
	assertEquals("as2", as2.getName());
	assertEquals("lc2", as2.getLabelColumn());
	assertFalse(as2.isActive());
	
	DisplayOptions options = as2.getDisplayOptions();
	assertEquals(10, options.getBorderWidth());
	assertEquals(20, options.getFontScale());
	assertEquals(30, options.getOpacity());
	assertEquals(ShapeType.RECTANGLE, options.getShapeType());
	assertFalse(options.isShowClusters());
	assertFalse(options.isShowLabels());
	assertTrue(options.isUseConstantFontSize());
	
	List<Cluster> clusters = new ArrayList<>(as2.getClusters());
	clusters.sort(Comparator.comparing(Cluster::getLabel));
	
	assertEquals(2, clusters.size());
	
	assertEquals("cluster1", clusters.get(0).getLabel());
	assertEquals(10, clusters.get(0).getNodes().size());
	assertEquals("cluster2", clusters.get(1).getLabel());
	assertEquals(20, clusters.get(1).getNodes().size());
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:52,代码来源:TestModelPersistor.java

示例8: applyXYMap

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
public void applyXYMap(Map<String,List<Double>> xyMap, CyNetwork currNetwork, CyApplicationManager manager){

		CyNetworkView currNetworkView2 = manager.getCurrentNetworkView();

		List<CyNode> currNodes = currNetwork.getNodeList();
		for (CyNode node:currNodes){


			String nName=currNetwork.getRow(node).get("name", String.class);

			for (Map.Entry<String, List<Double>> entry : xyMap.entrySet()) {
				String key = entry.getKey();

				if (key.equals(nName)){
					List<Double> values = entry.getValue();
					View<CyNode> currNodeView=  currNetworkView2.getNodeView(node) ;

					currNodeView.setVisualProperty(BasicVisualLexicon.NODE_X_LOCATION, values.get(0));
					currNodeView.setVisualProperty(BasicVisualLexicon.NODE_Y_LOCATION, values.get(1));


				}

			}
		}
		currNetworkView2.updateView();
		currNetworkView2.fitContent();
	}
 
开发者ID:sysbio-curie,项目名称:DeDaL,代码行数:29,代码来源:DedalMethods.java

示例9: doMyLayout

import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
public void doMyLayout (double pourcentage){
undoSlider.setPourcentage(pourcentage);
	//System.out.println("LIST in do Layout " );
	//dMet.getNetworkList(adapter);
	final CyApplicationManager manager = adapter.getCyApplicationManager();

	final CyNetworkManager netmanager = adapter.getCyNetworkManager();
	
	CyNetworkView currNetworkView = manager.getCurrentNetworkView();
	//System.out.println(" do layout p " + pourcentage);

	CyNetwork currNetwork = manager.getCurrentNetwork();
	
	
	//CyTable myreftable = myrefnetwork.getDefaultNodeTable();
	List<CyNode> currNodes = currNetwork.getNodeList();

	   
			for (CyNode pcaNode:currNodes){
				
				String pcaName = currNetwork.getRow(pcaNode).get("name", String.class);
				//System.out.println("name  " + pcaName);
			for (Map.Entry<String, List<Double>> pcaEntry : netMap2.entrySet()) {
				
				String pcaKey = pcaEntry.getKey();
				
				
				// to be given by user p%
				
				for (Map.Entry<String, List<Double>> currEntry : currNetMap.entrySet()) {
					String currKey = currEntry.getKey();
					//System.out.println("pcaKey " + pcaKey);
					//System.out.println("currKey " + currKey);
					if ((pcaKey.equals(currKey)) &&  (pcaKey.equals(pcaName))) {
						//System.out.println("pcaKey " + pcaKey);
						//System.out.println("currKey " + currKey);
						List<Double> pcaValues = pcaEntry.getValue();
						Double xpca = pcaValues.get(0);
						Double ypca = pcaValues.get(1);
						List<Double> currValues = currEntry.getValue();
						Double xcurr = currValues.get(0);
						Double ycurr = currValues.get(1);
						dMet.computePoint (xpca, ypca, xcurr, ycurr, pourcentage);
						
						
						Double xNew=dMet.xNew;
						Double yNew=dMet.yNew;
					
						
						
						View<CyNode> pcaNodeView=  currNetworkView.getNodeView(pcaNode) ;	
						
						
							
							pcaNodeView.setVisualProperty(BasicVisualLexicon.NODE_X_LOCATION, xNew);
							pcaNodeView.setVisualProperty(BasicVisualLexicon.NODE_Y_LOCATION, yNew);
							
							
							
						
					}
				}
			}
			
			}
			currNetworkView.updateView();
			currNetworkView.fitContent();
			//AbstractCyEdit myCyEdit = new UndoSlider();
			
			
			//undo.postEdit(myCyEdit);
}
 
开发者ID:sysbio-curie,项目名称:DeDaL,代码行数:73,代码来源:TransitionalLayout.java


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