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

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


    registerDropController(boundaryDropController);
    dropControllerCollection = new DropControllerCollection(dropControllerList);
  }

  private void calcBoundaryOffset() {
  Location widgetLocation = new WidgetLocation(context.boundaryPanel, null);
  boundaryOffsetX = widgetLocation.getLeft()
      + DOMUtil.getBorderLeft(context.boundaryPanel.getElement());
  boundaryOffsetY = widgetLocation.getTop()
      + DOMUtil.getBorderTop(context.boundaryPanel.getElement());
}
View Full Code Here


      if (context.dropController != null) {
        context.dropController.onEnter(context);
      }

      for (Widget widget : context.selectedWidgets) {
        Location location = widgetLocation.get(widget);
        int relativeX = location.getLeft() - draggableAbsoluteLeft;
        int relativeY = location.getTop() - draggableAbsoluteTop;
        container.add(widget, relativeX, relativeY);
      }
      movablePanel = container;
    }
    movablePanel.addStyleName(PRIVATE_CSS_MOVABLE_PANEL);
View Full Code Here

    }
  }

  public void moveBy(int right, int down) {
    AbsolutePanel parent = (AbsolutePanel) getParent();
    Location location = new WidgetLocation(this, parent);
    int left = location.getLeft() + right;
    int top = location.getTop() + down;
    parent.setWidgetPosition(this, left, top);
  }
View Full Code Here

      }
      super.dragStart();

      // one time calculation of boundary panel location for efficiency during
      // dragging
      Location widgetLocation = new WidgetLocation(context.boundaryPanel, null);
      boundaryOffsetX = widgetLocation.getLeft()
          + DOMUtil.getBorderLeft(context.boundaryPanel.getElement());
      boundaryOffsetY = widgetLocation.getTop()
          + DOMUtil.getBorderTop(context.boundaryPanel.getElement());

      dropTargetClientWidth = boundaryOffsetX
          + DOMUtil.getClientWidth(context.boundaryPanel.getElement())
          - context.draggable.getOffsetWidth();
View Full Code Here

      }
      super.dragStart();

      // one timecalculation of boundary panel location for efficiency during
      // dragging
      Location widgetLocation = new WidgetLocation(context.boundaryPanel, null);
      boundaryOffsetX = widgetLocation.getLeft()
          + DOMUtil.getBorderLeft(context.boundaryPanel.getElement());
      boundaryOffsetY = widgetLocation.getTop()
          + DOMUtil.getBorderTop(context.boundaryPanel.getElement());

      dropTargetClientWidth = boundaryOffsetX
          + DOMUtil.getClientWidth(context.boundaryPanel.getElement())
          - context.draggable.getOffsetWidth();
View Full Code Here

          currentDraggableLocation.getLeft(), currentDraggableLocation.getTop());
      movablePanel.addStyleName(getStylePrimaryName() + "-Movable");

      // one time calculation of boundary panel location for efficiency during
      // dragging
      Location widgetLocation = new WidgetLocation(context.boundaryPanel, null);
      final int[] border = DOM.getBorderSizes(context.boundaryPanel.getElement());
      boundaryOffsetX = widgetLocation.getLeft() + border[3];
      boundaryOffsetY = widgetLocation.getTop() + border[0];
      final Dimension box = DOM.getClientSize(boundaryPanel.getElement());
      dropTargetClientWidth = box.width;
      dropTargetClientHeight = box.height;

      layoutData = (BorderLayoutData) BaseLayout.getLayoutData(widget);
View Full Code Here

     */
    private void calculateBoundaryOffset() {
        assert context.boundaryPanel == getBoundaryPanel();

        AbsolutePanel boundaryPanel = getBoundaryPanel();
        Location widgetLocation = new WidgetLocation(boundaryPanel, null);
        Element boundaryElement = boundaryPanel.getElement();

        int left = widgetLocation.getLeft()
                + DOMUtil.getBorderLeft(boundaryElement);
        int top = widgetLocation.getTop()
                + DOMUtil.getBorderTop(boundaryElement);
        boundaryRectangle = boundaryRectangle.move(left, top);

    }
View Full Code Here

        AbsolutePanel desktop = context.boundaryPanel;
        Element desktopElement = desktop.getElement();
        desktopWidth = DOMUtil.getClientWidth(desktopElement);
        desktopHeight = DOMUtil.getClientHeight(desktopElement);

        Location desktopLocation = new WidgetLocation(desktop, null);
        desktopOffsetX = desktopLocation.getLeft()
                + DOMUtil.getBorderLeft(desktopElement);
        desktopOffsetY = desktopLocation.getTop()
                + DOMUtil.getBorderTop(desktopElement);

        getWindowPanelFromDraggable();
        bringToFront(windowPanel);
    }
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

  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

TOP

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

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.