use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class CanvasHighlight method applyStateToShape.
private void applyStateToShape(final String uuid, final ShapeState state) {
final Shape shape = getShape(uuid);
if (null != shape) {
uuids.add(uuid);
shape.applyState(state);
}
if (ShapeState.INVALID.equals(state)) {
setInvalidCursor();
} else {
setValidCursor();
}
}
use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class CanvasHighlight method unhighLight.
public CanvasHighlight unhighLight() {
if (!uuids.isEmpty()) {
uuids.forEach(uuid -> {
final Shape shape = getShape(uuid);
if (null != shape) {
shape.applyState(ShapeState.NONE);
}
});
getCanvas().draw();
uuids.clear();
}
setValidCursor();
return this;
}
use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class SessionPreviewCanvasHandlerProxyTest method checkApplyElementMutationDelegatesToWrapped.
@Test
public void checkApplyElementMutationDelegatesToWrapped() {
final Shape shape = mock(Shape.class);
final Element candidate = mock(Element.class);
final boolean applyPosition = true;
final boolean applyProperties = false;
final MutationContext mutationContext = mock(MutationContext.class);
proxy.applyElementMutation(shape, candidate, applyPosition, applyProperties, mutationContext);
verify(wrapped).applyElementMutation(eq(shape), eq(candidate), eq(applyPosition), eq(applyProperties), eq(mutationContext));
proxy.applyElementMutation(candidate, mutationContext);
verify(wrapped).applyElementMutation(eq(candidate), eq(mutationContext));
proxy.applyElementMutation(candidate, applyPosition, applyProperties, mutationContext);
verify(wrapped).applyElementMutation(eq(candidate), eq(applyPosition), eq(applyProperties), eq(mutationContext));
}
use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandler method removeChild.
@Override
public void removeChild(final Element parent, final Element child) {
final Shape parentShape = getCanvas().getShape(parent.getUUID());
final Shape childShape = getCanvas().getShape(child.getUUID());
if (!isRenderable(parentShape, childShape)) {
return;
}
super.removeChild(parent, child);
}
use of org.kie.workbench.common.stunner.core.client.shape.Shape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandler method addChild.
@Override
public void addChild(final Element parent, final Element child) {
final Shape parentShape = getCanvas().getShape(parent.getUUID());
final Shape childShape = getCanvas().getShape(child.getUUID());
if (!isRenderable(parentShape, childShape)) {
return;
}
super.addChild(parent, child);
}
Aggregations