Search in sources :

Example 31 with CyServiceRegistrar

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);
}
Also used : CyEventHelper(org.cytoscape.event.CyEventHelper) VisualStyle(org.cytoscape.view.vizmap.VisualStyle) VisualMappingManagerImpl(org.cytoscape.view.vizmap.internal.VisualMappingManagerImpl) VisualStyleFactory(org.cytoscape.view.vizmap.VisualStyleFactory) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Before(org.junit.Before)

Example 32 with CyServiceRegistrar

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);
}
Also used : CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Example 33 with CyServiceRegistrar

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);
}
Also used : Properties(java.util.Properties) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Example 34 with CyServiceRegistrar

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;
}
Also used : EquationParserImpl(org.cytoscape.equations.internal.EquationParserImpl) EquationCompilerImpl(org.cytoscape.equations.internal.EquationCompilerImpl) Interpreter(org.cytoscape.equations.Interpreter) CyNetworkNaming(org.cytoscape.session.CyNetworkNaming) InterpreterImpl(org.cytoscape.equations.internal.interpreter.InterpreterImpl) EquationCompiler(org.cytoscape.equations.EquationCompiler) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Example 35 with CyServiceRegistrar

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;
}
Also used : CyTableFactoryImpl(org.cytoscape.model.internal.CyTableFactoryImpl) CyNetworkManagerImpl(org.cytoscape.model.internal.CyNetworkManagerImpl) CyNetworkTableManagerImpl(org.cytoscape.model.internal.CyNetworkTableManagerImpl) CyRootNetworkImpl(org.cytoscape.model.internal.CyRootNetworkImpl) DummyCyEventHelper(org.cytoscape.event.DummyCyEventHelper) CyTableManagerImpl(org.cytoscape.model.internal.CyTableManagerImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Aggregations

CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)62 Properties (java.util.Properties)32 CyEventHelper (org.cytoscape.event.CyEventHelper)14 VisualMappingManager (org.cytoscape.view.vizmap.VisualMappingManager)13 CyApplicationManager (org.cytoscape.application.CyApplicationManager)12 UndoSupport (org.cytoscape.work.undo.UndoSupport)12 TaskIterator (org.cytoscape.work.TaskIterator)11 CyNetwork (org.cytoscape.model.CyNetwork)10 Task (org.cytoscape.work.Task)10 Before (org.junit.Before)10 Test (org.junit.Test)10 CyNetworkManager (org.cytoscape.model.CyNetworkManager)7 CyNetworkViewManager (org.cytoscape.view.model.CyNetworkViewManager)7 TaskFactory (org.cytoscape.work.TaskFactory)7 CyGroupManager (org.cytoscape.group.CyGroupManager)6 CyNetworkFactory (org.cytoscape.model.CyNetworkFactory)6 CyRootNetworkManager (org.cytoscape.model.subnetwork.CyRootNetworkManager)6 CyNetworkNaming (org.cytoscape.session.CyNetworkNaming)6 RenderingEngineManager (org.cytoscape.view.presentation.RenderingEngineManager)6 CyNetworkView (org.cytoscape.view.model.CyNetworkView)5