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 ----------