Search in sources :

Example 1 with WiresLayer

use of org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresLayer in project kie-wb-common by kiegroup.

the class LienzoCanvasExportTest method testWiresLayerBoundsProvider.

@Test
public void testWiresLayerBoundsProvider() {
    layer = new Layer();
    when(lienzoLayer.getLienzoLayer()).thenReturn(layer);
    WiresManager wiresManager = WiresManager.get(layer);
    com.ait.lienzo.client.core.shape.wires.WiresLayer wiresLayer = wiresManager.getLayer();
    wiresLayer.add(new WiresShape(new MultiPath().rect(0, 0, 50, 50)).setLocation(new Point2D(12, 44)));
    wiresLayer.add(new WiresShape(new MultiPath().rect(0, 0, 100, 150)).setLocation(new Point2D(1, 3)));
    LienzoCanvasExport.WiresLayerBoundsProvider provider = new LienzoCanvasExport.WiresLayerBoundsProvider();
    int[] size0 = provider.compute(lienzoLayer, CanvasExportSettings.build());
    assertEquals(0, size0[0]);
    assertEquals(0, size0[1]);
    assertEquals(151, size0[2]);
    assertEquals(203, size0[3]);
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) Layer(com.ait.lienzo.client.core.shape.Layer) WiresLayer(org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresLayer) WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) Point2D(com.ait.lienzo.client.core.types.Point2D) WiresManager(com.ait.lienzo.client.core.shape.wires.WiresManager) Test(org.junit.Test)

Example 2 with WiresLayer

use of org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresLayer in project kie-wb-common by kiegroup.

the class SessionPreviewImplTest method testCompleteRequest.

@Test
public void testCompleteRequest() {
    checkCanvasHandler(false, (c) -> {
        WiresLayer layer = mock(WiresLayer.class);
        when(canvasView.getLayer()).thenReturn(layer);
        preview.init();
        preview.complete();
        verify(layer, times(1)).setSkipDraw(eq(false));
    });
}
Also used : WiresLayer(org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresLayer) AbstractCanvasHandlerViewerTest(org.kie.workbench.common.stunner.client.widgets.presenters.AbstractCanvasHandlerViewerTest) Test(org.junit.Test)

Example 3 with WiresLayer

use of org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresLayer in project kie-wb-common by kiegroup.

the class SessionPreviewImplTest method testStartRequest.

@Test
public void testStartRequest() {
    checkCanvasHandler(false, (c) -> {
        WiresLayer layer = mock(WiresLayer.class);
        when(canvasView.getLayer()).thenReturn(layer);
        preview.init();
        preview.start();
        verify(layer, times(1)).setSkipDraw(eq(true));
    });
}
Also used : WiresLayer(org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresLayer) AbstractCanvasHandlerViewerTest(org.kie.workbench.common.stunner.client.widgets.presenters.AbstractCanvasHandlerViewerTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 WiresLayer (org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresLayer)3 AbstractCanvasHandlerViewerTest (org.kie.workbench.common.stunner.client.widgets.presenters.AbstractCanvasHandlerViewerTest)2 Layer (com.ait.lienzo.client.core.shape.Layer)1 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1 WiresManager (com.ait.lienzo.client.core.shape.wires.WiresManager)1 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1