Search in sources :

Example 1 with SVGPrimitiveShape

use of org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape in project kie-wb-common by kiegroup.

the class DecisionServiceDividerLineTest method testAsSVGPrimitiveShape.

@Test
public void testAsSVGPrimitiveShape() {
    final SVGPrimitiveShape primitiveShape = line.asSVGPrimitiveShape();
    assertThat(primitiveShape.get().isDraggable()).isTrue();
}
Also used : SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape) Test(org.junit.Test)

Example 2 with SVGPrimitiveShape

use of org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape in project kie-wb-common by kiegroup.

the class SVGBasicShapeViewImplTest method setup.

@Before
public void setup() throws Exception {
    this.parent = new SVGContainer("parent", new Group().setID("parent"), false, null);
    rectangle = new Rectangle(10d, 10d);
    this.shape = new SVGPrimitiveShape(rectangle);
    this.childShape = new SVGPrimitiveShape(new Rectangle(10d, 10d));
    this.child = new SVGBasicShapeViewImpl("svgChild1", childShape, 50d, 23d);
    this.tested = new SVGBasicShapeViewImpl("svg-test1", shape, 100, 340);
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) SVGContainer(org.kie.workbench.common.stunner.svg.client.shape.view.SVGContainer) SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape) Rectangle(com.ait.lienzo.client.core.shape.Rectangle) Before(org.junit.Before)

Example 3 with SVGPrimitiveShape

use of org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape in project kie-wb-common by kiegroup.

the class SVGChildViewHandlerTest method testAddChild.

@Test
public void testAddChild() {
    primitiveShape = new SVGPrimitiveShape(rectangle);
    tested.addChild(primitiveShape);
    verify(shapeView, times(1)).addChild(eq(rectangle));
    assertEquals(1, tested.getChildren().size());
    assertEquals(primitiveShape, tested.getChildren().iterator().next());
}
Also used : SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape) Test(org.junit.Test)

Example 4 with SVGPrimitiveShape

use of org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape in project kie-wb-common by kiegroup.

the class DecisionServiceDividerLine method asSVGPrimitiveShape.

SVGPrimitiveShape asSVGPrimitiveShape() {
    final SVGPrimitiveShape divider = SVGPrimitiveFactory.newSVGPrimitiveShape(this, false, null);
    divider.setDragEnabled(true);
    return divider;
}
Also used : SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape)

Example 5 with SVGPrimitiveShape

use of org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape in project kie-wb-common by kiegroup.

the class SVGShapeViewImplTest method setup.

@Before
public void setup() throws Exception {
    this.parent = new SVGContainer("parent", new Group().setID("parent"), false, null);
    rectangle = new Rectangle(10d, 10d);
    this.childShape = new SVGPrimitiveShape(new Rectangle(10d, 10d));
    this.child = new SVGBasicShapeViewImpl("svgChild1", childShape, 50d, 23d);
    this.shape = new SVGPrimitiveShape(rectangle);
    this.tested = new SVGShapeViewImpl("svg-test1", shape, 100, 340, false);
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) SVGContainer(org.kie.workbench.common.stunner.svg.client.shape.view.SVGContainer) SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape) Rectangle(com.ait.lienzo.client.core.shape.Rectangle) Before(org.junit.Before)

Aggregations

SVGPrimitiveShape (org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape)7 Test (org.junit.Test)4 Group (com.ait.lienzo.client.core.shape.Group)2 Rectangle (com.ait.lienzo.client.core.shape.Rectangle)2 Before (org.junit.Before)2 SVGContainer (org.kie.workbench.common.stunner.svg.client.shape.view.SVGContainer)2