Package com.allen_sauer.gwt.dnd.client.util

Examples of com.allen_sauer.gwt.dnd.client.util.WidgetLocation


        super(controller, commandManager);
    }

    @Override
    public void dragEnd() {
        WidgetLocation currentLocation = new WidgetLocation(windowPanel,
                getBoundaryPanel());

        commandManager.execute(new MoveWindowCommand(windowPanel,
                originalLocation.getLeft(), originalLocation.getTop(),
                currentLocation.getLeft(), currentLocation.getTop(), true));

        super.dragEnd();
    }
View Full Code Here


    // TODO command should also switch back to old zIndex
    @Override
    public void dragStart() {
        super.dragStart();

        originalLocation = new WidgetLocation(windowPanel, getBoundaryPanel());
    }
View Full Code Here

    }

    @Override
    public Point getLocation(WindowPanel window) {
        // TODO inline calculations
        WidgetLocation location = new WidgetLocation(window, boundaryPanel);
        return new Point(location.getLeft(), location.getTop());
    }
View Full Code Here

    @Override
    public void setLocation(WindowPanel window, int x, int y) {
        // TODO inline calculations
        boundaryPanel.setWidgetPosition(window, x, y);

        assert x == new WidgetLocation(window, boundaryPanel).getLeft();
        assert y == new WidgetLocation(window, boundaryPanel).getTop();
    }
View Full Code Here

  public void onMouseOut(MouseOutEvent event) {
    if (mouseDown && dragging == NOT_DRAGGING) {
      // TODO DOMUtil.cancelAllDocumentSelections(); ?

      // set context.mouseX/Y before startDragging() is called
      Location location = new WidgetLocation(mouseDownWidget, null);
      context.mouseX = mouseDownOffsetX + location.getLeft();
      context.mouseY = mouseDownOffsetY + location.getTop();

      startDragging();
    }
  }
View Full Code Here

      }

      // TODO Remove Safari workaround after GWT issue 1807 fixed
      if (sender != capturingWidget) {
        // In Safari 1.3.2 MAC does not honor capturing widget for mouse up
        Location location = new WidgetLocation(sender, null);
        x += location.getLeft();
        y += location.getTop();
      }
      // Proceed with the drop
      try {
        drop(x, y);
        if (dragging != ACTIVELY_DRAGGING) {
View Full Code Here

    mouseDown = true;
    event.preventDefault();

    mouseDownOffsetX = x;
    mouseDownOffsetY = y;
    WidgetLocation loc1 = new WidgetLocation(mouseDownWidget, null);
    if (mouseDownWidget != context.draggable) {
      WidgetLocation loc2 = new WidgetLocation(context.draggable, null);
      mouseDownOffsetX += loc1.getLeft() - loc2.getLeft();
      mouseDownOffsetY += loc1.getTop() - loc2.getTop();
    }
    if (context.dragController.getBehaviorDragStartSensitivity() == 0 && !toggleKey(event)) {
      // set context.mouseX/Y before startDragging() is called
      context.mouseX = x + loc1.getLeft();
      context.mouseY = y + loc1.getTop();
View Full Code Here

          if (!context.selectedWidgets.contains(context.draggable)) {
            context.dragController.toggleSelection(context.draggable);
          }

          // set context.mouseX/Y before startDragging() is called
          Location location = new WidgetLocation(mouseDownWidget, null);
          context.mouseX = mouseDownOffsetX + location.getLeft();
          context.mouseY = mouseDownOffsetY + location.getTop();

          // adjust (x,y) to be relative to capturingWidget at (0,0)
          // so that context.desiredDraggableX/Y is valid
          x += location.getLeft();
          y += location.getTop();

          startDragging();
        } else {
          // prevent IE image drag when drag sensitivity > 5
          Event currentEvent = DOM.eventGetCurrentEvent();
View Full Code Here

  @Override
  public void dragStart() {
    super.dragStart();

    lastResetCacheTimeMillis = System.currentTimeMillis();
    WidgetLocation currentDraggableLocation = new WidgetLocation(context.draggable,
        context.boundaryPanel);
    if (getBehaviorDragProxy()) {
      movablePanel = newDragProxy(context);
      context.boundaryPanel.add(movablePanel, currentDraggableLocation.getLeft(),
          currentDraggableLocation.getTop());
      checkGWTIssue1813(movablePanel, context.boundaryPanel);
    } else {
      saveSelectedWidgetsLocationAndStyle();
      AbsolutePanel container = new AbsolutePanel();
      container.getElement().getStyle().setProperty("overflow", "visible");

      container.setPixelSize(context.draggable.getOffsetWidth(),
          context.draggable.getOffsetHeight());
      context.boundaryPanel.add(container, currentDraggableLocation.getLeft(),
          currentDraggableLocation.getTop());
      checkGWTIssue1813(container, context.boundaryPanel);

      int draggableAbsoluteLeft = context.draggable.getAbsoluteLeft();
      int draggableAbsoluteTop = context.draggable.getAbsoluteTop();
      HashMap<Widget, CoordinateLocation> widgetLocation = new HashMap<Widget, CoordinateLocation>();
View Full Code Here

    for (Widget widget : context.selectedWidgets) {
      SavedWidgetInfo info = new SavedWidgetInfo();
      info.initialDraggableParent = widget.getParent();

      if (info.initialDraggableParent instanceof AbsolutePanel) {
        info.initialDraggableParentLocation = new WidgetLocation(widget,
            info.initialDraggableParent);
      } else if (info.initialDraggableParent instanceof InsertPanel) {
        info.initialDraggableIndex = ((InsertPanel) info.initialDraggableParent).getWidgetIndex(widget);
      } else if (info.initialDraggableParent instanceof SimplePanel) {
        // save nothing
View Full Code Here

TOP

Related Classes of com.allen_sauer.gwt.dnd.client.util.WidgetLocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.