Search in sources :

Example 1 with DecoratorItem

use of org.kie.workbench.common.stunner.lienzo.toolbox.items.DecoratorItem in project kie-wb-common by kiegroup.

the class ButtonGridItemImpl method decorateGrid.

@Override
public ButtonGridItemImpl decorateGrid(final DecoratorItem<?> decorator) {
    removeDecoratorHandlers();
    toolbox.decorate(decorator);
    if (decorator instanceof AbstractDecoratorItem) {
        final AbstractDecoratorItem instance = (AbstractDecoratorItem) decorator;
        decoratorHandlers[0] = instance.asPrimitive().setListening(true).addNodeMouseEnterHandler(event -> itemFocusCallback.execute());
        decoratorHandlers[1] = instance.asPrimitive().addNodeMouseExitHandler(event -> itemUnFocusCallback.execute());
        registrations().register(decoratorHandlers[0]);
        registrations().register(decoratorHandlers[1]);
    }
    return this;
}
Also used : NodeMouseClickHandler(com.ait.lienzo.client.core.event.NodeMouseClickHandler) MultiPath(com.ait.lienzo.client.core.shape.MultiPath) Iterator(java.util.Iterator) NodeDragMoveHandler(com.ait.lienzo.client.core.event.NodeDragMoveHandler) DecoratorItem(org.kie.workbench.common.stunner.lienzo.toolbox.items.DecoratorItem) Point2DGrid(org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid) AbstractDecoratorItem(org.kie.workbench.common.stunner.lienzo.toolbox.items.AbstractDecoratorItem) Shape(com.ait.lienzo.client.core.shape.Shape) Group(com.ait.lienzo.client.core.shape.Group) AbstractPrimitiveItem(org.kie.workbench.common.stunner.lienzo.toolbox.items.AbstractPrimitiveItem) Supplier(java.util.function.Supplier) AbstractDecoratedItem(org.kie.workbench.common.stunner.lienzo.toolbox.items.AbstractDecoratedItem) HandlerRegistration(com.google.gwt.event.shared.HandlerRegistration) DecoratedItem(org.kie.workbench.common.stunner.lienzo.toolbox.items.DecoratedItem) Point2D(com.ait.lienzo.client.core.types.Point2D) HandlerRegistrationManager(com.ait.tooling.nativetools.client.event.HandlerRegistrationManager) NodeDragEndHandler(com.ait.lienzo.client.core.event.NodeDragEndHandler) BiConsumer(java.util.function.BiConsumer) Direction(com.ait.lienzo.shared.core.types.Direction) NodeDragStartHandler(com.ait.lienzo.client.core.event.NodeDragStartHandler) BoundingBox(com.ait.lienzo.client.core.types.BoundingBox) Timer(com.google.gwt.user.client.Timer) ButtonGridItem(org.kie.workbench.common.stunner.lienzo.toolbox.items.ButtonGridItem) Command(org.uberfire.mvp.Command) AbstractDecoratorItem(org.kie.workbench.common.stunner.lienzo.toolbox.items.AbstractDecoratorItem)

Aggregations

NodeDragEndHandler (com.ait.lienzo.client.core.event.NodeDragEndHandler)1 NodeDragMoveHandler (com.ait.lienzo.client.core.event.NodeDragMoveHandler)1 NodeDragStartHandler (com.ait.lienzo.client.core.event.NodeDragStartHandler)1 NodeMouseClickHandler (com.ait.lienzo.client.core.event.NodeMouseClickHandler)1 Group (com.ait.lienzo.client.core.shape.Group)1 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1 Shape (com.ait.lienzo.client.core.shape.Shape)1 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1 Direction (com.ait.lienzo.shared.core.types.Direction)1 HandlerRegistrationManager (com.ait.tooling.nativetools.client.event.HandlerRegistrationManager)1 HandlerRegistration (com.google.gwt.event.shared.HandlerRegistration)1 Timer (com.google.gwt.user.client.Timer)1 Iterator (java.util.Iterator)1 BiConsumer (java.util.function.BiConsumer)1 Supplier (java.util.function.Supplier)1 Point2DGrid (org.kie.workbench.common.stunner.lienzo.toolbox.grid.Point2DGrid)1 AbstractDecoratedItem (org.kie.workbench.common.stunner.lienzo.toolbox.items.AbstractDecoratedItem)1 AbstractDecoratorItem (org.kie.workbench.common.stunner.lienzo.toolbox.items.AbstractDecoratorItem)1 AbstractPrimitiveItem (org.kie.workbench.common.stunner.lienzo.toolbox.items.AbstractPrimitiveItem)1