package org.simantics.sysdyn;\r
\r
+import java.util.HashMap;\r
import java.util.Map;\r
\r
import org.simantics.databoard.binding.Binding;\r
import org.simantics.db.layer0.variable.ValueAccessor;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.db.layer0.variable.VariableMap;\r
+import org.simantics.db.layer0.variable.VariableMapImpl;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.operation.Layer0X;\r
import org.simantics.scl.reflection.annotations.SCLValue;\r
\r
\r
@SCLValue(type = "VariableMap")\r
- public static VariableMap runProperties = new VariableMap() {\r
+ public static VariableMap runProperties = new VariableMapImpl() {\r
\r
@Override\r
public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {\r
}\r
\r
@Override\r
- public void getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ return map;\r
}\r
};\r
\r
@SCLValue(type = "VariableMap")\r
- public static VariableMap valuePropertyProperties = new VariableMap() {\r
+ public static VariableMap valuePropertyProperties = new VariableMapImpl() {\r
\r
@Override\r
public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {\r
}\r
\r
@Override\r
- public void getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ return map;\r
// Collections.emptyList();\r
// StandardGraphChildVariable variable = (StandardGraphChildVariable)context;\r
// collectPropertiesFromContext(graph, variable, variable.resource, map);\r
\r
\r
@SCLValue(type = "VariableMap")\r
- public static VariableMap runChildren = new VariableMap() {\r
+ public static VariableMap runChildren = new VariableMapImpl() {\r
\r
@Override\r
public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {\r
}\r
\r
@Override\r
- public void getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ \r
StandardGraphChildVariable variable = (StandardGraphChildVariable)context;\r
\r
- All.getStandardChildDomainChildVariables(graph, context, map);\r
+ map = All.getStandardChildDomainChildVariables(graph, context, map);\r
\r
for(Map.Entry<String, Resource> entry : graph.syncRequest(new StructuralChildMapOfResource(getConfiguration(graph, variable))).entrySet()) {\r
String name = entry.getKey();\r
Resource child = entry.getValue();\r
Variable var = graph.getPossibleContextualAdapter(child, variable, Variable.class, Variable.class);\r
if(var != null) {\r
+ if(map == null) map = new HashMap<String,Variable>();\r
map.put(name, var);\r
} else {\r
System.err.println("No adapter for " + child + " in " + variable.getURI(graph));\r
}\r
}\r
+ \r
+ return map;\r
+ \r
}\r
\r
Resource getConfiguration(ReadGraph graph, Variable run) throws DatabaseException {\r