1 package org.simantics.scenegraph.g2d.events;
3 import java.awt.Component;
4 import java.awt.event.MouseEvent;
5 import java.awt.event.MouseWheelEvent;
6 import java.lang.ref.WeakReference;
8 public class SGMouseWheelEvent extends MouseWheelEvent implements ISGMouseEvent {
12 private static final long serialVersionUID = 1L;
16 private WeakReference<MouseEvent> _orig;
18 public SGMouseWheelEvent(Component source, int id, long when,
19 int modifiers, int x, int y, int xAbs, int yAbs, int clickCount,
20 boolean popupTrigger, int scrollType, int scrollAmount,
21 int wheelRotation, MouseEvent orig) {
22 super(source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger,
23 scrollType, scrollAmount, wheelRotation);
26 this._orig = new WeakReference<MouseEvent>(orig);
29 public SGMouseWheelEvent(Component source, int id, long when,
30 int modifiers, int x, int y, int clickCount, boolean popupTrigger,
31 int scrollType, int scrollAmount, int wheelRotation, MouseEvent orig) {
32 super(source, id, when, modifiers, x, y, clickCount, popupTrigger, scrollType,
33 scrollAmount, wheelRotation);
36 this._orig = new WeakReference<MouseEvent>(orig);
39 public SGMouseWheelEvent(Component source, int id, long when,
40 int modifiers, double x, double y, int xAbs, int yAbs, int clickCount,
41 boolean popupTrigger, int scrollType, int scrollAmount,
42 int wheelRotation, MouseEvent orig) {
43 super(source, id, when, modifiers, (int)x, (int)y, xAbs, yAbs, clickCount, popupTrigger,
44 scrollType, scrollAmount, wheelRotation);
47 this._orig = new WeakReference<MouseEvent>(orig);
50 public SGMouseWheelEvent(Component source, int id, long when,
51 int modifiers, double x, double y, int clickCount, boolean popupTrigger,
52 int scrollType, int scrollAmount, int wheelRotation, MouseEvent orig) {
53 super(source, id, when, modifiers, (int)x, (int)y, clickCount, popupTrigger, scrollType,
54 scrollAmount, wheelRotation);
57 this._orig = new WeakReference<MouseEvent>(orig);
60 public double getDoubleX() {
64 public double getDoubleY() {
69 public void consume() {
70 MouseEvent e =_orig.get();
77 public boolean isConsumed() {
78 MouseEvent e =_orig.get();
80 return e.isConsumed();
81 return super.isConsumed();