Search in sources :

Example 1 with SVGMutableShapeImpl

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

the class SVGShapeFactory method newSVGMutableShape.

@SuppressWarnings("unchecked")
private SVGShape<?> newSVGMutableShape(final Object instance, final SVGShapeDef shapeDef) {
    final SVGShapeViewDef mutableShapeDef = (SVGShapeViewDef) shapeDef;
    final SVGShapeView view = newSVGShapeView(instance, mutableShapeDef);
    return new SVGMutableShapeImpl<Object, SVGShapeViewDef<Object, Object>>(mutableShapeDef, (SVGShapeViewImpl) view);
}
Also used : SVGShapeViewDef(org.kie.workbench.common.stunner.svg.client.shape.def.SVGShapeViewDef) SVGMutableShapeImpl(org.kie.workbench.common.stunner.svg.client.shape.impl.SVGMutableShapeImpl) SVGShapeView(org.kie.workbench.common.stunner.svg.client.shape.view.SVGShapeView)

Example 2 with SVGMutableShapeImpl

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

the class SVGShapeFactoryTest method testSVGMutableShapeDefBuilder.

@Test
public void testSVGMutableShapeDefBuilder() {
    doAnswer(invocationOnMock -> viewFactory).when(tested).getViewFactory(eq(svgMutableShapeDef));
    final SVGShape shape = tested.newShape(definition, svgMutableShapeDef);
    assertNotNull(shape);
    assertTrue(shape instanceof SVGMutableShapeImpl);
    assertEquals(shapeViewImpl, shape.getShapeView());
}
Also used : SVGMutableShapeImpl(org.kie.workbench.common.stunner.svg.client.shape.impl.SVGMutableShapeImpl) SVGShape(org.kie.workbench.common.stunner.svg.client.shape.SVGShape) Test(org.junit.Test)

Aggregations

SVGMutableShapeImpl (org.kie.workbench.common.stunner.svg.client.shape.impl.SVGMutableShapeImpl)2 Test (org.junit.Test)1 SVGShape (org.kie.workbench.common.stunner.svg.client.shape.SVGShape)1 SVGShapeViewDef (org.kie.workbench.common.stunner.svg.client.shape.def.SVGShapeViewDef)1 SVGShapeView (org.kie.workbench.common.stunner.svg.client.shape.view.SVGShapeView)1