Ignore:
Timestamp:
04/07/14 08:42:08 (10 years ago)
Author:
pharms
Message:
  • added support and initial implementation of a platform specific distance measure between GUI elements
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServer.java

    r1276 r1490  
    1616 
    1717import de.ugoe.cs.autoquest.eventcore.guimodel.IFrame; 
     18import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement; 
    1819 
    1920/** 
     
    8687    } 
    8788 
     89    /* (non-Javadoc) 
     90     * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#getDistanceTo(IGUIElement) 
     91     */ 
     92    @Override 
     93    public double getDistanceTo(IGUIElement otherElement) { 
     94        if (otherElement instanceof HTMLServer) { 
     95            if (this.equals(otherElement)) { 
     96                return DISTANCE_NONE; 
     97            } 
     98            else { 
     99                return DISTANCE_DISTINCT_SERVER; 
     100            } 
     101        } 
     102        else if (otherElement instanceof HTMLDocument) { 
     103            if (this.equals(((HTMLDocument) otherElement).getServer())) { 
     104                return DISTANCE_SAME_SERVER; 
     105            } 
     106            else { 
     107                return DISTANCE_DISTINCT_SERVER; 
     108            } 
     109        } 
     110        else if (otherElement instanceof HTMLPageElement) { 
     111            HTMLServerSpec serverSpec = 
     112                ((HTMLPageElementSpec) otherElement.getSpecification()).getPage().getServer(); 
     113             
     114            if (this.getSpecification().getSimilarity(serverSpec)) { 
     115                return DISTANCE_SAME_SERVER; 
     116            } 
     117            else { 
     118                return DISTANCE_DISTINCT_SERVER; 
     119            } 
     120        } 
     121         
     122        return DISTANCE_DISTINCT_SERVER; 
     123    } 
     124 
    88125} 
Note: See TracChangeset for help on using the changeset viewer.