Ignore:
Timestamp:
08/17/12 16:15:24 (12 years ago)
Author:
pharms
Message:
  • adaptations for ensuring, that GUI event targets can be created as singletons during parsing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/AbstractDefaultGUIElement.java

    r565 r576  
    1818    public static final long serialVersionUID = 1L; 
    1919 
    20     /** the information about the original type before the mapping */ 
    21     private String originalTypeInfo; 
     20    /** the specification of the GUI element */ 
     21    private IGUIElementSpec specification; 
    2222 
    23     /* (non-Javadoc) 
    24      * @see de.ugoe.cs.quest.eventcore.guimodel.IGUIElement#getParent() 
     23    /** 
     24     * <p> 
     25     * TODO: comment 
     26     * </p> 
     27     * 
     28     * @param specification 
    2529     */ 
    26     @Override 
    27     public IGUIElement getParent() { 
    28         // TODO remove getParent Stuff 
    29         return null; 
     30    public AbstractDefaultGUIElement(IGUIElementSpec specification) { 
     31        this.specification = specification; 
    3032    } 
    3133 
     
    3335     * (non-Javadoc) 
    3436     *  
    35      * @see de.ugoe.cs.tasktree.guimodel.GUIElement#getOriginalTypeInfo() 
     37     * @see de.ugoe.cs.tasktree.guimodel.GUIElement#getSpecification() 
    3638     */ 
    3739    @Override 
    38     public String getOriginalTypeInfo() { 
    39         return originalTypeInfo; 
     40    public IGUIElementSpec getSpecification() { 
     41        return specification; 
    4042    } 
    4143 
     
    4345     * (non-Javadoc) 
    4446     *  
    45      * @see GUIElement#setOriginalTypeInfo(String) 
     47     * @see GUIElement#equals(GUIElement) 
    4648     */ 
    47     void setOriginalTypeInfo(String originalTypeInfo) { 
    48         this.originalTypeInfo = originalTypeInfo; 
     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))); 
    4964    } 
    5065 
Note: See TracChangeset for help on using the changeset viewer.