Changeset 1385 for trunk


Ignore:
Timestamp:
02/15/14 13:05:51 (11 years ago)
Author:
pharms
Message:
  • corrected bug when setting the parent of a GUI element. Now all equal GUI elements will have the same parent.
File:
1 edited

Legend:

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

    r1259 r1385  
    6161     * </p> 
    6262     */ 
    63     boolean usageObserved; 
     63    private boolean usageObserved; 
    6464 
    6565    /** 
     
    222222     */ 
    223223    void setParent(IGUIElement newParent) { 
    224         this.parent = newParent; 
     224        synchronized (AbstractDefaultGUIElement.class) { 
     225            // all equal GUI elements must have the same parent. Otherwise, they are not equal 
     226            // anymore and we would have discrepancies on the return value of getParent() on 
     227            // equal GUI elements. 
     228            this.parent = newParent; 
     229            if (equalGUIElements != null) { 
     230                for (AbstractDefaultGUIElement candidate : equalGUIElements) { 
     231                    candidate.parent = newParent; 
     232                } 
     233            } 
     234        } 
     235 
    225236    } 
    226237 
Note: See TracChangeset for help on using the changeset viewer.