source: trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/AbstractDefaultGUIElement.java @ 585

Last change on this file since 585 was 576, checked in by pharms, 12 years ago
  • adaptations for ensuring, that GUI event targets can be created as singletons during parsing.
  • Property svn:executable set to *
File size: 1.7 KB
Line 
1// Module    : $RCSfile: AbstractDefaultGUIElement.java,v $
2// Version   : $Revision: 0.0 $  $Author: Patrick $  $Date: 27.11.2011 17:21:28 $
3// Project   : TaskTreePerformanceTest
4// Creation  : 2011 by Patrick
5// Copyright : Patrick Harms, 2011
6
7package de.ugoe.cs.quest.eventcore.guimodel;
8
9/**
10 * TODO comment
11 *
12 * @version $Revision: $ $Date: $
13 * @author 2011, last modified by $Author: $
14 */
15public abstract class AbstractDefaultGUIElement implements IGUIElement {
16   
17    /**  */
18    public static final long serialVersionUID = 1L;
19
20    /** the specification of the GUI element */
21    private IGUIElementSpec specification;
22
23    /**
24     * <p>
25     * TODO: comment
26     * </p>
27     *
28     * @param specification
29     */
30    public AbstractDefaultGUIElement(IGUIElementSpec specification) {
31        this.specification = specification;
32    }
33
34    /*
35     * (non-Javadoc)
36     *
37     * @see de.ugoe.cs.tasktree.guimodel.GUIElement#getSpecification()
38     */
39    @Override
40    public IGUIElementSpec getSpecification() {
41        return specification;
42    }
43
44    /*
45     * (non-Javadoc)
46     *
47     * @see GUIElement#equals(GUIElement)
48     */
49    public boolean equals(IGUIElement other) {
50        if (this == other)
51        {
52            return true;
53        }
54       
55        if (!this.getClass().isInstance(other)) {
56            return false;
57        }
58       
59        AbstractDefaultGUIElement otherElem = (AbstractDefaultGUIElement) other;
60       
61        return
62            ((otherElem.specification == specification) ||
63             ((specification != null) && specification.equals(otherElem.specification)));
64    }
65
66}
Note: See TracBrowser for help on using the repository browser.