Changeset 1490 for trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocument.java
- Timestamp:
- 04/07/14 08:42:08 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocument.java
r1276 r1490 16 16 17 17 import de.ugoe.cs.autoquest.eventcore.guimodel.IDialog; 18 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement; 18 19 19 20 /** … … 69 70 } 70 71 72 /* (non-Javadoc) 73 * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#getDistanceTo(IGUIElement) 74 */ 75 @Override 76 public double getDistanceTo(IGUIElement otherElement) { 77 if (otherElement instanceof HTMLServer) { 78 // use the implementation provided by the server 79 return otherElement.getDistanceTo(this); 80 } 81 else if (otherElement instanceof HTMLDocument) { 82 if (this.getSpecification().getSimilarity(otherElement.getSpecification())) { 83 return DISTANCE_NONE; 84 } 85 else { 86 // use the implementation provided by the server to check if the document resists 87 // at least on the same server 88 return getServer().getDistanceTo(otherElement); 89 } 90 } 91 else if (otherElement instanceof HTMLPageElement) { 92 HTMLDocumentSpec documentSpec = 93 ((HTMLPageElementSpec) otherElement.getSpecification()).getPage(); 94 95 if (this.getSpecification().getSimilarity(documentSpec)) { 96 return DISTANCE_SAME_DOCUMENT; 97 } 98 else { 99 // use the implementation provided by the server to check if the document resists 100 // at least on the same server 101 return getServer().getDistanceTo(otherElement); 102 } 103 } 104 105 return DISTANCE_DISTINCT_SERVER; 106 } 107 71 108 /** 72 109 * <p>
Note: See TracChangeset
for help on using the changeset viewer.