source: trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElement.java @ 606

Last change on this file since 606 was 606, checked in by sherbold, 12 years ago
  • reimplemented toString() JFCGUIElement and all its children. The output is now very verbose and detailed.
  • Property svn:executable set to *
File size: 2.7 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.jfc.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 class JFCGUIElement extends AbstractDefaultGUIElement {
19   
20    /**  */
21    private static final long serialVersionUID = 1L;
22
23    /** the specification of the GUI Element */
24    private JFCGUIElementSpec specification;
25
26    /**
27     * @param name
28     * @param id
29     * @param isModal
30     */
31    public JFCGUIElement(JFCGUIElementSpec specification, JFCGUIElement parent) {
32        super(specification, parent);
33        this.specification = specification;
34    }
35
36    /* (non-Javadoc)
37     * @see de.ugoe.cs.quest.eventcore.IEventTarget#getPlatform()
38     */
39    @Override
40    public String getPlatform() {
41        return "JFC";
42    }
43
44    /**
45     * TODO: comment
46     *
47     * @return
48     */
49    public String getJavaType() {
50        return specification.getType();
51    }
52
53    /**
54     * @return Returns the name.
55     */
56    String getName() {
57        return specification.getName();
58    }
59
60    /**
61     * @return the icon
62     */
63    String getIcon() {
64        return specification.getIcon();
65    }
66
67    /**
68     * @return the index
69     */
70    int getIndex() {
71        return specification.getIndex();
72    }
73
74    /**
75     * @return the hashCode
76     */
77    String getElementHash() {
78        return specification.getElementHash();
79    }
80
81    /**
82     * <p>
83     * TODO comment
84     * </p>
85     */
86    @Override
87    public void updateSpecification(IGUIElementSpec updateSpecification) {
88        if( updateSpecification instanceof JFCGUIElementSpec ) {
89            specification.setName(((JFCGUIElementSpec) updateSpecification).getName());
90            specification.setElementHash(((JFCGUIElementSpec) updateSpecification).getElementHash());
91        }
92    }
93   
94    /*
95     * (non-Javadoc)
96     *
97     * @see java.lang.Object#toString()
98     */
99    @Override
100    public String toString() {
101        String str = getElementDescriptor() + "(" + getName() + ", " + getElementHash() + "," + getIcon() + "," + getIndex() +")";
102        if( getParent()!=null ) {
103            return getParent().toString() + "->" + str;
104        }
105        return str;
106    }
107   
108    protected String getElementDescriptor() {
109        return "Default";
110    }
111
112}
Note: See TracBrowser for help on using the repository browser.