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
27 package com.drazzib.netpisteur.monitor;
28
29 import java.util.Calendar;
30 import java.util.GregorianCalendar;
31
32 /**
33 * Represents the placement at a given moment
34 *
35 * @author NetPisteur Team
36 */
37 public class Placement {
38
39
40
41
42 /**
43 * Represents ...
44 *
45 */
46
47 private int x;
48
49 private int y;
50
51
52 private GregorianCalendar date;
53
54
55
56
57 /**
58 * built a Placement object with 3 parameters (x-coordinate , y-coordinate
59 * and * the date of this placment)
60 *
61 * @param abs
62 * x-position
63 * @param ord
64 * y-position
65 * @param maDate
66 * date of mouse's position
67 */
68
69 public Placement(int abs, int ord, GregorianCalendar maDate) {
70 this.x = abs;
71 this.y = ord;
72 this.date = maDate;
73
74 }
75
76
77
78
79 /**
80 * return x-coordinate
81 *
82 * @return x-coordinate
83 */
84
85 public int getAbs() {
86
87 return this.x;
88
89 }
90
91 /**
92 * return y-coordinate
93 *
94 * @return y-coordinate
95 */
96
97 public int getOrd() {
98
99 return this.y;
100
101 }
102
103 /**
104 * return the date of mouse's position
105 *
106 * @return date of mouse's positions
107 */
108
109 public GregorianCalendar getDate() {
110
111 return this.date;
112
113 }
114
115 /**
116 * get the time's hour when someone clicks on the mouse
117 *
118 * @return the hours when it is clicked
119 */
120 public int getHours() {
121 return this.date.get(Calendar.HOUR_OF_DAY);
122 }
123
124 /**
125 * get the time's minute when someone clicks on the mouse
126 *
127 * @return the minutes when it is clicked
128 */
129 public int getMinutes() {
130 return this.date.get(Calendar.MINUTE);
131 }
132
133 /**
134 * get the time's second when someone clicks on the mouse
135 *
136 * @return the seconds when it is clicked
137 *
138 */
139 public int getSeconds() {
140 return this.date.get(Calendar.SECOND);
141 }
142
143 /**
144 * mouse's position in a String
145 *
146 * @return a string with mouse's positions
147 *
148 */
149
150 public String getPosition() {
151 String maPosition;
152 maPosition = this.x + " ; " + this.y;
153
154 return maPosition;
155
156 }
157
158 }
159