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

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


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

    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


      // TODO simplify after enhancement for issue 1112 provides InsertPanel
      // interface
      // http://code.google.com/p/google-web-toolkit/issues/detail?id=1112
      if (info.initialDraggableParent instanceof AbsolutePanel) {
        info.initialDraggableParentLocation = new WidgetLocation(widget,
            info.initialDraggableParent);
      } else if (info.initialDraggableParent instanceof HorizontalPanel) {
        info.initialDraggableIndex = ((HorizontalPanel) info.initialDraggableParent).getWidgetIndex(widget);
      } else if (info.initialDraggableParent instanceof VerticalPanel) {
        info.initialDraggableIndex = ((VerticalPanel) info.initialDraggableParent).getWidgetIndex(widget);
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

      }
      RootPanel.get().add(glassPanel, 0, 0);

      super.dragStart();

      WidgetLocation currentDraggableLocation = new WidgetLocation(
          context.draggable, context.boundaryPanel);
      movablePanel = context.draggable;
      context.boundaryPanel.add(movablePanel,
          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

        move.addEffectCompletedHandler(new EffectCompletedHandler() {
            @Override
            public void onEffectCompleted(EffectCompletedEvent event) {
                removeEffects();
                setLocation(x, y);
                assert 0 == new WidgetLocation(rootPanel, WindowPanel.this)
                        .getLeft();
                assert 0 == new WidgetLocation(rootPanel, WindowPanel.this)
                        .getTop();
            }
        });

        move.setTransitionType(FXUtil.EASE_OUT);
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

     * Creates the visual representation of the object that is being dragged.
     * This representation is used to indicate what is being dragged to the user
     * during the drag operation.
     */
    private void initDragProxy() {
        WidgetLocation currentDraggableLocation = new WidgetLocation(
                context.draggable, context.boundaryPanel);

        dragProxy = getAvatar(context).createProxy();
        dragProxy.setHover(true);

        context.boundaryPanel.add(dragProxy,
                currentDraggableLocation.getLeft(),
                currentDraggableLocation.getTop());
        checkGWTIssue1813(dragProxy, context.boundaryPanel);
        dragProxy.addStyleName(DragClientBundle.INSTANCE.css().movablePanel());
    }
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

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.