957958959960961962963964965966967
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; }
123512361237123812391240124112421243
* * @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); }
1614161516161617161816191620
* must be part of the DOM tree to have page coordinates. * * @return the location */ public Point getXY() { return new Point(getX(), getY()); }
22312232223322342235223622372238223922402241
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];
2917291829192920292129222923
* @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)); }
29452946294729482949295029512952295329542955
* @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);
30513052305330543055305630573058
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); }
317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211
} 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); }
26272829303132333435
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); } }
115116117118119120121122123
setSize(370, 270); } else { setSize(370, 290); } Point p = el().getAlignToXY(XDOM.getBody(), "c-c", null); setPagePosition(p.x, p.y); login.focus(); }