private static com.ait.lienzo.client.core.image.ImageStrip.Orientation convert(final ImageStrip.Orientation orientation) { return ImageStrip.Orientation.HORIZONTAL.equals(orientation) ? com.ait.lienzo.client.core.image.ImageStrip.Orientation.HORIZONTAL : com.ait.lienzo.client.core.image.ImageStrip.Orientation.VERTICAL; }
protected void beforeDraw(final Element element, final Shape shape) { if (shape instanceof Lifecycle) { final Lifecycle lifecycle = (Lifecycle) shape; lifecycle.beforeDraw(); } }
@Override public IsElement render(final ImageStripGlyph glyph, final double width, final double height) { final ImageStrip strip = stripRegistry.get(glyph.getStripType()); final int index = glyph.getIndex(); final boolean isHorizontal = ImageStrip.Orientation.HORIZONTAL.equals(strip.getOrientation()); final int clipX = isHorizontal ? (strip.getWide() + strip.getPadding()) * index : 0; final int clipY = !isHorizontal ? (strip.getHigh() + strip.getPadding()) * index : 0; final WidgetElementRendererView view = views.get(); strip.getCss().getCssResource().ensureInjected(); view.setWidget(panelBuilder.apply(strip.getCss().getClassName(), new Integer[]{clipX, clipY * -1})); return view; }
@Override @SuppressWarnings("unchecked") public void addChild(final S child, final Layout layout) { final V view = getCompositeShapeView(); children.add(child); view.addChild(child.getShapeView(), layout); }
@Override @SuppressWarnings("unchecked") public void addChild(final S child, final Layout layout) { final HasChildren<ShapeView<?>> view = (HasChildren<ShapeView<?>>) getShapeView(); view.addChild(child.getShapeView(), layout); children.add(child); }
@Override @SuppressWarnings("unchecked") public void removeChild(final S child) { final HasChildren<ShapeView<?>> view = (HasChildren<ShapeView<?>>) getShapeView(); view.removeChild(child.getShapeView()); children.remove(child); }
@Override @SuppressWarnings("unchecked") public void removeChild(final S child) { final V view = getCompositeShapeView(); children.remove(child); view.removeChild(child.getShapeView()); }
private boolean isConnector(Shape<?> shape) { return shape.getShapeView() instanceof IsConnector; }
private void drawEdge() { if (inEdge.getContent() instanceof ViewConnector) { final ViewConnector viewConnector = (ViewConnector) inEdge.getContent(); final MagnetConnection[] connections = createShapeConnections(); viewConnector.setSourceConnection(connections[0]); viewConnector.setTargetConnection(connections[1]); } NodeDragProxyImpl.this.transientEdgeShape.applyConnections(inEdge, edgeSourceNodeShape.getShapeView(), nodeShape.getShapeView(), MutationContext.STATIC); }
@Override public Group render(final ImageStripGlyph glyph, final double width, final double height) { final Group group = new Group(); final Image image = imageBuilder.apply(ImageStripRegistry.getName(glyph.getStripType()), glyph.getIndex()); scaleShape(image, width, height); group.add(image); return group; }
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(); } }
private static boolean isStateHighlight(ShapeState state) { return ShapeState.HIGHLIGHT.equals(state); } }
public ServiceTaskShapeDef(final Supplier<WorkItemDefinitionRegistry> workItemDefinitionRegistry) { this(workItemDefinitionRegistry, data -> ImageDataUriGlyph.create(() -> data)); }
protected void afterDraw(final Element element, final Shape shape) { if (shape instanceof Lifecycle) { final Lifecycle lifecycle = (Lifecycle) shape; lifecycle.afterDraw(); } }
public static ImageStripGlyph create(final Class<? extends ImageStrip> stripType, final int index) { return new ImageStripGlyph(stripType, index); }
public static ImageDataUriGlyph create(final SafeUri uri) { return new ImageDataUriGlyph(uri); }
private boolean supportsControlPoints(Shape<?> shape) { return shape.getShapeView() instanceof HasControlPoints; }
private static boolean isStateSelected(ShapeState state) { return ShapeState.SELECTED.equals(state); }