java.awt.event.MouseWheelEvent#isConsumed()源码实例Demo

下面列出了java.awt.event.MouseWheelEvent#isConsumed() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: runelite   文件: MouseManager.java
public MouseWheelEvent processMouseWheelMoved(MouseWheelEvent mouseWheelEvent)
{
	if (mouseWheelEvent.isConsumed())
	{
		return mouseWheelEvent;
	}

	for (MouseWheelListener mouseWheelListener : mouseWheelListeners)
	{
		mouseWheelEvent = mouseWheelListener.mouseWheelMoved(mouseWheelEvent);
		if (mouseWheelEvent.isConsumed())
		{
			break;
		}
	}
	return mouseWheelEvent;
}
 
源代码2 项目: darklaf   文件: MouseEventUI.java
/**
 * Re-dispatches the event to the first component in the hierarchy that has a {@link MouseWheelListener}
 * registered.
 */
@Override
protected void processMouseWheelEvent(final MouseWheelEvent event,
                                      final JXLayer<? extends V> jxlayer) {
    /*
     * Only process an event if it is not already consumed. This may be the
     * case if this LayerUI is contained in a wrapped hierarchy.
     */
    if (!event.isConsumed()) {
        /*
         * Since we will create a new event, the argument event must be
         * consumed.
         */
        event.consume();
        /*
         * Find a target up in the hierarchy that has
         * MouseWheelEventListeners registered.
         */
        Component target = event.getComponent();
        Component newTarget = findWheelListenerComponent(target);
        if (newTarget == null) {
            newTarget = jxlayer.getParent();
        }
        /*
         * Convert the location relative to the new target
         */
        Point point = SwingUtilities.convertPoint(event.getComponent(),
                                                  event.getPoint(), newTarget);
        /*
         * Create a new event and dispatch it.
         */
        newTarget.dispatchEvent(createMouseWheelEvent(event, point,
                                                      newTarget));
    }
}
 
源代码3 项目: dragonwell8_jdk   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码4 项目: TencentKona-8   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码5 项目: jdk8u60   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码6 项目: openjdk-jdk8u   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码7 项目: netbeans   文件: AbstractTabDisplayer.java
@Override
public final void mouseWheelMoved( MouseWheelEvent e ) {
    scrollLeft.mouseWheelMoved( e );
    if( e.isConsumed() )
        return;
    scrollRight.mouseWheelMoved( e );
}
 
源代码8 项目: openjdk-jdk8u-backup   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码9 项目: openjdk-jdk9   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码10 项目: jdk8u-jdk   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码11 项目: brModelo   文件: QuadroDeEdicao.java
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
    if (getDiagramaAtual() == null) {
        return;
    }
    getDiagramaAtual().mouseWheelMoved(e);
    if (!e.isConsumed()) {
        master.ScrollMove(e);
    }
    
    super.mouseWheelMoved(e);
}
 
源代码12 项目: hottub   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码13 项目: openjdk-8-source   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码14 项目: openjdk-8   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码15 项目: jdk8u_jdk   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码16 项目: jdk8u-jdk   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码17 项目: jdk8u-dev-jdk   文件: LWScrollPanePeer.java
@Override
public void handleEvent(AWTEvent e) {
    if (e instanceof MouseWheelEvent) {
        MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
        //java.awt.ScrollPane consumes the event
        // in case isWheelScrollingEnabled() is true,
        // forcibly send the consumed event to the delegate
        if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
            sendEventToDelegate(wheelEvent);
        }
    } else {
        super.handleEvent(e);
    }
}
 
源代码18 项目: consulo   文件: JBScrollPane.java
/**
 * Indicates whether the specified event is not consumed and does not have unexpected modifiers.
 *
 * @param event a mouse wheel event to check for validity
 * @return {@code true} if the specified event is valid, {@code false} otherwise
 */
public static boolean isScrollEvent(@Nonnull MouseWheelEvent event) {
  if (event.isConsumed()) return false; // event should not be consumed already
  if (event.getWheelRotation() == 0) return false; // any rotation expected (forward or backward)
  return 0 == (SCROLL_MODIFIERS & event.getModifiers());
}