// Module    : $RCSfile: GUIElementFromReplay.java,v $
// Version   : $Revision: 0.0 $  $Author: Patrick $  $Date: 27.11.2011 17:18:00 $
// Project   : TaskTreePerformanceTest
// Creation  : 2011 by Patrick
// Copyright : Patrick Harms, 2011

package de.ugoe.cs.quest.plugin.jfc.guimodel;

import de.ugoe.cs.quest.eventcore.guimodel.AbstractDefaultGUIElement;
import de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec;

/**
 * TODO comment
 * 
 * @version $Revision: $ $Date: $
 * @author 2011, last modified by $Author: $
 */
public class JFCGUIElement extends AbstractDefaultGUIElement {
    
    /**  */
    private static final long serialVersionUID = 1L;

    /** the specification of the GUI Element */
    private JFCGUIElementSpec specification;

    /**
     * @param name
     * @param id
     * @param isModal
     */
    public JFCGUIElement(JFCGUIElementSpec specification)
    {
        super(specification);
        this.specification = specification;
    }

    /* (non-Javadoc)
     * @see de.ugoe.cs.quest.eventcore.IEventTarget#getPlatform()
     */
    @Override
    public String getPlatform() {
        return "JFC";
    }

    /**
     * TODO: comment
     * 
     * @return
     */
    public String getJavaType() {
        return specification.getType();
    }

    /**
     * @return Returns the name.
     */
    String getName() {
        return specification.getName();
    }

    /**
     * @return the icon
     */
    String getIcon() {
        return specification.getIcon();
    }

    /**
     * @return the index
     */
    int getIndex() {
        return specification.getIndex();
    }

    /**
     * @return the hashCode
     */
    String getElementHash() {
        return specification.getElementHash();
    }

    @Override
    public void updateSpecification(IGUIElementSpec updateSpecification) {
        if( updateSpecification instanceof JFCGUIElementSpec ) {
            specification.setName(((JFCGUIElementSpec) updateSpecification).getName());
            specification.setElementHash(((JFCGUIElementSpec) updateSpecification).getElementHash());
        }
    }

}
