Ignore:
Timestamp:
09/20/12 12:03:03 (12 years ago)
Author:
sherbold
Message:
  • code documentation and clean-up
Location:
trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCButton.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents buttons in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 21.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCButton extends MFCGUIElement implements IButton { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCButton. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
     30     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2433     */ 
    2534    public MFCButton(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCCanvas.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents canvas' in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 23.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCCanvas extends MFCGUIElement implements ICanvas { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCCanvas. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
    2430     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2533     */ 
    2634    public MFCCanvas(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCComboBox.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents combo boxes in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 23.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCComboBox extends MFCGUIElement implements IComboBox { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCComboBox. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
    2430     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2533     */ 
    2634    public MFCComboBox(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCDialog.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents dialogs in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 21.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCDialog extends MFCWindow implements IDialog { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCDialog. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
     30     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2433     */ 
    2534    public MFCDialog(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCGUIElement.java

    r681 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56 
    67/** 
    7  * TODO comment 
     8 * <p> 
     9 * Base class that represents GUI element in MFC GUIs. 
     10 * </p> 
    811 *  
    9  * @version $Revision: $ $Date: $ 
    10  * @author 2011, last modified by $Author: $ 
     12 * @version 1.0 
     13 * @author Patrick Harms 
    1114 */ 
    1215public abstract class MFCGUIElement extends AbstractDefaultGUIElement { 
    13      
    14     /**  */ 
     16 
     17    /** 
     18     * <p> 
     19     * Id for object serialization. 
     20     * </p> 
     21     */ 
    1522    private static final long serialVersionUID = 1L; 
    1623 
    1724    /** 
    18      * @param name 
    19      * @param id 
    20      * @param isModal 
     25     * <p> 
     26     * Constructor. Creates a new MFCGUIElement. 
     27     * </p> 
     28     *  
     29     * @param specification 
     30     *            specification of created GUI element 
     31     * @param parent 
     32     *            parent of the created GUI element; null means that the element is a top-level 
     33     *            window 
    2134     */ 
    2235    public MFCGUIElement(MFCGUIElementSpec specification, MFCGUIElement parent) { 
     
    2437    } 
    2538 
    26     /* (non-Javadoc) 
     39    /* 
     40     * (non-Javadoc) 
     41     *  
    2742     * @see de.ugoe.cs.quest.eventcore.IEventTarget#getPlatform() 
    2843     */ 
     
    3348 
    3449    /** 
    35      * @return Returns the id. 
     50     * <p> 
     51     * Returns the HWND (Id) of the GUI element. 
     52     * </p> 
     53     *  
     54     * @return the HWND (Id) 
    3655     */ 
    3756    public String getId() { 
     
    4059 
    4160    /** 
    42      * @return Returns the name. 
     61     * <p> 
     62     * Returns the type of the GUI element. 
     63     * </p> 
     64     *  
     65     * @return the type 
    4366     */ 
    4467    public String getType() { 
     
    4770 
    4871    /** 
    49      * @return Returns the name. 
     72     * <p> 
     73     * Returns the name of the GUI element. 
     74     * </p> 
     75     *  
     76     * @return the name 
    5077     */ 
    5178    public String getName() { 
     
    5481 
    5582    /** 
    56      * @return Returns the isModal. 
     83     * <p> 
     84     * Returns the modality of the GUI element. 
     85     * </p> 
     86     *  
     87     * @return the modality 
    5788     */ 
    5889    public boolean isModal() { 
     
    6293    /** 
    6394     * <p> 
    64      * TODO: comment 
     95     * Returns the resource Id of the GUI element. 
    6596     * </p> 
    66      * 
    67      * @return 
     97     *  
     98     * @return the resource Id 
    6899     */ 
    69100    public int getResourceId() { 
     
    71102    } 
    72103 
    73     /* (non-Javadoc) 
    74      * @see de.ugoe.cs.quest.eventcore.guimodel.IGUIElement#updateSpecification(de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec) 
     104    /* 
     105     * (non-Javadoc) 
     106     *  
     107     * @see 
     108     * de.ugoe.cs.quest.eventcore.guimodel.IGUIElement#updateSpecification(de.ugoe.cs.quest.eventcore 
     109     * .guimodel.IGUIElementSpec) 
    75110     */ 
    76111    @Override 
     
    78113        ((MFCGUIElementSpec) super.getSpecification()).update(furtherSpec); 
    79114    } 
    80      
     115 
     116    /* 
     117     * (non-Javadoc) 
     118     *  
     119     * @see de.ugoe.cs.quest.eventcore.IEventTarget#getStringIdentifier() 
     120     */ 
    81121    @Override 
    82122    public String getStringIdentifier() { 
    83123        String str = this.toString(); 
    84         if( getParent()!=null ) { 
     124        if (getParent() != null) { 
    85125            return getParent().getStringIdentifier() + "->" + str; 
    86126        } 
     
    88128    } 
    89129 
    90     /* (non-Javadoc) 
     130    /* 
     131     * (non-Javadoc) 
     132     *  
    91133     * @see java.lang.Object#toString() 
    92134     */ 
     
    98140    /** 
    99141     * <p> 
    100      * TODO: comment 
     142     * Returns the XML representation of the GUI element. 
    101143     * </p> 
     144     *  
     145     * @return the XML representation 
    102146     */ 
    103147    public String toXML() { 
    104148        if (getParent() != null) { 
    105             return 
    106                 ((MFCGUIElement) getParent()).toXML() + 
     149            return ((MFCGUIElement) getParent()).toXML() + 
    107150                ((MFCGUIElementSpec) super.getSpecification()).toXML(); 
    108151        } 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCGUIElementSpec.java

    r832 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    99100     *            modality of the window 
    100101     */ 
    101     protected MFCGUIElementSpec(long    hwnd, 
    102                                 String  name, 
    103                                 int     resourceId, 
    104                                 String  type, 
    105                                 boolean isModal) 
     102    protected MFCGUIElementSpec(long hwnd, String name, int resourceId, String type, boolean isModal) 
    106103    { 
    107104        this.hwnd = hwnd; 
     
    121118    public String getName() { 
    122119        StringBuffer names = new StringBuffer(); 
    123          
     120 
    124121        if (name != null) { 
    125122            names.append('"'); 
     
    130127            names.append("NOT_SET"); 
    131128        } 
    132          
     129 
    133130        if (formerNames.size() > 0) { 
    134              
     131 
    135132            names.append(" (aka "); 
    136              
     133 
    137134            for (int i = 0; i < formerNames.size(); i++) { 
    138135                if (i > 0) { 
     
    144141                names.append('"'); 
    145142            } 
    146              
     143 
    147144            names.append(")"); 
    148145        } 
    149          
     146 
    150147        return names.toString(); 
    151148    } 
     
    173170    } 
    174171 
    175     /* (non-Javadoc) 
     172    /* 
     173     * (non-Javadoc) 
     174     *  
    176175     * @see de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec#getType() 
    177176     */ 
     
    183182    /** 
    184183     * <p> 
    185      * TODO: comment 
    186      * </p> 
    187      * 
    188      * @return 
     184     * Returns the modality of the specified GUI element. 
     185     * </p> 
     186     *  
     187     * @return the modality 
    189188     */ 
    190189    public boolean isModal() { 
     
    201200     */ 
    202201    public void setName(String newName) { 
    203         if ((this.name != null) && 
    204             (!this.name.equals(newName)) && 
     202        if ((this.name != null) && (!this.name.equals(newName)) && 
    205203            (!this.formerNames.contains(this.name))) 
    206204        { 
    207205            this.formerNames.add(this.name); 
    208206        } 
    209          
     207 
    210208        this.name = newName; 
    211209    } 
     
    223221            this.formerHwnds.add(this.hwnd); 
    224222        } 
    225          
     223 
    226224        this.hwnd = newHwnd; 
    227225    } 
    228226 
    229     /* (non-Javadoc) 
    230      * @see de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec#getSimilarity(de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec) 
     227    /* 
     228     * (non-Javadoc) 
     229     *  
     230     * @see 
     231     * de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec#getSimilarity(de.ugoe.cs.quest.eventcore 
     232     * .guimodel.IGUIElementSpec) 
    231233     */ 
    232234    @Override 
    233235    public boolean getSimilarity(IGUIElementSpec other) { 
    234          
     236 
    235237        if (this == other) { 
    236238            return true; 
    237239        } 
    238          
     240 
    239241        if (!(other instanceof MFCGUIElementSpec)) { 
    240242            return false; 
    241243        } 
    242          
     244 
    243245        MFCGUIElementSpec otherSpec = (MFCGUIElementSpec) other; 
    244246 
     
    260262        // and reopend, i.e. a new instance is created. If one of them stays the same, then 
    261263        // similarity is given. Therefore these are the first two comparisons 
    262          
     264 
    263265        if (hwnd == otherSpec.hwnd) { 
    264266            return true; 
    265267        } 
    266          
     268 
    267269        if ((name != null) && (name.equals(otherSpec.name))) { 
    268270            return true; 
    269271        } 
    270          
    271         if ((((name == null) && (otherSpec.name == null)) || 
    272              (("".equals(name)) && ("".equals(otherSpec.name)))) && 
    273             (formerNames.size() == 0) && (otherSpec.formerNames.size() == 0)) 
     272 
     273        if ((((name == null) && (otherSpec.name == null)) || (("".equals(name)) && ("" 
     274            .equals(otherSpec.name)))) && 
     275            (formerNames.size() == 0) && 
     276            (otherSpec.formerNames.size() == 0)) 
    274277        { 
    275278            return true; 
    276279        } 
    277          
     280 
    278281        // if the hwnd and the name did not stay the same, then the name should be checked first. 
    279282        // The current name of one of the specs must be contained in the former names of the 
     
    291294            return true; 
    292295        } 
    293          
     296 
    294297        // ok. Even the names do not match. This is usually a clear indication, that the elements 
    295298        // are distinct. However, we check, if the former handles matched. This is very unlikely 
     
    302305 
    303306        // now we can be really sure, that the GUI elements differ 
    304          
     307 
    305308        return false; 
    306309    } 
    307310 
    308     /* (non-Javadoc) 
     311    /* 
     312     * (non-Javadoc) 
     313     *  
    309314     * @see de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec#equals(IGUIElementSpec) 
    310315     */ 
    311316    @Override 
    312317    public boolean equals(Object other) { 
    313          
     318 
    314319        if (this == other) { 
    315320            return true; 
    316321        } 
    317          
     322 
    318323        if (!(other instanceof MFCGUIElementSpec)) { 
    319324            return false; 
    320325        } 
    321          
     326 
    322327        MFCGUIElementSpec otherSpec = (MFCGUIElementSpec) other; 
    323          
    324         return 
    325             (hwnd == otherSpec.hwnd) && (isModal == otherSpec.isModal) && 
     328 
     329        return (hwnd == otherSpec.hwnd) && (isModal == otherSpec.isModal) && 
    326330            (resourceId == otherSpec.resourceId) && 
    327331            ((type == otherSpec.type) || ((type != null) && (type.equals(otherSpec.type)))) && 
     
    329333    } 
    330334 
    331     /* (non-Javadoc) 
     335    /* 
     336     * (non-Javadoc) 
     337     *  
    332338     * @see java.lang.Object#hashCode() 
    333339     */ 
     
    340346    /** 
    341347     * <p> 
    342      * Returns a string identfier of the window:<br> 
     348     * Returns a string identifier of the window:<br> 
    343349     * {@code [resourceId;"windowName";"className";modality]} 
    344350     * </p> 
     
    348354    @Override 
    349355    public String toString() { 
    350         return "[" + resourceId + ";" + getName() + ";\"" + type + "\";" + isModal + ";" + 
    351             hwnd + "]"; 
    352     } 
    353  
    354     /** 
    355      * <p> 
    356      * TODO: comment 
    357      * </p> 
     356        return "[" + resourceId + ";" + getName() + ";\"" + type + "\";" + isModal + ";" + hwnd + 
     357            "]"; 
     358    } 
     359 
     360    /** 
     361     * <p> 
     362     * Returns the XML representation of this specification. 
     363     * </p> 
     364     *  
     365     * @return the XML representation 
    358366     */ 
    359367    String toXML() { 
    360         return 
    361             "<window name=\"" + (name != null ? StringTools.xmlEntityReplacement(name) : "") + 
    362             "\" class=\"" + StringTools.xmlEntityReplacement(type) + 
    363             "\" resourceId=\"" + resourceId + "\" isModal=\"" + 
    364             isModal + "\"/>"; 
    365     } 
    366  
    367     /** 
    368      * <p> 
    369      * TODO: comment 
    370      * </p> 
    371      * 
     368        return "<window name=\"" + (name != null ? StringTools.xmlEntityReplacement(name) : "") + 
     369            "\" class=\"" + StringTools.xmlEntityReplacement(type) + "\" resourceId=\"" + 
     370            resourceId + "\" isModal=\"" + isModal + "\"/>"; 
     371    } 
     372 
     373    /** 
     374     * <p> 
     375     * Updates the specification with another specification. 
     376     * </p> 
     377     *  
    372378     * @param furtherSpec 
     379     *            specification used to update the current specification 
    373380     */ 
    374381    void update(IGUIElementSpec furtherSpec) { 
    375382        MFCGUIElementSpec other = (MFCGUIElementSpec) furtherSpec; 
    376          
     383 
    377384        if (other != this) { 
    378385            for (long formerHwnd : other.formerHwnds) { 
     
    388395            } 
    389396 
    390             if ((name != other.name) && (name != null) && (!name.equals(other.name))) 
    391             { 
     397            if ((name != other.name) && (name != null) && (!name.equals(other.name))) { 
    392398                setName(other.name); 
    393399            } 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCListBox.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents list boxes in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 23.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCListBox extends MFCGUIElement implements IListBox { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCListBox. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
    2430     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2533     */ 
    2634    public MFCListBox(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCPanel.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents panels in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 23.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCPanel extends MFCGUIElement implements IPanel { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCPanel. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
    2430     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2533     */ 
    2634    public MFCPanel(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCTabbedPane.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents tabbed panes in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 23.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCTabbedPane extends MFCGUIElement implements ITabbedPane { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new TabbedPane. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
    2430     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2533     */ 
    2634    public MFCTabbedPane(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCTextArea.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents text areas in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 21.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCTextArea extends MFCGUIElement implements ITextArea { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCTextArea. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
     30     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2433     */ 
    2534    public MFCTextArea(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCToolBar.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents tool bars in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 23.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCToolBar extends MFCGUIElement implements IToolBar { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCToolBar. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
    2430     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2533     */ 
    2634    public MFCToolBar(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCTrackBar.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    56/** 
    67 * <p> 
    7  * TODO comment 
     8 * Class that represents track bars in MFC GUIs. 
    89 * </p> 
    910 *  
    10  * @version $Revision: $ $Date: 23.08.2012$ 
    11  * @author 2012, last modified by $Author: pharms$ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1213 */ 
    1314public class MFCTrackBar extends MFCGUIElement implements ITrackBar { 
    1415 
    15     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1621    private static final long serialVersionUID = 1L; 
    1722 
    1823    /** 
    1924     * <p> 
    20      * TODO: comment 
     25     * Constructor. Creates a new MFCTrackBar. 
    2126     * </p> 
    22      * 
     27     *  
    2328     * @param specification 
     29     *            specification of created GUI element 
    2430     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2533     */ 
    2634    public MFCTrackBar(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCWindow.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    45 
    56/** 
    6  * TODO comment 
     7 * <p> 
     8 * Class that represents windows in MFC GUIs. 
     9 * </p> 
    710 *  
    8  * @version $Revision: $ $Date: $ 
    9  * @author 2011, last modified by $Author: $ 
     11 * @version 1.0 
     12 * @author Patrick Harms 
    1013 */ 
    1114public class MFCWindow extends MFCGUIElement implements IFrame { 
    1215 
    13     /**  */ 
     16    /** 
     17     * <p> 
     18     * Id for object serialization. 
     19     * </p> 
     20     */ 
    1421    private static final long serialVersionUID = 1L; 
    1522 
    1623    /** 
    17      * @param name 
    18      * @param id 
    19      * @param isModal 
     24     * <p> 
     25     * Constructor. Creates a new MFCWindow. 
     26     * </p> 
     27     *  
     28     * @param specification 
     29     *            specification of created GUI element 
     30     * @param parent 
     31     *            parent of the created GUI element; null means that the element is a top-level 
     32     *            window 
    2033     */ 
    2134    public MFCWindow(MFCGUIElementSpec specification, MFCGUIElement parent) { 
  • trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/WindowTree.java

    r655 r837  
     1 
    12package de.ugoe.cs.quest.plugin.mfc.guimodel; 
    23 
     
    1213import de.ugoe.cs.quest.eventcore.guimodel.GUIModelException; 
    1314import de.ugoe.cs.quest.eventcore.guimodel.IGUIElementFactory; 
    14  
    1515 
    1616/** 
     
    3030    /** 
    3131     * <p> 
    32      * Maintains a set of all the targets of all widgets that were at some point part of the 
    33      * window tree. 
     32     * Maintains a set of all the targets of all widgets that were at some point part of the window 
     33     * tree. 
    3434     * </p> 
    3535     */ 
     
    3838    /** 
    3939     * <p> 
    40      * Map of all GUI element specifications that are part of the tree for efficient searching. 
    41      * The keys of the map are the hwnd's of the GUI elements. 
     40     * Map of all GUI element specifications that are part of the tree for efficient searching. The 
     41     * keys of the map are the hwnd's of the GUI elements. 
    4242     * </p> 
    4343     */ 
     
    4646    /** 
    4747     * <p> 
    48      * Map of all children of GUI elements that are part of the tree. The keys of the map are 
    49      * the hwnd's of the parent GUI elements. 
     48     * Map of all children of GUI elements that are part of the tree. The keys of the map are the 
     49     * hwnd's of the parent GUI elements. 
    5050     * </p> 
    5151     */ 
     
    5454    /** 
    5555     * <p> 
    56      * Map of all parents of GUI elements that are part of the tree. The keys of the map are 
    57      * the hwnd's of the child GUI elements. 
     56     * Map of all parents of GUI elements that are part of the tree. The keys of the map are the 
     57     * hwnd's of the child GUI elements. 
    5858     * </p> 
    5959     */ 
     
    6666     */ 
    6767    private GUIModel guiModel = new GUIModel(); 
    68      
     68 
    6969    /** 
    7070     * <p> 
     
    114114     *            class name of the window to be created 
    115115     */ 
    116     public void add(long    parentHwnd, 
    117                     long    childHwnd, 
    118                     String  childWindowName, 
    119                     int     resourceId, 
    120                     String  className, 
     116    public void add(long parentHwnd, 
     117                    long childHwnd, 
     118                    String childWindowName, 
     119                    int resourceId, 
     120                    String className, 
    121121                    boolean isModal) 
    122122    { 
     
    128128            if (parent != null) { 
    129129                List<MFCGUIElementSpec> otherChildren = childRelations.get(parentHwnd); 
    130                  
     130 
    131131                if (otherChildren == null) { 
    132132                    otherChildren = new ArrayList<MFCGUIElementSpec>(); 
    133133                    childRelations.put(parentHwnd, otherChildren); 
    134134                } 
    135                  
     135 
    136136                otherChildren.add(child); 
    137                  
     137 
    138138                parentRelations.put(childHwnd, parent); 
    139139            } 
     
    145145    /** 
    146146     * <p> 
    147      * Searches the tree for a window with the specified hwnd and returns its {@link MFCGUIElementSpec} 
    148      * . 
     147     * Searches the tree for a window with the specified hwnd and returns its 
     148     * {@link MFCGUIElementSpec} . 
    149149     * </p> 
    150150     *  
     
    157157        if (guiElement == null) { 
    158158            List<MFCGUIElementSpec> guiElementPath = new ArrayList<MFCGUIElementSpec>(); 
    159              
     159 
    160160            MFCGUIElementSpec child = guiElementSpecs.get(hwnd); 
    161              
     161 
    162162            if (child == null) { 
    163163                throw new RuntimeException("no GUI element found with id " + hwnd); 
    164164            } 
    165              
     165 
    166166            while (child != null) { 
    167167                guiElementPath.add(0, child); 
    168168                child = parentRelations.get(child.getHwnd()); 
    169169            } 
    170              
     170 
    171171            try { 
    172                 guiElement = (MFCGUIElement) 
    173                     guiModel.integratePath(guiElementPath, guiElementFactory); 
     172                guiElement = 
     173                    (MFCGUIElement) guiModel.integratePath(guiElementPath, guiElementFactory); 
    174174            } 
    175175            catch (GUIModelException e) { 
     
    183183    /** 
    184184     * <p> 
    185      * TODO: comment 
    186      * </p> 
    187      * 
     185     * Sets the name of a GUI element given its HWND. 
     186     * </p> 
     187     *  
    188188     * @param hwnd 
     189     *            HWND of the GUI element 
    189190     * @param windowName 
     191     *            new name of the GUI element 
    190192     */ 
    191193    public void setName(long hwnd, String windowName) { 
     
    201203        } 
    202204    } 
    203      
     205 
    204206    /** 
    205207     * <p> 
     
    215217        MFCGUIElementSpec node = guiElementSpecs.remove(hwnd); 
    216218        int removedCounter = 1; 
    217          
     219 
    218220        if (node != null) { 
    219221            List<MFCGUIElementSpec> nodesToBeRemoved = childRelations.remove(hwnd); 
    220              
     222 
    221223            // remove all children and sub-children, if any 
    222224            if (nodesToBeRemoved != null) { 
     
    225227                    List<MFCGUIElementSpec> children = 
    226228                        childRelations.remove(nodeToBeRemoved.getHwnd()); 
    227                      
     229 
    228230                    if (children != null) { 
    229231                        nodesToBeRemoved.addAll(children); 
    230232                    } 
    231                      
     233 
    232234                    guiElementSpecs.remove(nodeToBeRemoved.getHwnd()); 
    233235                    parentRelations.remove(nodeToBeRemoved.getHwnd()); 
     
    248250                        } 
    249251                    } 
    250                      
     252 
    251253                    if (children.size() <= 0) { 
    252254                        childRelations.remove(parent.getHwnd()); 
Note: See TracChangeset for help on using the changeset viewer.