use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.
the class VisualMappingManagerTest method setUp.
@Before
public void setUp() throws Exception {
final VisualStyleFactory factory = mock(VisualStyleFactory.class);
final VisualStyle dummyDefaultStyle = mock(VisualStyle.class);
when(factory.createVisualStyle(VisualMappingManagerImpl.DEFAULT_STYLE_NAME)).thenReturn(dummyDefaultStyle);
final CyEventHelper eventHelper = mock(CyEventHelper.class);
final CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
vmm = new VisualMappingManagerImpl(factory, serviceRegistrar);
}
use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
final CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
TableEventHelperFacade tableEventHelper = new TableEventHelperFacade(serviceRegistrar);
CyNetworkManagerImpl networkManager = new CyNetworkManagerImpl(serviceRegistrar);
CyNetworkTableManagerImpl networkTableManager = new CyNetworkTableManagerImpl();
CyTableManagerImpl tableManager = new CyTableManagerImpl(networkTableManager, networkManager, serviceRegistrar);
CyTableFactoryImpl tableFactory = new CyTableFactoryImpl(tableEventHelper, serviceRegistrar);
CyNetworkFactoryImpl networkFactory = new CyNetworkFactoryImpl(tableEventHelper, tableManager, networkTableManager, tableFactory, serviceRegistrar);
CyRootNetworkManagerImpl rootNetworkFactory = new CyRootNetworkManagerImpl();
registerService(bc, networkFactory, CyNetworkFactory.class);
registerService(bc, tableFactory, CyTableFactory.class);
registerService(bc, tableFactory, SessionLoadedListener.class);
registerService(bc, rootNetworkFactory, CyRootNetworkManager.class);
registerService(bc, tableManager, CyTableManager.class);
registerAllServices(bc, networkTableManager);
registerService(bc, tableManager, NetworkAboutToBeDestroyedListener.class);
registerService(bc, tableManager, EquationFunctionAddedListener.class);
registerService(bc, networkManager, CyNetworkManager.class);
}
use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
EnhancedSearchPlugin enhancedSearchPlugin = new EnhancedSearchPlugin(serviceRegistrar);
final Properties searchPluginProps = new Properties();
registerAllServices(bc, enhancedSearchPlugin, searchPluginProps);
}
use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.
the class TestCyNetworkFactory method mockCyServiceRegistrar.
private static CyServiceRegistrar mockCyServiceRegistrar(CyEventHelper deh) {
CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
CyNetworkNaming namingUtil = mock(CyNetworkNaming.class);
EquationCompiler compiler = new EquationCompilerImpl(new EquationParserImpl(serviceRegistrar));
final Interpreter interpreter = new InterpreterImpl();
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(deh);
when(serviceRegistrar.getService(CyNetworkNaming.class)).thenReturn(namingUtil);
when(serviceRegistrar.getService(EquationCompiler.class)).thenReturn(compiler);
when(serviceRegistrar.getService(Interpreter.class)).thenReturn(interpreter);
return serviceRegistrar;
}
use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.
the class TestCyNetworkFactory method getPrivateRootInstance.
public static CyRootNetwork getPrivateRootInstance(SavePolicy policy) {
DummyCyEventHelper deh = new DummyCyEventHelper();
CyServiceRegistrar serviceRegistrar = mockCyServiceRegistrar(deh);
CyNetworkTableManagerImpl ntm = new CyNetworkTableManagerImpl();
CyTableManagerImpl tm = new CyTableManagerImpl(ntm, new CyNetworkManagerImpl(serviceRegistrar), serviceRegistrar);
CyRootNetworkImpl ar = new CyRootNetworkImpl(deh, tm, ntm, new CyTableFactoryImpl(deh, serviceRegistrar), serviceRegistrar, false, policy);
return ar;
}
Aggregations