- Timestamp:
- 02/25/15 12:44:56 (10 years ago)
- Location:
- trunk/autoquest-plugin-android/src/main/java/de/ugoe/cs/autoquest/plugin/android
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-android/src/main/java/de/ugoe/cs/autoquest/plugin/android/AndroidLogParser.java
r1870 r1880 328 328 currentParentHash = Long.parseLong(atts.getValue("value")); 329 329 } 330 else if ("position".equals(atts.getValue("name"))) { 331 currentGUIElementSpec.setElementPosition(Integer.parseInt(atts.getValue("value"))); 332 } 330 333 } 331 334 else if (currentEventId != null) { -
trunk/autoquest-plugin-android/src/main/java/de/ugoe/cs/autoquest/plugin/android/guimodel/ANDROIDGUIElementSpec.java
r1869 r1880 53 53 * <p> 54 54 * Path to an element in an activity. e.g. a path of a button could look like 55 * MainActivity/DecorView/ActionBarOverlayLayout/FrameLayout/ 55 * MainActivity/DecorView/ActionBarOverlayLayout/FrameLayout/RelativeLayout/Button 56 56 * </p> 57 57 */ … … 86 86 /** 87 87 * <p> 88 * The position of the element in the original GUI. 89 * </p> 90 */ 91 private int elementPosition; 92 93 /** 94 * <p> 88 95 * Type hierarchy of the class itself. 89 96 * </p> 90 97 */ 91 98 private List<String> typeHierarchy = null; 92 99 93 100 /* 94 101 * (non-Javadoc) … … 121 128 */ 122 129 123 if (otherSpec.index > 1 && index == otherSpec.index) { 130 if (otherSpec.getIndex() > 1 && getIndex() == otherSpec.getIndex()) { 131 return true; 132 } 133 134 /* 135 * Path and label of the elements fits together. In this case it is most likely that this 136 * elements fits together. This only makes since in the case a label exists. 137 */ 138 if (otherSpec.getName() != "NOT_SET" && getName() != "NOT_SET" && 139 !otherSpec.getName().contains("image:") && getName().contains("image:") && 140 otherSpec.getName() == getName() && otherSpec.getPath() == getPath()) 141 { 142 return true; 143 } 144 145 /* 146 * Path and position fits together. In this case it is most likely that this elements fits 147 * together. 148 */ 149 if (otherSpec.getPath() == getPath() && 150 otherSpec.getElementPosition() == getElementPosition()) 151 { 124 152 return true; 125 153 } … … 142 170 return false; 143 171 } 144 145 172 146 173 /* … … 168 195 return typeHierarchy.toArray(new String[typeHierarchy.size()]); 169 196 } 170 197 171 198 /** 172 199 * <p> … … 210 237 * @return text or image of the GUI element. 211 238 */ 212 public String getName() { 239 public String getName() { 213 240 if (name == null || name.trim().length() == 0) { 214 241 return "NOT_SET"; … … 218 245 219 246 /** 247 * 248 * <p> 249 * Return the position of the element in the original GUI. 250 * </p> 251 * 252 * @return position of the element in the original GUI. 253 */ 254 public int getElementPosition() { 255 return elementPosition; 256 } 257 258 /** 259 * 260 * <p> 261 * Set the position of the element in the original GUI. 262 * </p> 263 * 264 * @param elementPosition 265 */ 266 public void setElementPosition(int elementPosition) { 267 this.elementPosition = elementPosition; 268 } 269 270 /** 220 271 * <p> 221 272 * Sets the GUI element identifier. … … 282 333 this.typeHierarchy = typeHierarchy; 283 334 } 284 335 285 336 /* 286 337 * (non-Javadoc) … … 303 354 (path == null ? otherSpec.path == null : path.equals(otherSpec.path)) && 304 355 (index == otherSpec.index) && 356 (elementPosition == otherSpec.elementPosition) && 305 357 (name == null ? otherSpec.name == null : name.equals(otherSpec.name)) && 306 358 (type == null ? otherSpec.type == null : type.equals(otherSpec.type)); 307 359 } 308 360 309 361 /* 310 362 * (non-Javadoc) … … 314 366 @Override 315 367 public int hashCode() { 316 // 17 due to the reason that this is a prime number.368 // 17 due to the reason that this is a prime number. 317 369 int result = 17; 318 370 /* … … 324 376 result = 31 * result + index; 325 377 result = 31 * result + getName().hashCode(); 326 result = 31 * result + type.hashCode(); 378 result = 31 * result + type.hashCode(); 379 result = 31 * result + elementPosition; 327 380 return result; 328 381 } 329 330 382 331 383 }
Note: See TracChangeset
for help on using the changeset viewer.