Index: trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDCalculator.java
===================================================================
--- trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDCalculator.java	(revision 796)
+++ trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDCalculator.java	(revision 806)
@@ -30,4 +30,13 @@
 	
 	static final int prime = 31;
+	private JFCReplayIDValidator validator;
+	
+	public JFCReplayIDCalculator() {
+		this.validator = null;
+	}
+	
+	public JFCReplayIDCalculator(JFCReplayIDValidator validator){
+		this.validator = validator;
+	}
 	
 	/**
@@ -73,9 +82,25 @@
 	   long propagatedHashCode = windowHashCode;
 	   
-	   // construct looks complicated but avoids going back and force through path
+	   // added validator to check if generated component ids are known
+	   if (validator != null){
+		   if (validator.validateReplayID("w" + windowHashCode)){
+			   System.out.println("ID w" + windowHashCode + " is valid.");
+		   }
+		   else{
+			   System.err.println(currentSpec + " describes an unknown component.");
+		   	   System.err.println("ID w" + windowHashCode + " is unknown." );
+		   	   System.err.println();
+		   }
+			   
+	   }
+	   
+	   // construct looks complicated but avoids going back and forth through path
 	   if (iterator.hasNext())
 		   currentSpec = iterator.next();
-	   else
+	   else{
 		   currentSpec = null;
+		   // there are no subcomponents, so we use windowHashCode as hashCode
+		   hashCode = windowHashCode;
+	   }
 
 	   // walk through component path and calculate hashcode
@@ -84,4 +109,16 @@
 		   hashCode = propagatedHashCode * prime + localHashCode;
 		   hashCode = (hashCode * 2) & 0xffffffffL;
+		   
+		   // added validator to check if generated component ids are known
+		   if (validator != null){
+			   if (validator.validateReplayID("w" + hashCode)){
+				   System.out.println("ID w" + hashCode + " is valid.");
+			   }
+			   else{
+				    System.err.println(currentSpec + " describes an unknown component.");
+			   		System.err.println("ID w" + hashCode + " is unknown." );
+			   		System.err.println();
+			   }
+		   }
 
 		   if (iterator.hasNext()){
@@ -111,10 +148,15 @@
 		
 		IEventTarget target = event.getTarget();
-		JFCGUIElement jfcTarget = (JFCGUIElement) target;
+		if (!target.getPlatform().equals("JFC")){
+			throw new IllegalArgumentException("Event target must be of type JFC.");
+		}
+		
+		JFCGUIElement currentTarget = (JFCGUIElement) target;
 		
 		// extract element path
-		JFCGUIElement currentTarget = jfcTarget;
 		while (currentTarget != null){
 			JFCGUIElementSpec currentSpec = (JFCGUIElementSpec) currentTarget.getSpecification();
+			
+			// new specification must be inserted at the beginning of the list
 			guiElementPath.add(0, currentSpec);
 			currentTarget = (JFCGUIElement) currentTarget.getParent();
Index: trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDValidator.java
===================================================================
--- trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDValidator.java	(revision 806)
+++ trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCReplayIDValidator.java	(revision 806)
@@ -0,0 +1,69 @@
+package de.ugoe.cs.quest.plugin.jfc;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class JFCReplayIDValidator {
+	private Set<String> validIds = null;
+	
+	public JFCReplayIDValidator(File guitarEfgFile) throws ParserConfigurationException, SAXException, IOException{
+		this.initialize(guitarEfgFile);
+	}
+	
+	public void initialize(File guitarGUIFile) throws ParserConfigurationException, SAXException, IOException{
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		DocumentBuilder builder = factory.newDocumentBuilder();
+		Document freemindGUI = builder.parse(guitarGUIFile);
+	
+		validIds = new HashSet<String>();
+		
+		NodeList guis = freemindGUI.getFirstChild().getChildNodes();
+		for (int i = 0; i < guis.getLength(); i++)
+			extractIDs(guis.item(i));
+	}
+	
+	private void extractIDs(Node node){
+		NodeList children = node.getChildNodes();
+		if (children != null){
+			for (int j = 0; j < children.getLength(); j++){
+				if (children.item(j).getNodeName().equals("Attributes")){
+					NodeList properties = children.item(j).getChildNodes();
+					for (int i = 0; i < properties.getLength(); i++){
+						NodeList property = properties.item(i).getChildNodes();
+						for (int k = 0; k < property.getLength(); k++){
+							if (property.item(k).getTextContent().equals("ID")){
+								validIds.add(property.item(k+2).getTextContent());
+							}
+						}
+					}
+				}
+				else{
+					extractIDs(children.item(j));
+				}
+			}
+		}
+	}
+	
+
+	public boolean validateReplayID(String replayID){
+		if (validIds == null || validIds.size() == 0)
+			throw new IllegalStateException("There are no valid IDs known, call initialize first.");
+		
+		if (validIds.contains(replayID))
+			return true;
+		
+		return false;
+		
+	}
+}
