Examples of GQuery


Examples of com.google.gwt.query.client.GQuery

    $helper.css(OPACITY_CSS_KEY, opacity.toString());

  }

  public void onStop(DraggableHandler handler, DragContext ctx, GqEvent e) {
    GQuery $element = (handler.getOptions().getHelperType() == HelperType.ORIGINAL) ? handler.getHelper() : $(ctx.getDraggable());
    if ($element == null || $element.length() == 0) {
      return;
    }

    if ($element.data(OLD_OPACITY_KEY) == null) {
      return;
    }
    Double oldOpacity = $element.data(OLD_OPACITY_KEY, Double.class);
    $element.css(OPACITY_CSS_KEY, oldOpacity != null ? String.valueOf(oldOpacity) : "");
    $element.removeData(OLD_OPACITY_KEY);

  }
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

  public void onStart(DraggableHandler handler, DragContext ctx,
                      GqEvent e) {

    if (ctx.getInitialDraggable() == ctx.getDraggable() && !isStarting) {
      isStarting = true;
      GQuery $body = $(body);
      String oldCursor = $body.css(CURSOR_CSS);
      if (oldCursor != null) {
        $body.data(OLD_CURSOR_KEY, oldCursor);
      }
      $body.css(CURSOR_CSS, handler.getOptions().getCursor().getCssName());
    }

  }
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

  public void onStop(DraggableHandler handler, DragContext ctx, GqEvent e) {
    if (ctx.getInitialDraggable() != ctx.getDraggable()) {
      return;
    }
    GQuery $body = $(body);
    String oldCursor = $body.data(OLD_CURSOR_KEY, String.class);
    $body.css(CURSOR_CSS, oldCursor);
    isStarting = false;
  }
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

      return;
    }

    DraggableHandler initialDragHandler = DraggableHandler
        .getInstance(initialDraggable);
    GQuery $initialDraggable = $(initialDraggable);

    GroupingMode groupingMode = handler.getOptions().getGroupingMode();
    int groupSpacing = handler.getOptions().getGroupSpacing();

    Offset newPosition = null;

    switch (groupingMode) {
      case DOWN:
        HelperInfo lastDown = $initialDraggable.data(LAST_DOWN, HelperInfo.class);
        if (lastDown == null) {
          lastDown = new HelperInfo(initialDragHandler.getAbsolutePosition(),
              initialDragHandler.getHelper());
        }

        newPosition = lastDown.offset.add(0, lastDown.height + groupSpacing);
        HelperInfo newLastDown = new HelperInfo(newPosition, handler.getHelper());
        $initialDraggable.data(LAST_DOWN, newLastDown);

        break;

      case UP:
        HelperInfo lastUp = $initialDraggable.data(LAST_UP, HelperInfo.class);
        if (lastUp == null) {
          lastUp = new HelperInfo(initialDragHandler.getAbsolutePosition(),
              initialDragHandler.getHelper());
        }

        newPosition = lastUp.offset.add(0, -handler.getHelperDimension()
            .getHeight()
            - groupSpacing);
        HelperInfo newLastUp = new HelperInfo(newPosition, handler.getHelper());
        $initialDraggable.data(LAST_UP, newLastUp);
        break;
      case LEFT:
        HelperInfo lastLeft = $initialDraggable.data(LAST_LEFT, HelperInfo.class);
        if (lastLeft == null) {
          lastLeft = new HelperInfo(initialDragHandler.getAbsolutePosition(),
              initialDragHandler.getHelper());
        }

        newPosition = lastLeft.offset.add(-handler.getHelperDimension()
            .getWidth()
            - groupSpacing, 0);
        HelperInfo newLastLeft = new HelperInfo(newPosition, handler.getHelper());
        $initialDraggable.data(LAST_LEFT, newLastLeft);

        break;

      case RIGHT:
        HelperInfo lastRight = $initialDraggable.data(LAST_RIGHT,
            HelperInfo.class);
        if (lastRight == null) {
          lastRight = new HelperInfo(initialDragHandler.getAbsolutePosition(),
              initialDragHandler.getHelper());
        }

        newPosition = lastRight.offset.add(lastRight.width + groupSpacing, 0);
        HelperInfo newLastRight = new HelperInfo(newPosition, handler.getHelper());
        $initialDraggable.data(LAST_RIGHT, newLastRight);

        break;

      default:
        break;
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

  public void onDrag(DraggableHandler info, DragContext ctx, GqEvent e) {
  }

  public void onStart(DraggableHandler info, DragContext ctx, GqEvent e) {

    GQuery stackElements = info.getOptions().getStack();
    Element[] sortedElementArray = stackElements.elements();
    Arrays.sort(sortedElementArray, new ZIndexComparator());

    if (sortedElementArray.length == 0) {
      return;
    }
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

  }

  public void onDrag(DraggableHandler handler, DragContext ctx, GqEvent e) {
    DraggableOptions options = handler.getOptions();
    Element draggableElement = ctx.getDraggable();
    GQuery scrollParent = handler.getHelperScrollParent();
    Element scrollParentElement = scrollParent.get(0);
    if (scrollParentElement == null) {
      return;
    }

    AxisOption axis = options.getAxis();
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

  }

  public void onStart(DraggableHandler handler, DragContext ctx,
                      GqEvent e) {

    GQuery scrollParent = handler.getHelperScrollParent();
    Element scrollParentElement = scrollParent.get(0);
    if (scrollParentElement != null
        && scrollParentElement != $(GQuery.document).get(0)
        && !"html".equalsIgnoreCase(scrollParentElement.getTagName())) {
      Offset scrollParentOffset = scrollParent.offset();
      $(ctx.getDraggable()).data(OVERFLOW_OFFSET_KEY, scrollParentOffset);
    }
  }
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

    }

    // select other draggable elements if select options is set
    SelectFunction selectFunction = options.getSelect();
    if (selectFunction != null) {
      GQuery followers = selectFunction.selectElements();
      followers.each(new Function() {
        @Override
        public void f(Element e) {
          DraggableHandler handler = DraggableHandler.getInstance(e);
          if (handler != null) {
            GWT.log("Select automatic selected element " + e.getId());
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

    // deselect automatic selected elements
    // select other draggable elements if select options is set
    SelectFunction selectFunction = options.getSelect();
    if (selectFunction != null) {
      GQuery followers = selectFunction.selectElements();
      for (Element e : followers.elements()) {
        unselect(e);
      }
    }

    return result;
View Full Code Here

Examples of com.google.gwt.query.client.GQuery

      return true;
    }

    // OK, we have a valid handle, check if we are clicking on the handle object
    // or one of its descendants
    GQuery handleAndDescendant = $(options.getHandle(), draggable).find("*").andSelf();
    for (Element e : handleAndDescendant.elements()) {
      if (e == event.getEventTarget().cast()) {
        return true;
      }
    }
    return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.