com.google.gwt.dom.client.Element.getAbsoluteTop()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(290)

本文整理了Java中com.google.gwt.dom.client.Element.getAbsoluteTop()方法的一些代码示例,展示了Element.getAbsoluteTop()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getAbsoluteTop()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getAbsoluteTop

Element.getAbsoluteTop介绍

[英]Gets an element's absolute top coordinate in the document's coordinate system.
[中]获取元素在文档坐标系中的绝对顶部坐标。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Gets an element's absolute top coordinate in the document's coordinate
  3. * system.
  4. *
  5. * @param elem the element to be measured
  6. * @return the element's absolute top coordinate
  7. * @deprecated Use {@link Element#getAbsoluteTop()} instead.
  8. */
  9. @Deprecated
  10. public static int getAbsoluteTop(Element elem) {
  11. return elem.getAbsoluteTop();
  12. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Gets an element's absolute bottom coordinate in the document's coordinate
  3. * system.
  4. */
  5. public final int getAbsoluteBottom() {
  6. return getAbsoluteTop() + getOffsetHeight();
  7. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. public void setPosition(int offsetWidth, int offsetHeight) {
  2. panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX,
  3. lastParent.getAbsoluteTop() + offsetY);
  4. }
  5. });

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Gets the touch y-position relative to a given element.
  3. *
  4. * @param target the element whose coordinate system is to be used
  5. * @return the relative y-position
  6. */
  7. public final int getRelativeY(Element target) {
  8. return getClientY() - target.getAbsoluteTop() + target.getScrollTop()
  9. + target.getOwnerDocument().getScrollTop();
  10. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Gets the mouse y-position relative to a given element.
  3. *
  4. * @param target the element whose coordinate system is to be used
  5. * @return the relative y-position
  6. */
  7. public int getRelativeY(Element target) {
  8. NativeEvent e = getNativeEvent();
  9. return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() +
  10. target.getOwnerDocument().getScrollTop();
  11. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. /**
  2. * Gets an element's absolute top coordinate in the document's coordinate
  3. * system.
  4. *
  5. * @param elem the element to be measured
  6. * @return the element's absolute top coordinate
  7. * @deprecated Use {@link Element#getAbsoluteTop()} instead.
  8. */
  9. @Deprecated
  10. public static int getAbsoluteTop(Element elem) {
  11. return elem.getAbsoluteTop();
  12. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * Gets an element's absolute bottom coordinate in the document's coordinate
  3. * system.
  4. */
  5. public final int getAbsoluteBottom() {
  6. return getAbsoluteTop() + getOffsetHeight();
  7. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. + senderElem.getPropertyInt("scrollLeft")
  2. + Window.getScrollLeft();
  3. int y = event.getClientY() - senderElem.getAbsoluteTop()
  4. + senderElem.getPropertyInt("scrollTop")
  5. + Window.getScrollTop();

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. public void setPosition(int offsetWidth, int offsetHeight) {
  2. panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX,
  3. lastParent.getAbsoluteTop() + offsetY);
  4. }
  5. });

代码示例来源:origin: net.wetheinter/gwt-user

  1. public void setPosition(int offsetWidth, int offsetHeight) {
  2. panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX,
  3. lastParent.getAbsoluteTop() + offsetY);
  4. }
  5. });

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. int top = selectedElem.getAbsoluteTop() - containerTop;
  2. int width = selectedElem.getPropertyInt("offsetWidth");
  3. int height = selectedElem.getPropertyInt("offsetHeight");

代码示例来源:origin: pl.touk.gwtaculous/gwtaculous-lib

  1. public static boolean isMouseCursorWithinElement(Element element, int mousePosX, int mousePosY){
  2. int elementTop = element.getAbsoluteTop();
  3. int elementLeft = element.getAbsoluteLeft();
  4. int elementBottom = element.getAbsoluteBottom();
  5. int elementRight = element.getAbsoluteRight();
  6. if (mousePosX > elementLeft && mousePosX < elementRight && mousePosY > elementTop && mousePosY < elementBottom) {
  7. return true;
  8. }
  9. return false;
  10. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. /**
  2. * Gets the touch y-position relative to a given element.
  3. *
  4. * @param target the element whose coordinate system is to be used
  5. * @return the relative y-position
  6. */
  7. public final int getRelativeY(Element target) {
  8. return getClientY() - target.getAbsoluteTop() + target.getScrollTop()
  9. + target.getOwnerDocument().getScrollTop();
  10. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * Gets the touch y-position relative to a given element.
  3. *
  4. * @param target the element whose coordinate system is to be used
  5. * @return the relative y-position
  6. */
  7. public final int getRelativeY(Element target) {
  8. return getClientY() - target.getAbsoluteTop() + target.getScrollTop()
  9. + target.getOwnerDocument().getScrollTop();
  10. }

代码示例来源:origin: playn/playn

  1. /**
  2. * Gets the event's y-position relative to a given element.
  3. *
  4. * @param e native event
  5. * @param target the element whose coordinate system is to be used
  6. * @return the relative y-position
  7. */
  8. static float getRelativeY (NativeEvent e, Element target) {
  9. return (e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() +
  10. target.getOwnerDocument().getScrollTop()) / HtmlGraphics.experimentalScale;
  11. }

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

  1. @Override
  2. public void updateSizes() {
  3. super.updateSizes();
  4. splitHeight = splitter.getOffsetHeight();
  5. if (splitTop == 0) {
  6. splitTop = splitter.getAbsoluteTop();
  7. }
  8. if (isAttached()) {
  9. updateDockButtonPosition();
  10. }
  11. }

代码示例来源:origin: threerings/playn

  1. /**
  2. * Gets the event's y-position relative to a given element.
  3. *
  4. * @param e native event
  5. * @param target the element whose coordinate system is to be used
  6. * @return the relative y-position
  7. */
  8. static float getRelativeY(NativeEvent e, Element target) {
  9. return (e.getClientY() - target.getAbsoluteTop() + target.getScrollTop()
  10. + target.getOwnerDocument().getScrollTop()) / HtmlGraphics.experimentalScale;
  11. }
  12. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. /**
  2. * Gets the mouse y-position relative to a given element.
  3. *
  4. * @param target the element whose coordinate system is to be used
  5. * @return the relative y-position
  6. */
  7. public int getRelativeY(Element target) {
  8. NativeEvent e = getNativeEvent();
  9. return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() +
  10. target.getOwnerDocument().getScrollTop();
  11. }

代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client

  1. private int getRelativeY(final ContextMenuEvent event) {
  2. final NativeEvent e = event.getNativeEvent();
  3. final Element target = event.getRelativeElement();
  4. return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop();
  5. }

代码示例来源:origin: kiegroup/appformer

  1. public static int getRelativeYOfEvent(final DomEvent event) {
  2. final NativeEvent e = event.getNativeEvent();
  3. final Element target = event.getRelativeElement();
  4. return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop();
  5. }
  6. }

相关文章

Element类方法