source: trunk/autoquest-test-utils/src/main/java/de/ugoe/cs/autoquest/test/DummyGUIElement.java @ 1876

Last change on this file since 1876 was 1876, checked in by pharms, 9 years ago
  • added support for views in GUIs
File size: 2.8 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.test;
16
17import de.ugoe.cs.autoquest.eventcore.guimodel.AbstractDefaultGUIElement;
18import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
19import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec;
20import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIView;
21
22/**
23 * TODO comment
24 *
25 * @version $Revision: $ $Date: 02.04.2012$
26 * @author 2012, last modified by $Author: patrick$
27 */
28public class DummyGUIElement extends AbstractDefaultGUIElement implements IGUIElement {
29
30    /**  */
31    private static final long serialVersionUID = 1L;
32
33    /** */
34    private String name;
35
36    /**
37     *
38     */
39    public DummyGUIElement(String name) {
40        this(name, null);
41    }
42
43    /**
44     *
45     */
46    public DummyGUIElement(String name, IGUIElement parent) {
47        super(null, parent);
48        this.name = name;
49    }
50
51    /*
52     * (non-Javadoc)
53     *
54     * @see de.ugoe.cs.autoquest.eventcore.IEventTarget#getPlatform()
55     */
56    @Override
57    public String getPlatform() {
58        return "Dummy";
59    }
60
61    /*
62     * (non-Javadoc)
63     *
64     * @see de.ugoe.cs.autoquest.eventcore.IEventTarget#getStringIdentifier()
65     */
66    @Override
67    public String getStringIdentifier() {
68        return name;
69    }
70
71    /*
72     * (non-Javadoc)
73     *
74     * @see java.lang.Object#toString()
75     */
76    @Override
77    public String toString() {
78        return name;
79    }
80
81    /*
82     * (non-Javadoc)
83     *
84     * @see de.harms.attef.userinteraction.GUIElement#equals(GUIElement)
85     */
86    public boolean equals(IGUIElement other) {
87        return this == other;
88    }
89
90    @Override
91    public void updateSpecification(IGUIElementSpec specToIntegrateElementFor) {
92        // dummy
93    }
94
95    /* (non-Javadoc)
96     * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#getView()
97     */
98    @Override
99    public IGUIView getView() {
100        return null;
101    }
102
103    /* (non-Javadoc)
104     * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#getDistanceTo(IGUIElement)
105     */
106    @Override
107    public double getDistanceTo(IGUIElement otherElement) {
108        if (this == otherElement) {
109            return 0.0;
110        }
111        else {
112            return 1.0;
113        }
114    }
115}
Note: See TracBrowser for help on using the repository browser.