Search in sources :

Example 1 with ZoomControl

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

the class SessionPreviewImplTest method setup.

@Before
@SuppressWarnings("unchecked")
public void setup() {
    this.preview = new SessionPreviewImpl(definitionManager, shapeManager, textPropertyProviderFactory, canvasCommandManager, definitionUtils, graphUtils, canvasHandlerFactories, canvasCommandFactories, selectionControl, view);
    final DiagramImpl diagram = new DiagramImpl("diagram", new MetadataImpl());
    final GraphImpl graph = new GraphImpl("graph", new GraphNodeStoreImpl());
    final DefinitionSetImpl definitionSet = new DefinitionSetImpl("id");
    diagram.setGraph(graph);
    graph.setContent(definitionSet);
    definitionSet.setBounds(new BoundsImpl(new BoundImpl(0.0, 0.0), new BoundImpl(100.0, 100.0)));
    when(session.getCanvasHandler()).thenReturn(canvasHandler);
    when(session.getCanvas()).thenReturn(canvas);
    when(canvasHandler.getDiagram()).thenReturn(diagram);
    when(shapeManager.getCanvasFactory(any(Diagram.class))).thenReturn(canvasFactory);
    when(canvasFactory.newCanvas()).thenReturn(canvas);
    when(canvasFactory.newControl(eq(ZoomControl.class))).thenReturn(zoomControl);
    when(canvasHandlerFactories.select(any(Annotation.class))).thenReturn(canvasHandlerFactories);
    when(canvasHandlerFactories.get()).thenReturn(canvasHandler);
    when(canvas.getView()).thenReturn(canvasView);
    preview.open(session, callback);
}
Also used : GraphNodeStoreImpl(org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl) ZoomControl(org.kie.workbench.common.stunner.core.client.canvas.controls.zoom.ZoomControl) MetadataImpl(org.kie.workbench.common.stunner.core.diagram.MetadataImpl) DefinitionSetImpl(org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSetImpl) DiagramImpl(org.kie.workbench.common.stunner.core.diagram.DiagramImpl) GraphImpl(org.kie.workbench.common.stunner.core.graph.impl.GraphImpl) BoundImpl(org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl) BoundsImpl(org.kie.workbench.common.stunner.core.graph.content.view.BoundsImpl) Annotation(java.lang.annotation.Annotation) Diagram(org.kie.workbench.common.stunner.core.diagram.Diagram) Before(org.junit.Before)

Example 2 with ZoomControl

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

the class CaseManagementCanvasFactoryTest method testControls.

@Test
public void testControls() {
    ConnectionAcceptorControl connectionAcceptorControl = factory.newControl(ConnectionAcceptorControl.class);
    assertNotNull(connectionAcceptorControl);
    ContainmentAcceptorControl containmentAcceptorControl = factory.newControl(ContainmentAcceptorControl.class);
    assertNotNull(containmentAcceptorControl);
    DockingAcceptorControl dockingAcceptorControl = factory.newControl(DockingAcceptorControl.class);
    assertNotNull(dockingAcceptorControl);
    CanvasInPlaceTextEditorControl canvasInPlaceTextEditorControl = factory.newControl(CanvasInPlaceTextEditorControl.class);
    assertNotNull(canvasInPlaceTextEditorControl);
    SelectionControl selectionControl = factory.newControl(SelectionControl.class);
    assertNotNull(selectionControl);
    ElementBuilderControl elementBuilderControl = factory.newControl(ElementBuilderControl.class);
    assertNotNull(elementBuilderControl);
    NodeBuilderControl nodeBuilderControl = factory.newControl(NodeBuilderControl.class);
    assertNotNull(nodeBuilderControl);
    EdgeBuilderControl edgeBuilderControl = factory.newControl(EdgeBuilderControl.class);
    assertNotNull(edgeBuilderControl);
    ZoomControl zoomControl = factory.newControl(ZoomControl.class);
    assertNotNull(zoomControl);
    PanControl panControl = factory.newControl(PanControl.class);
    assertNotNull(panControl);
    KeyboardControl keyboardControl = factory.newControl(KeyboardControl.class);
    assertNotNull(keyboardControl);
}
Also used : ZoomControl(org.kie.workbench.common.stunner.core.client.canvas.controls.zoom.ZoomControl) PanControl(org.kie.workbench.common.stunner.core.client.canvas.controls.pan.PanControl) KeyboardControl(org.kie.workbench.common.stunner.core.client.canvas.controls.keyboard.KeyboardControl) EdgeBuilderControl(org.kie.workbench.common.stunner.core.client.canvas.controls.builder.EdgeBuilderControl) CaseManagementNodeBuilderControl(org.kie.workbench.common.stunner.cm.client.canvas.controls.builder.CaseManagementNodeBuilderControl) NodeBuilderControl(org.kie.workbench.common.stunner.core.client.canvas.controls.builder.NodeBuilderControl) ConnectionAcceptorControl(org.kie.workbench.common.stunner.core.client.canvas.controls.connection.ConnectionAcceptorControl) ElementBuilderControl(org.kie.workbench.common.stunner.core.client.canvas.controls.builder.ElementBuilderControl) CaseManagementElementBuilderControl(org.kie.workbench.common.stunner.cm.client.canvas.controls.builder.CaseManagementElementBuilderControl) ContainmentAcceptorControl(org.kie.workbench.common.stunner.core.client.canvas.controls.containment.ContainmentAcceptorControl) SelectionControl(org.kie.workbench.common.stunner.core.client.canvas.controls.select.SelectionControl) DockingAcceptorControl(org.kie.workbench.common.stunner.core.client.canvas.controls.docking.DockingAcceptorControl) CanvasInPlaceTextEditorControl(org.kie.workbench.common.stunner.core.client.canvas.controls.actions.CanvasInPlaceTextEditorControl) Test(org.junit.Test)

Aggregations

ZoomControl (org.kie.workbench.common.stunner.core.client.canvas.controls.zoom.ZoomControl)2 Annotation (java.lang.annotation.Annotation)1 Before (org.junit.Before)1 Test (org.junit.Test)1 CaseManagementElementBuilderControl (org.kie.workbench.common.stunner.cm.client.canvas.controls.builder.CaseManagementElementBuilderControl)1 CaseManagementNodeBuilderControl (org.kie.workbench.common.stunner.cm.client.canvas.controls.builder.CaseManagementNodeBuilderControl)1 CanvasInPlaceTextEditorControl (org.kie.workbench.common.stunner.core.client.canvas.controls.actions.CanvasInPlaceTextEditorControl)1 EdgeBuilderControl (org.kie.workbench.common.stunner.core.client.canvas.controls.builder.EdgeBuilderControl)1 ElementBuilderControl (org.kie.workbench.common.stunner.core.client.canvas.controls.builder.ElementBuilderControl)1 NodeBuilderControl (org.kie.workbench.common.stunner.core.client.canvas.controls.builder.NodeBuilderControl)1 ConnectionAcceptorControl (org.kie.workbench.common.stunner.core.client.canvas.controls.connection.ConnectionAcceptorControl)1 ContainmentAcceptorControl (org.kie.workbench.common.stunner.core.client.canvas.controls.containment.ContainmentAcceptorControl)1 DockingAcceptorControl (org.kie.workbench.common.stunner.core.client.canvas.controls.docking.DockingAcceptorControl)1 KeyboardControl (org.kie.workbench.common.stunner.core.client.canvas.controls.keyboard.KeyboardControl)1 PanControl (org.kie.workbench.common.stunner.core.client.canvas.controls.pan.PanControl)1 SelectionControl (org.kie.workbench.common.stunner.core.client.canvas.controls.select.SelectionControl)1 Diagram (org.kie.workbench.common.stunner.core.diagram.Diagram)1 DiagramImpl (org.kie.workbench.common.stunner.core.diagram.DiagramImpl)1 MetadataImpl (org.kie.workbench.common.stunner.core.diagram.MetadataImpl)1 DefinitionSetImpl (org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSetImpl)1