Search in sources :

Example 31 with MultiPath

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

the class InformationRequirementView method createLine.

private static Object[] createLine(final double x1, final double y1, final double x2, final double y2) {
    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 DirectionalLine line = new DirectionalLine(x1, y1, x2, y2);
    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)

Example 32 with MultiPath

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

the class WiresCanvasViewTest method testDeleteRoot.

@Test
public void testDeleteRoot() {
    WiresShapeView shapeView = new WiresShapeView(new MultiPath().rect(0, 0, 50, 50));
    tested.deleteRoot(shapeView);
    verify(wiresLayer, times(1)).delete(eq(shapeView.getGroup()));
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) WiresShapeView(org.kie.workbench.common.stunner.client.lienzo.shape.view.wires.WiresShapeView) Test(org.junit.Test)

Example 33 with MultiPath

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

the class WiresCanvasViewTest method testDelete.

@Test
public void testDelete() {
    WiresShapeView shapeView = new WiresShapeView(new MultiPath().rect(0, 0, 50, 50));
    tested.delete(shapeView);
    verify(wiresLayer, times(1)).delete(eq(shapeView));
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) WiresShapeView(org.kie.workbench.common.stunner.client.lienzo.shape.view.wires.WiresShapeView) Test(org.junit.Test)

Example 34 with MultiPath

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

the class WiresCanvasViewTest method testAddChild.

@Test
public void testAddChild() {
    WiresShapeView parent = new WiresShapeView(new MultiPath().rect(0, 0, 50, 50));
    WiresShapeView child = new WiresShapeView(new MultiPath().rect(0, 0, 50, 50));
    tested.addChild(parent, child);
    verify(wiresLayer, times(1)).addChild(eq(parent), eq(child));
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) WiresShapeView(org.kie.workbench.common.stunner.client.lienzo.shape.view.wires.WiresShapeView) Test(org.junit.Test)

Example 35 with MultiPath

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

the class WiresCanvasViewTest method testDeleteChild.

@Test
public void testDeleteChild() {
    WiresShapeView parent = new WiresShapeView(new MultiPath().rect(0, 0, 50, 50));
    WiresShapeView child = new WiresShapeView(new MultiPath().rect(0, 0, 50, 50));
    tested.deleteChild(parent, child);
    verify(wiresLayer, times(1)).deleteChild(eq(parent), eq(child));
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) WiresShapeView(org.kie.workbench.common.stunner.client.lienzo.shape.view.wires.WiresShapeView) Test(org.junit.Test)

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