Search in sources :

Example 1 with WiresResizeEndEvent

use of com.ait.lienzo.client.core.shape.wires.event.WiresResizeEndEvent in project lienzo-core by ahome-it.

the class WiresShapeControlHandleList method resizeEnd.

protected void resizeEnd(final AbstractNodeDragEvent<?> dragEvent) {
    if (m_wires_shape.isResizable()) {
        final double[] r = resizeWhileDrag(dragEvent);
        m_wires_shape.getHandlerManager().fireEvent(new WiresResizeEndEvent(m_wires_shape, dragEvent, (int) r[0], (int) r[1], r[2], r[3]));
    }
}
Also used : WiresResizeEndEvent(com.ait.lienzo.client.core.shape.wires.event.WiresResizeEndEvent)

Example 2 with WiresResizeEndEvent

use of com.ait.lienzo.client.core.shape.wires.event.WiresResizeEndEvent in project lienzo-core by ahome-it.

the class WiresManager method register.

public WiresShapeControl register(final WiresShape shape, final boolean addIntoIndex) {
    shape.setWiresManager(this);
    final WiresShapeHandler handler = new WiresShapeHandler(getControlFactory().newShapeControl(shape, this), getControlFactory().newShapeHighlight(this), this);
    if (addIntoIndex) {
        // Shapes added to the align and distribute index.
        handler.getControl().setAlignAndDistributeControl(addToIndex(shape));
        shape.addWiresResizeEndHandler(new WiresResizeEndHandler() {

            @Override
            public void onShapeResizeEnd(final WiresResizeEndEvent event) {
                removeFromIndex(shape);
                handler.getControl().setAlignAndDistributeControl(addToIndex(shape));
            }
        });
    }
    final HandlerRegistrationManager registrationManager = createHandlerRegistrationManager();
    setWiresShapeHandler(shape, registrationManager, handler);
    // Shapes added to the canvas layer by default.
    getLayer().add(shape);
    final String uuid = shape.uuid();
    m_shapesMap.put(uuid, shape);
    m_shapeHandlersMap.put(uuid, registrationManager);
    return handler.getControl();
}
Also used : WiresResizeEndHandler(com.ait.lienzo.client.core.shape.wires.event.WiresResizeEndHandler) WiresShapeHandler(com.ait.lienzo.client.core.shape.wires.handlers.impl.WiresShapeHandler) HandlerRegistrationManager(com.ait.tooling.nativetools.client.event.HandlerRegistrationManager) WiresResizeEndEvent(com.ait.lienzo.client.core.shape.wires.event.WiresResizeEndEvent)

Aggregations

WiresResizeEndEvent (com.ait.lienzo.client.core.shape.wires.event.WiresResizeEndEvent)2 WiresResizeEndHandler (com.ait.lienzo.client.core.shape.wires.event.WiresResizeEndHandler)1 WiresShapeHandler (com.ait.lienzo.client.core.shape.wires.handlers.impl.WiresShapeHandler)1 HandlerRegistrationManager (com.ait.tooling.nativetools.client.event.HandlerRegistrationManager)1