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


Java MouseWheelEvent.getScrollAmount方法代码示例

本文整理汇总了Java中java.awt.event.MouseWheelEvent.getScrollAmount方法的典型用法代码示例。如果您正苦于以下问题:Java MouseWheelEvent.getScrollAmount方法的具体用法?Java MouseWheelEvent.getScrollAmount怎么用?Java MouseWheelEvent.getScrollAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.event.MouseWheelEvent的用法示例。


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

示例1: handleWheelScrolling

import java.awt.event.MouseWheelEvent; //导入方法依赖的package包/类
public static void handleWheelScrolling(ScrollPane sp, MouseWheelEvent e) {
    if (log.isLoggable(PlatformLogger.Level.FINER)) {
        log.finer("x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource());
    }
    int increment = 0;

    if (sp != null && e.getScrollAmount() != 0) {
        Adjustable adj = getAdjustableToScroll(sp);
        if (adj != null) {
            increment = getIncrementFromAdjustable(adj, e);
            if (log.isLoggable(PlatformLogger.Level.FINER)) {
                log.finer("increment from adjustable(" + adj.getClass() + ") : " + increment);
            }
            scrollAdjustable(adj, increment);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ScrollPaneWheelScroller.java

示例2: scroll

import java.awt.event.MouseWheelEvent; //导入方法依赖的package包/类
private static void scroll(JScrollBar scroller, MouseWheelEvent event) {
    if (event.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
        int direction = event.getUnitsToScroll() < 0 ? -1 : 1;
        int increment = scroller.getUnitIncrement(direction);
        int amount = event.getScrollAmount();
        int oldValue = scroller.getValue();
        int newValue = oldValue + increment * amount * direction;
        if (oldValue != newValue) scroller.setValue(newValue);
        event.consume();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ProfilerTableContainer.java

示例3: mouseWheelMoved

import java.awt.event.MouseWheelEvent; //导入方法依赖的package包/类
@Override
public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent) {
	if (mouseWheelEvent.getScrollAmount() == 0) {
		return;
	}
	vertical.setValue(vertical.getValue() + 3 * mouseWheelEvent.getWheelRotation());
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:8,代码来源:JEditTextArea.java

示例4: cloneEvent

import java.awt.event.MouseWheelEvent; //导入方法依赖的package包/类
private MouseWheelEvent cloneEvent(MouseWheelEvent e) {
  return new MouseWheelEvent(getParentScrollPane(), e.getID(), e
      .getWhen(), e.getModifiers(), 1, 1, e
      .getClickCount(), false, e.getScrollType(), e
      .getScrollAmount(), e.getWheelRotation());
}
 
开发者ID:nccgroup,项目名称:Decoder-Improved,代码行数:7,代码来源:PDControlScrollPane.java


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