Search in sources :

Example 6 with NetworkAddedEvent

use of org.cytoscape.model.events.NetworkAddedEvent in project cytoscape-impl by cytoscape.

the class CySubNetworkTest method testAddNewEdgeEventAfterNetworkAdd.

@Test
public void testAddNewEdgeEventAfterNetworkAdd() {
    CySubNetwork sub = root.addSubNetwork();
    CyNode nx1 = sub.addNode();
    CyNode nx2 = sub.addNode();
    ((CySubNetworkImpl) sub).handleEvent(new NetworkAddedEvent(mock(CyNetworkManager.class), sub));
    CyEdge ex1 = sub.addEdge(nx1, nx2, false);
    Object payload = deh.getLastPayload();
    assertNotNull(payload);
}
Also used : NetworkAddedEvent(org.cytoscape.model.events.NetworkAddedEvent) CySubNetworkImpl(org.cytoscape.model.internal.CySubNetworkImpl) CyNode(org.cytoscape.model.CyNode) CyEdge(org.cytoscape.model.CyEdge) Test(org.junit.Test)

Example 7 with NetworkAddedEvent

use of org.cytoscape.model.events.NetworkAddedEvent in project cytoscape-impl by cytoscape.

the class CySubNetworkTest method testAddNewNodeEventAfterNetworkAdd.

@Test
public void testAddNewNodeEventAfterNetworkAdd() {
    CySubNetwork sub = root.addSubNetwork();
    ((CySubNetworkImpl) sub).handleEvent(new NetworkAddedEvent(mock(CyNetworkManager.class), sub));
    sub.addNode();
    Object payload = deh.getLastPayload();
    assertNotNull(payload);
}
Also used : NetworkAddedEvent(org.cytoscape.model.events.NetworkAddedEvent) CySubNetworkImpl(org.cytoscape.model.internal.CySubNetworkImpl) Test(org.junit.Test)

Aggregations

NetworkAddedEvent (org.cytoscape.model.events.NetworkAddedEvent)7 CySubNetworkImpl (org.cytoscape.model.internal.CySubNetworkImpl)6 Test (org.junit.Test)6 CyNode (org.cytoscape.model.CyNode)5 CyApplicationManager (org.cytoscape.application.CyApplicationManager)3 CyRow (org.cytoscape.model.CyRow)3 CyNetworkNaming (org.cytoscape.session.CyNetworkNaming)3 ArrayList (java.util.ArrayList)2 CyEdge (org.cytoscape.model.CyEdge)2 CyNetwork (org.cytoscape.model.CyNetwork)2 CyTableImpl (org.cytoscape.model.internal.CyTableImpl)2 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)2 NewNetworkSelectedNodesOnlyTask (org.cytoscape.task.internal.network.NewNetworkSelectedNodesOnlyTask)2 CyNetworkViewManager (org.cytoscape.view.model.CyNetworkViewManager)2 VisualMappingManager (org.cytoscape.view.vizmap.VisualMappingManager)2 TaskIterator (org.cytoscape.work.TaskIterator)2 TaskMonitor (org.cytoscape.work.TaskMonitor)2 UndoSupport (org.cytoscape.work.undo.UndoSupport)2 CyEventHelper (org.cytoscape.event.CyEventHelper)1