use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandler method applyElementMutation.
@Override
public void applyElementMutation(final Element candidate, final boolean applyPosition, final boolean applyProperties, final MutationContext mutationContext) {
final Shape candidateShape = getCanvas().getShape(candidate.getUUID());
if (!isRenderable(candidateShape)) {
return;
}
super.applyElementMutation(candidate, applyPosition, applyProperties, mutationContext);
}
use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandler method addChild.
@SuppressWarnings("unchecked")
public void addChild(final Element parent, final Element child, final int index) {
final Shape parentShape = getCanvas().getShape(parent.getUUID());
final Shape childShape = getCanvas().getShape(child.getUUID());
if (!isRenderable(parentShape, childShape)) {
return;
}
final CaseManagementCanvasPresenter caseManagementCanvasPresenter = (CaseManagementCanvasPresenter) getCanvas();
caseManagementCanvasPresenter.addChildShape(parentShape, childShape, index);
}
use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class CaseManagementShapeDefFactoryTest method testBuilders.
@Test
public void testBuilders() {
final Shape nullShape = tested.newShape(mock(BPMNDefinition.class), new NullShapeDef());
assertNotNull(nullShape);
assertTrue(nullShape instanceof NullShape);
final Shape diagramShape = tested.newShape(new CaseManagementDiagram.CaseManagementDiagramBuilder().build(), new CaseManagementDiagramShapeDef());
assertNotNull(diagramShape);
assertTrue(diagramShape instanceof CMContainerShape);
final Shape subprocessShape = tested.newShape(new AdHocSubprocess.AdHocSubprocessBuilder().build(), new CaseManagementSubprocessShapeDef());
assertNotNull(subprocessShape);
assertTrue(subprocessShape instanceof CMContainerShape);
final Shape activityShape = tested.newShape(new UserTask.UserTaskBuilder().build(), new CaseManagementTaskShapeDef());
assertNotNull(activityShape);
assertTrue(activityShape instanceof ActivityShape);
final Shape activityShape2 = tested.newShape(new ReusableSubprocess.ReusableSubprocessBuilder().build(), new CaseManagementReusableSubprocessTaskShapeDef());
assertNotNull(activityShape2);
assertTrue(activityShape2 instanceof ActivityShape);
}
use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class DelegateShapeFactoryTest method testDelegate2.
@Test
@SuppressWarnings("unchecked")
public void testDelegate2() {
final String definition2Id = BindableAdapterUtils.getDefinitionId(Definition2.class);
tested.delegate(Definition2.class, shapeDef2, () -> shapeDefFactoryStub);
final Shape shape = tested.newShape(definition2);
assertNotNull(shape);
assertEquals(shape2, shape);
final ShapeGlyph glyph = (ShapeGlyph) tested.getGlyph(definition2Id);
assertNotNull(glyph);
assertEquals(definition2Id, glyph.getDefinitionId());
assertEquals(tested, glyph.getFactorySupplier().get());
}
use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class DelegateShapeFactoryTest method testDelegate1.
@Test
@SuppressWarnings("unchecked")
public void testDelegate1() {
final String definition1Id = BindableAdapterUtils.getDefinitionId(Definition1.class);
tested.delegate(Definition1.class, shapeDef1, () -> shapeDefFactoryStub);
final Shape shape = tested.newShape(definition1);
assertNotNull(shape);
assertEquals(shape1, shape);
final ShapeGlyph glyph = (ShapeGlyph) tested.getGlyph(definition1Id);
assertNotNull(glyph);
assertEquals(definition1Id, glyph.getDefinitionId());
assertEquals(tested, glyph.getFactorySupplier().get());
}
Aggregations