Example usage for com.google.gwt.user.client.ui ScrollPanel getHorizontalScrollPosition

List of usage examples for com.google.gwt.user.client.ui ScrollPanel getHorizontalScrollPosition

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui ScrollPanel getHorizontalScrollPosition.

Prototype

@Override
public int getHorizontalScrollPosition() 

Source Link

Document

Gets the horizontal scroll position.

Usage

From source file:com.ponysdk.ui.terminal.addon.floatablepanel.PCFloatablePanel.java

License:Apache License

private boolean setAndGetHorizontalScrollChanged(ScrollPanel scrollPanel) {
    final boolean changed = scrollPanel.getHorizontalScrollPosition() != lastHorizontalScrollPosition;
    lastHorizontalScrollPosition = scrollPanel.getHorizontalScrollPosition();

    if (!changed) {
        if (scrollPanel.getAbsoluteLeft() != getAbsoluteLeft()) {
            return true;
        }/*w ww .j  a  v  a 2s .co  m*/
    }

    return changed;
}

From source file:org.eclipse.draw2d.FigureCanvas.java

License:Open Source License

private void scroll(ScrollPanel sp) {
    int hsp = sp.getHorizontalScrollPosition();
    int vsp = sp.getVerticalScrollPosition();

    int hminimum = getViewport().getHorizontalRangeModel().getMinimum();
    int vminimum = getViewport().getVerticalRangeModel().getMinimum();

    scrollTo(hminimum + hsp, vminimum + vsp);
}

From source file:org.rstudio.studio.client.workbench.views.vcs.git.dialog.GitReviewPanel.java

License:Open Source License

private void scrollBy(ScrollPanel scrollPanel, int vscroll, int hscroll) {
    if (vscroll != 0) {
        scrollPanel.setVerticalScrollPosition(Math.max(0, scrollPanel.getVerticalScrollPosition() + vscroll));
    }/*from  w  ww  . j  a  va 2s .  c  o  m*/

    if (hscroll != 0) {
        scrollPanel
                .setHorizontalScrollPosition(Math.max(0, scrollPanel.getHorizontalScrollPosition() + hscroll));
    }
}