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

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

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

Element.getOwnerDocument介绍

暂无

代码示例

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

  1. @Override
  2. public int getAbsoluteLeft(Element elem) {
  3. Document doc = elem.getOwnerDocument();
  4. return getBoundingClientRectLeft(elem) + doc.getScrollLeft();
  5. }

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

  1. @Override
  2. public int getAbsoluteTop(Element elem) {
  3. return getAbsoluteTopImpl(elem.getOwnerDocument().getViewportElement(),
  4. elem);
  5. }

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

  1. @Override
  2. public int getAbsoluteTop(Element elem) {
  3. Document doc = elem.getOwnerDocument();
  4. return getBoundingClientRectTop(elem) + doc.getScrollTop();
  5. }

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

  1. @Override
  2. public int getAbsoluteLeft(Element elem) {
  3. return getAbsoluteLeftImpl(elem.getOwnerDocument().getViewportElement(),
  4. elem);
  5. }

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

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

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

  1. @Override
  2. public int getAbsoluteLeft(Element elem) {
  3. ClientRect rect = getBoundingClientRect(elem);
  4. double left = rect != null ? rect.getSubPixelLeft()
  5. + getScrollLeft(elem.getOwnerDocument())
  6. : getAbsoluteLeftUsingOffsets(elem);
  7. return toInt32(left);
  8. }

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

  1. @Override
  2. public int getAbsoluteTop(Element elem) {
  3. ClientRect rect = getBoundingClientRect(elem);
  4. double top = rect != null ? rect.getSubPixelTop()
  5. + getScrollTop(elem.getOwnerDocument())
  6. : getAbsoluteTopUsingOffsets(elem);
  7. return toInt32(top);
  8. }

代码示例来源: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 x-position relative to a given element.
  3. *
  4. * @param target the element whose coordinate system is to be used
  5. * @return the relative x-position
  6. */
  7. public int getRelativeX(Element target) {
  8. NativeEvent e = getNativeEvent();
  9. return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() +
  10. target.getOwnerDocument().getScrollLeft();
  11. }

代码示例来源: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: net.wetheinter/gwt-user

  1. @Override
  2. public int getAbsoluteTop(Element elem) {
  3. return getAbsoluteTopImpl(elem.getOwnerDocument().getViewportElement(),
  4. elem);
  5. }

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

  1. @Override
  2. public int getAbsoluteLeft(Element elem) {
  3. Document doc = elem.getOwnerDocument();
  4. return getBoundingClientRectLeft(elem) + doc.getScrollLeft();
  5. }

代码示例来源: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.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.uberfire/uberfire-wires-core-grids

  1. public static int getRelativeXOfEvent(final DomEvent event) {
  2. final NativeEvent e = event.getNativeEvent();
  3. final Element target = event.getRelativeElement();
  4. return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() + target.getOwnerDocument().getScrollLeft();
  5. }

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

  1. private int getRelativeX(final ContextMenuEvent event) {
  2. final NativeEvent e = event.getNativeEvent();
  3. final Element target = event.getRelativeElement();
  4. return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() + target.getOwnerDocument().getScrollLeft();
  5. }

代码示例来源: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类方法