-
Bug
-
Resolution: Fixed
-
P4
-
8u5
-
b28
-
x86
-
windows_7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8056500 | emb-9 | Alexandr Scherbatiy | P4 | Resolved | Fixed | master |
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
In 1.7 a new field, preciseWheelRotation, was added to MouseWheelEvent. SwingUtilities.convertMouseEvent misses this, creating a new MouseWheelEvent without preserving the precise value.
Additionally, the javadoc for that method could use a bit of cleanup: aesthetically, technically, and grammatically. Among other things, it makes reference to a method "translateMouseEvent" which doesn't seem to exist.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.event.MouseWheelEvent;
import javax.swing.*;
public class PreciseWheelRotationBug {
public static void main(String[] args) {
// need to provide a source component connected to hierarchy
// or coordinate conversion throws an exception
JFrame frame = new JFrame();
JPanel panel = new JPanel();
frame.add(panel);
MouseWheelEvent mwe = new MouseWheelEvent(panel,
0, 0, 0, 0, 0, 0, 0, 0, false, 0, 0,
3, // wheelRotation
3.14); // preciseWheelRotation
MouseWheelEvent mwe2 = (MouseWheelEvent)
SwingUtilities.convertMouseEvent(mwe.getComponent(), mwe, null);
System.out.println(mwe.getPreciseWheelRotation() + " => " + mwe2.getPreciseWheelRotation());
if (mwe2.getPreciseWheelRotation() == mwe.getPreciseWheelRotation()) {
System.out.println("PASS");
} else {
System.out.println("FAIL");
}
}
}
---------- END SOURCE ----------
A DESCRIPTION OF THE PROBLEM :
In 1.7 a new field, preciseWheelRotation, was added to MouseWheelEvent. SwingUtilities.convertMouseEvent misses this, creating a new MouseWheelEvent without preserving the precise value.
Additionally, the javadoc for that method could use a bit of cleanup: aesthetically, technically, and grammatically. Among other things, it makes reference to a method "translateMouseEvent" which doesn't seem to exist.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.event.MouseWheelEvent;
import javax.swing.*;
public class PreciseWheelRotationBug {
public static void main(String[] args) {
// need to provide a source component connected to hierarchy
// or coordinate conversion throws an exception
JFrame frame = new JFrame();
JPanel panel = new JPanel();
frame.add(panel);
MouseWheelEvent mwe = new MouseWheelEvent(panel,
0, 0, 0, 0, 0, 0, 0, 0, false, 0, 0,
3, // wheelRotation
3.14); // preciseWheelRotation
MouseWheelEvent mwe2 = (MouseWheelEvent)
SwingUtilities.convertMouseEvent(mwe.getComponent(), mwe, null);
System.out.println(mwe.getPreciseWheelRotation() + " => " + mwe2.getPreciseWheelRotation());
if (mwe2.getPreciseWheelRotation() == mwe.getPreciseWheelRotation()) {
System.out.println("PASS");
} else {
System.out.println("FAIL");
}
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8056500 SwingUtilities.convertMouseEvent misses MouseWheelEvent.preciseWheelRotation
-
- Resolved
-
- relates to
-
JDK-6524352 support for high-resolution mouse wheel
-
- Closed
-