Search in sources :

Example 1 with PolyLineConnectorFactory

use of org.kie.workbench.common.stunner.shapes.client.factory.PolyLineConnectorFactory in project kie-wb-common by kiegroup.

the class PolyLineConnectorViewTest method testCreateLine.

@Test
public void testCreateLine() {
    double[] points = new double[] { 0, 0, 10, 10 };
    PolyLineConnectorFactory factory = new PolyLineConnectorFactory();
    Object[] line = PolylineConnectorView.createLine(factory, points);
    MultiPathDecorator head = (MultiPathDecorator) line[1];
    MultiPath headPath = head.getPath();
    BoundingBox headBoundingBox = headPath.getBoundingBox();
    MultiPathDecorator tail = (MultiPathDecorator) line[2];
    MultiPath tailPath = tail.getPath();
    BoundingBox tailBoundingBox = tailPath.getBoundingBox();
    assertEquals(0, headBoundingBox.getWidth(), 0);
    assertEquals(0, headBoundingBox.getHeight(), 0);
    assertNotEquals(0, tailBoundingBox.getWidth(), 0);
    assertNotEquals(0, tailBoundingBox.getHeight(), 0);
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) BoundingBox(com.ait.lienzo.client.core.types.BoundingBox) PolyLineConnectorFactory(org.kie.workbench.common.stunner.shapes.client.factory.PolyLineConnectorFactory) MultiPathDecorator(com.ait.lienzo.client.core.shape.MultiPathDecorator) Test(org.junit.Test)

Aggregations

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