1 package org.simantics.scenegraph.g2d.events;
3 import java.awt.Component;
4 import java.awt.event.MouseEvent;
5 import java.lang.ref.WeakReference;
7 public class SGMouseEvent extends MouseEvent implements ISGMouseEvent {
11 private static final long serialVersionUID = 1L;
15 private WeakReference<MouseEvent> _orig;
17 public SGMouseEvent(Component source, int id, long when, int modifiers,
18 int x, int y, int xAbs, int yAbs, int clickCount,
19 boolean popupTrigger, int button, MouseEvent orig) {
20 super(source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger,
24 this._orig = new WeakReference<MouseEvent>(orig);
27 public SGMouseEvent(Component source, int id, long when, int modifiers,
28 int x, int y, int clickCount, boolean popupTrigger, int button, MouseEvent orig) {
29 super(source, id, when, modifiers, x, y, clickCount, popupTrigger, button);
32 this._orig = new WeakReference<MouseEvent>(orig);
35 public SGMouseEvent(Component source, int id, long when, int modifiers,
36 int x, int y, int clickCount, boolean popupTrigger, MouseEvent orig) {
37 super(source, id, when, modifiers, x, y, clickCount, popupTrigger);
40 this._orig = new WeakReference<MouseEvent>(orig);
43 public SGMouseEvent(Component source, int id, long when, int modifiers,
44 double x, double y, int xAbs, int yAbs, int clickCount,
45 boolean popupTrigger, int button, MouseEvent orig) {
46 super(source, id, when, modifiers, (int)x, (int)y, xAbs, yAbs, clickCount, popupTrigger,
50 this._orig = new WeakReference<MouseEvent>(orig);
53 public SGMouseEvent(Component source, int id, long when, int modifiers,
54 double x, double y, int clickCount, boolean popupTrigger, int button, MouseEvent orig) {
55 super(source, id, when, modifiers, (int)x, (int)y, clickCount, popupTrigger, button);
58 this._orig = new WeakReference<MouseEvent>(orig);
61 public SGMouseEvent(Component source, int id, long when, int modifiers,
62 double x, double y, int clickCount, boolean popupTrigger, MouseEvent orig) {
63 super(source, id, when, modifiers, (int)x, (int)y, clickCount, popupTrigger);
66 this._orig = new WeakReference<MouseEvent>(orig);
69 public double getDoubleX() {
73 public double getDoubleY() {
78 public void consume() {
79 MouseEvent e =_orig.get();
86 public boolean isConsumed() {
87 MouseEvent e =_orig.get();
89 return e.isConsumed();
90 return super.isConsumed();