提交 dbd40778 编写于 作者: A alexp

7132793: [macosx] setWheelScrollEnabled action reversed

Reviewed-by: serb, art
上级 55df51a2
......@@ -1226,7 +1226,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
sendEventToDelegate(e);
}
private void sendEventToDelegate(final AWTEvent e) {
protected void sendEventToDelegate(final AWTEvent e) {
synchronized (getDelegateLock()) {
if (getDelegate() == null || !isShowing() || !isEnabled()) {
return;
......
......@@ -29,6 +29,7 @@ import javax.swing.*;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;
import java.awt.*;
import java.awt.event.MouseWheelEvent;
import java.awt.peer.ScrollPanePeer;
import java.util.List;
......@@ -51,6 +52,21 @@ final class LWScrollPanePeer extends LWContainerPeer<ScrollPane, JScrollPane>
return sp;
}
@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);
}
}
@Override
public void stateChanged(final ChangeEvent e) {
SwingUtilities.invokeLater(new Runnable() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册