Ignore:
Timestamp:
08/14/14 17:07:17 (10 years ago)
Author:
dmay
Message:

current progress: generate valid jacareto xml files and start replaying mouse clicks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/guimodel/JFCGUIElement.java

    r1674 r1678  
    8787     * @return the name 
    8888     */ 
    89     String getName() { 
     89    public String getName() { 
    9090        return specification.getName(); 
    9191    } 
     
    128128     *  
    129129     * @see 
    130      * de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#updateSpecification(de.ugoe.cs.autoquest.eventcore 
    131      * .guimodel.IGUIElementSpec) 
     130     * de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#updateSpecification(de.ugoe.cs.autoquest 
     131     * .eventcore .guimodel.IGUIElementSpec) 
    132132     */ 
    133133    @Override 
     
    152152    } 
    153153 
    154     /* 
    155      * (non-Javadoc) 
    156      *  
    157      * @see java.lang.Object#toString() 
    158      */ 
    159154    public String getJacaretoHierarchy() { 
    160         String str = getElementDescriptor() + "_(" + getIndex() + ")"; 
     155        String str; 
     156 
     157        // get the Java classname, ignore the package hierarchy if present 
     158        String[] parts = getSpecification().getType().split("\\."); 
     159        String name = parts[parts.length - 1]; 
     160 
     161        // find the correct Jacareto index 
     162        // jacareto indices start at 1 
     163        int jacIndex = getIndex() + 1; 
     164        // some class specific hacks 
     165        if (name.equals("JFrame")) { 
     166            jacIndex++; 
     167        } 
     168        else if (name.equals("JLayeredPane")) { 
     169            jacIndex--; 
     170        } 
     171 
     172        str = parts[parts.length - 1] + "_(" + jacIndex + ")"; 
     173 
    161174        if (getParent() != null) { 
    162175            return ((JFCGUIElement) getParent()).getJacaretoHierarchy() + "." + str; 
     
    164177        return str; 
    165178    } 
    166      
     179 
    167180    /* 
    168181     * (non-Javadoc) 
     
    178191    } 
    179192 
    180     /* (non-Javadoc) 
     193    /* 
     194     * (non-Javadoc) 
     195     *  
    181196     * @see de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#getDistanceTo(IGUIElement) 
    182197     */ 
Note: See TracChangeset for help on using the changeset viewer.