network = networkFactory.createNetwork();
network.getRow(network).set(CyNetwork.NAME, "Results");
CyNetworkView view = viewFactory.createNetworkView(network);
...
CyNode cy = network.addNode(); // Works
network.getRow(cy).set(CyNetwork.NAME, name); // Works
cynodes.put(name, cy); // Works
View<CyNode> nodeDesign = view.getNodeView(cy); // nodeDesign is null!
nodeDesign.setVisualProperty(BasicVisualLexicon.NODE_FILL_COLOR, Color.YELLOW); // null pointer exception thrown!
// Callback from CyActivatorCalculationResponseThread.run()
public void handleResults(Results results) {
// Create a result model
CyResultModel model = null; // Custom class that connects nodes to edges and modifies the visual of those nodes
if(results != null) {
CyNetworkViewFactory viewFactory = getService(bc, CyNetworkViewFactory.class);
CyNetworkViewManager viewManager = getService(bc, CyNetworkViewManager.class);
CyEventHelper helper = getService(bc, CyEventHelper.class);
helper.flushPayloadEvents(); // Adding this has blocked the thread as it never finishes
model = new CyResultModel(networkFactory, viewFactory, viewManager, results);
// add network to cytoscape
CyNetworkManager networkManager = getService(bc, CyNetworkManager.class);
// ========>> We never get here anymore!
networkManager.addNetwork(model.getNetwork());
}
// Log status
int numResults = 0;
int numEvents = 0;
if(results != null) {
numResults = results.getResultCount();
for(int i = 0; i < numResults; i++) {
numEvents += results.getResult(i).getEventCount();
}
}
this.AddLog("Returned " + numResults + " subnetworks, " + numEvents + " nodes\n");
runButtonRef.setEnabled(true);;
connectButtonRef.setEnabled(true);
runButtonRef.setText(originalRunText);
}
--
You received this message because you are subscribed to a topic in the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cytoscape-helpdesk/VYUAYcrcBzY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-helpdesk/2dbc2e02-167e-4599-89df-6e81418a7d4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.