本文整理汇总了Java中java.awt.Component.addMouseWheelListener方法的典型用法代码示例。如果您正苦于以下问题:Java Component.addMouseWheelListener方法的具体用法?Java Component.addMouseWheelListener怎么用?Java Component.addMouseWheelListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Component
的用法示例。
在下文中一共展示了Component.addMouseWheelListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EventBinding
import java.awt.Component; //导入方法依赖的package包/类
/**
* Creates a new Binding.
* @param c the JOGLUI canvas
* @param d the FengGUI Display
*/
public EventBinding(Component c, Display d)
{
display = d;
// makes FengGUI listen to tab keys
// http://answers.google.com/answers/threadview?id=126916
c.setFocusTraversalKeysEnabled(false);
c.addMouseListener(this);
c.addMouseMotionListener(this);
c.addMouseWheelListener(this);
c.addKeyListener(this);
}
示例2: subscribeActual
import java.awt.Component; //导入方法依赖的package包/类
@Override
protected void subscribeActual(Observer<? super MouseEvent> observer) {
Component w = widget;
int f = flags;
MouseEventConsumer aec = new MouseEventConsumer(observer, w, f);
observer.onSubscribe(aec);
if ((f & 1) != 0) {
w.addMouseListener(aec);
}
if ((f & 2) != 0) {
w.addMouseMotionListener(aec);
}
if ((f & 4) != 0) {
w.addMouseWheelListener(aec);
}
if (aec.get() == null) {
aec.onDispose(w);
}
}
示例3: subscribeActual
import java.awt.Component; //导入方法依赖的package包/类
@Override
protected void subscribeActual(Observer<? super MouseWheelEvent> observer) {
Component w = widget;
MouseWheelEventConsumer aec = new MouseWheelEventConsumer(observer, w);
observer.onSubscribe(aec);
w.addMouseWheelListener(aec);
if (aec.get() == null) {
w.removeMouseWheelListener(aec);
}
}