[927] | 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.
|
---|
[831] | 14 |
|
---|
[922] | 15 | package de.ugoe.cs.autoquest.eventcore.guimodel;
|
---|
[545] | 16 |
|
---|
[2146] | 17 | import de.ugoe.cs.autoquest.eventcore.AbstractDefaultHierarchicalEventTarget;
|
---|
[609] | 18 |
|
---|
[545] | 19 | /**
|
---|
[831] | 20 | * <p>
|
---|
| 21 | * Skeletal implementation for GUI elements.
|
---|
| 22 | * </p>
|
---|
[545] | 23 | *
|
---|
[831] | 24 | * @version 1.0
|
---|
| 25 | * @author Patrick Harms
|
---|
[545] | 26 | */
|
---|
[2146] | 27 | public abstract class AbstractDefaultGUIElement extends AbstractDefaultHierarchicalEventTarget
|
---|
| 28 | implements IGUIElement
|
---|
| 29 | {
|
---|
[831] | 30 |
|
---|
| 31 | /**
|
---|
| 32 | * <p>
|
---|
| 33 | * Id for object serialization.
|
---|
| 34 | * </p>
|
---|
| 35 | */
|
---|
[545] | 36 | public static final long serialVersionUID = 1L;
|
---|
[1010] | 37 |
|
---|
| 38 | /**
|
---|
| 39 | * <p>
|
---|
| 40 | * Boolean that indicates if a GUIElement was used during a session.
|
---|
| 41 | * </p>
|
---|
| 42 | */
|
---|
[1385] | 43 | private boolean usageObserved;
|
---|
[603] | 44 |
|
---|
[576] | 45 | /**
|
---|
| 46 | * <p>
|
---|
[831] | 47 | * Constructor. Creates a new AbstractDefaultGUIElement.
|
---|
[576] | 48 | * </p>
|
---|
[831] | 49 | *
|
---|
[576] | 50 | * @param specification
|
---|
[831] | 51 | * specification of the created GUI element
|
---|
| 52 | * @param parent
|
---|
| 53 | * parent of the created GUI element; null means the element is a top-level window
|
---|
[565] | 54 | */
|
---|
[603] | 55 | public AbstractDefaultGUIElement(IGUIElementSpec specification, IGUIElement parent) {
|
---|
[2146] | 56 | super(specification, parent);
|
---|
[565] | 57 | }
|
---|
| 58 |
|
---|
[2146] | 59 | /* (non-Javadoc)
|
---|
| 60 | * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#getGUIModel()
|
---|
[545] | 61 | */
|
---|
| 62 | @Override
|
---|
[2146] | 63 | public GUIModel getGUIModel() {
|
---|
| 64 | return (GUIModel) super.getEventTargetModel();
|
---|
[545] | 65 | }
|
---|
| 66 |
|
---|
[2146] | 67 | /* (non-Javadoc)
|
---|
| 68 | * @see de.ugoe.cs.autoquest.eventcore.AbstractDefaultHierarchicalEventTarget#getParent()
|
---|
[603] | 69 | */
|
---|
| 70 | @Override
|
---|
| 71 | public IGUIElement getParent() {
|
---|
[2146] | 72 | return (IGUIElement) super.getParent();
|
---|
[603] | 73 | }
|
---|
| 74 |
|
---|
[1433] | 75 | /* (non-Javadoc)
|
---|
[2146] | 76 | * @see de.ugoe.cs.autoquest.eventcore.AbstractDefaultHierarchicalEventTarget#getSpecification()
|
---|
[1433] | 77 | */
|
---|
| 78 | @Override
|
---|
[2146] | 79 | public IGUIElementSpec getSpecification() {
|
---|
| 80 | return (IGUIElementSpec) super.getSpecification();
|
---|
[1433] | 81 | }
|
---|
| 82 |
|
---|
[2146] | 83 | /* (non-Javadoc)
|
---|
| 84 | * @see de.ugoe.cs.autoquest.eventcore.AbstractDefaultHierarchicalEventTarget#getEventTargetModel()
|
---|
[609] | 85 | */
|
---|
| 86 | @Override
|
---|
[2146] | 87 | public GUIModel getEventTargetModel() {
|
---|
| 88 | return (GUIModel) super.getEventTargetModel();
|
---|
[609] | 89 | }
|
---|
| 90 |
|
---|
[545] | 91 | /*
|
---|
| 92 | * (non-Javadoc)
|
---|
| 93 | *
|
---|
[1051] | 94 | * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#isUsed()
|
---|
| 95 | */
|
---|
| 96 | @Override
|
---|
| 97 | public boolean isUsed() {
|
---|
| 98 | return usageObserved;
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 | /*
|
---|
| 102 | * (non-Javadoc)
|
---|
| 103 | *
|
---|
| 104 | * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#markUsed()
|
---|
| 105 | */
|
---|
| 106 | @Override
|
---|
| 107 | public void markUsed() {
|
---|
| 108 | this.usageObserved = true;
|
---|
| 109 | }
|
---|
| 110 |
|
---|
[545] | 111 | }
|
---|