import org.simantics.db.RequestProcessor;
import org.simantics.db.Resource;
import org.simantics.db.common.NamedResource;
-import org.simantics.db.common.procedure.adapter.ListenerAdapter;
+import org.simantics.db.common.procedure.adapter.ProcedureAdapter;
import org.simantics.db.common.request.BinaryRead;
import org.simantics.db.common.request.ParametrizedPrimitiveRead;
import org.simantics.db.common.request.ResourceRead;
import org.simantics.db.layer0.variable.VariableBuilder;
import org.simantics.db.layer0.variable.Variables;
import org.simantics.db.procedure.Listener;
+import org.simantics.db.procedure.Procedure;
import org.simantics.layer0.Layer0;
import org.simantics.scenegraph.INode;
import org.simantics.scenegraph.LoaderNode;
public class ScenegraphLoaderUtils {
- static Map<Pair<Variable, String>, Collection<Listener<Object>>> externalMap = new HashMap<Pair<Variable, String>, Collection<Listener<Object>>>();
+ static Map<Pair<Variable, String>, Collection<Procedure<Object>>> externalMap = new HashMap<Pair<Variable, String>, Collection<Procedure<Object>>>();
static Map<Pair<Variable, String>, Object> externalValueMap = new HashMap<Pair<Variable, String>, Object>();
final public static class ScenegraphPropertyReference<T> {
public void register(ReadGraph graph, final Listener<T> procedure) {
Object value = externalValueMap.get(parameter);
procedure.execute((T)value);
- Collection<Listener<Object>> listeners = externalMap.get(parameter);
+ Collection<Procedure<Object>> listeners = externalMap.get(parameter);
if(listeners == null) {
- listeners = new ArrayList<Listener<Object>>();
+ listeners = new ArrayList<Procedure<Object>>();
externalMap.put(parameter, listeners);
}
- listeners.add(new ListenerAdapter<Object>() {
+ listeners.add(new ProcedureAdapter<Object>() {
@Override
public void execute(Object result) {
public Boolean apply(String property, Object value) {
Pair<Variable, String> key = Pair.make(reference.first, reference.second + "#" + property);
externalValueMap.put(key, value);
- Collection<Listener<Object>> listeners = externalMap.get(key);
+ Collection<Procedure<Object>> listeners = externalMap.get(key);
if(listeners != null) {
- for(Listener<Object> listener : listeners) listener.execute(value);
+ for(Procedure<Object> listener : listeners) listener.execute(value);
}
return true;
}