@Override public void onMouseDown(final MouseDownEvent event) { VConsole.log("onMouseDown"); extractSelection(); removeSelectionBox(); if (currentKeyModifiers.contains(KeyCodes.KEY_CTRL)) { selectionBox.setSelectionBoxStartX(event.getX()); selectionBox.setSelectionBoxStartY(event.getY()); selectionBox.setSelectionBoxVisible(true); VConsole.log( "onMouseDown - selection started:" + selectionBox.getSelectionBoxStartX() + "," + selectionBox.getSelectionBoxStartY()); } else if (event.getSource() instanceof VNode) { onMove = false; } else if (event.getSource() instanceof DrawingArea) { onMove = true; startX = event.getX(); startY = event.getY(); VConsole.log("onMouseDown - moving"); } else { VConsole.error("onMouseDown - UNKNOWN STATE"); } }
public void onMouseDown(MouseDownEvent event) { setMouseDown(true); updateCSS(); DOM.setCapture(view.getElement()); dragStartX = event.getX(); dragStartY = event.getY(); event.preventDefault(); }
public void onMouseDown(@Nonnull final MouseDownEvent event) { dragging = true; // capturing the mouse to the dragged widget. DOM.setCapture(container.getElement()); startY = event.getY(); ClientLog.log("DOWN", null); event.stopPropagation(); event.preventDefault(); originalStyle = widget.getElement().getAttribute("style"); }
private Postit addNewPostit(MouseDownEvent event) { System.out.println("Create"); Postit postit = new Postit(); postit.x = event.getX(); postit.y = event.getY(); postit.width = 50; postit.height = 20; postits.add(postit); return postit; }