Changeset 743
- Timestamp:
- 09/03/12 09:14:35 (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
r736 r743 340 340 else if ("hash".equals(atts.getValue("name"))) { 341 341 currentGuiElementSpec.setElementHash 342 ( atts.getValue("value"));342 ((int) Long.parseLong(atts.getValue("value"), 16)); 343 343 } 344 344 } … … 566 566 else 567 567 { 568 throw new SAXException 569 ("log file has an error, as it contains a key up event on key " + key + 570 " for which there is no preceeding key down event"); 568 Console.printerrln("log file has an error, as it contains a key up event on key " + 569 key + " for which there is no preceeding key down event"); 571 570 } 572 571 … … 645 644 matcher = Pattern.compile(pattern).matcher(matcher.group(2)); 646 645 647 String elementHash = "-1";646 float elementHash = -1; 648 647 649 648 pattern = "(([\\d]*)|([\\w$]*)|(([\\w$@\\.]*)=([\\w$@\\.]*)))\\z"; … … 656 655 // found digit value. Those in combination usually denote the position 657 656 // of the GUI element. So calculate an element has out of them 658 elementHash += valueMatcher.group(2);657 elementHash += Integer.parseInt(valueMatcher.group(2)); 659 658 } 660 659 else if ((valueMatcher.group(5) != null) && … … 667 666 668 667 if ("alignmentX".equals(key) || "alignmentY".equals(key)) { 669 elementHash += valueMatcher.group(6);668 elementHash += Float.parseFloat(valueMatcher.group(6)); 670 669 } 671 670 } … … 673 672 } 674 673 675 currentGuiElementSpec.setName("unknown(" + elementHash+ ")");674 currentGuiElementSpec.setName("unknown(" + ((int) elementHash) + ")"); 676 675 currentGuiElementSpec.setType(type); 677 676 currentGuiElementSpec.setIndex(-1); 678 currentGuiElementSpec.setElementHash( elementHash);677 currentGuiElementSpec.setElementHash((int) elementHash); 679 678 } 680 679 catch (Exception e) -
trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElement.java
r736 r743 69 69 * @return the hashCode 70 70 */ 71 StringgetElementHash() {71 int getElementHash() { 72 72 return specification.getElementHash(); 73 73 } -
trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElementSpec.java
r736 r743 46 46 * </p> 47 47 */ 48 private String elementHash = "-1";48 private int elementHash = -1; 49 49 50 50 /** … … 53 53 * </p> 54 54 */ 55 private List< String> formerElementHashes = new ArrayList<String>();55 private List<Integer> formerElementHashes = new ArrayList<Integer>(); 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 .equals(otherSpec.elementHash)) {89 if (elementHash == 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 .equals(otherSpec.elementHash));165 (index == otherSpec.index) && (elementHash == otherSpec.elementHash); 166 166 } 167 167 … … 233 233 * @return the elementHash 234 234 */ 235 public StringgetElementHash() {235 public int getElementHash() { 236 236 return elementHash; 237 237 } … … 275 275 * @param elementHash the elementHash to set 276 276 */ 277 public void setElementHash( StringnewElementHash) {278 if ( !this.elementHash.equals("-1") &&277 public void setElementHash(int newElementHash) { 278 if ((this.elementHash > -1) && 279 279 !this.formerElementHashes.contains(this.elementHash)) 280 280 { … … 294 294 void update(JFCGUIElementSpec other) { 295 295 if (other != this) { 296 for ( StringformerElementHash : other.formerElementHashes) {296 for (int formerElementHash : other.formerElementHashes) { 297 297 setElementHash(formerElementHash); 298 298 }
Note: See TracChangeset
for help on using the changeset viewer.