Search in sources :

Example 1 with OrthogonalPolyLineConnectorFactory

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

the class OrthogonalPolyLineConnectorViewTest method testCreateLine.

@Test
public void testCreateLine() {
    double[] points = new double[] { 0, 0, 10, 10 };
    OrthogonalPolyLineConnectorFactory factory = new OrthogonalPolyLineConnectorFactory();
    Object[] line = PolylineConnectorView.createLine(factory, ConnectorShapeDef.Direction.ONE, 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) OrthogonalPolyLineConnectorFactory(org.kie.workbench.common.stunner.shapes.client.factory.OrthogonalPolyLineConnectorFactory) BoundingBox(com.ait.lienzo.client.core.types.BoundingBox) 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 OrthogonalPolyLineConnectorFactory (org.kie.workbench.common.stunner.shapes.client.factory.OrthogonalPolyLineConnectorFactory)1