]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph.loader/src/org/simantics/scenegraph/loader/ScenegraphVariableAdapter.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scenegraph.loader / src / org / simantics / scenegraph / loader / ScenegraphVariableAdapter.java
1 package org.simantics.scenegraph.loader;
2
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.Resource;
5 import org.simantics.db.common.adaption.SimpleContextualAdapter;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.db.layer0.variable.StandardGraphChildVariable;
8 import org.simantics.db.layer0.variable.Variable;
9
10 public class ScenegraphVariableAdapter extends SimpleContextualAdapter<Variable, Variable> {
11
12         @Override
13         public Variable adapt(ReadGraph g, Resource source, Variable context) throws DatabaseException {
14                 SceneGraphContext vc = ScenegraphLoaderUtils.getContext(g, context);
15                 if(vc != null)
16                         return new ScenegraphVariable(context, source, null, /*context.adapt(g, SceneGraphContext.class).getRuntime()*/ null);
17                 else
18                         return new StandardGraphChildVariable(context, null, source);
19         }
20
21 }