Search in sources :

Example 1 with AbstractClientSession

use of org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientSession in project kie-wb-common by kiegroup.

the class SessionDiagramPreviewScreen method doOpenDiagram.

@Override
protected void doOpenDiagram() {
    final AbstractClientSession session = getSession();
    if (null != session) {
        newPreview(() -> sessionPreview.open(session, WIDTH, HEIGHT, new SessionViewer.SessionViewerCallback<AbstractClientSession, Diagram>() {

            @Override
            public void afterCanvasInitialized() {
            }

            @Override
            public void onSuccess() {
                LOGGER.log(FINE, "Session's preview completed for [" + session + "]");
                view.showScreenView(sessionPreview.getView());
            }

            @Override
            public void onError(final ClientRuntimeError error) {
                LOGGER.log(SEVERE, "Error while showing session preview for [" + session + "]. " + "Error=[" + error + "]");
            }
        }));
    } else {
        LOGGER.log(WARNING, "Trying to open a null session!");
    }
}
Also used : AbstractClientSession(org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientSession) ClientRuntimeError(org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError)

Example 2 with AbstractClientSession

use of org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientSession in project kie-wb-common by kiegroup.

the class BaseNavigateCommand method enableHandlers.

protected void enableHandlers(final boolean enabled) {
    final CanvasHandler handler = getCanvasHandler();
    if (handler == null) {
        return;
    }
    final Layer layer = handler.getCanvas().getLayer();
    if (enabled) {
        layer.enableHandlers();
        ((AbstractClientSession) sessionManager.getCurrentSession()).resume();
    } else {
        layer.disableHandlers();
        ((AbstractClientSession) sessionManager.getCurrentSession()).pause();
    }
}
Also used : AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) CanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler) AbstractClientSession(org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientSession) Layer(org.kie.workbench.common.stunner.core.client.canvas.Layer)

Aggregations

AbstractClientSession (org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientSession)2 AbstractCanvasHandler (org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler)1 CanvasHandler (org.kie.workbench.common.stunner.core.client.canvas.CanvasHandler)1 Layer (org.kie.workbench.common.stunner.core.client.canvas.Layer)1 ClientRuntimeError (org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError)1