Search in sources :

Example 21 with MultiPath

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

the class WiresUtilsTest method isWiresShapeWhenRegisteredWiresShape.

@Test
public void isWiresShapeWhenRegisteredWiresShape() {
    final WiresShape ws = new WiresShape(new MultiPath());
    WiresUtils.assertShapeGroup(ws.getContainer(), WiresCanvas.WIRES_CANVAS_GROUP_ID);
    assertTrue(WiresUtils.isWiresShape(ws));
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) MultiPath(com.ait.lienzo.client.core.shape.MultiPath) Test(org.junit.Test)

Example 22 with MultiPath

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

the class WiresUtilsTest method isWiresShapeWhenUnregisteredWiresShape.

@Test
public void isWiresShapeWhenUnregisteredWiresShape() {
    final WiresShape ws = new WiresShape(new MultiPath());
    assertFalse(WiresUtils.isWiresShape(ws));
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) MultiPath(com.ait.lienzo.client.core.shape.MultiPath) Test(org.junit.Test)

Example 23 with MultiPath

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

the class WiresUtilsTest method isWiresLayerWhenWiresShape.

@Test
public void isWiresLayerWhenWiresShape() {
    final WiresShape ws = new WiresShape(new MultiPath());
    assertFalse(WiresUtils.isWiresLayer(ws));
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) MultiPath(com.ait.lienzo.client.core.shape.MultiPath) Test(org.junit.Test)

Example 24 with MultiPath

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

the class CaseManagementCanvasHandlerTest method makeShape.

@SuppressWarnings("unchecked")
private ActivityShape makeShape() {
    final CaseManagementTaskShapeDef shapeDef = new CaseManagementTaskShapeDef();
    final ActivityView shapeView = new ActivityView(10.0, 20.0);
    final ActivityShape shape = new ActivityShape(shapeDef, new PictureShapeView(new MultiPath()), shapeView);
    return shape;
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) CaseManagementTaskShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementTaskShapeDef) ActivityShape(org.kie.workbench.common.stunner.cm.client.shape.ActivityShape) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)

Example 25 with MultiPath

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

the class AbstractConnectorView method createLine.

static Object[] createLine(LineConnectorFactory lineFactory, final double... points) {
    // The head decorator must be not visible, as connectors are unidirectional.
    final MultiPath head = new MultiPath();
    final MultiPath tail = new MultiPath().M(DECORATOR_WIDTH, DECORATOR_HEIGHT).L(0, DECORATOR_HEIGHT).L(DECORATOR_WIDTH / 2, 0).Z().setFillColor(ColorName.BLACK).setFillAlpha(1);
    final AbstractDirectionalMultiPointShape<?> line = lineFactory.createLine(Point2DArray.fromArrayOfDouble(points));
    line.setDraggable(true);
    line.setSelectionStrokeOffset(SELECTION_OFFSET);
    line.setHeadOffset(head.getBoundingBox().getHeight());
    line.setTailOffset(tail.getBoundingBox().getHeight());
    final MultiPathDecorator headDecorator = new MultiPathDecorator(head);
    final MultiPathDecorator tailDecorator = new MultiPathDecorator(tail);
    return new Object[] { line, headDecorator, tailDecorator };
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) MultiPathDecorator(com.ait.lienzo.client.core.shape.MultiPathDecorator)

Aggregations

MultiPath (com.ait.lienzo.client.core.shape.MultiPath)39 Test (org.junit.Test)16 WiresShapeView (org.kie.workbench.common.stunner.client.lienzo.shape.view.wires.WiresShapeView)10 MultiPathDecorator (com.ait.lienzo.client.core.shape.MultiPathDecorator)9 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)9 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)7 Point2D (com.ait.lienzo.client.core.types.Point2D)7 Point2DArray (com.ait.lienzo.client.core.types.Point2DArray)4 Before (org.junit.Before)4 Layer (com.ait.lienzo.client.core.shape.Layer)3 PickerPart (com.ait.lienzo.client.core.shape.wires.PickerPart)3 DashArray (com.ait.lienzo.client.core.types.DashArray)3 PictureShapeView (org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)3 Group (com.ait.lienzo.client.core.shape.Group)2 WiresConnection (com.ait.lienzo.client.core.shape.wires.WiresConnection)2 WiresConnector (com.ait.lienzo.client.core.shape.wires.WiresConnector)2 WiresMagnet (com.ait.lienzo.client.core.shape.wires.WiresMagnet)2 NFastArrayList (com.ait.tooling.nativetools.client.collection.NFastArrayList)2 SafeUri (com.google.gwt.safehtml.shared.SafeUri)2 Edge (org.kie.workbench.common.stunner.core.graph.Edge)2