当前位置: 首页>>代码示例>>Java>>正文


Java ScrollStateController类代码示例

本文整理汇总了Java中org.apache.harmony.awt.ScrollStateController的典型用法代码示例。如果您正苦于以下问题:Java ScrollStateController类的具体用法?Java ScrollStateController怎么用?Java ScrollStateController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ScrollStateController类属于org.apache.harmony.awt包,在下文中一共展示了ScrollStateController类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ChoicePopupBox

import org.apache.harmony.awt.ScrollStateController; //导入依赖的package包/类
public ChoicePopupBox(Choice choice) {
    scrollLocation = 0;
    this.choice = choice;
    style = choice.popupStyle;
    vAdj = new ScrollPaneAdjustable(choice, Adjustable.VERTICAL) {
        private static final long serialVersionUID = 2280561825998835980L;

        @Override
        void repaintComponent(Rectangle r) {
            if (isVisible()) {
                repaint(r);
            }
        }
    };
    scrollable = new ChoiceScrollable();
    listState = new ChoiceListState();
    scrollController = new ScrollStateController(scrollable);
    scrollbarController = vAdj.getStateController();
    vAdj.addAdjustmentListener(scrollController);
    nSkip = MAX_SKIP;
    dragScrollTimer = new PeriodicTimer(25l, getAsyncHandler(getDragScrollHandler()));
}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:23,代码来源:ChoicePopupBox.java

示例2: ScrollPane

import org.apache.harmony.awt.ScrollStateController; //导入依赖的package包/类
public ScrollPane(int scrollbarDisplayPolicy) throws HeadlessException {
    toolkit.lockAWT();
    try {
        Toolkit.checkHeadless();
        switch (scrollbarDisplayPolicy) {
            case SCROLLBARS_ALWAYS:
            case SCROLLBARS_AS_NEEDED:
            case SCROLLBARS_NEVER:
                break;
            default:
                // awt.146=illegal scrollbar display policy
                throw new IllegalArgumentException(Messages.getString("awt.146")); //$NON-NLS-1$
        }
        this.scrollbarDisplayPolicy = scrollbarDisplayPolicy;
        setWheelScrollingEnabled(true);
        hAdjustable = new ScrollPaneAdjustable(this, Adjustable.HORIZONTAL);
        vAdjustable = new ScrollPaneAdjustable(this, Adjustable.VERTICAL);
        scrollable = new SPScrollable();
        stateController = new ScrollStateController(scrollable);
        addAWTComponentListener(stateController);
        hAdjustable.addAWTAdjustmentListener(stateController);
        vAdjustable.addAWTAdjustmentListener(stateController);
        // The initial size of this container is set to 100x100:
        setSize(100, 100);
    } finally {
        toolkit.unlockAWT();
    }
}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:29,代码来源:ScrollPane.java

示例3: TextArea

import org.apache.harmony.awt.ScrollStateController; //导入依赖的package包/类
public TextArea(String text, int rows, int columns, int scrollbars)
        throws HeadlessException {
    super();
    toolkit.lockAWT();
    try {
        Toolkit.checkHeadless();
        setFont(new Font("Dialog", Font.PLAIN, 12)); // QUICK FIX //$NON-NLS-1$
        setText(text);
        this.rows = Math.max(0, rows);
        this.columns = Math.max(0, columns);
        if ((scrollbars < SCROLLBARS_BOTH) || (scrollbars > SCROLLBARS_NONE)) {
            scrollbars = SCROLLBARS_BOTH;
        }
        scrollbarVisibility = scrollbars;
        if (noHorizontalScroll()) {
            replaceView();
        }
        setFocusTraversalKeys();
        // init scrolling
        hAdjustable = new ScrollPaneAdjustable(this, Adjustable.HORIZONTAL);
        vAdjustable = new ScrollPaneAdjustable(this, Adjustable.VERTICAL);
        scrollable = new TextScrollable();
        stateController = new ScrollStateController(scrollable);
        addScrolling();
    } finally {
        toolkit.unlockAWT();
    }
}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:29,代码来源:TextArea.java


注:本文中的org.apache.harmony.awt.ScrollStateController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。