Search in sources :

Example 1 with MoveAnnotationTaskFactory

use of org.cytoscape.ding.impl.cyannotator.tasks.MoveAnnotationTaskFactory in project cytoscape-impl by cytoscape.

the class CyActivator method startPresentationImpl.

private void startPresentationImpl(final BundleContext bc, final CyServiceRegistrar serviceRegistrar) {
    DVisualLexicon dVisualLexicon = new DVisualLexicon(cgManager);
    NVLTFActionSupport nvltfActionSupport = new NVLTFActionSupport(serviceRegistrar);
    ViewTaskFactoryListener vtfListener = new ViewTaskFactoryListener(nvltfActionSupport);
    AnnotationFactoryManager annotationFactoryManager = new AnnotationFactoryManager();
    AnnotationManager annotationManager = new AnnotationManagerImpl(serviceRegistrar);
    DingGraphLOD dingGraphLOD = new DingGraphLOD(serviceRegistrar);
    registerService(bc, dingGraphLOD, PropertyUpdatedListener.class, new Properties());
    DingGraphLODAll dingGraphLODAll = new DingGraphLODAll();
    HandleFactory handleFactory = new HandleFactoryImpl();
    registerService(bc, handleFactory, HandleFactory.class, new Properties());
    DingRenderingEngineFactory dingRenderingEngineFactory = new DingRenderingEngineFactory(dVisualLexicon, vtfListener, annotationFactoryManager, dingGraphLOD, handleFactory, serviceRegistrar);
    DingNavigationRenderingEngineFactory dingNavigationRenderingEngineFactory = new DingNavigationRenderingEngineFactory(serviceRegistrar, dVisualLexicon);
    DingRenderingEngineFactory dingVisualStyleRenderingEngineFactory = new DingVisualStyleRenderingEngineFactory(dVisualLexicon, vtfListener, annotationFactoryManager, dingGraphLOD, handleFactory, serviceRegistrar);
    DingThumbnailRenderingEngineFactory dingThumbnailRenderingEngineFactory = new DingThumbnailRenderingEngineFactory(dVisualLexicon, serviceRegistrar);
    AddEdgeNodeViewTaskFactoryImpl addEdgeNodeViewTaskFactory = new AddEdgeNodeViewTaskFactoryImpl(serviceRegistrar);
    ContinuousMappingCellRendererFactory continuousMappingCellRendererFactory = getService(bc, ContinuousMappingCellRendererFactory.class);
    // Object Position Editor
    ObjectPositionValueEditor objectPositionValueEditor = new ObjectPositionValueEditor();
    ObjectPositionEditor objectPositionEditor = new ObjectPositionEditor(objectPositionValueEditor, continuousMappingCellRendererFactory, serviceRegistrar);
    DingViewModelFactory dingNetworkViewFactory = new DingViewModelFactory(dVisualLexicon, vtfListener, annotationFactoryManager, dingGraphLOD, handleFactory, serviceRegistrar);
    DingRenderer renderer = DingRenderer.getInstance();
    renderer.registerNetworkViewFactory(dingNetworkViewFactory);
    renderer.registerRenderingEngineFactory(NetworkViewRenderer.DEFAULT_CONTEXT, dingRenderingEngineFactory);
    renderer.registerRenderingEngineFactory(NetworkViewRenderer.BIRDS_EYE_CONTEXT, dingNavigationRenderingEngineFactory);
    renderer.registerRenderingEngineFactory(NetworkViewRenderer.VISUAL_STYLE_PREVIEW_CONTEXT, dingVisualStyleRenderingEngineFactory);
    renderer.registerRenderingEngineFactory(NetworkViewRenderer.THUMBNAIL_CONTEXT, dingThumbnailRenderingEngineFactory);
    registerService(bc, renderer, NetworkViewRenderer.class, new Properties());
    // Edge Bend editor
    EdgeBendValueEditor edgeBendValueEditor = new EdgeBendValueEditor(dingNetworkViewFactory, dingRenderingEngineFactory, serviceRegistrar);
    EdgeBendEditor edgeBendEditor = new EdgeBendEditor(edgeBendValueEditor, continuousMappingCellRendererFactory, serviceRegistrar);
    Properties dingRenderingEngineFactoryProps = new Properties();
    dingRenderingEngineFactoryProps.setProperty(ID, "ding");
    registerAllServices(bc, dingRenderingEngineFactory, dingRenderingEngineFactoryProps);
    Properties dingNavigationRenderingEngineFactoryProps = new Properties();
    dingNavigationRenderingEngineFactoryProps.setProperty(ID, "dingNavigation");
    registerAllServices(bc, dingNavigationRenderingEngineFactory, dingNavigationRenderingEngineFactoryProps);
    Properties addEdgeNodeViewTaskFactoryProps = new Properties();
    addEdgeNodeViewTaskFactoryProps.setProperty(PREFERRED_ACTION, "Edge");
    addEdgeNodeViewTaskFactoryProps.setProperty(PREFERRED_MENU, NODE_ADD_MENU);
    addEdgeNodeViewTaskFactoryProps.setProperty(TITLE, "Edge");
    addEdgeNodeViewTaskFactoryProps.setProperty(MENU_GRAVITY, "0.1");
    registerService(bc, addEdgeNodeViewTaskFactory, NodeViewTaskFactory.class, addEdgeNodeViewTaskFactoryProps);
    Properties dVisualLexiconProps = new Properties();
    dVisualLexiconProps.setProperty(ID, "ding");
    registerService(bc, dVisualLexicon, VisualLexicon.class, dVisualLexiconProps);
    final Properties positionEditorProp = new Properties();
    positionEditorProp.setProperty(ID, "objectPositionValueEditor");
    registerService(bc, objectPositionValueEditor, ValueEditor.class, positionEditorProp);
    final Properties objectPositionEditorProp = new Properties();
    objectPositionEditorProp.setProperty(ID, "objectPositionEditor");
    registerService(bc, objectPositionEditor, VisualPropertyEditor.class, objectPositionEditorProp);
    registerAllServices(bc, edgeBendValueEditor, new Properties());
    registerService(bc, edgeBendEditor, VisualPropertyEditor.class, new Properties());
    Properties dingNetworkViewFactoryServiceProps = new Properties();
    registerService(bc, dingNetworkViewFactory, CyNetworkViewFactory.class, dingNetworkViewFactoryServiceProps);
    // Annotations
    registerServiceListener(bc, annotationFactoryManager::addAnnotationFactory, annotationFactoryManager::removeAnnotationFactory, AnnotationFactory.class);
    registerService(bc, annotationManager, AnnotationManager.class, new Properties());
    // Arrow
    AnnotationFactory<?> arrowAnnotationFactory = new ArrowAnnotationFactory(serviceRegistrar);
    Properties arrowFactory = new Properties();
    arrowFactory.setProperty("type", "ArrowAnnotation.class");
    registerService(bc, arrowAnnotationFactory, AnnotationFactory.class, arrowFactory);
    AddArrowTaskFactory addArrowTaskFactory = new AddArrowTaskFactory(arrowAnnotationFactory);
    Properties addArrowTaskFactoryProps = new Properties();
    addArrowTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    addArrowTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_ADD_MENU);
    addArrowTaskFactoryProps.setProperty(MENU_GRAVITY, "1.2");
    addArrowTaskFactoryProps.setProperty(TITLE, "Arrow Annotation");
    registerService(bc, addArrowTaskFactory, NetworkViewLocationTaskFactory.class, addArrowTaskFactoryProps);
    // Image annotation
    AnnotationFactory<?> imageAnnotationFactory = new ImageAnnotationFactory(serviceRegistrar);
    Properties imageFactory = new Properties();
    imageFactory.setProperty("type", "ImageAnnotation.class");
    registerService(bc, imageAnnotationFactory, AnnotationFactory.class, imageFactory);
    AddAnnotationTaskFactory addImageTaskFactory = new AddAnnotationTaskFactory(imageAnnotationFactory);
    Properties addImageTaskFactoryProps = new Properties();
    addImageTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    addImageTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_ADD_MENU);
    addImageTaskFactoryProps.setProperty(MENU_GRAVITY, "1.3");
    addImageTaskFactoryProps.setProperty(TITLE, "Image Annotation");
    registerService(bc, addImageTaskFactory, NetworkViewLocationTaskFactory.class, addImageTaskFactoryProps);
    // Shape annotation
    AnnotationFactory<?> shapeAnnotationFactory = new ShapeAnnotationFactory(serviceRegistrar);
    Properties shapeFactory = new Properties();
    shapeFactory.setProperty("type", "ShapeAnnotation.class");
    registerService(bc, shapeAnnotationFactory, AnnotationFactory.class, shapeFactory);
    AddAnnotationTaskFactory addShapeTaskFactory = new AddAnnotationTaskFactory(shapeAnnotationFactory);
    Properties addShapeTaskFactoryProps = new Properties();
    addShapeTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    addShapeTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_ADD_MENU);
    addShapeTaskFactoryProps.setProperty(MENU_GRAVITY, "1.4");
    addShapeTaskFactoryProps.setProperty(TITLE, "Shape Annotation");
    registerService(bc, addShapeTaskFactory, NetworkViewLocationTaskFactory.class, addShapeTaskFactoryProps);
    // Text annotation
    AnnotationFactory<?> textAnnotationFactory = new TextAnnotationFactory(serviceRegistrar);
    Properties textFactory = new Properties();
    textFactory.setProperty("type", "TextAnnotation.class");
    registerService(bc, textAnnotationFactory, AnnotationFactory.class, textFactory);
    AddAnnotationTaskFactory addTextTaskFactory = new AddAnnotationTaskFactory(textAnnotationFactory);
    Properties addTextTaskFactoryProps = new Properties();
    addTextTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    addTextTaskFactoryProps.setProperty(MENU_GRAVITY, "1.5");
    addTextTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_ADD_MENU);
    addTextTaskFactoryProps.setProperty(TITLE, "Text Annotation");
    registerService(bc, addTextTaskFactory, NetworkViewLocationTaskFactory.class, addTextTaskFactoryProps);
    // Bounded Text annotation
    AnnotationFactory<?> boundedAnnotationFactory = new BoundedTextAnnotationFactory(serviceRegistrar);
    Properties boundedFactory = new Properties();
    boundedFactory.setProperty("type", "BoundedTextAnnotation.class");
    registerService(bc, boundedAnnotationFactory, AnnotationFactory.class, boundedFactory);
    AddAnnotationTaskFactory addBoundedTextTaskFactory = new AddAnnotationTaskFactory(boundedAnnotationFactory);
    Properties addBoundedTextTaskFactoryProps = new Properties();
    addBoundedTextTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    addBoundedTextTaskFactoryProps.setProperty(MENU_GRAVITY, "1.6");
    addBoundedTextTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_ADD_MENU);
    addBoundedTextTaskFactoryProps.setProperty(TITLE, "Bounded Text Annotation");
    registerService(bc, addBoundedTextTaskFactory, NetworkViewLocationTaskFactory.class, addBoundedTextTaskFactoryProps);
    AnnotationFactory<?> groupAnnotationFactory = new GroupAnnotationFactory(serviceRegistrar);
    Properties groupFactory = new Properties();
    groupFactory.setProperty("type", "GroupAnnotation.class");
    registerService(bc, groupAnnotationFactory, AnnotationFactory.class, groupFactory);
    // Annotation edit
    EditAnnotationTaskFactory editAnnotationTaskFactory = new EditAnnotationTaskFactory();
    Properties editAnnotationTaskFactoryProps = new Properties();
    editAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    editAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "2.0");
    editAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU);
    editAnnotationTaskFactoryProps.setProperty(TITLE, "Modify Annotation");
    registerService(bc, editAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, editAnnotationTaskFactoryProps);
    MoveAnnotationTaskFactory moveAnnotationTaskFactory = new MoveAnnotationTaskFactory();
    Properties moveAnnotationTaskFactoryProps = new Properties();
    moveAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    moveAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "2.1");
    moveAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU);
    moveAnnotationTaskFactoryProps.setProperty(TITLE, "Move Annotation");
    registerService(bc, moveAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, moveAnnotationTaskFactoryProps);
    LayerAnnotationTaskFactory moveTFAnnotationTaskFactory = new LayerAnnotationTaskFactory(-10000);
    Properties moveTFAnnotationTaskFactoryProps = new Properties();
    moveTFAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    moveTFAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "3.1");
    moveTFAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU + ".Reorder Annotations[2.2]");
    moveTFAnnotationTaskFactoryProps.setProperty(TITLE, "Move Annotation To Front");
    registerService(bc, moveTFAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, moveTFAnnotationTaskFactoryProps);
    LayerAnnotationTaskFactory moveFAnnotationTaskFactory = new LayerAnnotationTaskFactory(-1);
    Properties moveFAnnotationTaskFactoryProps = new Properties();
    moveFAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    moveFAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "3.2");
    moveFAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU + ".Reorder Annotations[2.2]");
    moveFAnnotationTaskFactoryProps.setProperty(TITLE, "Move Annotation Forwards");
    registerService(bc, moveFAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, moveFAnnotationTaskFactoryProps);
    LayerAnnotationTaskFactory moveBAnnotationTaskFactory = new LayerAnnotationTaskFactory(1);
    Properties moveBAnnotationTaskFactoryProps = new Properties();
    moveBAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    moveBAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "3.3");
    moveBAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU + ".Reorder Annotations[2.2]");
    moveBAnnotationTaskFactoryProps.setProperty(TITLE, "Move Annotation Backwards");
    registerService(bc, moveBAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, moveBAnnotationTaskFactoryProps);
    LayerAnnotationTaskFactory moveTBAnnotationTaskFactory = new LayerAnnotationTaskFactory(10000);
    Properties moveTBAnnotationTaskFactoryProps = new Properties();
    moveTBAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    moveTBAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "3.4");
    moveTBAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU + ".Reorder Annotations[2.2]");
    moveTBAnnotationTaskFactoryProps.setProperty(TITLE, "Move Annotation To Back");
    moveTBAnnotationTaskFactoryProps.setProperty(INSERT_SEPARATOR_AFTER, "true");
    registerService(bc, moveTBAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, moveTBAnnotationTaskFactoryProps);
    ChangeAnnotationCanvasTaskFactory pullAnnotationTaskFactory = new ChangeAnnotationCanvasTaskFactory(Annotation.FOREGROUND);
    Properties pullAnnotationTaskFactoryProps = new Properties();
    pullAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    pullAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "3.5");
    pullAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU + ".Reorder Annotations[2.2]");
    pullAnnotationTaskFactoryProps.setProperty(TITLE, "Pull Annotation to Foreground Canvas");
    registerService(bc, pullAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, pullAnnotationTaskFactoryProps);
    ChangeAnnotationCanvasTaskFactory pushAnnotationTaskFactory = new ChangeAnnotationCanvasTaskFactory(Annotation.BACKGROUND);
    Properties pushAnnotationTaskFactoryProps = new Properties();
    pushAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    pushAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "3.6");
    pushAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU + ".Reorder Annotations[2.2]");
    pushAnnotationTaskFactoryProps.setProperty(TITLE, "Push Annotation to Background Canvas");
    registerService(bc, pushAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, pushAnnotationTaskFactoryProps);
    ResizeAnnotationTaskFactory resizeAnnotationTaskFactory = new ResizeAnnotationTaskFactory();
    Properties resizeAnnotationTaskFactoryProps = new Properties();
    resizeAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    resizeAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "2.3");
    resizeAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_EDIT_MENU);
    resizeAnnotationTaskFactoryProps.setProperty(TITLE, "Resize Annotation");
    registerService(bc, resizeAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, resizeAnnotationTaskFactoryProps);
    // Annotation delete
    RemoveAnnotationTaskFactory removeAnnotationTaskFactory = new RemoveAnnotationTaskFactory();
    Properties removeAnnotationTaskFactoryProps = new Properties();
    removeAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    removeAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "1.1");
    removeAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_DELETE_MENU);
    removeAnnotationTaskFactoryProps.setProperty(TITLE, "Annotation");
    registerService(bc, removeAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, removeAnnotationTaskFactoryProps);
    // Annotation select
    SelectAnnotationTaskFactory selectAnnotationTaskFactory = new SelectAnnotationTaskFactory();
    Properties selectAnnotationTaskFactoryProps = new Properties();
    selectAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    selectAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "1.1");
    selectAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_SELECT_MENU);
    selectAnnotationTaskFactoryProps.setProperty(TITLE, "Select/Unselect Annotation");
    registerService(bc, selectAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, selectAnnotationTaskFactoryProps);
    // Annotation group
    GroupAnnotationsTaskFactory groupAnnotationTaskFactory = new GroupAnnotationsTaskFactory();
    Properties groupAnnotationTaskFactoryProps = new Properties();
    groupAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    groupAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "100");
    groupAnnotationTaskFactoryProps.setProperty(INSERT_SEPARATOR_BEFORE, "true");
    groupAnnotationTaskFactoryProps.setProperty(IN_MENU_BAR, "false");
    groupAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_GROUP_MENU);
    groupAnnotationTaskFactoryProps.setProperty(TITLE, "Group Annotations");
    registerService(bc, groupAnnotationTaskFactory, NetworkViewTaskFactory.class, groupAnnotationTaskFactoryProps);
    // Annotation ungroup
    UngroupAnnotationsTaskFactory ungroupAnnotationTaskFactory = new UngroupAnnotationsTaskFactory();
    Properties ungroupAnnotationTaskFactoryProps = new Properties();
    ungroupAnnotationTaskFactoryProps.setProperty(PREFERRED_ACTION, "NEW");
    ungroupAnnotationTaskFactoryProps.setProperty(MENU_GRAVITY, "100");
    ungroupAnnotationTaskFactoryProps.setProperty(INSERT_SEPARATOR_BEFORE, "true");
    ungroupAnnotationTaskFactoryProps.setProperty(PREFERRED_MENU, NETWORK_GROUP_MENU);
    ungroupAnnotationTaskFactoryProps.setProperty(TITLE, "Ungroup Annotations");
    registerService(bc, ungroupAnnotationTaskFactory, NetworkViewLocationTaskFactory.class, ungroupAnnotationTaskFactoryProps);
    // Set mouse drag selection modes
    SelectModeAction selectNodesOnlyAction = new SelectModeAction(SelectModeAction.NODES, 0.5f, serviceRegistrar);
    registerAllServices(bc, selectNodesOnlyAction, new Properties());
    SelectModeAction selectEdgesOnlyAction = new SelectModeAction(SelectModeAction.EDGES, 0.6f, serviceRegistrar);
    registerAllServices(bc, selectEdgesOnlyAction, new Properties());
    SelectModeAction selectNodesAndEdgesAction = new SelectModeAction(SelectModeAction.ALL, 0.7f, serviceRegistrar);
    registerAllServices(bc, selectNodesAndEdgesAction, new Properties());
    {
        // Toggle Graphics Details
        ShowGraphicsDetailsTaskFactory factory = new ShowGraphicsDetailsTaskFactory(dingGraphLOD, dingGraphLODAll);
        Properties props = new Properties();
        props.setProperty(ID, "showGraphicsDetailsTaskFactory");
        // Used at least by cyREST
        registerService(bc, factory, NetworkViewTaskFactory.class, props);
        // Main menu
        GraphicsDetailAction mainMenuAction = new GraphicsDetailAction(5.0f, "View", factory, serviceRegistrar);
        registerAllServices(bc, mainMenuAction);
        // Network tab's context menu
        GraphicsDetailAction networkMenuAction = new GraphicsDetailAction(11.0f, null, factory, serviceRegistrar);
        props = new Properties();
        props.setProperty(IN_NETWORK_PANEL_CONTEXT_MENU, "true");
        registerAllServices(bc, networkMenuAction, props);
    }
    // if IN_CONTEXT_MENU is not specified, default to true
    final String vtfFilter = String.format("(| (!(%s=*)) (%s=true))", IN_CONTEXT_MENU, IN_CONTEXT_MENU);
    registerServiceListener(bc, vtfListener::addNodeViewTaskFactory, vtfListener::removeNodeViewTaskFactory, NodeViewTaskFactory.class, vtfFilter);
    registerServiceListener(bc, vtfListener::addEdgeViewTaskFactory, vtfListener::removeEdgeViewTaskFactory, EdgeViewTaskFactory.class, vtfFilter);
    registerServiceListener(bc, vtfListener::addNetworkViewTaskFactory, vtfListener::removeNetworkViewTaskFactory, NetworkViewTaskFactory.class, vtfFilter);
    registerServiceListener(bc, vtfListener::addNetworkViewLocationTaskFactory, vtfListener::removeNetworkViewLocationTaskFactory, NetworkViewLocationTaskFactory.class);
    registerServiceListener(bc, vtfListener::addCyEdgeViewContextMenuFactory, vtfListener::removeCyEdgeViewContextMenuFactory, CyEdgeViewContextMenuFactory.class);
    registerServiceListener(bc, vtfListener::addCyNodeViewContextMenuFactory, vtfListener::removeCyNodeViewContextMenuFactory, CyNodeViewContextMenuFactory.class);
    registerServiceListener(bc, vtfListener::addCyNetworkViewContextMenuFactory, vtfListener::removeCyNetworkViewContextMenuFactory, CyNetworkViewContextMenuFactory.class);
    registerServiceListener(bc, annotationFactoryManager::addAnnotationFactory, annotationFactoryManager::removeAnnotationFactory, AnnotationFactory.class);
    BendFactory bendFactory = new BendFactoryImpl();
    registerService(bc, bendFactory, BendFactory.class, new Properties());
    // Register the factory
    dVisualLexicon.addBendFactory(bendFactory, new HashMap<Object, Object>());
    // Translators for Passthrough
    final CustomGraphicsTranslator cgTranslator = new CustomGraphicsTranslator(cgManager, cg2Manager);
    registerService(bc, cgTranslator, ValueTranslator.class, new Properties());
    // Factories for Visual Property Dependency
    final NodeSizeDependencyFactory nodeSizeDependencyFactory = new NodeSizeDependencyFactory(dVisualLexicon);
    registerService(bc, nodeSizeDependencyFactory, VisualPropertyDependencyFactory.class, new Properties());
    final EdgeColorDependencyFactory edgeColorDependencyFactory = new EdgeColorDependencyFactory(dVisualLexicon);
    registerService(bc, edgeColorDependencyFactory, VisualPropertyDependencyFactory.class, new Properties());
    final CustomGraphicsSizeDependencyFactory cgSizeDependencyFactory = new CustomGraphicsSizeDependencyFactory(dVisualLexicon);
    registerService(bc, cgSizeDependencyFactory, VisualPropertyDependencyFactory.class, new Properties());
    // Custom Graphics Editors
    final CyCustomGraphicsValueEditor cgValueEditor = new CyCustomGraphicsValueEditor(cgManager, cg2Manager, cgBrowser, serviceRegistrar);
    registerAllServices(bc, cgValueEditor, new Properties());
    final CustomGraphicsVisualPropertyEditor cgVisualPropertyEditor = new CustomGraphicsVisualPropertyEditor(CyCustomGraphics.class, cgValueEditor, continuousMappingCellRendererFactory, serviceRegistrar);
    registerService(bc, cgVisualPropertyEditor, VisualPropertyEditor.class, new Properties());
}
Also used : EditAnnotationTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.EditAnnotationTaskFactory) DingVisualStyleRenderingEngineFactory(org.cytoscape.ding.impl.DingVisualStyleRenderingEngineFactory) BendFactory(org.cytoscape.view.presentation.property.values.BendFactory) ChangeAnnotationCanvasTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.ChangeAnnotationCanvasTaskFactory) CustomGraphicsSizeDependencyFactory(org.cytoscape.ding.dependency.CustomGraphicsSizeDependencyFactory) ImageAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.ImageAnnotationFactory) ViewTaskFactoryListener(org.cytoscape.ding.impl.ViewTaskFactoryListener) EdgeColorDependencyFactory(org.cytoscape.ding.dependency.EdgeColorDependencyFactory) CyCustomGraphicsValueEditor(org.cytoscape.ding.impl.editor.CyCustomGraphicsValueEditor) SelectAnnotationTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.SelectAnnotationTaskFactory) DingViewModelFactory(org.cytoscape.ding.impl.DingViewModelFactory) NVLTFActionSupport(org.cytoscape.ding.impl.NVLTFActionSupport) GroupAnnotationsTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.GroupAnnotationsTaskFactory) HandleFactoryImpl(org.cytoscape.ding.impl.HandleFactoryImpl) NetworkViewTaskFactory(org.cytoscape.task.NetworkViewTaskFactory) AddEdgeNodeViewTaskFactoryImpl(org.cytoscape.ding.impl.AddEdgeNodeViewTaskFactoryImpl) DingGraphLOD(org.cytoscape.ding.impl.DingGraphLOD) AnnotationManager(org.cytoscape.view.presentation.annotations.AnnotationManager) AddArrowTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.AddArrowTaskFactory) AnnotationManagerImpl(org.cytoscape.ding.impl.cyannotator.AnnotationManagerImpl) ObjectPositionEditor(org.cytoscape.ding.impl.editor.ObjectPositionEditor) Properties(java.util.Properties) DingThumbnailRenderingEngineFactory(org.cytoscape.ding.impl.DingThumbnailRenderingEngineFactory) TextAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.TextAnnotationFactory) BoundedTextAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.BoundedTextAnnotationFactory) LayerAnnotationTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.LayerAnnotationTaskFactory) ContinuousMappingCellRendererFactory(org.cytoscape.view.vizmap.gui.editor.ContinuousMappingCellRendererFactory) ResizeAnnotationTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.ResizeAnnotationTaskFactory) DingNavigationRenderingEngineFactory(org.cytoscape.ding.impl.DingNavigationRenderingEngineFactory) NodeSizeDependencyFactory(org.cytoscape.ding.dependency.NodeSizeDependencyFactory) HandleFactory(org.cytoscape.view.presentation.property.values.HandleFactory) GraphicsDetailAction(org.cytoscape.ding.action.GraphicsDetailAction) DingGraphLODAll(org.cytoscape.ding.impl.DingGraphLODAll) DingRenderingEngineFactory(org.cytoscape.ding.impl.DingRenderingEngineFactory) RemoveAnnotationTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.RemoveAnnotationTaskFactory) ArrowAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.ArrowAnnotationFactory) UngroupAnnotationsTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.UngroupAnnotationsTaskFactory) AddAnnotationTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.AddAnnotationTaskFactory) MoveAnnotationTaskFactory(org.cytoscape.ding.impl.cyannotator.tasks.MoveAnnotationTaskFactory) GroupAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.GroupAnnotationFactory) EdgeBendValueEditor(org.cytoscape.ding.impl.editor.EdgeBendValueEditor) DingRenderer(org.cytoscape.ding.impl.DingRenderer) ShapeAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.ShapeAnnotationFactory) BendFactoryImpl(org.cytoscape.ding.impl.BendFactoryImpl) CustomGraphicsTranslator(org.cytoscape.ding.customgraphics.CustomGraphicsTranslator) EdgeBendEditor(org.cytoscape.ding.impl.editor.EdgeBendEditor) BoundedTextAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.BoundedTextAnnotationFactory) AnnotationFactoryManager(org.cytoscape.ding.impl.cyannotator.AnnotationFactoryManager) CustomGraphicsVisualPropertyEditor(org.cytoscape.ding.impl.editor.CustomGraphicsVisualPropertyEditor)

Aggregations

Properties (java.util.Properties)1 GraphicsDetailAction (org.cytoscape.ding.action.GraphicsDetailAction)1 CustomGraphicsTranslator (org.cytoscape.ding.customgraphics.CustomGraphicsTranslator)1 CustomGraphicsSizeDependencyFactory (org.cytoscape.ding.dependency.CustomGraphicsSizeDependencyFactory)1 EdgeColorDependencyFactory (org.cytoscape.ding.dependency.EdgeColorDependencyFactory)1 NodeSizeDependencyFactory (org.cytoscape.ding.dependency.NodeSizeDependencyFactory)1 AddEdgeNodeViewTaskFactoryImpl (org.cytoscape.ding.impl.AddEdgeNodeViewTaskFactoryImpl)1 BendFactoryImpl (org.cytoscape.ding.impl.BendFactoryImpl)1 DingGraphLOD (org.cytoscape.ding.impl.DingGraphLOD)1 DingGraphLODAll (org.cytoscape.ding.impl.DingGraphLODAll)1 DingNavigationRenderingEngineFactory (org.cytoscape.ding.impl.DingNavigationRenderingEngineFactory)1 DingRenderer (org.cytoscape.ding.impl.DingRenderer)1 DingRenderingEngineFactory (org.cytoscape.ding.impl.DingRenderingEngineFactory)1 DingThumbnailRenderingEngineFactory (org.cytoscape.ding.impl.DingThumbnailRenderingEngineFactory)1 DingViewModelFactory (org.cytoscape.ding.impl.DingViewModelFactory)1 DingVisualStyleRenderingEngineFactory (org.cytoscape.ding.impl.DingVisualStyleRenderingEngineFactory)1 HandleFactoryImpl (org.cytoscape.ding.impl.HandleFactoryImpl)1 NVLTFActionSupport (org.cytoscape.ding.impl.NVLTFActionSupport)1 ViewTaskFactoryListener (org.cytoscape.ding.impl.ViewTaskFactoryListener)1 AnnotationFactoryManager (org.cytoscape.ding.impl.cyannotator.AnnotationFactoryManager)1