Ignore:
Timestamp:
12/11/12 17:24:30 (12 years ago)
Author:
fglaser
Message:
  • autoquest-plugin-jfc subproject was adapted to new naming conventions (GUI element instead of component) were appropriate
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  
    108108    /** 
    109109     * <p> 
    110      * internal handle to the parameters currently parsed for a component 
     110     * internal handle to the GUI element specification currently parsed for a GUI element 
    111111     * </p> 
    112112     */ 
     
    115115    /** 
    116116     * <p> 
    117      * internal handle to the last parsed component 
     117     * internal handle to the last parsed GUI element 
    118118     * </p> 
    119119     */ 
     
    122122    /** 
    123123     * <p> 
    124      * internal handle to the component of the previous event to be potentially reused for the 
     124     * internal handle to the GUI element of the previous event to be potentially reused for the 
    125125     * current 
    126126     * </p> 
     
    148148     * </p> 
    149149     *  
    150      * @author Steffen Herbold 
    151      * @version 1.0 
    152150     */ 
    153151    private enum ParamSource { 
     
    396394                if (currentGuiElementPath.size() <= 0) 
    397395                { 
    398                     // no component specification available. Try to parse the GUI element from 
     396                    // no GUI element specification available. Try to parse the GUI element from 
    399397                    // the toString parameter 
    400398                    currentGuiElementSpec = new JFCGUIElementSpec(); 
     
    631629    /** 
    632630     * <p> 
    633      * for some events in the log file, no component specification is provided. In this case the 
     631     * for some events in the log file, no GUI element specification is provided. In this case the 
    634632     * GUI element on which the event is executed must be determined based on the 
    635633     * <code>toString</code> parameter of the event. This is achieved through this method. The 
     
    642640     *            the <code>toString</code> parameter of the event to be parsed for the GUI element 
    643641     *             
    644      * @return the appropriate GUI Element 
     642     * @return the appropriate GUI element 
    645643     *  
    646644     * @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  
    7777   /** 
    7878    * 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 a event target 
     79    * @param List of {@link JFCGUIElementSpec}s that represent the path of an event target 
    8080    * for which the replayID should be calculated.  
    8181    * @return replayID 
     
    9191           String title = currentSpec.getName(); 
    9292           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; 
    9797            
    98            // added validator to check if generated component ids are known 
     98           // added validator to check if generated GUI element ids are known 
    9999           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."); 
    102102                   } 
    103103                   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." ); 
    106106                           System.err.println(); 
    107107                   } 
     
    114114           else{ 
    115115                   currentSpec = null; 
    116                    // there are no subcomponents, so we use windowHashCode as hashCode 
    117                    hashCode = windowHashCode; 
     116                   // there are no children of current GUI element, so we use topLevelHashCode as hashCode 
     117                   hashCode = topLevelHashCode; 
    118118           } 
    119119 
    120            // walk through component path and calculate hashcode 
     120           // walk through GUI element path and calculate hashcode 
    121121           while(currentSpec != null){ 
    122122                   long localHashCode = getLocalHashCode(currentSpec); 
     
    124124                   hashCode = (hashCode * 2) & 0xffffffffL; 
    125125                    
    126                    // added validator to check if generated component ids are known 
     126                   // added validator to check if generated GUI element ids are known 
    127127                   if (validator != null){ 
    128128                           if (validator.validateReplayID("w" + hashCode)){ 
    129129                                   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."); 
    131131                           } 
    132132                           else{ 
    133133                                   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."); 
    135135                                   System.err.println(); 
    136136                           } 
     
    183183         
    184184        /** 
    185          * Calculates the hashcode part of a component. 
     185         * Calculates the hashcode part of a GUI element. 
    186186         * @param spec The {@link JFCGUIElementSpec} for which the hashcode should be calculated. 
    187187         * @return the local hashcode 
     
    238238         
    239239        /** 
    240          * Guitar has a special way to deal with window titles when 
    241          * calculating unique widget IDs. This method mimics Guitar's 
     240         * 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 
    242242         * behavior (compare guitar source code: edu.umd.cs.guitar. 
    243243         * model.JFCDefaultIDGeneratorSimple). 
  • trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCSimplifiedLogParser.java

    r1004 r1009  
    4242import de.ugoe.cs.autoquest.keyboardmaps.VirtualKey; 
    4343import de.ugoe.cs.autoquest.plugin.jfc.eventcore.JFCEventId; 
    44 import de.ugoe.cs.autoquest.plugin.jfc.guimodel.JFCComponentTree; 
    4544import de.ugoe.cs.autoquest.plugin.jfc.guimodel.JFCGUIElement; 
    4645import de.ugoe.cs.autoquest.plugin.jfc.guimodel.JFCGUIElementSpec; 
     
    7675     *  
    7776     * <p> 
    78      * Internal handle to the hashcode of the component, that is currently parsed. 
    79      * </p> 
    80      */ 
    81     private Long currentComponentHash; 
     77     * Internal handle to the hashcode of the GUI element, that is currently parsed. 
     78     * </p> 
     79     */ 
     80    private Long currentGUIElementHash; 
    8281     
    8382    /** 
    8483     *  
    8584     * <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.  
    8786     * </p> 
    8887     */ 
     
    118117    /** 
    119118     * <p> 
    120      * internal handle to the parameters currently parsed for a component 
     119     * internal handle to the specification currently parsed for a GUI element 
    121120     * </p> 
    122121     */ 
     
    125124    /** 
    126125     * <p> 
    127      * internal handle to the parsed gui structure, stored in a JFCComponentTree 
     126     * internal handle to the parsed GUI structure, stored in a GUIElementTree 
    128127     * </p> 
    129128     */ 
     
    132131    /** 
    133132     * <p> 
    134      * internal handle to the component of the previous event to be potentially reused for the 
     133     * internal handle to the GUI element of the previous event to be potentially reused for the 
    135134     * current 
    136135     * </p> 
     
    288287    /** 
    289288     * <p> 
    290      * Returns the gui model that is obtained from parsing log files. 
     289     * Returns the GUI model that is obtained from parsing log files. 
    291290     * </p> 
    292291     *  
     
    319318        } 
    320319        else if (qName.equals("component")) { 
    321                 currentComponentHash = Long.parseLong(atts.getValue("hash"), 16); 
     320                currentGUIElementHash = Long.parseLong(atts.getValue("hash"), 16); 
    322321                currentGuiElementSpec = new JFCGUIElementSpec(); 
    323                 currentGuiElementSpec.setElementHash((int) currentComponentHash.longValue()); 
     322                currentGuiElementSpec.setElementHash((int) currentGUIElementHash.longValue()); 
    324323        } 
    325324        else if (qName.equals("event")) { 
     
    347346                        } 
    348347                currentEventParameters.put(atts.getValue("name"), atts.getValue("value")); 
    349             } else if(currentComponentHash != null){ 
     348            } else if(currentGUIElementHash != null){ 
    350349                if ("title".equals(atts.getValue("name"))) { 
    351350                                currentGuiElementSpec.setName(atts.getValue("value")); 
     
    390389                currentGuiElementSpec.setTypeHierarchy(currentTypeHierarchy); 
    391390        } 
    392         else if (qName.equals("component") && currentComponentHash != null) { 
    393                 currentGUIElementTree.add(currentComponentHash, currentParentHash, currentGuiElementSpec); 
     391        else if (qName.equals("component") && currentGUIElementHash != null) { 
     392                currentGUIElementTree.add(currentGUIElementHash, currentParentHash, currentGuiElementSpec); 
    394393                // do something with the ancestor list here 
    395394                 
    396                 currentComponentHash = null; 
     395                currentGUIElementHash = null; 
    397396                currentParentHash = null; 
    398397                currentTypeHierarchy = null; 
     
    609608    /** 
    610609     * <p> 
    611      * for some events in the log file, no component specification is provided. In this case the 
     610     * for some events in the log file, no GUI element specification is provided. In this case the 
    612611     * GUI element on which the event is executed must be determined based on the 
    613612     * <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  
    7777    /** 
    7878     * <p> 
    79      * Hash code of the window element. Used as unique identifier during its existence. 
     79     * Hash code of the GUI element. Used as unique identifier during its existence. 
    8080     * </p> 
    8181     */ 
     
    8484    /** 
    8585     * <p> 
    86      * Previous hashes of the window as the window may have been destroyed and recreated. 
     86     * Previous hashes of the GUI element as the GUI element may have been destroyed and recreated. 
    8787     * </p> 
    8888     */ 
Note: See TracChangeset for help on using the changeset viewer.