import org.simantics.sysdyn.representation.Configuration;\r
import org.simantics.sysdyn.representation.IElement;\r
import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.Shadow;\r
import org.simantics.sysdyn.representation.Variable;\r
import org.simantics.sysdyn.unitParser.ParseException;\r
import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
\r
// Support listening, if graph and mapping exists\r
if(graph != null && model != null) {\r
+ if (var instanceof Shadow)\r
+ var = ((Shadow)var).getOriginal();\r
Resource varResource = model.getMapping().inverseGet(var);\r
if(varResource != null) {\r
try {\r
for(IElement e : configuration.getElements()) {\r
if(e instanceof Variable) {\r
Variable var = (Variable)e;\r
- if(var.getName().equals(element))\r
- return var;\r
+ try {\r
+ if(var.getName().equals(element))\r
+ return var;\r
+ } catch (NullPointerException npe) {\r
+ npe.printStackTrace();\r
+ System.out.println("See UnitUtils");\r
+ return null;\r
+ }\r
} else if(e instanceof Module && elements.length > 1) {\r
Module mod = (Module)e;\r
if(mod.getName().equals(element)) {\r