*******************************************************************************/\r
package org.simantics.sysdyn.ui.elements2;\r
\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.Resource;\r
import org.simantics.db.Session;\r
import org.simantics.db.exception.DatabaseException;\r
try {\r
l0 = Layer0.getInstance(session);\r
ModelingResources mr = session.getService(ModelingResources.class);\r
- return queue.offer(new RelatedPropertyModification(object, mr.ElementToComponent, l0.HasName, l0.String, newValue, StringBindingDefault.INSTANCE), null);\r
+ return queue.offer(new RelatedPropertyModification(object, mr.ElementToComponent, l0.HasName, l0.String, newValue, Bindings.STRING), null);\r
} catch (DatabaseException e) {\r
e.printStackTrace();\r
}\r
import java.util.concurrent.ConcurrentSkipListMap;\r
import java.util.concurrent.atomic.AtomicInteger;\r
\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.AsyncReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
return;\r
}\r
\r
- graph.forPossibleRelatedValue(property, l0.HasName, StringBindingDefault.INSTANCE, new AsyncProcedure<String>() {\r
+ graph.forPossibleRelatedValue(property, l0.HasName, Bindings.STRING, new AsyncProcedure<String>() {\r
\r
@Override\r
public void exception(AsyncReadGraph graph, Throwable throwable) {\r
import org.eclipse.ui.handlers.HandlerUtil;\r
import org.simantics.databoard.Bindings;\r
import org.simantics.databoard.Files;\r
-import org.simantics.databoard.binding.error.BindingException;\r
import org.simantics.databoard.binding.error.RuntimeBindingConstructionException;\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
-import org.simantics.databoard.serialization.SerializationException;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.common.primitiverequest.PossibleRelatedValue;\r
if (!graph.hasStatement(model, Layer0.getInstance(graph).PartOf))\r
return null;\r
Layer0 l0 = Layer0.getInstance(graph);\r
- String name = graph.syncRequest(new PossibleRelatedValue<String>(model, l0.HasName, StringBindingDefault.INSTANCE ));\r
+ String name = graph.syncRequest(new PossibleRelatedValue<String>(model, l0.HasName, Bindings.STRING ));\r
return name;\r
\r
}\r
@Override\r
public void run(ReadGraph graph) throws DatabaseException {\r
Layer0 l0 = Layer0.getInstance(graph);\r
- String name = graph.syncRequest(new PossibleRelatedValue<String>(model, l0.HasName, StringBindingDefault.INSTANCE ));\r
+ String name = graph.syncRequest(new PossibleRelatedValue<String>(model, l0.HasName, Bindings.STRING ));\r
ArrayList<Pair<Resource, String>> roots = new ArrayList<Pair<Resource, String>>();\r
roots.add(Pair.make(model, name));\r
TransferableGraph1 tg = graph.syncRequest(new TransferableGraphRequest(roots, model));\r
e.printStackTrace();\r
} catch (IOException e) {\r
e.printStackTrace();\r
- } catch (SerializationException e) {\r
- e.printStackTrace();\r
- } catch (BindingException e) {\r
- e.printStackTrace();\r
}\r
\r
\r
e.printStackTrace();\r
} catch (IOException e) {\r
e.printStackTrace();\r
- } catch (SerializationException e) {\r
- e.printStackTrace();\r
}\r
if(tg == null) return null;\r
\r
import org.eclipse.ui.PartInitException;\r
import org.eclipse.ui.PlatformUI;\r
import org.eclipse.ui.handlers.HandlerUtil;\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.common.request.ReadRequest;\r
\r
DiagramResource dr = DiagramResource.getInstance(graph);\r
Resource runtime = viewer.getRuntime();\r
- String uri = graph.getPossibleRelatedValue(runtime, dr.HasVariable, StringBindingDefault.INSTANCE);\r
- String currentRVI = graph.getPossibleRelatedValue(runtime, dr.HasRVI, StringBindingDefault.INSTANCE);\r
+ String uri = graph.getPossibleRelatedValue(runtime, dr.HasVariable, Bindings.STRING);\r
+ String currentRVI = graph.getPossibleRelatedValue(runtime, dr.HasRVI, Bindings.STRING);\r
Variable variable = Variables.getVariable(graph, uri);\r
Resource model = Variables.getModel(graph, variable);\r
final String modelURI = graph.getURI(model);\r
\r
if(diagram == null) return;\r
\r
- String finalRvi = currentRVI + "/" + graph.getPossibleRelatedValue(component, l0.HasName, StringBindingDefault.INSTANCE);\r
+ String finalRvi = currentRVI + "/" + graph.getPossibleRelatedValue(component, l0.HasName, Bindings.STRING);\r
\r
// This is ugly but it has to be done like this because WorkModel example has too PartOfs\r
Resource rootLibrary = graph.getPossibleObject(model, l0.PartOf);\r
import java.util.List;\r
\r
import org.simantics.databoard.binding.Binding;\r
-import org.simantics.databoard.binding.java.DoubleBindingDefault;\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
-import org.simantics.databoard.binding.mutable.MutableDouble;\r
-import org.simantics.databoard.type.DataType;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.Datatypes;\r
+import org.simantics.databoard.primitives.MutableDouble;\r
+import org.simantics.databoard.type.Datatype;\r
import org.simantics.databoard.type.DoubleType;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
\r
@Override\r
public <T> T getValue(ReadGraph graph, Binding binding) throws DatabaseException {\r
- if(!DoubleBindingDefault.INSTANCE.equals(binding)) return null;\r
+ if(!Bindings.DOUBLE.equals(binding)) return null;\r
return getValue(graph);\r
}\r
\r
public void setValue(WriteGraph graph, Object object, Binding binding) throws DatabaseException {\r
Layer0 l0 = Layer0.getInstance(graph);\r
SysdynResource sr = SysdynResource.getInstance(graph);\r
-// if(!DoubleBindingDefault.INSTANCE.equals(binding)) return;\r
+// if(!Bindings.DOUBLE.equals(binding)) return;\r
// if(!MutableDoubleBinding.INSTANCE.equals(binding)) return;\r
Resource represents = graph.getPossibleObject(resource, l0.Represents);\r
if(represents == null) return;\r
if(expression == null) return;\r
if(!graph.isInstanceOf(expression, sr.ParameterExpression)) return;\r
Double value = new Double(((MutableDouble)object).doubleValue());\r
- graph.claimLiteral(expression, sr.HasEquation, value.toString(), StringBindingDefault.INSTANCE);\r
+ graph.claimLiteral(expression, sr.HasEquation, value.toString(), Bindings.STRING);\r
}\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
public <T> T getInterface(ReadGraph graph, Class<T> clazz)\r
throws DatabaseException {\r
- if(DataType.class.equals(clazz)) return (T)DoubleType.INSTANCE;\r
+ if(Datatype.class.equals(clazz)) return (T)Datatypes.DOUBLE;\r
return super.getInterface(graph, clazz);\r
}\r
}\r
import java.util.Collection;\r
import java.util.HashSet;\r
\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.Session;\r
public void add(ReadGraph graph, final Resource run) throws DatabaseException {\r
\r
final Layer0 l0 = Layer0.getInstance(graph);\r
- final String experimentName = graph.getPossibleRelatedValue(run, l0.HasName, StringBindingDefault.INSTANCE);\r
+ final String experimentName = graph.getPossibleRelatedValue(run, l0.HasName, Bindings.STRING);\r
\r
RuntimeValuations vs = graph.getService(RuntimeValuations.class);\r
if(vs.supports(experimentName)) {\r
HashSet<Pair<String, Resource>> result = new HashSet<Pair<String, Resource>>();\r
Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
for(Resource part : graph.getObjects(configuration, l0.ConsistsOf)) {\r
- String partName = graph.getPossibleRelatedValue(part, l0.HasName, StringBindingDefault.INSTANCE);\r
+ String partName = graph.getPossibleRelatedValue(part, l0.HasName, Bindings.STRING);\r
result.add(new Pair<String, Resource>(partName, part));\r
}\r
return result;\r
import org.eclipse.ui.PartInitException;\r
import org.osgi.service.prefs.BackingStoreException;\r
import org.simantics.databoard.accessor.Accessor;\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.Builtins;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
Resource diagram = OrderedSetUtils.create(g, sr.ConfigurationDiagram);\r
GraphLayer l = new GraphLayerUtil(g).createLayer(DiagramConstants.DEFAULT_LAYER_NAME, true);\r
g.claim(diagram, mu.dr.HasLayer, l.getLayer());\r
- g.claimLiteral(diagram, l0.HasName, "Diagrammi", StringBindingDefault.INSTANCE);\r
+ g.claimLiteral(diagram, l0.HasName, "Diagrammi", Bindings.STRING);\r
\r
Resource conf = GraphUtils.create2(g,\r
sr.Configuration,\r
import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;\r
import org.simantics.browsing.ui.swt.widgets.impl.Widget;\r
import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.Builtins;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
List<Pair<String, Object>> result = new ArrayList<Pair<String, Object>>();\r
for(Resource r : resourceList) {\r
result.add(new Pair<String, Object>( \r
- (String)graph.getRelatedValue(r, Layer0.getInstance(graph).HasName, StringBindingDefault.INSTANCE)\r
+ (String)graph.getRelatedValue(r, Layer0.getInstance(graph).HasName, Bindings.STRING)\r
, r));\r
}\r
return result;\r
*******************************************************************************/\r
package org.simantics.sysdyn.ui.properties.widgets;\r
\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
valueResource = graph.getPossibleObject(dependency, sr.HasHead);\r
if(!graph.isInstanceOf(valueResource, sr.Variable))\r
return "";\r
- return (String)graph.getRelatedValue(valueResource, l0.HasName, StringBindingDefault.INSTANCE);\r
+ return (String)graph.getRelatedValue(valueResource, l0.HasName, Bindings.STRING);\r
}\r
});\r
} catch (DatabaseException e) {\r
package org.simantics.sysdyn.ui.properties.widgets.factories;\r
\r
import org.simantics.browsing.ui.swt.widgets.impl.TextModifyListenerImpl;\r
-import org.simantics.databoard.binding.java.DoubleBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.exception.DatabaseException;\r
if(graph.hasStatement(input, graph.getResource(propertyURI)))\r
graph.deny(input, graph.getResource(propertyURI));\r
} else {\r
- graph.claimLiteral(input, graph.getResource(propertyURI), Double.parseDouble(text), DoubleBindingDefault.INSTANCE);\r
+ graph.claimLiteral(input, graph.getResource(propertyURI), Double.parseDouble(text), Bindings.DOUBLE);\r
}\r
}\r
\r
package org.simantics.sysdyn.ui.properties.widgets.factories;\r
\r
import org.simantics.browsing.ui.swt.widgets.impl.TextModifyListenerImpl;\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
import org.simantics.db.exception.DatabaseException;\r
// TODO: add enumerations to the variable\r
String originalName = graph.getRelatedValue(variable, Layer0.getInstance(graph).HasName);\r
VariableNameUtils.renameInEquations(graph, variable, originalName, text);\r
- graph.claimLiteral(variable, graph.getResource(propertyURI), text, StringBindingDefault.INSTANCE);\r
+ graph.claimLiteral(variable, graph.getResource(propertyURI), text, Bindings.STRING);\r
}\r
}\r
\r
import org.simantics.browsing.ui.common.ColumnKeys;\r
import org.simantics.browsing.ui.graph.contributor.labeler.ColumnLabelerContributor;\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.utils.datastructures.ArrayMap;\r
@Override\r
public Map<String, String> getLabel(ReadGraph graph, OperationModelNode model) throws DatabaseException {\r
\r
- String label = model.data.getPropertyValue(graph, "Name", StringBindingDefault.INSTANCE);\r
+ String label = model.data.getPropertyValue(graph, "Name", Bindings.STRING);\r
\r
return new ArrayMap<String, String>(new String[] { ColumnKeys.SINGLE } , new String[] { label });\r
\r
\r
import org.simantics.browsing.ui.common.ColumnKeys;\r
import org.simantics.browsing.ui.graph.contributor.labeler.ColumnLabelerContributor;\r
-import org.simantics.databoard.binding.java.StringBindingDefault;\r
+import org.simantics.databoard.Bindings;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
@Override\r
public Map<String, String> getLabel(ReadGraph graph, Variable variable) throws DatabaseException {\r
\r
- String label = variable.getPropertyValue(graph, "Name", StringBindingDefault.INSTANCE);\r
+ String label = variable.getPropertyValue(graph, "Name", Bindings.STRING);\r
\r
return new ArrayMap<String, String>(new String[] { ColumnKeys.SINGLE } , new String[] { label });\r
\r