public int getVerticalScrollPosition() { return getScrollableElement().getScrollTop(); }
public int getScrollTop(Document doc) { return ensureDocumentScrollingElement(doc).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 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(); }
public void onScroll(ScrollEvent event) { Widget source = getSource(event); Element elem = source.getElement(); getListener().onScroll(getSource(event), elem.getScrollLeft(), elem.getScrollTop()); } }
@Override public void onScroll(ScrollEvent event) { if (isScrollProcessorLocked) { return; } int newScrollTop = event.getRelativeElement().getScrollTop(); int delta = lastScrollTop - newScrollTop; escalate(newScrollTop, delta); lastScrollTop = newScrollTop; } };
/** * 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; } }
/** * 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; }
/** * 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; }
@Test public void testOnScroll() { reset(element); when(element.getScrollTop()).thenReturn(100); when(element.getScrollLeft()).thenReturn(200); tested.onScroll(scrollEvent); verify(paletteStyle, times(1)).setTop(100, Style.Unit.PX); verify(paletteStyle, times(1)).setLeft(200, Style.Unit.PX); }
/** * 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 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(); }
@EventHandler("sessionContainer") protected void onScroll(@ForEvent("scroll") ScrollEvent e) { // on the editor scroll recalculate palette position to be fixed on the screen palettePanel.getElement().getStyle().setTop(paletteInitialTop + e.getRelativeElement().getScrollTop(), Style.Unit.PX); palettePanel.getElement().getStyle().setLeft(paletteInitialLeft + e.getRelativeElement().getScrollLeft(), Style.Unit.PX); e.preventDefault(); }
public void onScroll(ScrollEvent event) { Widget source = getSource(event); Element elem = source.getElement(); getListener().onScroll(getSource(event), elem.getScrollLeft(), elem.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(); } }
/** * Get relative y position on the page. * @return x position in pixels */ public final int getRelativeY() { NativeEvent e = getNativeEvent(); Element target = getTarget(); 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 void onScroll(ScrollEvent event) { Widget source = getSource(event); Element elem = source.getElement(); getListener().onScroll(getSource(event), elem.getScrollLeft(), elem.getScrollTop()); } }