Ignore:
Timestamp:
04/07/14 08:42:08 (11 years ago)
Author:
pharms
Message:
  • added support and initial implementation of a platform specific distance measure between GUI elements
Location:
trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel
Files:
2 edited

Legend:

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

    r1433 r1490  
    8787    public String toString() { 
    8888        return getStringIdentifier(); 
     89    } 
     90 
     91    /* (non-Javadoc) 
     92     * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#getDistanceTo(IGUIElement) 
     93     */ 
     94    @Override 
     95    public double getDistanceTo(IGUIElement otherElement) { 
     96        if (equals(otherElement)) { 
     97            return 0.0; 
     98        } 
     99        else if (super.getParent() != null) { 
     100            return super.getParent().getDistanceTo(otherElement); 
     101        } 
     102        else { 
     103            return 1.0; 
     104        } 
    89105    } 
    90106 
  • trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/IGUIElement.java

    r1433 r1490  
    109109     */ 
    110110    public void addEqualGUIElement(IGUIElement equalElement); 
     111 
     112    /** 
     113     * <p> 
     114     * Returns a measure for the distance of this {@link IGUIElement} to the provided one. Distance 
     115     * means a measure for the distance in display of the rendered GUI. The returned values must be 
     116     * between 0.0 and 1.0 inclusive. 0.0 means no distance, e.g., if the distance to itself shall be 
     117     * returned. 1.0 means the highest distance possible. Two GUI elements that are not visible 
     118     * at the same time independent of the screen resolution (e.g., because they resist in separate 
     119     * views) must have a distance of at least 0.5.   
     120     * </p> 
     121     *  
     122     * @param guiElement 
     123     *            the GUI element to measure the distance for 
     124     */ 
     125    public double getDistanceTo(IGUIElement otherElement); 
    111126} 
Note: See TracChangeset for help on using the changeset viewer.