Search in sources :

Example 1 with BaseCanvasHandler

use of org.kie.workbench.common.stunner.core.client.canvas.BaseCanvasHandler in project kie-wb-common by kiegroup.

the class SessionPreviewImpl method getCanvasHandler.

BaseCanvasHandler getCanvasHandler() {
    if (canvasHandler == null) {
        BaseCanvasHandler handler;
        final String defSetId = getDiagram().getMetadata().getDefinitionSetId();
        final Annotation qualifier = definitionUtils.getQualifier(defSetId);
        final ManagedInstance<BaseCanvasHandler> customInstances = canvasHandlerFactories.select(qualifier);
        if (customInstances.isUnsatisfied()) {
            handler = canvasHandlerFactories.select(DefinitionManager.DEFAULT_QUALIFIER).get();
        } else {
            handler = customInstances.get();
        }
        canvasHandler = new SessionPreviewCanvasHandlerProxy(handler, definitionManager, graphUtils, shapeManager, textPropertyProviderFactory);
    }
    return canvasHandler;
}
Also used : BaseCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.BaseCanvasHandler) Annotation(java.lang.annotation.Annotation)

Example 2 with BaseCanvasHandler

use of org.kie.workbench.common.stunner.core.client.canvas.BaseCanvasHandler in project kie-wb-common by kiegroup.

the class SessionPreviewImpl method onOpen.

@SuppressWarnings("unchecked")
private void onOpen(final Diagram diagram) {
    final Annotation qualifier = definitionUtils.getQualifier(diagram.getMetadata().getDefinitionSetId());
    final BaseCanvasHandler delegate = InstanceUtils.lookup(canvasHandlers, qualifier);
    canvas = InstanceUtils.lookup(canvases, qualifier);
    canvasPanel = InstanceUtils.lookup(canvasPanels, qualifier);
    canvasHandler = new SessionPreviewCanvasHandlerProxy(delegate, definitionUtils.getDefinitionManager(), graphUtils, shapeManager, textPropertyProviderFactory);
    mediatorsControl = InstanceUtils.lookup(mediatorControls, qualifier);
    selectionControl = InstanceUtils.lookup(selectionControls, qualifier);
    commandFactory = InstanceUtils.lookup(canvasCommandFactories, qualifier);
    commandManager = InstanceUtils.lookup(canvasCommandManagers, qualifier);
}
Also used : BaseCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.BaseCanvasHandler) Annotation(java.lang.annotation.Annotation)

Aggregations

Annotation (java.lang.annotation.Annotation)2 BaseCanvasHandler (org.kie.workbench.common.stunner.core.client.canvas.BaseCanvasHandler)2