[950] | 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 |
|
---|
| 15 | package de.ugoe.cs.autoquest.plugin.html.guimodel;
|
---|
| 16 |
|
---|
| 17 | import de.ugoe.cs.autoquest.eventcore.guimodel.AbstractDefaultGUIElement;
|
---|
| 18 | import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec;
|
---|
| 19 |
|
---|
| 20 | /**
|
---|
| 21 | * <p>
|
---|
| 22 | * Base class for all HTML GUI elements.
|
---|
| 23 | * </p>
|
---|
| 24 | *
|
---|
| 25 | * @version 1.0
|
---|
| 26 | * @author Patrick Harms
|
---|
| 27 | */
|
---|
| 28 | public class HTMLGUIElement extends AbstractDefaultGUIElement {
|
---|
| 29 |
|
---|
| 30 | /**
|
---|
| 31 | * <p>
|
---|
| 32 | * Id for object serialization.
|
---|
| 33 | * </p>
|
---|
| 34 | */
|
---|
| 35 | private static final long serialVersionUID = 1L;
|
---|
| 36 |
|
---|
| 37 | /**
|
---|
| 38 | * <p>
|
---|
| 39 | * Constructor. Creates a new HTMLGUIElement.
|
---|
| 40 | * </p>
|
---|
| 41 | *
|
---|
| 42 | * @param specification
|
---|
| 43 | * specification of created GUI element
|
---|
| 44 | * @param parent
|
---|
| 45 | * parent of the created GUI element; null means that the element is a top-level
|
---|
| 46 | * window
|
---|
| 47 | */
|
---|
| 48 | public HTMLGUIElement(HTMLGUIElementSpec specification, HTMLGUIElement parent) {
|
---|
| 49 | super(specification, parent);
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | /*
|
---|
| 53 | * (non-Javadoc)
|
---|
| 54 | *
|
---|
| 55 | * @see de.ugoe.cs.autoquest.eventcore.IEventTarget#getPlatform()
|
---|
| 56 | */
|
---|
| 57 | @Override
|
---|
| 58 | public String getPlatform() {
|
---|
| 59 | return "HTML";
|
---|
| 60 | }
|
---|
| 61 |
|
---|
| 62 | /*
|
---|
| 63 | * (non-Javadoc)
|
---|
| 64 | *
|
---|
| 65 | * @see
|
---|
| 66 | * de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#updateSpecification(de.ugoe.cs.autoquest.eventcore
|
---|
| 67 | * .guimodel.IGUIElementSpec)
|
---|
| 68 | */
|
---|
| 69 | @Override
|
---|
| 70 | public void updateSpecification(IGUIElementSpec updateSpecification) {
|
---|
[961] | 71 | // nothing to do. There is not need for handle things such as name changes, etc.
|
---|
[950] | 72 | }
|
---|
| 73 |
|
---|
| 74 | /*
|
---|
| 75 | * (non-Javadoc)
|
---|
| 76 | *
|
---|
| 77 | * @see java.lang.Object#toString()
|
---|
| 78 | */
|
---|
| 79 | @Override
|
---|
| 80 | public String getStringIdentifier() {
|
---|
| 81 | String str = this.toString();
|
---|
| 82 | if (getParent() != null) {
|
---|
[994] | 83 | return str + "<-" + getParent().getStringIdentifier();
|
---|
[950] | 84 | }
|
---|
| 85 | return str;
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 | /**
|
---|
| 89 | * <p>
|
---|
| 90 | * A short string describing the GUI element, e.g., Button, Canvas, or ScrollBar.
|
---|
| 91 | * </p>
|
---|
| 92 | *
|
---|
| 93 | * @return short element descriptor
|
---|
| 94 | */
|
---|
| 95 | protected String getElementDescriptor() {
|
---|
| 96 | return "Default";
|
---|
| 97 | }
|
---|
| 98 |
|
---|
| 99 | }
|
---|