Search in sources :

Example 1 with CyGroupFactoryImpl

use of org.cytoscape.group.internal.CyGroupFactoryImpl in project cytoscape-impl by cytoscape.

the class AbstractGroupTaskTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    support = new NetworkTestSupport();
    network = support.getNetwork();
    CyRootNetworkManager rootNetworkManager = new CyRootNetworkManagerImpl();
    rootNetwork = rootNetworkManager.getRootNetwork(network);
    when(registrar.getService(VisualMappingManager.class)).thenReturn(vmMgr);
    when(registrar.getService(CyNetworkViewManager.class)).thenReturn(netViewMgr);
    when(registrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    final LockedVisualPropertiesManager lvpCache = new LockedVisualPropertiesManager(registrar);
    groupManager = new CyGroupManagerImpl(registrar);
    groupFactory = new CyGroupFactoryImpl(groupManager, lvpCache);
    group1 = groupFactory.createGroup(network, true);
    rootNetwork.getRow(group1.getGroupNode(), CyRootNetwork.SHARED_ATTRS).set(CyRootNetwork.SHARED_NAME, "group1");
    group2 = groupFactory.createGroup(network, true);
    rootNetwork.getRow(group2.getGroupNode(), CyRootNetwork.SHARED_ATTRS).set(CyRootNetwork.SHARED_NAME, "group2");
    task = new AbstractGroupTask() {

        @Override
        public void run(TaskMonitor taskMonitor) throws Exception {
        }
    };
    task.net = network;
    task.groupMgr = groupManager;
}
Also used : CyRootNetworkManager(org.cytoscape.model.subnetwork.CyRootNetworkManager) CyGroupManagerImpl(org.cytoscape.group.internal.CyGroupManagerImpl) TaskMonitor(org.cytoscape.work.TaskMonitor) CyRootNetworkManagerImpl(org.cytoscape.model.internal.CyRootNetworkManagerImpl) NetworkTestSupport(org.cytoscape.model.NetworkTestSupport) LockedVisualPropertiesManager(org.cytoscape.group.internal.LockedVisualPropertiesManager) CyGroupFactoryImpl(org.cytoscape.group.internal.CyGroupFactoryImpl) Before(org.junit.Before)

Example 2 with CyGroupFactoryImpl

use of org.cytoscape.group.internal.CyGroupFactoryImpl in project cytoscape-impl by cytoscape.

the class TestCyGroupFactory method getFactory.

public static CyGroupFactory getFactory() {
    final DummyCyEventHelper eventHelper = new DummyCyEventHelper();
    final VisualMappingManager vmMgr = mock(VisualMappingManager.class);
    final CyNetworkViewManager netViewMgr = mock(CyNetworkViewManager.class);
    final CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(vmMgr);
    when(serviceRegistrar.getService(CyNetworkViewManager.class)).thenReturn(netViewMgr);
    final CyGroupManagerImpl mgr = new CyGroupManagerImpl(serviceRegistrar);
    final LockedVisualPropertiesManager lvpMgr = new LockedVisualPropertiesManager(serviceRegistrar);
    final CyGroupFactoryImpl groupFactory = new CyGroupFactoryImpl(mgr, lvpMgr);
    return groupFactory;
}
Also used : CyNetworkViewManager(org.cytoscape.view.model.CyNetworkViewManager) CyGroupManagerImpl(org.cytoscape.group.internal.CyGroupManagerImpl) LockedVisualPropertiesManager(org.cytoscape.group.internal.LockedVisualPropertiesManager) DummyCyEventHelper(org.cytoscape.event.DummyCyEventHelper) VisualMappingManager(org.cytoscape.view.vizmap.VisualMappingManager) CyGroupFactoryImpl(org.cytoscape.group.internal.CyGroupFactoryImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Aggregations

CyGroupFactoryImpl (org.cytoscape.group.internal.CyGroupFactoryImpl)2 CyGroupManagerImpl (org.cytoscape.group.internal.CyGroupManagerImpl)2 LockedVisualPropertiesManager (org.cytoscape.group.internal.LockedVisualPropertiesManager)2 DummyCyEventHelper (org.cytoscape.event.DummyCyEventHelper)1 NetworkTestSupport (org.cytoscape.model.NetworkTestSupport)1 CyRootNetworkManagerImpl (org.cytoscape.model.internal.CyRootNetworkManagerImpl)1 CyRootNetworkManager (org.cytoscape.model.subnetwork.CyRootNetworkManager)1 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)1 CyNetworkViewManager (org.cytoscape.view.model.CyNetworkViewManager)1 VisualMappingManager (org.cytoscape.view.vizmap.VisualMappingManager)1 TaskMonitor (org.cytoscape.work.TaskMonitor)1 Before (org.junit.Before)1