ArrayList<Variable> variables = new ArrayList<Variable>();\r
\r
for(Variable child : variable.getChildren(graph)) {\r
- Resource represents = (Resource)child.getPropertyValue(graph, Variables.REPRESENTS);\r
+ Resource represents = child.getRepresents(graph);\r
if(graph.isInstanceOf(represents, sr.IndependentVariable)) {\r
variables.add(child);\r
} else if (graph.isInstanceOf(represents, sr.Input)) {\r
\r
\r
for(Variable child : variable.getChildren(graph)) {\r
- Resource represents = (Resource)child.getPropertyValue(graph, Variables.REPRESENTS);\r
+ Resource represents = child.getRepresents(graph);\r
if(graph.isInstanceOf(represents, sr.IndependentVariable)) {\r
variables.put(child.getName(graph), child);\r
} else if (graph.isInstanceOf(represents, sr.Input)) {\r
\r
for (String s : variables.keySet()) {\r
Variable v = variables.get(s);\r
- Resource represents = (Resource)v.getPropertyValue(graph, Variables.REPRESENTS);\r
+ Resource represents = v.getRepresents(graph);\r
result.add(new VariableNode<Variable>(v, represents));\r
}\r
\r
for (String s : inputs.keySet()) {\r
Variable v = inputs.get(s);\r
- Resource represents = (Resource)v.getPropertyValue(graph, Variables.REPRESENTS);\r
+ Resource represents = v.getRepresents(graph);\r
result.add(new InputNode(v, represents));\r
}\r
\r
for (String s : modules.keySet()) {\r
Variable v = modules.get(s);\r
- Resource represents = (Resource)v.getPropertyValue(graph, Variables.REPRESENTS);\r
+ Resource represents = v.getRepresents(graph);\r
result.add(new ModuleNode(v, represents));\r
}\r
\r
for (String s : enumerations.keySet()) {\r
Variable v = enumerations.get(s);\r
- Resource represents = (Resource)v.getPropertyValue(graph, Variables.REPRESENTS);\r
+ Resource represents = v.getRepresents(graph);\r
result.add(new EnumerationNode(v, represents));\r
}\r
\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.db.layer0.variable.Variables;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.sysdyn.ui.Activator;\r
\r
String image = "icons/brick.png";\r
\r
- Resource r = (Resource)var.getPropertyValue(graph, Variables.REPRESENTS);\r
+ Resource r = var.getRepresents(graph);\r
if(r != null) {\r
Layer0 L0 = Layer0.getInstance(graph);\r
SysdynResource sr = SysdynResource.getInstance(graph);\r