Ignore:
Timestamp:
09/03/12 09:14:35 (12 years ago)
Author:
pharms
Message:
  • handle element hashes as int again and simply corrected parsing
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCLogParser.java

    r736 r743  
    340340                    else if ("hash".equals(atts.getValue("name"))) { 
    341341                        currentGuiElementSpec.setElementHash 
    342                             (atts.getValue("value")); 
     342                            ((int) Long.parseLong(atts.getValue("value"), 16)); 
    343343                    } 
    344344                } 
     
    566566            else 
    567567            { 
    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"); 
    571570            } 
    572571 
     
    645644            matcher = Pattern.compile(pattern).matcher(matcher.group(2)); 
    646645             
    647             String elementHash = "-1"; 
     646            float elementHash = -1; 
    648647             
    649648            pattern = "(([\\d]*)|([\\w$]*)|(([\\w$@\\.]*)=([\\w$@\\.]*)))\\z"; 
     
    656655                        // found digit value. Those in combination usually denote the position 
    657656                        // of the GUI element. So calculate an element has out of them 
    658                         elementHash += valueMatcher.group(2); 
     657                        elementHash += Integer.parseInt(valueMatcher.group(2)); 
    659658                    } 
    660659                    else if ((valueMatcher.group(5) != null) && 
     
    667666                         
    668667                        if ("alignmentX".equals(key) || "alignmentY".equals(key)) { 
    669                             elementHash += valueMatcher.group(6); 
     668                            elementHash += Float.parseFloat(valueMatcher.group(6)); 
    670669                        } 
    671670                    } 
     
    673672            } 
    674673 
    675             currentGuiElementSpec.setName("unknown(" + elementHash + ")"); 
     674            currentGuiElementSpec.setName("unknown(" + ((int) elementHash) + ")"); 
    676675            currentGuiElementSpec.setType(type); 
    677676            currentGuiElementSpec.setIndex(-1); 
    678             currentGuiElementSpec.setElementHash(elementHash); 
     677            currentGuiElementSpec.setElementHash((int) elementHash); 
    679678        } 
    680679        catch (Exception e) 
Note: See TracChangeset for help on using the changeset viewer.