本文整理汇总了Java中org.cytoscape.application.CyApplicationManager.getCurrentNetwork方法的典型用法代码示例。如果您正苦于以下问题:Java CyApplicationManager.getCurrentNetwork方法的具体用法?Java CyApplicationManager.getCurrentNetwork怎么用?Java CyApplicationManager.getCurrentNetwork使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cytoscape.application.CyApplicationManager
的用法示例。
在下文中一共展示了CyApplicationManager.getCurrentNetwork方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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;
}
示例3: ControlPanel
import org.cytoscape.application.CyApplicationManager; //导入方法依赖的package包/类
public ControlPanel(CyNetworkManager networkManager,
CyRootNetworkManager rootNetworkManager,
CyApplicationManager applicationManager,
CyGroupManager groupManager,
CyGroupFactory groupFactory,
TaskManager taskManager) {
this.networkManager = networkManager;
this.rootNetworkManager = rootNetworkManager;
this.applicationManager = applicationManager;
this.groupManager = groupManager;
this.groupFactory = groupFactory;
this.taskManager = taskManager;
this.networkSettings = new HashMap<Long, NetworkSettings>();
this.itemChangeListener = new ItemChangeListener();
this.nSelectedNodes = 0;
this.currentNetworkSUID = null;
initUserInterface();
CyNetwork network = applicationManager.getCurrentNetwork();
if (network != null) {
this.currentNetworkSUID = network.getSUID();
this.networkSettings.put(currentNetworkSUID, new NetworkSettings(network));
updateUserInterface();
updateFeedbackTableModel();
updateButtons();
} else {
disableUserInterface();
}
this.setVisible(true);
}
示例4: 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);
}