Package com.sencha.gxt.core.client.util

Examples of com.sencha.gxt.core.client.util.Point


   *          coordinates
   * @return the position
   */
  public final Point getPosition(boolean local) {
    if (local) {
      return new Point(getLeft(true), getTop(true));
    }
    return getXY();
  }
View Full Code Here


   * must be part of the DOM tree to have page coordinates.
   *
   * @return the location
   */
  public final Point getXY() {
    return new Point(getX(), getY());
  }
View Full Code Here

    if (offsets == null) {
      offsets = new int[] {0, 0};
    }
    Element c = container != null ? container : Document.get().getBody();

    Point o = getOffsetsTo(c);
    int l = o.getX();
    int t = o.getY();
    l = l + c.getScrollLeft();
    t = t + c.getScrollTop();
    int b = t + getOffsetHeight() + offsets[0];
    int r = l + getOffsetWidth() + offsets[1];
View Full Code Here

   *
   * @param x the x coordinate
   * @param y the y coordinate
   */
  public final void setXY(int x, int y) {
    setXY(new Point(x, y));
  }
View Full Code Here

   *
   * @param p the position
   */
  public final void setXY(Point p) {
    makePositionable();
    Point pts = translatePoints(p);
    if (p.getX() != Style.DEFAULT) {
      setLeft(pts.getX());
    }
    if (p.getY() != Style.DEFAULT) {
      setTop(pts.getY());
    }
  }
View Full Code Here

    int t = Util.parseInt(map.get("top"), -11234);

    l = l != -11234 ? l : (relative ? 0 : getOffsetLeft());
    t = t != -11234 ? t : (relative ? 0 : getOffsetTop());

    Point o = getXY();
    return new Point(p.getX() - o.getX() + l, p.getY() - o.getY() + t);
  }
View Full Code Here

    } else {
      vw = elem.getOffsetWidth();
      vh = elem.getOffsetHeight();
    }

    Point xy = proposedXY;
    int x = xy.getX();
    int y = xy.getY();

    int vr = vx + vw;
    int vb = vy + vh;

    int w = getOffsetWidth();
    int h = getOffsetHeight();

    if ((x + w) > vr) {
      x = vr - w;
    }
    if ((y + h) > vb) {
      y = vb - h;

    }

    // then make sure top/left isn't negative
    if (x < vx) {
      x = vx;
    }
    if (y < vy) {
      y = vy;
    }

    return new Point(x, y);
  }
View Full Code Here

  }

  @Override
  protected void onAdd(List<M> models, int index) {
    if (enableGrouping) {
      Point ss = getScrollState();
      refresh(false);
      restoreScroll(ss);
    } else {
      super.onAdd(models, index);
    }
View Full Code Here

  protected void onMouseMove(Event event) {
    targetXY = event.<XEvent> cast().getXY();
    if (isAttached() && toolTipConfig.isTrackMouse()) {
      Side origAnchor = toolTipConfig.getAnchor();
      Point p = getTargetXY(0);
      toolTipConfig.setAnchor(origAnchor);
      if (constrainPosition) {
        p = getElement().adjustForConstraints(p);
      }
      setPagePosition(p.getX(), p.getY());
    }
  }
View Full Code Here

  protected void onTargetOver(Event ce) {
    if (disabled || !target.getElement().isOrHasChild(ce.getEventTarget().<Element> cast())) {
      return;
    }
    clearTimer("hide");
    targetXY = new Point(ce.getClientX(), ce.getClientY());
    delayShow();
  }
View Full Code Here

TOP

Related Classes of com.sencha.gxt.core.client.util.Point

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.