1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package com.drazzib.netpisteur.monitor;
27
28 import java.util.Calendar;
29 import java.util.GregorianCalendar;
30
31 /**
32 * Represents the class Click which is used to get informations about the mouse
33 * 's coordinates and the date when the mouse is clicked.
34 *
35 * @author NetPisteur Team
36 */
37 public class Click {
38
39
40
41
42 /**
43 * Represents the mouse's position(x-coordinates & ordinates) & the date
44 *
45 */
46
47 private int x, y;
48
49
50 private GregorianCalendar calen;
51
52
53 private long millisec;
54
55
56
57
58 /**
59 * empty constructor which initializes the coordinates at zero and the Date
60 * as null
61 *
62 */
63 public Click() {
64 this.x = 0;
65 this.y = 0;
66 this.calen = null;
67 this.millisec = System.currentTimeMillis();
68 }
69
70 /**
71 * normal constructor which initializes the coordinates and the date as
72 * those entered as parameter in this constructor
73 *
74 * @param _x //
75 * the x-coordinates
76 * @param _y //
77 * the y-coordinates
78 * @param leCalen //
79 * Gregorian Calendar
80 */
81
82 public Click(int _x, int _y, GregorianCalendar leCalen) {
83 this.x = _x;
84 this.y = _y;
85 this.calen = leCalen;
86 this.millisec = System.currentTimeMillis();
87 }
88
89
90
91
92 /**
93 * get the x-coordinates of the mouse's position when it is clicked
94 *
95 * @return the x-coordinates
96 *
97 */
98 public int getAbs() {
99 return (this.x);
100 }
101
102 /**
103 * get the ordinates of the mouse's position when it is clicked
104 *
105 * @return the ordinates
106 *
107 */
108 public int getOrd() {
109 return (this.y);
110 }
111
112 /**
113 * get the time's hour when someone clicks on the mouse
114 *
115 * @return the hours when it is clicked
116 */
117 public int getHours() {
118 return this.calen.get(Calendar.HOUR_OF_DAY);
119 }
120
121 /**
122 * get the time's minute when someone clicks on the mouse
123 *
124 * @return the minutes when it is clicked
125 */
126 public int getMinutes() {
127 return this.calen.get(Calendar.MINUTE);
128 }
129
130 /**
131 * get the time's second when someone clicks on the mouse
132 *
133 * @return the seconds when it is clicked
134 *
135 */
136 public int getSeconds() {
137 return this.calen.get(Calendar.SECOND);
138 }
139
140 /**
141 * get the time in millisec since 1970 when someone clicks on the * mouse
142 *
143 * @return the milliseconds when it is clicked
144 *
145 */
146
147 public long getMilliSec() {
148 return this.millisec;
149 }
150
151 /**
152 * get the Gregorian Calendar when someone clicks on the mouse
153 *
154 * @return the Gregorian Calendar when it is clicked
155 *
156 */
157 public GregorianCalendar getCalen() {
158 return this.calen;
159 }
160
161
162 }