use of org.kie.workbench.common.stunner.core.client.shape.ShapeState in project kie-wb-common by kiegroup.
the class SVGShapeImplTest method testApplyState.
@Test
public void testApplyState() {
final ShapeState state = ShapeState.SELECTED;
mocked.applyState(state);
verify(lienzoShape, times(1)).applyState(eq(state));
verify(lienzoShape, times(0)).beforeDraw();
verify(lienzoShape, times(0)).afterDraw();
verify(lienzoShape, times(0)).destroy();
}
use of org.kie.workbench.common.stunner.core.client.shape.ShapeState in project kie-wb-common by kiegroup.
the class ShapeStateAttributeHandler method reset.
@Override
public ShapeState reset() {
final ShapeState result = this.state;
newDefaultStateApplier().accept(getShapeView(), stateHolder.copy());
this.state = ShapeState.NONE;
return result;
}
use of org.kie.workbench.common.stunner.core.client.shape.ShapeState in project kie-wb-common by kiegroup.
the class AbstractElementShape method applyProperties.
@Override
public void applyProperties(final E element, final MutationContext mutationContext) {
final ShapeState shapeState = getShape().getShapeStateHandler().reset();
// Apply generic view operations.
getShapeHandlersDef().viewHandler().accept(getDefinition(element), getShapeView());
// Apply custom view operations.
applyCustomProperties(element, mutationContext);
// Apply size operations.
getShapeHandlersDef().sizeHandler().ifPresent(h -> h.accept(element.getContent(), getShapeView()));
getShape().getShapeStateHandler().shapeAttributesChanged().applyState(shapeState);
}
use of org.kie.workbench.common.stunner.core.client.shape.ShapeState in project kie-wb-common by kiegroup.
the class ShapeStateAttributeAnimationHandler method applyState.
@Override
public void applyState(final ShapeState shapeState) {
final ShapeState currentState = getShapeState();
if (!shapeState.equals(currentState)) {
if (null != animationHandle) {
animationHandle.stop();
setAnimationHandle(null);
}
handler.applyState(shapeState);
}
}
Aggregations