Changeset 736
- Timestamp:
- 08/31/12 15:16:13 (12 years ago)
- Location:
- trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCLogParser.java
r713 r736 340 340 else if ("hash".equals(atts.getValue("name"))) { 341 341 currentGuiElementSpec.setElementHash 342 ( Integer.parseInt(atts.getValue("value"), 16));342 (atts.getValue("value")); 343 343 } 344 344 } … … 645 645 matcher = Pattern.compile(pattern).matcher(matcher.group(2)); 646 646 647 float elementHash = -1;647 String elementHash = "-1"; 648 648 649 649 pattern = "(([\\d]*)|([\\w$]*)|(([\\w$@\\.]*)=([\\w$@\\.]*)))\\z"; … … 656 656 // found digit value. Those in combination usually denote the position 657 657 // of the GUI element. So calculate an element has out of them 658 elementHash += Integer.parseInt(valueMatcher.group(2));658 elementHash += valueMatcher.group(2); 659 659 } 660 660 else if ((valueMatcher.group(5) != null) && … … 667 667 668 668 if ("alignmentX".equals(key) || "alignmentY".equals(key)) { 669 elementHash += Float.parseFloat(valueMatcher.group(6));669 elementHash += valueMatcher.group(6); 670 670 } 671 671 } … … 673 673 } 674 674 675 currentGuiElementSpec.setName("unknown(" + ((int) elementHash)+ ")");675 currentGuiElementSpec.setName("unknown(" + elementHash + ")"); 676 676 currentGuiElementSpec.setType(type); 677 677 currentGuiElementSpec.setIndex(-1); 678 currentGuiElementSpec.setElementHash( (int)elementHash);678 currentGuiElementSpec.setElementHash(elementHash); 679 679 } 680 680 catch (Exception e) -
trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElement.java
r714 r736 69 69 * @return the hashCode 70 70 */ 71 intgetElementHash() {71 String getElementHash() { 72 72 return specification.getElementHash(); 73 73 } -
trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElementSpec.java
r714 r736 43 43 /** 44 44 * <p> 45 * hash code of the window elem t. Used as unique identifier during its existence.46 * </p> 47 */ 48 private int elementHash = -1;45 * hash code of the window element. Used as unique identifier during its existence. 46 * </p> 47 */ 48 private String elementHash = "-1"; 49 49 50 50 /** … … 53 53 * </p> 54 54 */ 55 private List< Integer> formerElementHashes = new ArrayList<Integer>();55 private List<String> formerElementHashes = new ArrayList<String>(); 56 56 57 57 /* (non-Javadoc) … … 87 87 // the same, then similarity is given. Therefore these are the first two comparisons 88 88 89 if (elementHash == otherSpec.elementHash) {89 if (elementHash.equals(otherSpec.elementHash)) { 90 90 return true; 91 91 } … … 163 163 ((type == otherSpec.type) || ((type != null) && (type.equals(otherSpec.type)))) && 164 164 ((icon == otherSpec.icon) || ((icon != null) && (icon.equals(otherSpec.icon)))) && 165 (index == otherSpec.index) && (elementHash == otherSpec.elementHash);165 (index == otherSpec.index) && (elementHash.equals(otherSpec.elementHash)); 166 166 } 167 167 … … 233 233 * @return the elementHash 234 234 */ 235 public intgetElementHash() {235 public String getElementHash() { 236 236 return elementHash; 237 237 } … … 275 275 * @param elementHash the elementHash to set 276 276 */ 277 public void setElementHash( intnewElementHash) {278 if ( (this.elementHash > -1) &&277 public void setElementHash(String newElementHash) { 278 if (!this.elementHash.equals("-1") && 279 279 !this.formerElementHashes.contains(this.elementHash)) 280 280 { … … 294 294 void update(JFCGUIElementSpec other) { 295 295 if (other != this) { 296 for ( intformerElementHash : other.formerElementHashes) {296 for (String formerElementHash : other.formerElementHashes) { 297 297 setElementHash(formerElementHash); 298 298 }
Note: See TracChangeset
for help on using the changeset viewer.