use of com.ait.lienzo.client.core.event.NodeDragEndEvent in project lienzo-core by ahome-it.
the class LienzoHandlerManager method doDragCancel.
private final void doDragCancel(final INodeXYEvent event) {
if (m_dragging) {
doDragMove(event);
Cursor cursor = m_lienzo.getNormalCursor();
if (null == cursor) {
cursor = LienzoCore.get().getDefaultNormalCursor();
if (null == cursor) {
cursor = m_lienzo.getWidgetCursor();
if (null == cursor) {
cursor = Cursor.DEFAULT;
}
}
}
m_lienzo.setCursor(cursor);
if (DragMode.DRAG_LAYER == m_drag_mode) {
m_drag_node.setVisible(true);
m_dragContext.dragDone();
m_drag_node.getLayer().draw();
m_lienzo.getDragLayer().clear();
} else {
m_dragContext.dragDone();
}
m_drag_node.setDragging(false);
m_drag_node.fireEvent(new NodeDragEndEvent(m_dragContext));
m_drag_node = null;
m_drag_mode = null;
m_dragging = false;
m_dragging_dispatch_move = false;
m_dragging_using_touches = false;
}
}
use of com.ait.lienzo.client.core.event.NodeDragEndEvent in project lienzo-core by ahome-it.
the class WiresContainer method ensureHandlers.
private void ensureHandlers() {
if (!m_drag_initialized && (null != m_container)) {
m_registrationManager.register(m_container.addNodeDragStartHandler(new NodeDragStartHandler() {
@Override
public void onNodeDragStart(final NodeDragStartEvent event) {
WiresContainer.this.m_dragging = true;
m_events.fireEvent(new WiresDragStartEvent(WiresContainer.this, event));
}
}));
m_registrationManager.register(m_container.addNodeDragMoveHandler(new NodeDragMoveHandler() {
@Override
public void onNodeDragMove(final NodeDragMoveEvent event) {
WiresContainer.this.m_dragging = true;
m_events.fireEvent(new WiresDragMoveEvent(WiresContainer.this, event));
}
}));
m_registrationManager.register(m_container.addNodeDragEndHandler(new NodeDragEndHandler() {
@Override
public void onNodeDragEnd(final NodeDragEndEvent event) {
WiresContainer.this.m_dragging = false;
m_events.fireEvent(new WiresDragEndEvent(WiresContainer.this, event));
}
}));
m_container.setAttributesChangedBatcher(m_attributesChangedBatcher);
final AttributesChangedHandler handler = new AttributesChangedHandler() {
@Override
public void onAttributesChanged(final AttributesChangedEvent event) {
if (!WiresContainer.this.m_dragging && event.evaluate(XYWH_OP)) {
fireMove();
}
}
};
// Attribute change handlers.
m_registrationManager.register(m_container.addAttributesChangedHandler(Attribute.X, handler));
m_registrationManager.register(m_container.addAttributesChangedHandler(Attribute.Y, handler));
m_drag_initialized = true;
}
}
Aggregations