use of org.cytoscape.group.internal.CyGroupManagerImpl 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;
}
use of org.cytoscape.group.internal.CyGroupManagerImpl 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;
}
Aggregations