Search in sources :

Example 1 with EdgeBuilderControl

use of org.kie.workbench.common.stunner.core.client.canvas.controls.builder.EdgeBuilderControl 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)

Example 2 with EdgeBuilderControl

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

the class CreateConnectorActionTest method testCompleteDrag.

private void testCompleteDrag(DragProxyCallback callback) {
    // Verify drag proxy complete.
    callback.onComplete(100, 500);
    final ArgumentCaptor<EdgeBuildRequest> edgeBuildRequestArgumentCaptor = ArgumentCaptor.forClass(EdgeBuildRequest.class);
    final ArgumentCaptor<BuilderControl.BuildCallback> completeCallbackCaptor = ArgumentCaptor.forClass(BuilderControl.BuildCallback.class);
    verify(edgeBuilderControl, times(1)).build(edgeBuildRequestArgumentCaptor.capture(), completeCallbackCaptor.capture());
    final EdgeBuildRequest edgeBuildRequest = edgeBuildRequestArgumentCaptor.getValue();
    assertEquals(edge, edgeBuildRequest.getEdge());
    assertEquals(element, edgeBuildRequest.getInNode());
    assertEquals(targetNode, edgeBuildRequest.getOutNode());
    final BuilderControl.BuildCallback completeCallback = completeCallbackCaptor.getValue();
    completeCallback.onSuccess(TARGET_NODE_UUID);
    verify(edgeBuilderControl, times(1)).disable();
    verify(edgeBuilderControl, times(1)).setCommandManagerProvider(eq(null));
    verify(canvasHighlight, times(1)).destroy();
}
Also used : EdgeBuilderControl(org.kie.workbench.common.stunner.core.client.canvas.controls.builder.EdgeBuilderControl) BuilderControl(org.kie.workbench.common.stunner.core.client.canvas.controls.builder.BuilderControl) EdgeBuildRequest(org.kie.workbench.common.stunner.core.client.canvas.controls.builder.request.EdgeBuildRequest)

Aggregations

EdgeBuilderControl (org.kie.workbench.common.stunner.core.client.canvas.controls.builder.EdgeBuilderControl)2 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 BuilderControl (org.kie.workbench.common.stunner.core.client.canvas.controls.builder.BuilderControl)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 EdgeBuildRequest (org.kie.workbench.common.stunner.core.client.canvas.controls.builder.request.EdgeBuildRequest)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 ZoomControl (org.kie.workbench.common.stunner.core.client.canvas.controls.zoom.ZoomControl)1