Search in sources :

Example 6 with MultiPathDecorator

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

the class AuthorityRequirementView 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_RADIUS, -DECORATOR_RADIUS).circle(DECORATOR_RADIUS).setFillColor(ColorName.BLACK).setFillAlpha(1);
    final DirectionalLine line = new DirectionalLine(x1, y1, x2, y2);
    line.setDashArray(new DashArray(4, 4));
    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) DashArray(com.ait.lienzo.client.core.types.DashArray)

Example 7 with MultiPathDecorator

use of com.ait.lienzo.client.core.shape.MultiPathDecorator 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)

Aggregations

MultiPath (com.ait.lienzo.client.core.shape.MultiPath)7 MultiPathDecorator (com.ait.lienzo.client.core.shape.MultiPathDecorator)7 DashArray (com.ait.lienzo.client.core.types.DashArray)3 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)2 Test (org.junit.Test)2 OrthogonalPolyLineConnectorFactory (org.kie.workbench.common.stunner.shapes.client.factory.OrthogonalPolyLineConnectorFactory)1 PolyLineConnectorFactory (org.kie.workbench.common.stunner.shapes.client.factory.PolyLineConnectorFactory)1