Changeset 603 for trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/AbstractDefaultGUIElement.java
- Timestamp:
- 08/23/12 14:07:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/AbstractDefaultGUIElement.java
r576 r603 21 21 private IGUIElementSpec specification; 22 22 23 /** the reference to the parent element */ 24 private IGUIElement parent; 25 23 26 /** 24 27 * <p> … … 28 31 * @param specification 29 32 */ 30 public AbstractDefaultGUIElement(IGUIElementSpec specification ) {33 public AbstractDefaultGUIElement(IGUIElementSpec specification, IGUIElement parent) { 31 34 this.specification = specification; 35 this.parent = parent; 32 36 } 33 37 … … 42 46 } 43 47 48 /* (non-Javadoc) 49 * @see de.ugoe.cs.quest.eventcore.guimodel.IGUIElement#getParent() 50 */ 51 @Override 52 public IGUIElement getParent() { 53 return parent; 54 } 55 44 56 /* 45 57 * (non-Javadoc) … … 47 59 * @see GUIElement#equals(GUIElement) 48 60 */ 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))); 61 public final boolean equals(Object other) { 62 // implement final, as GUI elments are all singletons and the equal only if they are the 63 // same object 64 return super.equals(other); 65 } 66 67 /* (non-Javadoc) 68 * @see java.lang.Object#hashCode() 69 */ 70 @Override 71 public final int hashCode() { 72 // implement final, as GUI elments are all singletons and the equal only if they are the 73 // same object 74 return super.hashCode(); 64 75 } 65 76
Note: See TracChangeset
for help on using the changeset viewer.