public static final ShapeViewUserDataEncoder get() { return new ShapeViewUserDataEncoder(); }
public ShapeStateDefaultHandler setBackgroundShape(final Supplier<LienzoShapeView<?>> shapeSupplier) { backgroundShapeSupplier = shapeSupplier; /** * TODO: need to fix when resolution of JBPM-7681 is available * @see <a href="https://issues.jboss.org/browse/JBPM-7681">JBPM-7681</a> */ shapeViewDataEncoder.applyShapeViewType(shapeSupplier, ShapeType.BACKGROUND); return this; }
@Override public T setUUID(final String uuid) { this.uuid = uuid; ShapeViewUserDataEncoder.get().setShapeViewChildrenIds(uuid, getGroup()); WiresUtils.assertShapeUUID(this.getGroup(), uuid); return cast(); }
public void applyShapeViewRenderType(final Supplier<LienzoShapeView<?>> shapeSupplier, ShapeStateDefaultHandler.RenderType renderType) { if (Objects.isNull(renderType)) { return; } applyShapeViewUserData(shapeSupplier, "renderType", renderType.name()); }
ShapeStateDefaultHandler(final ShapeStateAttributeAnimationHandler<LienzoShapeView<?>> handler) { this.handler = handler.onComplete(this::applyShadow); this.shapeViewDataEncoder = ShapeViewUserDataEncoder.get(); setRenderType(RenderType.STROKE); }
public ShapeStateDefaultHandler setRenderType(final RenderType renderType) { handler.getAttributesHandler().useAttributes(renderType.stateAttributesProvider); /** * TODO: need to fix when resolution of JBPM-7681 is available * @see <a href="https://issues.jboss.org/browse/JBPM-7681">JBPM-7681</a> */ shapeViewDataEncoder.applyShapeViewRenderType(borderShapeSupplier, renderType); return this; }
public void setShapeViewChildrenIds(String uuid, IContainer container) { //recursive call to set children in case of container container.getChildNodes().toList().stream() .filter(Objects::nonNull) .filter(child -> child instanceof IContainer) .forEach(child -> setShapeViewChildrenIds(uuid, (IContainer) child)); //set the children ids container.getChildNodes().toList().stream() .filter(Objects::nonNull) .filter(child -> !(child instanceof IContainer)) .filter(child -> child instanceof IDrawable<?>) .forEach(child -> { IDrawable drawable = (IDrawable) child; //id == parent uuid + children userData drawable.setID(uuid + drawable.getUserData()); }); } }
public void applyShapeViewType(final Supplier<LienzoShapeView<?>> shapeSupplier, ShapeStateDefaultHandler.ShapeType shapeType) { if (Objects.isNull(shapeType)) { return; } applyShapeViewUserData(shapeSupplier, "shapeType", shapeType.name()); }
public ShapeStateDefaultHandler setContainerShape(final Supplier<LienzoShapeView<?>> shapeSupplier) { shapeViewDataEncoder.applyShapeViewType(shapeSupplier, ShapeType.CONTAINER); return this; }
public ShapeStateDefaultHandler setBorderShape(final Supplier<LienzoShapeView<?>> shapeSupplier) { handler.getAttributesHandler().setView(shapeSupplier); borderShapeSupplier = shapeSupplier; /** * TODO: need to fix when resolution of JBPM-7681 is available * @see <a href="https://issues.jboss.org/browse/JBPM-7681">JBPM-7681</a> */ shapeViewDataEncoder.applyShapeViewType(shapeSupplier, ShapeType.BORDER); return this; }