source: trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlEvent.java @ 870

Last change on this file since 870 was 870, checked in by pharms, 12 years ago
  • added some comments
File size: 3.1 KB
Line 
1package de.ugoe.cs.autoquest.htmlmonitor;
2
3/**
4 * <p>
5 * represents an event caused by a user on a specific web site. An event contains the infos
6 * about the client ({@link HtmlClientInfos}, when ant where the event took place, the type of
7 * event and some additional infos such as the event coordinates or the number of the pressed
8 * key.
9 * </p>
10 *
11 * @author Patrick Harms
12 */
13class HtmlEvent {
14
15    /**
16     * infos about the client that caused the event
17     */
18    private HtmlClientInfos clientInfos;
19
20    /**
21     * the time stamp of the event
22     */
23    private Long time;
24
25    /**
26     * the path in the HTML DOM to the object on which the event was executed
27     */
28    private String path;
29
30    /**
31     * the type of the event, e.g. onclick
32     */
33    private String eventType;
34
35    /**
36     * the coordinates of the event, usually an array with two values (x and y)
37     */
38    private Integer[] coordinates;
39
40    /**
41     * if the event is a key event, the key that was pressed or released
42     */
43    private Integer key;
44
45    /**
46     * if the event is a scroll event, the resulting position of the scrolled element
47     */
48    private Integer scrollPosition;
49
50    /**
51     * <p>
52     * initializes the event with all relevantinfos
53     * </p>
54     *
55     * @param clientInfos    infos about the client that caused the event
56     * @param time           the time stamp of the event
57     * @param path           the path in the HTML DOM to the object on which the event was executed
58     * @param eventType      the type of the event, e.g. onclick
59     * @param coordinates    the coordinates of the event, usually an array with two values
60     *                       (x and y)
61     * @param key            if the event is a key event, the key that was pressed or released
62     * @param scrollPosition if the event is a scroll event, the resulting position of the
63     *                       scrolled element
64     */
65    HtmlEvent(HtmlClientInfos clientInfos,
66              Long            time,
67              String          path,
68              String          eventType,
69              Integer[]       coordinates,
70              Integer         key,
71              Integer         scrollPosition)
72    {
73        this.clientInfos = clientInfos;
74        this.time = time;
75        this.path = path;
76        this.eventType = eventType;
77        this.coordinates = coordinates;
78        this.key = key;
79        this.scrollPosition = scrollPosition;
80    }
81
82    /**
83     * @return the clientInfos
84     */
85    HtmlClientInfos getClientInfos() {
86        return clientInfos;
87    }
88
89    /**
90     * @return the time
91     */
92    Long getTime() {
93        return time;
94    }
95
96    /**
97     * @return the path
98     */
99    String getPath() {
100        return path;
101    }
102
103    /**
104     * @return the eventType
105     */
106    String getEventType() {
107        return eventType;
108    }
109
110    /**
111     * @return the coordinates
112     */
113    Integer[] getCoordinates() {
114        return coordinates;
115    }
116
117    /**
118     * @return the key
119     */
120    Integer getKey() {
121        return key;
122    }
123
124    /**
125     * @return the scrollPosition
126     */
127    Integer getScrollPosition() {
128        return scrollPosition;
129    }
130
131}
Note: See TracBrowser for help on using the repository browser.