- Timestamp:
- 12/11/12 17:24:30 (12 years ago)
- Location:
- trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCLogParser.java
r946 r1009 108 108 /** 109 109 * <p> 110 * internal handle to the parameters currently parsed for a component110 * internal handle to the GUI element specification currently parsed for a GUI element 111 111 * </p> 112 112 */ … … 115 115 /** 116 116 * <p> 117 * internal handle to the last parsed component117 * internal handle to the last parsed GUI element 118 118 * </p> 119 119 */ … … 122 122 /** 123 123 * <p> 124 * internal handle to the component of the previous event to be potentially reused for the124 * internal handle to the GUI element of the previous event to be potentially reused for the 125 125 * current 126 126 * </p> … … 148 148 * </p> 149 149 * 150 * @author Steffen Herbold151 * @version 1.0152 150 */ 153 151 private enum ParamSource { … … 396 394 if (currentGuiElementPath.size() <= 0) 397 395 { 398 // no component specification available. Try to parse the GUI element from396 // no GUI element specification available. Try to parse the GUI element from 399 397 // the toString parameter 400 398 currentGuiElementSpec = new JFCGUIElementSpec(); … … 631 629 /** 632 630 * <p> 633 * for some events in the log file, no component specification is provided. In this case the631 * for some events in the log file, no GUI element specification is provided. In this case the 634 632 * GUI element on which the event is executed must be determined based on the 635 633 * <code>toString</code> parameter of the event. This is achieved through this method. The … … 642 640 * the <code>toString</code> parameter of the event to be parsed for the GUI element 643 641 * 644 * @return the appropriate GUI Element642 * @return the appropriate GUI element 645 643 * 646 644 * @throws SAXException thrown if the provided value of the <code>toString</code> parameter -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCReplayIDCalculator.java
r927 r1009 77 77 /** 78 78 * Calculates the replayID of a JFCEvent needed for compatibility with guitar suite 79 * @param List of {@link JFCGUIElementSpec}s that represent the component path of aevent target79 * @param List of {@link JFCGUIElementSpec}s that represent the path of an event target 80 80 * for which the replayID should be calculated. 81 81 * @return replayID … … 91 91 String title = currentSpec.getName(); 92 92 String fuzzyTitle = getFuzzyTitle(title); 93 long windowHashCode = fuzzyTitle.hashCode();94 windowHashCode = (windowHashCode * 2) & 0xffffffffL;95 96 long propagatedHashCode = windowHashCode;93 long topLevelHashCode = fuzzyTitle.hashCode(); 94 topLevelHashCode = (topLevelHashCode * 2) & 0xffffffffL; 95 96 long propagatedHashCode = topLevelHashCode; 97 97 98 // added validator to check if generated component ids are known98 // added validator to check if generated GUI element ids are known 99 99 if (validator != null){ 100 if (validator.validateReplayID("w" + windowHashCode)){101 System.out.println("ID w" + windowHashCode + " is valid.");100 if (validator.validateReplayID("w" + topLevelHashCode)){ 101 System.out.println("ID w" + topLevelHashCode + " is valid."); 102 102 } 103 103 else{ 104 System.err.println(currentSpec + " describes an unknown component.");105 System.err.println("ID w" + windowHashCode + " is unknown." );104 System.err.println(currentSpec + " describes an unknown GUI element."); 105 System.err.println("ID w" + topLevelHashCode + " is unknown." ); 106 106 System.err.println(); 107 107 } … … 114 114 else{ 115 115 currentSpec = null; 116 // there are no subcomponents, so we use windowHashCode as hashCode117 hashCode = windowHashCode;116 // there are no children of current GUI element, so we use topLevelHashCode as hashCode 117 hashCode = topLevelHashCode; 118 118 } 119 119 120 // walk through component path and calculate hashcode120 // walk through GUI element path and calculate hashcode 121 121 while(currentSpec != null){ 122 122 long localHashCode = getLocalHashCode(currentSpec); … … 124 124 hashCode = (hashCode * 2) & 0xffffffffL; 125 125 126 // added validator to check if generated component ids are known126 // added validator to check if generated GUI element ids are known 127 127 if (validator != null){ 128 128 if (validator.validateReplayID("w" + hashCode)){ 129 129 System.out.println("ID w" + hashCode + " is valid."); 130 System.out.println("==> " + currentSpec + " describes a known component.");130 System.out.println("==> " + currentSpec + " describes a known GUI element."); 131 131 } 132 132 else{ 133 133 System.err.println("ID w" + hashCode + " is unknown." ); 134 System.err.println("==> " + currentSpec + " describes an unknown component.");134 System.err.println("==> " + currentSpec + " describes an unknown GUI element."); 135 135 System.err.println(); 136 136 } … … 183 183 184 184 /** 185 * Calculates the hashcode part of a component.185 * Calculates the hashcode part of a GUI element. 186 186 * @param spec The {@link JFCGUIElementSpec} for which the hashcode should be calculated. 187 187 * @return the local hashcode … … 238 238 239 239 /** 240 * Guitar has a special way to deal with window titles when241 * calculating unique widget IDs. This method mimics Guitar's240 * Guitar has a special way to deal with top level GUI elements (window) 241 * titles when calculating unique widget IDs. This method mimics Guitar's 242 242 * behavior (compare guitar source code: edu.umd.cs.guitar. 243 243 * model.JFCDefaultIDGeneratorSimple). -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCSimplifiedLogParser.java
r1004 r1009 42 42 import de.ugoe.cs.autoquest.keyboardmaps.VirtualKey; 43 43 import de.ugoe.cs.autoquest.plugin.jfc.eventcore.JFCEventId; 44 import de.ugoe.cs.autoquest.plugin.jfc.guimodel.JFCComponentTree;45 44 import de.ugoe.cs.autoquest.plugin.jfc.guimodel.JFCGUIElement; 46 45 import de.ugoe.cs.autoquest.plugin.jfc.guimodel.JFCGUIElementSpec; … … 76 75 * 77 76 * <p> 78 * Internal handle to the hashcode of the component, that is currently parsed.79 * </p> 80 */ 81 private Long current ComponentHash;77 * Internal handle to the hashcode of the GUI element, that is currently parsed. 78 * </p> 79 */ 80 private Long currentGUIElementHash; 82 81 83 82 /** 84 83 * 85 84 * <p> 86 * Internal handle to the hashcode of the parent of the component, that is currently parsed.85 * Internal handle to the hashcode of the parent of the GUI element, that is currently parsed. 87 86 * </p> 88 87 */ … … 118 117 /** 119 118 * <p> 120 * internal handle to the parameters currently parsed for a component119 * internal handle to the specification currently parsed for a GUI element 121 120 * </p> 122 121 */ … … 125 124 /** 126 125 * <p> 127 * internal handle to the parsed gui structure, stored in a JFCComponentTree126 * internal handle to the parsed GUI structure, stored in a GUIElementTree 128 127 * </p> 129 128 */ … … 132 131 /** 133 132 * <p> 134 * internal handle to the component of the previous event to be potentially reused for the133 * internal handle to the GUI element of the previous event to be potentially reused for the 135 134 * current 136 135 * </p> … … 288 287 /** 289 288 * <p> 290 * Returns the guimodel that is obtained from parsing log files.289 * Returns the GUI model that is obtained from parsing log files. 291 290 * </p> 292 291 * … … 319 318 } 320 319 else if (qName.equals("component")) { 321 current ComponentHash = Long.parseLong(atts.getValue("hash"), 16);320 currentGUIElementHash = Long.parseLong(atts.getValue("hash"), 16); 322 321 currentGuiElementSpec = new JFCGUIElementSpec(); 323 currentGuiElementSpec.setElementHash((int) current ComponentHash.longValue());322 currentGuiElementSpec.setElementHash((int) currentGUIElementHash.longValue()); 324 323 } 325 324 else if (qName.equals("event")) { … … 347 346 } 348 347 currentEventParameters.put(atts.getValue("name"), atts.getValue("value")); 349 } else if(current ComponentHash != null){348 } else if(currentGUIElementHash != null){ 350 349 if ("title".equals(atts.getValue("name"))) { 351 350 currentGuiElementSpec.setName(atts.getValue("value")); … … 390 389 currentGuiElementSpec.setTypeHierarchy(currentTypeHierarchy); 391 390 } 392 else if (qName.equals("component") && current ComponentHash != null) {393 currentGUIElementTree.add(current ComponentHash, currentParentHash, currentGuiElementSpec);391 else if (qName.equals("component") && currentGUIElementHash != null) { 392 currentGUIElementTree.add(currentGUIElementHash, currentParentHash, currentGuiElementSpec); 394 393 // do something with the ancestor list here 395 394 396 current ComponentHash = null;395 currentGUIElementHash = null; 397 396 currentParentHash = null; 398 397 currentTypeHierarchy = null; … … 609 608 /** 610 609 * <p> 611 * for some events in the log file, no component specification is provided. In this case the610 * for some events in the log file, no GUI element specification is provided. In this case the 612 611 * GUI element on which the event is executed must be determined based on the 613 612 * <code>toString</code> parameter of the event. This is achieved through this method. The -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/guimodel/JFCGUIElementSpec.java
r990 r1009 77 77 /** 78 78 * <p> 79 * Hash code of the windowelement. Used as unique identifier during its existence.79 * Hash code of the GUI element. Used as unique identifier during its existence. 80 80 * </p> 81 81 */ … … 84 84 /** 85 85 * <p> 86 * Previous hashes of the window as the windowmay have been destroyed and recreated.86 * Previous hashes of the GUI element as the GUI element may have been destroyed and recreated. 87 87 * </p> 88 88 */
Note: See TracChangeset
for help on using the changeset viewer.