Search in sources :

Example 36 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.

the class CyTableManagerTest method setUp.

@Before
public void setUp() {
    final Interpreter interpreter = new InterpreterImpl();
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    when(serviceRegistrar.getService(CyNetworkNaming.class)).thenReturn(namingUtil);
    when(serviceRegistrar.getService(EquationCompiler.class)).thenReturn(compiler);
    when(serviceRegistrar.getService(Interpreter.class)).thenReturn(interpreter);
    networkTableMgr = new CyNetworkTableManagerImpl();
    networkManager = new CyNetworkManagerImpl(serviceRegistrar);
    mgr = new CyTableManagerImpl(networkTableMgr, networkManager, serviceRegistrar);
    assertNotNull(mgr);
    assertEquals(0, mgr.getAllTables(true).size());
    final CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    final CyTableFactoryImpl tableFactory = new CyTableFactoryImpl(eventHelper, serviceRegistrar);
    goodNetwork = new CyRootNetworkImpl(eventHelper, (CyTableManagerImpl) mgr, networkTableMgr, tableFactory, serviceRegistrar, true, SavePolicy.DO_NOT_SAVE).getBaseNetwork();
    networkManager.addNetwork(goodNetwork);
    globalTable = tableFactory.createTable("test table", CyIdentifiable.SUID, Long.class, true, true);
    assertNotNull(globalTable);
    assertNotNull(goodNetwork);
    assertEquals(1, networkManager.getNetworkSet().size());
}
Also used : CyTableFactoryImpl(org.cytoscape.model.internal.CyTableFactoryImpl) Interpreter(org.cytoscape.equations.Interpreter) CyNetworkManagerImpl(org.cytoscape.model.internal.CyNetworkManagerImpl) CyNetworkTableManagerImpl(org.cytoscape.model.internal.CyNetworkTableManagerImpl) CyRootNetworkImpl(org.cytoscape.model.internal.CyRootNetworkImpl) InterpreterImpl(org.cytoscape.equations.internal.interpreter.InterpreterImpl) CyTableManagerImpl(org.cytoscape.model.internal.CyTableManagerImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Before(org.junit.Before)

Example 37 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.

the class RenderingEngineManagerTest method setUp.

@Before
public void setUp() throws Exception {
    final CyEventHelper eventHelper = mock(CyEventHelper.class);
    final CyServiceRegistrar serviceRegistrar = mock(CyServiceRegistrar.class);
    when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
    manager = new RenderingEngineManagerImpl(serviceRegistrar);
}
Also used : CyEventHelper(org.cytoscape.event.CyEventHelper) RenderingEngineManagerImpl(org.cytoscape.view.presentation.internal.RenderingEngineManagerImpl) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) Before(org.junit.Before)

Example 38 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);
    CyNetworkViewManagerImpl cyNetworkViewManager = new CyNetworkViewManagerImpl(serviceRegistrar);
    registerAllServices(bc, cyNetworkViewManager, new Properties());
    NullCyNetworkViewFactory nullCyNetworkViewFactory = new NullCyNetworkViewFactory();
    Properties nullViewFactoryProperties = new Properties();
    nullViewFactoryProperties.put("id", "NullCyNetworkViewFactory");
    registerService(bc, nullCyNetworkViewFactory, CyNetworkViewFactory.class, nullViewFactoryProperties);
}
Also used : Properties(java.util.Properties) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Example 39 with CyServiceRegistrar

use of org.cytoscape.service.util.CyServiceRegistrar in project cytoscape-impl by cytoscape.

the class CyActivator method start.

@Override
public void start(final BundleContext bc) {
    final CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
    final ServicesUtil servicesUtil = new ServicesUtil(serviceRegistrar, ApplicationFacade.NAME);
    final AttributeSetProxy attributeSetProxy = new AttributeSetProxy(servicesUtil);
    final MappingFunctionFactoryProxy mappingFactoryProxy = new MappingFunctionFactoryProxy(servicesUtil);
    final EditorManagerImpl editorManager = new EditorManagerImpl(attributeSetProxy, mappingFactoryProxy, servicesUtil);
    // These listeners must be registered before the ValueEditors and VisualPropertyEditors:
    registerServiceListener(bc, editorManager::addValueEditor, editorManager::removeValueEditor, ValueEditor.class);
    registerServiceListener(bc, editorManager::addVisualPropertyValueEditor, editorManager::removeVisualPropertyValueEditor, VisualPropertyValueEditor.class);
    registerServiceListener(bc, editorManager::addVisualPropertyEditor, editorManager::removeVisualPropertyEditor, VisualPropertyEditor.class);
    registerServiceListener(bc, editorManager::addRenderingEngineFactory, editorManager::removeRenderingEngineFactory, RenderingEngineFactory.class);
    registerAllServices(bc, editorManager);
    final MappingFunctionFactoryManagerImpl mappingFunctionFactoryManager = new MappingFunctionFactoryManagerImpl();
    registerServiceListener(bc, mappingFunctionFactoryManager::addFactory, mappingFunctionFactoryManager::removeFactory, VisualMappingFunctionFactory.class);
    registerAllServices(bc, mappingFunctionFactoryManager);
    final NumericValueEditor<Double> doubleValueEditor = new NumericValueEditor<>(Double.class);
    final NumericValueEditor<Integer> integerValueEditor = new NumericValueEditor<>(Integer.class);
    final NumericValueEditor<Float> floatValueEditor = new NumericValueEditor<>(Float.class);
    final StringValueEditor stringValueEditor = new StringValueEditor();
    final BooleanValueEditor booleanValueEditor = new BooleanValueEditor();
    final FontValueEditor fontValueEditor = new FontValueEditor(servicesUtil);
    final CyColorChooser colorChooser = new CyColorChooser();
    final CyColorPropertyEditor cyColorPropertyEditor = new CyColorPropertyEditor(colorChooser, servicesUtil);
    final CyFontPropertyEditor cyFontPropertyEditor = new CyFontPropertyEditor();
    final ContinuousMappingCellRendererFactory cmCellRendererFactory = getService(bc, ContinuousMappingCellRendererFactory.class);
    final ColorVisualPropertyEditor colorPropertyEditor = new ColorVisualPropertyEditor(Paint.class, editorManager, cyColorPropertyEditor, cmCellRendererFactory);
    final NumberVisualPropertyEditor<Double> doublePropertyEditor = new NumberVisualPropertyEditor<>(Double.class, cmCellRendererFactory);
    final NumberVisualPropertyEditor<Integer> integerPropertyEditor = new NumberVisualPropertyEditor<>(Integer.class, cmCellRendererFactory);
    final NumberVisualPropertyEditor<Float> floatPropertyEditor = new NumberVisualPropertyEditor<>(Float.class, cmCellRendererFactory);
    final FontVisualPropertyEditor fontVisualPropertyEditor = new FontVisualPropertyEditor(Font.class, cyFontPropertyEditor, cmCellRendererFactory);
    final StringVisualPropertyEditor stringPropertyEditor = new StringVisualPropertyEditor(cmCellRendererFactory);
    final CyComboBoxPropertyEditor booleanEditor = new CyComboBoxPropertyEditor();
    booleanEditor.setAvailableValues(new Boolean[] { true, false });
    final BooleanVisualPropertyEditor booleanVisualPropertyEditor = new BooleanVisualPropertyEditor(booleanEditor, cmCellRendererFactory);
    // Context menu for edge bend
    final Properties clearAllBendsForThisEdgeProps = new Properties();
    clearAllBendsForThisEdgeProps.put(ServiceProperties.PREFERRED_MENU, ServiceProperties.EDGE_EDIT_MENU);
    clearAllBendsForThisEdgeProps.put(ServiceProperties.TITLE, "Clear All Bends For This Edge");
    clearAllBendsForThisEdgeProps.put(ServiceProperties.MENU_GRAVITY, "5.0");
    clearAllBendsForThisEdgeProps.put(ServiceProperties.INSERT_SEPARATOR_BEFORE, "true");
    final ClearAllBendsForThisEdgeTaskFactory clearAllBendsForThisEdgeTaskFactory = new ClearAllBendsForThisEdgeTaskFactory(servicesUtil);
    registerService(bc, clearAllBendsForThisEdgeTaskFactory, EdgeViewTaskFactory.class, clearAllBendsForThisEdgeProps);
    // Register ValueEditors and VisualPropertyEditors
    // -------------------------------------------------------------------------------------------------------------
    registerAllServices(bc, attributeSetProxy);
    registerAllServices(bc, editorManager.getNodeEditor());
    registerAllServices(bc, editorManager.getEdgeEditor());
    registerAllServices(bc, editorManager.getNetworkEditor());
    registerAllServices(bc, colorChooser);
    registerAllServices(bc, doubleValueEditor);
    registerAllServices(bc, integerValueEditor);
    registerAllServices(bc, floatValueEditor);
    registerAllServices(bc, stringValueEditor);
    registerAllServices(bc, booleanValueEditor);
    registerAllServices(bc, fontValueEditor);
    registerAllServices(bc, colorPropertyEditor);
    registerAllServices(bc, doublePropertyEditor);
    registerAllServices(bc, floatPropertyEditor);
    registerAllServices(bc, integerPropertyEditor);
    registerAllServices(bc, fontVisualPropertyEditor);
    registerAllServices(bc, stringPropertyEditor);
    registerAllServices(bc, booleanVisualPropertyEditor);
    // Tasks
    // -------------------------------------------------------------------------------------------------------------
    final CreateNewVisualStyleTaskFactory createNewVisualStyleTaskFactory = new CreateNewVisualStyleTaskFactory(servicesUtil);
    final Properties createNewVisualStyleTaskFactoryProps = new Properties();
    createNewVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    createNewVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.TITLE, CreateNewVisualStyleTask.TITLE + "...");
    createNewVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.MENU_ID, ServicePropertiesUtil.MAIN_MENU);
    createNewVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.GRAVITY, "1.0");
    registerAllServices(bc, createNewVisualStyleTaskFactory, createNewVisualStyleTaskFactoryProps);
    final CopyVisualStyleTaskFactory copyVisualStyleTaskFactory = new CopyVisualStyleTaskFactory(servicesUtil);
    final Properties copyVisualStyleTaskFactoryProps = new Properties();
    copyVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    copyVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.TITLE, CopyVisualStyleTask.TITLE + "...");
    copyVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.MENU_ID, ServicePropertiesUtil.MAIN_MENU);
    copyVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.GRAVITY, "2.0");
    registerAllServices(bc, copyVisualStyleTaskFactory, copyVisualStyleTaskFactoryProps);
    final RenameVisualStyleTaskFactory renameVisualStyleTaskFactory = new RenameVisualStyleTaskFactory(servicesUtil);
    final Properties renameVisualStyleTaskFactoryProps = new Properties();
    renameVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    renameVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.TITLE, RenameVisualStyleTask.TITLE + "...");
    renameVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.MENU_ID, ServicePropertiesUtil.MAIN_MENU);
    renameVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.GRAVITY, "3.0");
    registerAllServices(bc, renameVisualStyleTaskFactory, renameVisualStyleTaskFactoryProps);
    final RemoveVisualStyleTaskFactory removeVisualStyleTaskFactory = new RemoveVisualStyleTaskFactory(servicesUtil);
    final Properties removeVisualStyleTaskFactoryProps = new Properties();
    removeVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    removeVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.TITLE, RemoveVisualStyleTask.TITLE);
    removeVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.MENU_ID, ServicePropertiesUtil.MAIN_MENU);
    removeVisualStyleTaskFactoryProps.setProperty(ServicePropertiesUtil.GRAVITY, "4.0");
    registerAllServices(bc, removeVisualStyleTaskFactory, removeVisualStyleTaskFactoryProps);
    final MakeVisualStylesDefaultTaskFactory makeVisualStylesDefaultTaskFactory = new MakeVisualStylesDefaultTaskFactory(servicesUtil);
    final Properties makeVisualStylesDefaultTaskFactoryProps = new Properties();
    makeVisualStylesDefaultTaskFactoryProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    makeVisualStylesDefaultTaskFactoryProps.setProperty(ServicePropertiesUtil.TITLE, MakeVisualStylesDefaultTask.TITLE);
    makeVisualStylesDefaultTaskFactoryProps.setProperty(ServicePropertiesUtil.MENU_ID, ServicePropertiesUtil.MAIN_MENU);
    makeVisualStylesDefaultTaskFactoryProps.setProperty(ServicePropertiesUtil.GRAVITY, "5.0");
    makeVisualStylesDefaultTaskFactoryProps.setProperty(ServicePropertiesUtil.INSERT_SEPARATOR_BEFORE, "true");
    registerAllServices(bc, makeVisualStylesDefaultTaskFactory, makeVisualStylesDefaultTaskFactoryProps);
    final CreateLegendTaskFactory createLegendTaskFactory = new CreateLegendTaskFactory(servicesUtil);
    final Properties createLegendTaskFactoryProps = new Properties();
    createLegendTaskFactoryProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    createLegendTaskFactoryProps.setProperty(ServicePropertiesUtil.TITLE, CreateLegendTask.TITLE + "...");
    createLegendTaskFactoryProps.setProperty(ServicePropertiesUtil.MENU_ID, ServicePropertiesUtil.MAIN_MENU);
    createLegendTaskFactoryProps.setProperty(ServicePropertiesUtil.GRAVITY, "6.0");
    createLegendTaskFactoryProps.setProperty(ServicePropertiesUtil.INSERT_SEPARATOR_BEFORE, "true");
    registerAllServices(bc, createLegendTaskFactory, createLegendTaskFactoryProps);
    // Visual Styles Panel Context Menu
    // -------------------------------------------------------------------------------------------------------------
    // Edit sub-menu
    final EditSelectedDiscreteValuesAction editAction = new EditSelectedDiscreteValuesAction(servicesUtil, editorManager);
    final Properties editSelectedProps = new Properties();
    editSelectedProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    editSelectedProps.setProperty(ServicePropertiesUtil.TITLE, EditSelectedDiscreteValuesAction.NAME);
    editSelectedProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    editSelectedProps.setProperty(ServicePropertiesUtil.GRAVITY, "1.0");
    registerService(bc, editAction, CyAction.class, editSelectedProps);
    final RemoveSelectedDiscreteValuesAction removeAction = new RemoveSelectedDiscreteValuesAction(servicesUtil);
    final Properties removeSelectedProps = new Properties();
    removeSelectedProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    removeSelectedProps.setProperty(ServicePropertiesUtil.TITLE, RemoveSelectedDiscreteValuesAction.NAME);
    removeSelectedProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    removeSelectedProps.setProperty(ServicePropertiesUtil.GRAVITY, "2.0");
    registerService(bc, removeAction, CyAction.class, removeSelectedProps);
    final RemoveVisualMappingsTaskFactory removeVisualMappingsTaskFactory = new RemoveVisualMappingsTaskFactory(servicesUtil);
    final Properties removeVisualMappingTaskFactoryProps = new Properties();
    removeVisualMappingTaskFactoryProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    removeVisualMappingTaskFactoryProps.setProperty(ServicePropertiesUtil.TITLE, "Remove Mappings from Selected Visual Properties");
    removeVisualMappingTaskFactoryProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    removeVisualMappingTaskFactoryProps.setProperty(ServicePropertiesUtil.GRAVITY, "3.0");
    removeVisualMappingTaskFactoryProps.setProperty(ServicePropertiesUtil.INSERT_SEPARATOR_BEFORE, "true");
    registerAllServices(bc, removeVisualMappingsTaskFactory, removeVisualMappingTaskFactoryProps);
    // Discrete value generators:
    final RainbowColorMappingGenerator rainbowGenerator = new RainbowColorMappingGenerator(Color.class);
    final Properties rainbowGeneratorProps = new Properties();
    rainbowGeneratorProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI");
    rainbowGeneratorProps.setProperty(ServicePropertiesUtil.TITLE, "Rainbow");
    rainbowGeneratorProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    registerService(bc, rainbowGenerator, DiscreteMappingGenerator.class, rainbowGeneratorProps);
    final RainbowOscColorMappingGenerator rainbowOscGenerator = new RainbowOscColorMappingGenerator(Color.class);
    final Properties rainbowOscGeneratorProps = new Properties();
    rainbowOscGeneratorProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI.contextMenu");
    rainbowOscGeneratorProps.setProperty(ServicePropertiesUtil.TITLE, "Rainbow OSC");
    rainbowOscGeneratorProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    registerService(bc, rainbowOscGenerator, DiscreteMappingGenerator.class, rainbowOscGeneratorProps);
    final RandomColorMappingGenerator randomColorGenerator = new RandomColorMappingGenerator(Color.class);
    final Properties randomColorGeneratorProps = new Properties();
    randomColorGeneratorProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI.contextMenu");
    randomColorGeneratorProps.setProperty(ServicePropertiesUtil.TITLE, "Random Color");
    randomColorGeneratorProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    registerService(bc, randomColorGenerator, DiscreteMappingGenerator.class, randomColorGeneratorProps);
    final NumberSeriesMappingGenerator<Number> seriesGenerator = new NumberSeriesMappingGenerator<Number>(Number.class);
    final Properties numberSeriesGeneratorProps = new Properties();
    numberSeriesGeneratorProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI.contextMenu");
    numberSeriesGeneratorProps.setProperty(ServicePropertiesUtil.TITLE, "Number Series");
    numberSeriesGeneratorProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    registerService(bc, seriesGenerator, DiscreteMappingGenerator.class, numberSeriesGeneratorProps);
    final RandomNumberMappingGenerator randomNumberGenerator = new RandomNumberMappingGenerator();
    final Properties randomNumberGeneratorProps = new Properties();
    randomNumberGeneratorProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI.contextMenu");
    randomNumberGeneratorProps.setProperty(ServicePropertiesUtil.TITLE, "Random Numbers");
    randomNumberGeneratorProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    registerService(bc, randomNumberGenerator, DiscreteMappingGenerator.class, randomNumberGeneratorProps);
    final FitLabelMappingGenerator<Double> fitLabelMappingGenerator = new FitLabelMappingGenerator<Double>(Double.class, servicesUtil);
    final Properties fitLabelGeneratorProps = new Properties();
    fitLabelGeneratorProps.setProperty(ServicePropertiesUtil.SERVICE_TYPE, "vizmapUI.contextMenu");
    fitLabelGeneratorProps.setProperty(ServicePropertiesUtil.TITLE, "Fit label width (only works with 'name' column to node size or width)");
    fitLabelGeneratorProps.setProperty(ServicePropertiesUtil.MENU_ID, "context");
    registerService(bc, fitLabelMappingGenerator, DiscreteMappingGenerator.class, fitLabelGeneratorProps);
    // Create the main GUI component
    // -------------------------------------------------------------------------------------------------------------
    final VizMapperMainPanel vizMapperMainPanel = new VizMapperMainPanel(servicesUtil);
    // Start the PureMVC components
    // -------------------------------------------------------------------------------------------------------------
    final VizMapperProxy vizMapperProxy = new VizMapperProxy(servicesUtil);
    final PropsProxy propsProxy = new PropsProxy(servicesUtil);
    final VizMapPropertyBuilder vizMapPropertyBuilder = new VizMapPropertyBuilder(editorManager, mappingFunctionFactoryManager, servicesUtil);
    final VizMapperMediator vizMapperMediator = new VizMapperMediator(vizMapperMainPanel, servicesUtil, vizMapPropertyBuilder);
    final VizMapperMenuMediator vizMapperMenuMediator = new VizMapperMenuMediator(vizMapperMainPanel, servicesUtil);
    final StartupCommand startupCommand = new StartupCommand(vizMapperProxy, attributeSetProxy, mappingFactoryProxy, propsProxy, vizMapperMediator, vizMapperMenuMediator, servicesUtil);
    registerAllServices(bc, vizMapperProxy);
    registerAllServices(bc, mappingFactoryProxy);
    registerAllServices(bc, propsProxy);
    registerAllServices(bc, vizMapperMediator);
    registerServiceListener(bc, vizMapperMediator::onCyActionRegistered, vizMapperMediator::onCyActionUnregistered, CyAction.class);
    registerServiceListener(bc, vizMapperMediator::onTaskFactoryRegistered, vizMapperMediator::onTaskFactoryUnregistered, TaskFactory.class);
    registerServiceListener(bc, vizMapperMediator::onMappingGeneratorRegistered, vizMapperMediator::onMappingGeneratorUnregistered, DiscreteMappingGenerator.class);
    registerServiceListener(bc, vizMapperMenuMediator::onRenderingEngineFactoryRegistered, vizMapperMenuMediator::onRenderingEngineFactoryUnregistered, RenderingEngineFactory.class);
    final VizMapEventHandlerManagerImpl vizMapEventHandlerManager = new VizMapEventHandlerManagerImpl(editorManager, attributeSetProxy, servicesUtil, vizMapPropertyBuilder, vizMapperMediator);
    registerServiceListener(bc, vizMapEventHandlerManager::registerPCL, vizMapEventHandlerManager::unregisterPCL, RenderingEngineFactory.class);
    // Startup the framework
    new ApplicationFacade(startupCommand).startup();
}
Also used : CyFontPropertyEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.propertyeditor.CyFontPropertyEditor) NumberVisualPropertyEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.NumberVisualPropertyEditor) VizMapperMediator(org.cytoscape.view.vizmap.gui.internal.view.VizMapperMediator) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) NumberSeriesMappingGenerator(org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.NumberSeriesMappingGenerator) AttributeSetProxy(org.cytoscape.view.vizmap.gui.internal.model.AttributeSetProxy) CyColorChooser(org.cytoscape.view.vizmap.gui.internal.view.editor.valueeditor.CyColorChooser) CyColorPropertyEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.propertyeditor.CyColorPropertyEditor) StringValueEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.valueeditor.StringValueEditor) RandomNumberMappingGenerator(org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.RandomNumberMappingGenerator) ClearAllBendsForThisEdgeTaskFactory(org.cytoscape.view.vizmap.gui.internal.task.ClearAllBendsForThisEdgeTaskFactory) MappingFunctionFactoryProxy(org.cytoscape.view.vizmap.gui.internal.model.MappingFunctionFactoryProxy) RemoveSelectedDiscreteValuesAction(org.cytoscape.view.vizmap.gui.internal.action.RemoveSelectedDiscreteValuesAction) MakeVisualStylesDefaultTaskFactory(org.cytoscape.view.vizmap.gui.internal.task.MakeVisualStylesDefaultTaskFactory) RandomColorMappingGenerator(org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.RandomColorMappingGenerator) RemoveVisualMappingsTaskFactory(org.cytoscape.view.vizmap.gui.internal.task.RemoveVisualMappingsTaskFactory) NumericValueEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.valueeditor.NumericValueEditor) VizMapperMenuMediator(org.cytoscape.view.vizmap.gui.internal.view.VizMapperMenuMediator) BooleanVisualPropertyEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.BooleanVisualPropertyEditor) RainbowOscColorMappingGenerator(org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.RainbowOscColorMappingGenerator) EditorManagerImpl(org.cytoscape.view.vizmap.gui.internal.view.editor.EditorManagerImpl) StringVisualPropertyEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.StringVisualPropertyEditor) ServiceProperties(org.cytoscape.work.ServiceProperties) Properties(java.util.Properties) CopyVisualStyleTaskFactory(org.cytoscape.view.vizmap.gui.internal.task.CopyVisualStyleTaskFactory) ContinuousMappingCellRendererFactory(org.cytoscape.view.vizmap.gui.editor.ContinuousMappingCellRendererFactory) VizMapPropertyBuilder(org.cytoscape.view.vizmap.gui.internal.view.VizMapPropertyBuilder) VizMapperProxy(org.cytoscape.view.vizmap.gui.internal.model.VizMapperProxy) BooleanValueEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.valueeditor.BooleanValueEditor) VizMapperMainPanel(org.cytoscape.view.vizmap.gui.internal.view.VizMapperMainPanel) RainbowColorMappingGenerator(org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.RainbowColorMappingGenerator) RemoveVisualStyleTaskFactory(org.cytoscape.view.vizmap.gui.internal.task.RemoveVisualStyleTaskFactory) PropsProxy(org.cytoscape.view.vizmap.gui.internal.model.PropsProxy) EditSelectedDiscreteValuesAction(org.cytoscape.view.vizmap.gui.internal.action.EditSelectedDiscreteValuesAction) CreateNewVisualStyleTaskFactory(org.cytoscape.view.vizmap.gui.internal.task.CreateNewVisualStyleTaskFactory) FontVisualPropertyEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.FontVisualPropertyEditor) VizMapEventHandlerManagerImpl(org.cytoscape.view.vizmap.gui.internal.event.VizMapEventHandlerManagerImpl) FontValueEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.valueeditor.FontValueEditor) FitLabelMappingGenerator(org.cytoscape.view.vizmap.gui.internal.util.mapgenerator.FitLabelMappingGenerator) ServicesUtil(org.cytoscape.view.vizmap.gui.internal.util.ServicesUtil) StartupCommand(org.cytoscape.view.vizmap.gui.internal.controller.StartupCommand) ColorVisualPropertyEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.ColorVisualPropertyEditor) CyComboBoxPropertyEditor(org.cytoscape.view.vizmap.gui.internal.view.editor.propertyeditor.CyComboBoxPropertyEditor) CreateLegendTaskFactory(org.cytoscape.view.vizmap.gui.internal.task.CreateLegendTaskFactory) RenameVisualStyleTaskFactory(org.cytoscape.view.vizmap.gui.internal.task.RenameVisualStyleTaskFactory)

Example 40 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);
    final UndoSupport undoSupport = getService(bc, UndoSupport.class);
    GridNodeLayout gridNodeLayout = new GridNodeLayout(undoSupport);
    CyLayoutAlgorithmManagerImpl layoutManager = new CyLayoutAlgorithmManagerImpl(gridNodeLayout, serviceRegistrar);
    registerService(bc, layoutManager, CyLayoutAlgorithmManager.class, new Properties());
    {
        Properties props = new Properties();
        // gridNodeLayoutProps.setProperty(PREFERRED_MENU, "Layout.Cytoscape Layouts");
        props.setProperty("preferredTaskManager", "menu");
        props.setProperty(TITLE, gridNodeLayout.toString());
        props.setProperty(MENU_GRAVITY, "10.0");
        registerService(bc, gridNodeLayout, CyLayoutAlgorithm.class, props);
    }
    registerServiceListener(bc, layoutManager::addLayout, layoutManager::removeLayout, CyLayoutAlgorithm.class);
}
Also used : GridNodeLayout(org.cytoscape.view.layout.internal.algorithms.GridNodeLayout) CyLayoutAlgorithm(org.cytoscape.view.layout.CyLayoutAlgorithm) Properties(java.util.Properties) UndoSupport(org.cytoscape.work.undo.UndoSupport) 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