public void run() { CyLayoutAlgorithm layoutAlgorithm = CyLayouts.getLayout("force-directed"); networkView.applyLayout(layoutAlgorithm); Cytoscape.getCurrentNetworkView().fitContent(); } });
public void actionPerformed(ActionEvent e) { if (this.nodeView.getNode().getNestedNetwork() == null) { return; } CyNetwork nestedNetwork = (CyNetwork) this.nodeView.getNode().getNestedNetwork(); CyNetworkView theView = Cytoscape.getNetworkView(nestedNetwork.getIdentifier()); if (theView == null || theView.getIdentifier() == null) { theView = Cytoscape.createNetworkView(nestedNetwork); CyLayoutAlgorithm alg = cytoscape.layout.CyLayouts.getLayout("force-directed"); theView.applyLayout(alg); } Cytoscape.getDesktop().setFocus(nestedNetwork.getIdentifier()); } }
view.applyLayout(layout); view.fitContent();