source: trunk/quest-plugin-mfc/src/main/java/de/ugoe/cs/quest/plugin/mfc/guimodel/MFCGUIElement.java @ 619

Last change on this file since 619 was 619, checked in by pharms, 12 years ago
  • adapted implementation to now generate a full GUI model as well as concrete GUI interaction events
  • Property svn:executable set to *
File size: 2.8 KB
Line 
1// Module    : $RCSfile: GUIElementFromReplay.java,v $
2// Version   : $Revision: 0.0 $  $Author: Patrick $  $Date: 27.11.2011 17:18:00 $
3// Project   : TaskTreePerformanceTest
4// Creation  : 2011 by Patrick
5// Copyright : Patrick Harms, 2011
6
7package de.ugoe.cs.quest.plugin.mfc.guimodel;
8
9import de.ugoe.cs.quest.eventcore.guimodel.AbstractDefaultGUIElement;
10import de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec;
11
12/**
13 * TODO comment
14 *
15 * @version $Revision: $ $Date: $
16 * @author 2011, last modified by $Author: $
17 */
18public abstract class MFCGUIElement extends AbstractDefaultGUIElement {
19   
20    /**  */
21    private static final long serialVersionUID = 1L;
22
23    /**
24     * @param name
25     * @param id
26     * @param isModal
27     */
28    public MFCGUIElement(MFCGUIElementSpec specification, MFCGUIElement parent) {
29        super(specification, parent);
30    }
31
32    /* (non-Javadoc)
33     * @see de.ugoe.cs.quest.eventcore.IEventTarget#getPlatform()
34     */
35    @Override
36    public String getPlatform() {
37        return "MFC";
38    }
39
40    /**
41     * @return Returns the id.
42     */
43    public String getId() {
44        return Long.toString(((MFCGUIElementSpec) super.getSpecification()).getHwnd());
45    }
46
47    /**
48     * @return Returns the name.
49     */
50    public String getType() {
51        return ((MFCGUIElementSpec) super.getSpecification()).getType();
52    }
53
54    /**
55     * @return Returns the name.
56     */
57    public String getName() {
58        return ((MFCGUIElementSpec) super.getSpecification()).getName();
59    }
60
61    /**
62     * @return Returns the isModal.
63     */
64    public boolean isModal() {
65        return ((MFCGUIElementSpec) super.getSpecification()).isModal();
66    }
67
68    /**
69     * <p>
70     * TODO: comment
71     * </p>
72     *
73     * @return
74     */
75    public int getResourceId() {
76        return ((MFCGUIElementSpec) super.getSpecification()).getResourceId();
77    }
78
79    /* (non-Javadoc)
80     * @see de.ugoe.cs.quest.eventcore.guimodel.IGUIElement#updateSpecification(de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec)
81     */
82    @Override
83    public void updateSpecification(IGUIElementSpec furtherSpec) {
84        ((MFCGUIElementSpec) super.getSpecification()).update(furtherSpec);
85    }
86
87    /* (non-Javadoc)
88     * @see java.lang.Object#toString()
89     */
90    @Override
91    public String toString() {
92        return super.getSpecification().toString();
93    }
94
95    /**
96     * <p>
97     * TODO: comment
98     * </p>
99     */
100    public String toXML() {
101        if (getParent() != null) {
102            return
103                ((MFCGUIElement) getParent()).toXML() +
104                ((MFCGUIElementSpec) super.getSpecification()).toXML();
105        }
106        else {
107            return ((MFCGUIElementSpec) super.getSpecification()).toXML();
108        }
109    }
110}
Note: See TracBrowser for help on using the repository browser.