Search in sources :

Example 1 with DVisualLexicon

use of org.cytoscape.ding.DVisualLexicon in project cytoscape-impl by cytoscape.

the class DGraphViewApplyTest method setUp.

@Before
public void setUp() throws Exception {
    // Build real DGraphView object.
    MockitoAnnotations.initMocks(this);
    testSupport.getNetworkTableManager();
    network = buildNetworkModel();
    rootNetworkManager = new CyRootNetworkManagerImpl();
    spacialFactory = new RTreeFactory();
    dingLexicon = new DVisualLexicon(cgManager);
    handleFactory = new HandleFactoryImpl();
    when(serviceRegistrar.getService(CyRootNetworkManager.class)).thenReturn(rootNetworkManager);
    when(serviceRegistrar.getService(UndoSupport.class)).thenReturn(undoSupport);
    when(serviceRegistrar.getService(SpacialIndex2DFactory.class)).thenReturn(spacialFactory);
    when(serviceRegistrar.getService(DialogTaskManager.class)).thenReturn(dialogTaskManager);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(IconManager.class)).thenReturn(iconManager);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(visualMappingManager);
    when(serviceRegistrar.getService(CyNetworkViewManager.class)).thenReturn(networkViewManager);
    dgv = new DGraphView(network, dingLexicon, vtfListener, annotationFactoryManager, dingGraphLOD, handleFactory, serviceRegistrar);
    assertNotNull(dgv);
    assertEquals(3, dgv.getModel().getNodeCount());
    assertEquals(3, dgv.getModel().getEdgeCount());
    nodeView1 = dgv.getDNodeView(node1);
    nodeView2 = dgv.getDNodeView(node2);
    nodeView3 = dgv.getDNodeView(node3);
    ev1 = dgv.getDEdgeView(edge12);
    ev2 = dgv.getDEdgeView(edge13);
    ev3 = dgv.getDEdgeView(edge23);
}
Also used : CyRootNetworkManagerImpl(org.cytoscape.model.internal.CyRootNetworkManagerImpl) DVisualLexicon(org.cytoscape.ding.DVisualLexicon) RTreeFactory(org.cytoscape.spacial.internal.rtree.RTreeFactory) Before(org.junit.Before)

Example 2 with DVisualLexicon

use of org.cytoscape.ding.DVisualLexicon in project cytoscape-impl by cytoscape.

the class DNodeViewTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    rootNetworkManager = netSupport.getRootNetworkFactory();
    spacialFactory = new RTreeFactory();
    when(serviceRegistrar.getService(CyRootNetworkManager.class)).thenReturn(rootNetworkManager);
    when(serviceRegistrar.getService(UndoSupport.class)).thenReturn(undoSupport);
    when(serviceRegistrar.getService(SpacialIndex2DFactory.class)).thenReturn(spacialFactory);
    when(serviceRegistrar.getService(DialogTaskManager.class)).thenReturn(dialogTaskManager);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(IconManager.class)).thenReturn(iconManager);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(visualMappingManager);
    when(serviceRegistrar.getService(CyNetworkViewManager.class)).thenReturn(networkViewManager);
    when(serviceRegistrar.getService(CyApplicationConfiguration.class)).thenReturn(applicationConfiguration);
    dingLexicon = new DVisualLexicon(mock(CustomGraphicsManager.class));
    buildNetwork();
    networkView = new DGraphView(network, dingLexicon, vtfListener, annotationFactoryManager, dingGraphLOD, handleFactory, serviceRegistrar);
    dnv1 = (DNodeView) networkView.getDNodeView(node1);
    dnv2 = (DNodeView) networkView.getDNodeView(node2);
}
Also used : DVisualLexicon(org.cytoscape.ding.DVisualLexicon) RTreeFactory(org.cytoscape.spacial.internal.rtree.RTreeFactory) Before(org.junit.Before)

Example 3 with DVisualLexicon

use of org.cytoscape.ding.DVisualLexicon in project cytoscape-impl by cytoscape.

the class DVisualLexiconTest method setUp.

@Before
public void setUp() throws Exception {
    final CustomGraphicsManager manager = mock(CustomGraphicsManager.class);
    dLexicon = new DVisualLexicon(manager);
}
Also used : DVisualLexicon(org.cytoscape.ding.DVisualLexicon) CustomGraphicsManager(org.cytoscape.ding.customgraphics.CustomGraphicsManager) Before(org.junit.Before)

Aggregations

DVisualLexicon (org.cytoscape.ding.DVisualLexicon)3 Before (org.junit.Before)3 RTreeFactory (org.cytoscape.spacial.internal.rtree.RTreeFactory)2 CustomGraphicsManager (org.cytoscape.ding.customgraphics.CustomGraphicsManager)1 CyRootNetworkManagerImpl (org.cytoscape.model.internal.CyRootNetworkManagerImpl)1