Package com.extjs.gxt.ui.client.util

Examples of com.extjs.gxt.ui.client.util.Point


    rect.height = s.height;
    if (local) {
      rect.x = getLeft(true);
      rect.y = getTop(true);
    } else {
      Point p = getXY();
      rect.x = p.x;
      rect.y = p.y;
    }
    return rect;
  }
View Full Code Here


   *
   * @param to the to element
   * @return the xy page offsets
   */
  public Point getOffsetsTo(Element to) {
    Point o = getXY();
    Point e = El.fly(to, "_internal").getXY();
    return new Point(o.x - e.x, o.y - e.y);
  }
View Full Code Here

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

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

    Point o = getOffsetsTo(c);
    int l = o.x;
    int t = o.y;
    l = l + c.getScrollLeft();
    t = t + c.getScrollTop();
    int b = t + getHeight() + offsets[0];
View Full Code Here

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

   * @param p the position
   * @return this
   */
  public El setXY(Point p) {
    makePositionable();
    Point pts = translatePoints(p);
    if (p.x != Style.DEFAULT) {
      setLeft(pts.x);
    }
    if (p.y != Style.DEFAULT) {
      setTop(pts.y);
View Full Code Here

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

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

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

    } else {
      vw = fly(elem, "_internal").getWidth();
      vh = fly(elem, "_internal").getHeight();
    }

    Point xy = proposedXY;
    int x = xy.x;
    int y = xy.y;

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

    int w = getWidth();
    int h = getHeight();

    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

    super.onLayout(container, target);
    Component c = container.getItem(0);
    if (c != null) {
      callLayout(c, false);

      Point p = c.el().getAlignToXY(target.dom, "c-c", null);
      p = c.el().translatePoints(p);
      setPosition(c, p.x, p.y);
    }
  }
View Full Code Here

      setSize(370, 270);
    } else {
      setSize(370, 290);
    }
   
      Point p = el().getAlignToXY(XDOM.getBody(), "c-c", null);
      setPagePosition(p.x, p.y);     
      login.focus();
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.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.