Search in sources :

Example 1 with DelegateShapeFactory

use of org.kie.workbench.common.stunner.core.client.shape.factory.DelegateShapeFactory in project kie-wb-common by kiegroup.

the class CaseManagementShapeFactoryTest method setup.

@Before
@SuppressWarnings("unchecked")
public void setup() {
    this.pictureShapeView = new PictureShapeView(new MultiPath().rect(0, 0, 10, 10));
    this.cmShapeViewFactory = new CaseManagementShapeViewFactory();
    final BasicShapesFactory basicShapesFactory = new BasicShapesFactory(new ShapeDefFunctionalFactory<>(), basicViewFactory);
    basicShapesFactory.init();
    final CaseManagementShapeDefFactory cmShapeDefFactory = new CaseManagementShapeDefFactory(cmShapeViewFactory, basicViewFactory, new ShapeDefFunctionalFactory<>());
    cmShapeDefFactory.init();
    this.delegate = spy(new DelegateShapeFactory());
    doReturn(glyph).when(delegate).getGlyph(anyString());
    this.factory = new CaseManagementShapeFactory(cmShapeDefFactory, basicShapesFactory, delegate);
    this.factory.init();
    when(basicViewFactory.pictureFromUri(any(SafeUri.class), anyDouble(), anyDouble())).thenReturn(pictureShapeView);
    when(basicViewFactory.connector(anyDouble(), anyDouble(), anyDouble(), anyDouble())).thenReturn(connectorShapeView);
    when(definitionManager.adapters()).thenReturn(adapterManager);
    when(adapterManager.forDefinition()).thenReturn(definitionAdapter);
}
Also used : MultiPath(com.ait.lienzo.client.core.shape.MultiPath) DelegateShapeFactory(org.kie.workbench.common.stunner.core.client.shape.factory.DelegateShapeFactory) BasicShapesFactory(org.kie.workbench.common.stunner.shapes.client.factory.BasicShapesFactory) SafeUri(com.google.gwt.safehtml.shared.SafeUri) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView) Before(org.junit.Before)

Aggregations

MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1 SafeUri (com.google.gwt.safehtml.shared.SafeUri)1 Before (org.junit.Before)1 DelegateShapeFactory (org.kie.workbench.common.stunner.core.client.shape.factory.DelegateShapeFactory)1 BasicShapesFactory (org.kie.workbench.common.stunner.shapes.client.factory.BasicShapesFactory)1 PictureShapeView (org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)1