/** * Gets an element's absolute top coordinate in the document's coordinate * system. * * @param elem the element to be measured * @return the element's absolute top coordinate * @deprecated Use {@link Element#getAbsoluteTop()} instead. */ @Deprecated public static int getAbsoluteTop(Element elem) { return elem.getAbsoluteTop(); }
/** * Gets an element's absolute bottom coordinate in the document's coordinate * system. */ public final int getAbsoluteBottom() { return getAbsoluteTop() + getOffsetHeight(); }
public void setPosition(int offsetWidth, int offsetHeight) { panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX, lastParent.getAbsoluteTop() + offsetY); } });
/** * Gets the touch y-position relative to a given element. * * @param target the element whose coordinate system is to be used * @return the relative y-position */ public final int getRelativeY(Element target) { return getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop(); }
/** * Gets the mouse y-position relative to a given element. * * @param target the element whose coordinate system is to be used * @return the relative y-position */ public int getRelativeY(Element target) { NativeEvent e = getNativeEvent(); return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop(); }
/** * Gets an element's absolute top coordinate in the document's coordinate * system. * * @param elem the element to be measured * @return the element's absolute top coordinate * @deprecated Use {@link Element#getAbsoluteTop()} instead. */ @Deprecated public static int getAbsoluteTop(Element elem) { return elem.getAbsoluteTop(); }
/** * Gets an element's absolute bottom coordinate in the document's coordinate * system. */ public final int getAbsoluteBottom() { return getAbsoluteTop() + getOffsetHeight(); }
+ senderElem.getPropertyInt("scrollLeft") + Window.getScrollLeft(); int y = event.getClientY() - senderElem.getAbsoluteTop() + senderElem.getPropertyInt("scrollTop") + Window.getScrollTop();
public void setPosition(int offsetWidth, int offsetHeight) { panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX, lastParent.getAbsoluteTop() + offsetY); } });
public void setPosition(int offsetWidth, int offsetHeight) { panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX, lastParent.getAbsoluteTop() + offsetY); } });
int top = selectedElem.getAbsoluteTop() - containerTop; int width = selectedElem.getPropertyInt("offsetWidth"); int height = selectedElem.getPropertyInt("offsetHeight");
public static boolean isMouseCursorWithinElement(Element element, int mousePosX, int mousePosY){ int elementTop = element.getAbsoluteTop(); int elementLeft = element.getAbsoluteLeft(); int elementBottom = element.getAbsoluteBottom(); int elementRight = element.getAbsoluteRight(); if (mousePosX > elementLeft && mousePosX < elementRight && mousePosY > elementTop && mousePosY < elementBottom) { return true; } return false; }
/** * Gets the touch y-position relative to a given element. * * @param target the element whose coordinate system is to be used * @return the relative y-position */ public final int getRelativeY(Element target) { return getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop(); }
/** * Gets the touch y-position relative to a given element. * * @param target the element whose coordinate system is to be used * @return the relative y-position */ public final int getRelativeY(Element target) { return getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop(); }
/** * Gets the event's y-position relative to a given element. * * @param e native event * @param target the element whose coordinate system is to be used * @return the relative y-position */ static float getRelativeY (NativeEvent e, Element target) { return (e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop()) / HtmlGraphics.experimentalScale; }
@Override public void updateSizes() { super.updateSizes(); splitHeight = splitter.getOffsetHeight(); if (splitTop == 0) { splitTop = splitter.getAbsoluteTop(); } if (isAttached()) { updateDockButtonPosition(); } }
/** * Gets the event's y-position relative to a given element. * * @param e native event * @param target the element whose coordinate system is to be used * @return the relative y-position */ static float getRelativeY(NativeEvent e, Element target) { return (e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop()) / HtmlGraphics.experimentalScale; } }
/** * Gets the mouse y-position relative to a given element. * * @param target the element whose coordinate system is to be used * @return the relative y-position */ public int getRelativeY(Element target) { NativeEvent e = getNativeEvent(); return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop(); }
private int getRelativeY(final ContextMenuEvent event) { final NativeEvent e = event.getNativeEvent(); final Element target = event.getRelativeElement(); return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop(); }
public static int getRelativeYOfEvent(final DomEvent event) { final NativeEvent e = event.getNativeEvent(); final Element target = event.getRelativeElement(); return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop(); } }