1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package de.desy.acop.chart;
24 import java.awt.Point;
25
26 public class AcopEvent extends java.util.EventObject
27 {
28 protected int event_type;
29 protected int link_id, link_error;
30 protected int histo_index;
31 protected Point mouse_point;
32 protected double mouseUserX, mouseUserY;
33 protected double zoomX1, zoomY1, zoomX2, zoomY2;
34
35
36 public final static int ACOP_MOUSE_MOVE_EVENT = 1;
37 public final static int ACOP_MOUSE_CLICK_EVENT = 2;
38 public final static int ACOP_MOUSE_ZOOM_EVENT = 3;
39 public final static int ACOP_MOUSE_ENTER_EVENT = 4;
40 public final static int ACOP_MOUSE_EXIT_EVENT = 5;
41 public final static int ACOP_MOUSE_DCLICK_EVENT = 6;
42 public final static int ACOP_MOUSE_PRESSED_EVENT = 7;
43
44
45
46 public AcopEvent(Object source, int eventId, int linkId, int error)
47 {
48
49 super(source);
50
51
52 event_type = eventId;
53 link_id = linkId;
54 link_error = error;
55 }
56
57
58 public AcopEvent(Object source, int eventId, int histIndex, int x, int y, double userx, double usery)
59 {
60
61 super(source);
62
63 event_type = eventId;
64
65
66 histo_index = histIndex;
67 mouse_point = new Point(x,y);
68 mouseUserX = userx;
69 mouseUserY = usery;
70 }
71
72
73 public AcopEvent(Object source, int eventId, double xMin, double yMin, double xMax, double yMax)
74 {
75
76 super(source);
77
78 event_type = eventId;
79
80
81 zoomX1 = xMin;
82 zoomY1 = yMin;
83 zoomX2 = xMax;
84 zoomY2 = yMax;
85 }
86
87 public int getEventType()
88 {
89 return event_type;
90 }
91
92 public int getLinkId()
93 {
94 return link_id;
95 }
96
97 public int getLinkError()
98 {
99 return link_error;
100 }
101
102 public int getHistoIndex()
103 {
104 return histo_index;
105 }
106
107 public Point getMousePoint()
108 {
109 return mouse_point;
110 }
111
112 public double getMousePositionX()
113 {
114 return mouseUserX;
115 }
116
117 public double getMousePositionY()
118 {
119 return mouseUserY;
120 }
121
122 public double getZoomXMin()
123 {
124 return zoomX1;
125 }
126
127 public double getZoomYMin()
128 {
129 return zoomY1;
130 }
131
132 public double getZoomXMax()
133 {
134 return zoomX2;
135 }
136
137 public double getZoomYMax()
138 {
139 return zoomY2;
140 }
141 }