當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。