source: trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/IGUIElement.java @ 1490

Last change on this file since 1490 was 1490, checked in by pharms, 10 years ago
  • added support and initial implementation of a platform specific distance measure between GUI elements
  • Property svn:executable set to *
File size: 3.5 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.eventcore.guimodel;
16
17import de.ugoe.cs.autoquest.eventcore.IEventTarget;
18
19/**
20 * <p>
21 * Common interface for all GUI elements.
22 * </p>
23 *
24 * @version 1.0
25 * @author Patrick Harms
26 */
27public interface IGUIElement extends IEventTarget {
28   
29    /**
30     * <p>
31     * Returns the specification of the GUI element.
32     * </p>
33     *
34     * @return the specification
35     */
36    public IGUIElementSpec getSpecification();
37
38    /**
39     * <p>
40     * Returns the parent of the GUI element.
41     * </p>
42     *
43     * @return the parent
44     */
45    public IGUIElement getParent();
46
47    /**
48     * <p>
49     * returns the GUI model to which this GUI element belongs
50     * </p>
51     */
52    public GUIModel getGUIModel();
53   
54    /**
55     * <p>
56     * returns true, if a usage of this GUI element in a trace was observed
57     * </p>
58     *
59     * @return as described
60     */
61    public boolean isUsed();
62
63    /**
64     * <p>
65     * Marks a GUI element as used.
66     * </p>
67     */
68    public void markUsed();
69
70    /**
71     * <p>
72     * Defines that {@link IGUIElement} implementations have to define equals.
73     * </p>
74     *
75     * @see Object#equals(Object)
76     */
77    @Override
78    public boolean equals(Object other);
79
80    /**
81     * <p>
82     * Defines that {@link IGUIElement} implementations have to define hashCode.
83     * </p>
84     *
85     * @see Object#hashCode()
86     */
87    @Override
88    public int hashCode();
89
90    /**
91     * <p>
92     * Updates the specification of a GUI element with another specification, e.g., to add further
93     * known names of the GUI element.
94     * </p>
95     *
96     * @param furtherSpec
97     *            additional specification
98     */
99    public void updateSpecification(IGUIElementSpec furtherSpec);
100
101    /**
102     * <p>
103     * The {@link IGUIElement} that is passed by this function is equal to the current GUI element
104     * and will hereafter be treated as such.
105     * </p>
106     *
107     * @param guiElement
108     *            GUI element that is equal
109     */
110    public void addEqualGUIElement(IGUIElement equalElement);
111
112    /**
113     * <p>
114     * Returns a measure for the distance of this {@link IGUIElement} to the provided one. Distance
115     * means a measure for the distance in display of the rendered GUI. The returned values must be
116     * between 0.0 and 1.0 inclusive. 0.0 means no distance, e.g., if the distance to itself shall be
117     * returned. 1.0 means the highest distance possible. Two GUI elements that are not visible
118     * at the same time independent of the screen resolution (e.g., because they resist in separate
119     * views) must have a distance of at least 0.5. 
120     * </p>
121     *
122     * @param guiElement
123     *            the GUI element to measure the distance for
124     */
125    public double getDistanceTo(IGUIElement otherElement);
126}
Note: See TracBrowser for help on using the repository browser.