Class DecoratedShapeView<T extends WiresShapeViewExt>

  • All Implemented Interfaces:
    LienzoShapeView<T>, org.kie.workbench.common.stunner.core.client.shape.view.HasControlPoints<T>, org.kie.workbench.common.stunner.core.client.shape.view.HasDecorators<com.ait.lienzo.client.core.shape.Shape<?>>, org.kie.workbench.common.stunner.core.client.shape.view.HasDragBounds<T>, org.kie.workbench.common.stunner.core.client.shape.view.HasEventHandlers<T,​com.ait.lienzo.client.core.shape.Shape<?>>, org.kie.workbench.common.stunner.core.client.shape.view.HasFillGradient<T>, org.kie.workbench.common.stunner.core.client.shape.view.HasShadow<T>, org.kie.workbench.common.stunner.core.client.shape.view.HasSize<T>, org.kie.workbench.common.stunner.core.client.shape.view.HasTitle<T>, org.kie.workbench.common.stunner.core.client.shape.view.ShapeView<T>

    public class DecoratedShapeView<T extends WiresShapeViewExt>
    extends WiresShapeViewExt<T>
    implements org.kie.workbench.common.stunner.core.client.shape.view.HasSize<T>
    This Shape is an extension of WiresShapeViewExt, but instead of the need of a multipath instance for constructing it, which is being used for attaching the different control points to the view instance, it only requires a single Lienzo shape instance that is being wrapped by an instance of a multi-path. So the internal multi-path instance "decorates" the given shape and the others shape's children, if any, by providing a non visible square in which the different control points.

    This way any kind of path or primitive instance can be added as child for this shape and even if that instance cannot be resized or supports some control point handler, due to it's state, the already provided multi-path instance is used for these goals.

    When scaling this shape, it scales all children for fitting the given new size, and the multi-path instance is rebuild to provide the right magnets and control points.

    • Constructor Detail

      • DecoratedShapeView

        public DecoratedShapeView​(org.kie.workbench.common.stunner.core.client.shape.view.event.ViewEventType[] supportedEventTypes,
                                  WiresScalableContainer scalableContainer,
                                  com.ait.lienzo.client.core.shape.Shape<?> theShape,
                                  double width,
                                  double height)
    • Method Detail

      • getAttachableShape

        public com.ait.lienzo.client.core.shape.Shape<?> getAttachableShape()
        Specified by:
        getAttachableShape in interface org.kie.workbench.common.stunner.core.client.shape.view.HasEventHandlers<T extends WiresShapeViewExt,​com.ait.lienzo.client.core.shape.Shape<?>>
        Overrides:
        getAttachableShape in class WiresShapeViewExt<T extends WiresShapeViewExt>
      • addScalableChild

        public DecoratedShapeView addScalableChild​(com.ait.lienzo.client.core.shape.IPrimitive<?> child)
      • setSize

        public T setSize​(double width,
                         double height)
        Specified by:
        setSize in interface org.kie.workbench.common.stunner.core.client.shape.view.HasSize<T extends WiresShapeViewExt>
      • setMinWidth

        public T setMinWidth​(Double minWidth)
        Specified by:
        setMinWidth in interface org.kie.workbench.common.stunner.core.client.shape.view.HasSize<T extends WiresShapeViewExt>
      • setMaxWidth

        public T setMaxWidth​(Double maxWidth)
        Specified by:
        setMaxWidth in interface org.kie.workbench.common.stunner.core.client.shape.view.HasSize<T extends WiresShapeViewExt>
      • setMinHeight

        public T setMinHeight​(Double minHeight)
        Specified by:
        setMinHeight in interface org.kie.workbench.common.stunner.core.client.shape.view.HasSize<T extends WiresShapeViewExt>
      • setMaxHeight

        public T setMaxHeight​(Double maxHeight)
        Specified by:
        setMaxHeight in interface org.kie.workbench.common.stunner.core.client.shape.view.HasSize<T extends WiresShapeViewExt>
      • createControlHandles

        protected com.ait.lienzo.client.core.shape.wires.WiresShapeControlHandleList createControlHandles​(com.ait.lienzo.client.core.shape.wires.IControlHandle.ControlHandleType type,
                                                                                                          com.ait.lienzo.client.core.shape.wires.ControlHandleList controls)
        Overrides:
        createControlHandles in class com.ait.lienzo.client.core.shape.wires.WiresShape
      • getControls

        public org.kie.workbench.common.stunner.client.lienzo.shape.view.wires.ext.DecoratedShapeView.DecoratedWiresShapeControlHandleList getControls()
        Overrides:
        getControls in class com.ait.lienzo.client.core.shape.wires.WiresShape