use of org.cytoscape.model.CyNetworkManager in project clusterMaker2 by RBVI.
the class ModelUtils method createChildNetwork.
public static CyNetwork createChildNetwork(ClusterManager manager, CyNetwork network, List<CyNode> nodeList, List<CyEdge> edgeList, String title) {
String name = network.getRow(network).get(CyNetwork.NAME, String.class);
// Create the network;
CyNetwork newNetwork = ((CySubNetwork) network).getRootNetwork().addSubNetwork(nodeList, edgeList);
// Register the network
CyNetworkManager netManager = manager.getService(CyNetworkManager.class);
netManager.addNetwork(newNetwork);
// Set the title
newNetwork.getRow(newNetwork).set(CyNetwork.NAME, name + title);
return newNetwork;
}
use of org.cytoscape.model.CyNetworkManager in project cytoscape-api by cytoscape.
the class AbstractNetworkEventTest method testGetNetwork.
@Test
public final void testGetNetwork() {
final CyNetworkManager networkManager = mock(CyNetworkManager.class);
final CyNetwork network = mock(CyNetwork.class);
final AbstractNetworkEvent event = new AbstractNetworkEvent(networkManager, Object.class, network);
assertEquals("Network returned by getNetwork() is *not* the one passed into the constructor!", network, event.getNetwork());
}
use of org.cytoscape.model.CyNetworkManager in project cytoscape-api by cytoscape.
the class NetworkAddedEventTest method testGetNetwork.
@Test
public final void testGetNetwork() {
final CyNetworkManager networkManager = mock(CyNetworkManager.class);
final CyNetwork network = mock(CyNetwork.class);
final NetworkAddedEvent event = new NetworkAddedEvent(networkManager, network);
assertEquals("Network returned by getNetwork() is *not* the one passed into the constructor!", network, event.getNetwork());
}
use of org.cytoscape.model.CyNetworkManager in project cytoscape-api by cytoscape.
the class NetworkAddedEventTest method testNullNetworkConstructorFailure.
@Test
public final void testNullNetworkConstructorFailure() {
final CyNetworkManager networkManager = mock(CyNetworkManager.class);
try {
final NetworkAddedEvent event = new NetworkAddedEvent(networkManager, null);
} catch (final NullPointerException e) {
return;
}
fail("The expected NullPointerException was *not* triggered!");
}
use of org.cytoscape.model.CyNetworkManager in project EnrichmentMapApp by BaderLab.
the class EnrichmentMap method getName.
public String getName() {
final String undefined = "-- UNDEFINED --";
if (serviceRegistrar == null)
return undefined;
CyNetworkManager networkManager = serviceRegistrar.getService(CyNetworkManager.class);
if (networkManager == null)
return undefined;
CyNetwork net = networkManager.getNetwork(networkID);
if (net == null)
return undefined;
return NetworkUtil.getName(net);
}
Aggregations