當前位置: 首頁>>代碼示例>>Java>>正文


Java Element.getScrollLeft方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.Element.getScrollLeft方法的典型用法代碼示例。如果您正苦於以下問題:Java Element.getScrollLeft方法的具體用法?Java Element.getScrollLeft怎麽用?Java Element.getScrollLeft使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.Element的用法示例。


在下文中一共展示了Element.getScrollLeft方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBrowserEvent

import com.google.gwt.user.client.Element; //導入方法依賴的package包/類
@Override
public void onBrowserEvent(Event event) {
    super.onBrowserEvent(event);

    if (DOM.eventGetType(event) == Event.ONSCROLL) {
        Element element = getElement();

        int scrollTop = element.getScrollTop();
        int scrollLeft = element.getScrollLeft();

        if (this.scrollTop != scrollTop || this.scrollLeft != scrollLeft) {
            if (onScrollHandler != null) {
                onScrollHandler.accept(scrollTop, scrollLeft);
            }

            this.scrollTop = scrollTop;
            this.scrollLeft = scrollLeft;
        }
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:21,代碼來源:CubaScrollBoxLayoutWidget.java

示例2: restoreScrollPositions

import com.google.gwt.user.client.Element; //導入方法依賴的package包/類
private void restoreScrollPositions() {
    Element body = getElement();
    int scrollX = body.getScrollLeft();
    int scrollY = body.getScrollTop();
    int viewWidth = DOM.getElementPropertyInt(body, "clientWidth");
    int viewHeight = DOM.getElementPropertyInt(body, "clientHeight");
    if (currentViewHeight == viewHeight && currentViewWidth == viewWidth) {
        if (currentScrollX != scrollX) {
            setHorizontalScrollPosition(currentScrollX);
        }

        if (currentScrollY != scrollY) {
            setScrollPosition(currentScrollY);
        }
    }
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:17,代碼來源:BasicImageGrid.java

示例3: saveScrollPosition

import com.google.gwt.user.client.Element; //導入方法依賴的package包/類
private void saveScrollPosition() {
    Element body = getElement();
    int scrollX = body.getScrollLeft();
    int scrollY = body.getScrollTop();
    int viewWidth = DOM.getElementPropertyInt(body, "clientWidth");
    int viewHeight = DOM.getElementPropertyInt(body, "clientHeight");

    if (currentViewHeight != viewHeight) {
        currentViewHeight = viewHeight;
    }

    if (currentViewWidth != viewWidth) {
        currentViewWidth = viewWidth;
    }

    if (currentScrollX != scrollX) {
        currentScrollX = scrollX;
    }

    if (currentScrollY != scrollY) {
        currentScrollY = scrollY;
    }

    if (lockrelated != null && mpwList.size() > 0) {
        lockrelated = mpwList.get(0).getGroup().getLockRelated();
    }
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:28,代碼來源:BasicImageGrid.java


注:本文中的com.google.gwt.user.client.Element.getScrollLeft方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。