Search in sources :

Example 41 with WiresShape

use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.

the class ShapeViewDragProxyImpl method show.

@Override
public DragProxy<AbstractCanvas, ShapeView<?>, DragProxyCallback> show(final ShapeView<?> item, final int x, final int y, final DragProxyCallback callback) {
    final AbstractDragProxy.Callback c = new AbstractDragProxy.Callback() {

        @Override
        public void onStart(final int x, final int y) {
            callback.onStart(x, y);
        }

        @Override
        public void onMove(final int x, final int y) {
            callback.onMove(x, y);
        }

        @Override
        public void onComplete(final int x, final int y) {
            callback.onComplete(x, y);
        }
    };
    if (item instanceof WiresShape) {
        final WiresShape wiresShape = (WiresShape) item;
        this.proxy = new WiresShapeDragProxy(getLayer().getLienzoLayer(), wiresShape, x, y, 100, c);
    } else if (item instanceof WiresConnector) {
        final WiresConnector wiresConnector = (WiresConnector) item;
        this.proxy = new WiresConnectorDragProxy(getLayer().getLienzoLayer(), wiresConnector, x, y, 100, c);
    }
    return this;
}
Also used : AbstractDragProxy(org.kie.workbench.common.stunner.lienzo.primitive.AbstractDragProxy) WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) WiresConnector(com.ait.lienzo.client.core.shape.wires.WiresConnector) DragProxyCallback(org.kie.workbench.common.stunner.core.client.components.drag.DragProxyCallback) WiresConnectorDragProxy(org.kie.workbench.common.stunner.lienzo.primitive.WiresConnectorDragProxy) WiresShapeDragProxy(org.kie.workbench.common.stunner.lienzo.primitive.WiresShapeDragProxy)

Example 42 with WiresShape

use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.

the class LienzoLayerUtilsTest method registerShape.

private WiresShape registerShape(final String expectedUUID) {
    final Shape path = new MultiPath();
    final WiresShape ws = new WiresShape((MultiPath) path);
    WiresUtils.assertShapeUUID(ws.getContainer(), expectedUUID);
    return ws;
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) Shape(com.ait.lienzo.client.core.shape.Shape) WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape)

Example 43 with WiresShape

use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.

the class CanvasView method undock.

@Override
public AbstractCanvas.View undock(final ShapeView<?> target, final ShapeView<?> child) {
    final WiresShape targetShape = (WiresShape) target;
    final WiresShape childShape = (WiresShape) child;
    return undock(targetShape, childShape);
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape)

Example 44 with WiresShape

use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.

the class CanvasViewTest method testUndock.

@Test
@SuppressWarnings("unchecked")
public void testUndock() {
    final WiresShape wiresShape = mock(WiresShape.class);
    final WiresShape targetWiresShape = mock(WiresShape.class);
    tested.undock(targetWiresShape, wiresShape);
    verify(targetWiresShape, times(1)).remove(eq(wiresShape));
    verify(wiresShape, times(1)).setDockedTo((WiresContainer) isNull());
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) Test(org.junit.Test)

Example 45 with WiresShape

use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.

the class CanvasViewTest method testDock.

@Test
@SuppressWarnings("unchecked")
public void testDock() {
    final WiresShape wiresShape = mock(WiresShape.class);
    final WiresShape parentWiresShape = mock(WiresShape.class);
    tested.dockShape(parentWiresShape, wiresShape);
    verify(parentWiresShape, times(1)).add(eq(wiresShape));
    verify(wiresShape, times(1)).setDockedTo(eq(parentWiresShape));
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) Test(org.junit.Test)

Aggregations

WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)58 Test (org.junit.Test)14 Point2D (com.ait.lienzo.client.core.types.Point2D)11 WiresConnector (com.ait.lienzo.client.core.shape.wires.WiresConnector)9 WiresContainer (com.ait.lienzo.client.core.shape.wires.WiresContainer)7 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)6 WiresManager (com.ait.lienzo.client.core.shape.wires.WiresManager)4 PickerPart (com.ait.lienzo.client.core.shape.wires.PickerPart)3 IContainmentAcceptor (com.ait.lienzo.client.core.shape.wires.IContainmentAcceptor)2 WiresConnection (com.ait.lienzo.client.core.shape.wires.WiresConnection)2 WiresLayer (com.ait.lienzo.client.core.shape.wires.WiresLayer)2 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)2 AbstractCaseManagementShape (org.kie.workbench.common.stunner.cm.client.wires.AbstractCaseManagementShape)2 MockCaseManagementShape (org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape)2 Node (org.kie.workbench.common.stunner.core.graph.Node)2 Group (com.ait.lienzo.client.core.shape.Group)1 Layer (com.ait.lienzo.client.core.shape.Layer)1 Shape (com.ait.lienzo.client.core.shape.Shape)1 IDockingAcceptor (com.ait.lienzo.client.core.shape.wires.IDockingAcceptor)1 ILayoutHandler (com.ait.lienzo.client.core.shape.wires.ILayoutHandler)1