From 22844f7dfb119afdf64dc113550a363cbcead90b Mon Sep 17 00:00:00 2001 From: lehtonen Date: Thu, 11 Mar 2010 08:23:06 +0000 Subject: [PATCH] Fixed objmap, h2d, sysdyn and sysdyn.ui to use the new style URIs. git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14811 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../org/simantics/h2d/diagram/Diagram.java | 4 +- .../objmap/examples/SysdynExample.java | 14 ++-- .../factories/RelatedElementRuleFactory.java | 2 +- .../factories/RelatedElementsRuleFactory.java | 2 +- .../factories/RelatedValueRuleFactory.java | 5 +- .../objmap/rules/MappedElementRule.java | 4 -- .../objmap/rules/MappedElementsRule.java | 2 - .../org/simantics/objmap/rules/ValueRule.java | 4 -- .../objmap/rules/range/FieldAccessor.java | 2 - .../objmap/schema/MappingSchemas.java | 2 +- org.simantics.sysdyn.ui/adapters.xml | 4 +- org.simantics.sysdyn.ui/plugin.xml | 4 +- .../sysdyn/ui/elements/AuxiliaryElement.java | 2 +- .../sysdyn/ui/elements/CloudElement.java | 2 +- .../sysdyn/ui/elements/DependencyElement.java | 8 +-- .../sysdyn/ui/elements/FlowElement.java | 6 +- .../ui/elements/RectangularElement.java | 4 +- .../sysdyn/ui/elements/StockElement.java | 2 +- .../sysdyn/ui/elements/TextElement.java | 6 +- .../sysdyn/ui/elements/ValveElement.java | 2 +- .../sysdyn/ui/elements/ValveElementOld.java | 2 +- .../org/simantics/sysdyn/SysdynResource.java | 68 +++++++++---------- .../sysdyn/representation/Auxiliary.java | 4 +- .../sysdyn/representation/Cloud.java | 4 +- .../sysdyn/representation/Configuration.java | 10 +-- .../sysdyn/representation/Dependency.java | 6 +- .../simantics/sysdyn/representation/Flow.java | 6 +- .../sysdyn/representation/Stock.java | 2 +- .../sysdyn/representation/Valve.java | 4 +- .../sysdyn/representation/Variable.java | 8 +-- .../expressions/ConstantExpression.java | 8 +-- .../expressions/DelayExpression.java | 2 +- .../expressions/LookupExpression.java | 2 +- .../expressions/NormalExpression.java | 8 +-- .../expressions/ParameterExpression.java | 4 +- .../expressions/StockExpression.java | 20 +++--- .../expressions/WithLookupExpression.java | 6 +- 37 files changed, 116 insertions(+), 129 deletions(-) diff --git a/org.simantics.h2d/src/org/simantics/h2d/diagram/Diagram.java b/org.simantics.h2d/src/org/simantics/h2d/diagram/Diagram.java index afd9d8d7..d17e4bff 100644 --- a/org.simantics.h2d/src/org/simantics/h2d/diagram/Diagram.java +++ b/org.simantics.h2d/src/org/simantics/h2d/diagram/Diagram.java @@ -7,10 +7,10 @@ import org.simantics.h2d.element.IElement; import org.simantics.objmap.annotations.RelatedValue; import org.simantics.objmap.annotations.GraphType; -@GraphType("http://www.simantics.org/Sysdyn#Configuration") +@GraphType("http://www.simantics.org/Sysdyn-1.0/Configuration") public class Diagram implements IDiagram { - @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#ConsistsOf") + @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/ConsistsOf") public ArrayList elements = new ArrayList(); ArrayList listeners = new ArrayList(); diff --git a/org.simantics.objmap/examples/org/simantics/objmap/examples/SysdynExample.java b/org.simantics.objmap/examples/org/simantics/objmap/examples/SysdynExample.java index 57092cb7..174c8eb4 100644 --- a/org.simantics.objmap/examples/org/simantics/objmap/examples/SysdynExample.java +++ b/org.simantics.objmap/examples/org/simantics/objmap/examples/SysdynExample.java @@ -14,29 +14,29 @@ import org.simantics.objmap.schema.SimpleSchema; public class SysdynExample { - @GraphType("http://www.simantics.org/Sysdyn#Configuration") + @GraphType("http://www.simantics.org/Sysdyn-1.0/Configuration") static class Configuration { - @RelatedElements("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#ConsistsOf") + @RelatedElements("http://www.simantics.org/Layer0-1.0/Relations/ConsistsOf") Collection components; } static abstract class Component { } - @GraphType("http://www.simantics.org/Sysdyn#Dependency") + @GraphType("http://www.simantics.org/Sysdyn-1.0/Dependency") static class Dependency extends Component { - @RelatedElement("http://www.simantics.org/Sysdyn#HasTail") + @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail") Variable tail; - @RelatedElement("http://www.simantics.org/Sysdyn#HasHead") + @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead") Auxiliary head; } static abstract class Variable extends Component { - @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasName") + @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasName") String name; } - @GraphType("http://www.simantics.org/Sysdyn#Auxiliary") + @GraphType("http://www.simantics.org/Sysdyn-1.0/Auxiliary") static class Auxiliary extends Variable { } diff --git a/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedElementRuleFactory.java b/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedElementRuleFactory.java index f4499fa4..2aedbd31 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedElementRuleFactory.java +++ b/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedElementRuleFactory.java @@ -20,7 +20,7 @@ public class RelatedElementRuleFactory implements IFieldRuleFactory { public IMappingRule create(ReadGraph g, Annotation _annotation, Field field) throws ResourceNotFoundException, ValidationException, ServiceException { RelatedElement annotation = (RelatedElement)_annotation; return new MappedElementRule( - new RelatedObjectAccessor(g.getResourceByURI(annotation.value())), + new RelatedObjectAccessor(g.getResource(annotation.value())), new FieldAccessor(field) ); } diff --git a/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedElementsRuleFactory.java b/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedElementsRuleFactory.java index 7269783e..d6f6c0dc 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedElementsRuleFactory.java +++ b/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedElementsRuleFactory.java @@ -21,7 +21,7 @@ public class RelatedElementsRuleFactory implements IFieldRuleFactory { public IMappingRule create(ReadGraph g, Annotation _annotation, Field field) throws ResourceNotFoundException, ValidationException, ServiceException { RelatedElements annotation = (RelatedElements)_annotation; return new MappedElementsRule( - new RelatedObjectsAccessor(g.getResourceByURI(annotation.value()), + new RelatedObjectsAccessor(g.getResource(annotation.value()), annotation.composition()), new FieldAccessor>(field) ); diff --git a/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedValueRuleFactory.java b/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedValueRuleFactory.java index 7bbecaa4..f04f4fb1 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedValueRuleFactory.java +++ b/org.simantics.objmap/src/org/simantics/objmap/annotations/factories/RelatedValueRuleFactory.java @@ -3,7 +3,6 @@ package org.simantics.objmap.annotations.factories; import java.lang.annotation.Annotation; import java.lang.reflect.Field; -import org.simantics.db.Builtins; import org.simantics.db.ReadGraph; import org.simantics.db.exception.ResourceNotFoundException; import org.simantics.db.exception.ServiceException; @@ -20,10 +19,10 @@ public class RelatedValueRuleFactory implements IFieldRuleFactory { @Override public IMappingRule create(ReadGraph g, Annotation _annotation, Field field) throws ResourceNotFoundException, ValidationException, ServiceException { RelatedValue annotation = (RelatedValue)_annotation; - Builtins b = g.getBuiltins(); + //Builtins b = g.getBuiltins(); return new ValueRule( new RelatedValueAccessor( - g.getResourceByURI(annotation.value()), + g.getResource(annotation.value()), DataTypeUtils.dataTypeOfClass(g, field.getType()) ), new FieldAccessor(field) diff --git a/org.simantics.objmap/src/org/simantics/objmap/rules/MappedElementRule.java b/org.simantics.objmap/src/org/simantics/objmap/rules/MappedElementRule.java index 51a3e6e5..c9baa3b8 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/rules/MappedElementRule.java +++ b/org.simantics.objmap/src/org/simantics/objmap/rules/MappedElementRule.java @@ -1,13 +1,9 @@ package org.simantics.objmap.rules; -import java.util.ArrayList; - import org.apache.log4j.Logger; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.layer0.utils.direct.GraphUtils; import org.simantics.objmap.IFunction; import org.simantics.objmap.IMappingRule; import org.simantics.objmap.MappingException; diff --git a/org.simantics.objmap/src/org/simantics/objmap/rules/MappedElementsRule.java b/org.simantics.objmap/src/org/simantics/objmap/rules/MappedElementsRule.java index e37ce133..24062a0e 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/rules/MappedElementsRule.java +++ b/org.simantics.objmap/src/org/simantics/objmap/rules/MappedElementsRule.java @@ -7,8 +7,6 @@ import org.apache.log4j.Logger; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.layer0.utils.direct.GraphUtils; import org.simantics.objmap.IFunction; import org.simantics.objmap.IMappingRule; import org.simantics.objmap.MappingException; diff --git a/org.simantics.objmap/src/org/simantics/objmap/rules/ValueRule.java b/org.simantics.objmap/src/org/simantics/objmap/rules/ValueRule.java index 13e46703..98a4908f 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/rules/ValueRule.java +++ b/org.simantics.objmap/src/org/simantics/objmap/rules/ValueRule.java @@ -4,10 +4,6 @@ import org.apache.log4j.Logger; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.exception.ServiceException; -import org.simantics.db.exception.ValidationException; -import org.simantics.layer0.utils.direct.GraphUtils; import org.simantics.objmap.IFunction; import org.simantics.objmap.IMappingRule; import org.simantics.objmap.MappingException; diff --git a/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java b/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java index 83a4bfd0..be773b40 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java +++ b/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java @@ -3,8 +3,6 @@ package org.simantics.objmap.rules.range; import java.lang.reflect.Field; import org.apache.log4j.Logger; -import org.simantics.db.exception.DatabaseException; -import org.simantics.layer0.utils.direct.GraphUtils; import org.simantics.objmap.MappingException; /** diff --git a/org.simantics.objmap/src/org/simantics/objmap/schema/MappingSchemas.java b/org.simantics.objmap/src/org/simantics/objmap/schema/MappingSchemas.java index 472915bf..19552ead 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/schema/MappingSchemas.java +++ b/org.simantics.objmap/src/org/simantics/objmap/schema/MappingSchemas.java @@ -35,7 +35,7 @@ public class MappingSchemas { collectRulesFromAnnotations(g, clazz, rules); return new SimpleLinkType( - g.getResourceByURI(graphType.value()), + g.getResource(graphType.value()), clazz, rules); } diff --git a/org.simantics.sysdyn.ui/adapters.xml b/org.simantics.sysdyn.ui/adapters.xml index 21a73a13..3b210400 100644 --- a/org.simantics.sysdyn.ui/adapters.xml +++ b/org.simantics.sysdyn.ui/adapters.xml @@ -3,13 +3,13 @@ diff --git a/org.simantics.sysdyn.ui/plugin.xml b/org.simantics.sysdyn.ui/plugin.xml index f4d8d239..0e0926b3 100644 --- a/org.simantics.sysdyn.ui/plugin.xml +++ b/org.simantics.sysdyn.ui/plugin.xml @@ -22,12 +22,12 @@ + type_uris="http://www.simantics.org/Sysdyn-1.0/Configuration"> + type_uris="http://www.simantics.org/Sysdyn-1.0/Configuration"> elements = new ArrayList(); diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Dependency.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Dependency.java index ff1eb648..6f639bdc 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Dependency.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Dependency.java @@ -4,11 +4,11 @@ import org.simantics.objmap.annotations.GraphType; import org.simantics.objmap.annotations.RelatedElement; import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid; -@GraphType("http://www.simantics.org/Sysdyn#Dependency") +@GraphType("http://www.simantics.org/Sysdyn-1.0/Dependency") public class Dependency implements IElement { - @RelatedElement("http://www.simantics.org/Sysdyn#HasTail") + @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail") public IElement tail; - @RelatedElement("http://www.simantics.org/Sysdyn#HasHead") + @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead") public IElement head; @Override diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Flow.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Flow.java index c9a2aa63..0413c786 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Flow.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Flow.java @@ -4,11 +4,11 @@ import org.simantics.objmap.annotations.GraphType; import org.simantics.objmap.annotations.RelatedElement; import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid; -@GraphType("http://www.simantics.org/Sysdyn#Flow") +@GraphType("http://www.simantics.org/Sysdyn-1.0/Flow") public class Flow implements IElement { - @RelatedElement("http://www.simantics.org/Sysdyn#HasTail") + @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail") public IElement tail; - @RelatedElement("http://www.simantics.org/Sysdyn#HasHead") + @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead") public IElement head; @Override diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Stock.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Stock.java index 3287853f..10916242 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Stock.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Stock.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import org.simantics.objmap.annotations.GraphType; import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid; -@GraphType("http://www.simantics.org/Sysdyn#Stock") +@GraphType("http://www.simantics.org/Sysdyn-1.0/Stock") public class Stock extends Variable { public ArrayList incomingFlows = new ArrayList(2); public ArrayList outgoingFlows = new ArrayList(2); diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Valve.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Valve.java index b3674010..7b6f1966 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Valve.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Valve.java @@ -3,10 +3,10 @@ package org.simantics.sysdyn.representation; import org.simantics.objmap.annotations.GraphType; import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid; -@GraphType("http://www.simantics.org/Sysdyn#Valve") +@GraphType("http://www.simantics.org/Sysdyn-1.0/Valve") public class Valve extends Variable { @Override public void accept(IElementVisitorVoid v) { - v.visit(this); + v.visit(this); } } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Variable.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Variable.java index d9b44119..dee65cc3 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Variable.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Variable.java @@ -5,13 +5,13 @@ import org.simantics.objmap.annotations.RelatedValue; import org.simantics.sysdyn.representation.expressions.IExpression; public abstract class Variable implements IElement { - @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasName") + @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasName") protected String name; - @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasType") + @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasType") protected String type; - //@RelatedValue("http://www.simantics.org/Sysdyn#HasValue") + //@RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasValue") //public String value; - @RelatedElement("http://www.simantics.org/Sysdyn#HasExpression") + @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasExpression") public IExpression expression; public String getName() { diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/ConstantExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/ConstantExpression.java index 86f26e1c..2ac6bc62 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/ConstantExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/ConstantExpression.java @@ -4,12 +4,12 @@ import org.simantics.objmap.annotations.GraphType; import org.simantics.objmap.annotations.RelatedValue; import org.simantics.sysdyn.representation.Variable; -@GraphType("http://www.simantics.org/Sysdyn#ConstantExpression") +@GraphType("http://www.simantics.org/Sysdyn-1.0/ConstantExpression") public class ConstantExpression extends Expression { - - @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation") + + @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasEquation") private String equation; - + @Override public String getDeclaration(Variable variable) { return " constant " + variable.getType() + " " + variable.getName() + " = " + equation + ";\n"; diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/DelayExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/DelayExpression.java index cb334859..285a74e1 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/DelayExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/DelayExpression.java @@ -2,7 +2,7 @@ package org.simantics.sysdyn.representation.expressions; import org.simantics.objmap.annotations.GraphType; -@GraphType("http://www.simantics.org/Sysdyn#Delayxpression") +@GraphType("http://www.simantics.org/Sysdyn-1.0/DelayExpression") public class DelayExpression extends Expression { } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/LookupExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/LookupExpression.java index ccb925d8..2877ee41 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/LookupExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/LookupExpression.java @@ -2,7 +2,7 @@ package org.simantics.sysdyn.representation.expressions; import org.simantics.objmap.annotations.GraphType; -@GraphType("http://www.simantics.org/Sysdyn#LookupExpression") +@GraphType("http://www.simantics.org/Sysdyn-1.0/LookupExpression") public class LookupExpression extends Expression { } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/NormalExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/NormalExpression.java index c8242c54..8929020a 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/NormalExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/NormalExpression.java @@ -4,12 +4,12 @@ import org.simantics.objmap.annotations.GraphType; import org.simantics.objmap.annotations.RelatedValue; import org.simantics.sysdyn.representation.Variable; -@GraphType("http://www.simantics.org/Sysdyn#NormalExpression") +@GraphType("http://www.simantics.org/Sysdyn-1.0/NormalExpression") public class NormalExpression extends Expression { - @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation") + @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasEquation") private String equation; - + @Override public String getDeclaration(Variable variable) { return " " + variable.getType() + " " + variable.getName() + ";\n"; @@ -19,5 +19,5 @@ public class NormalExpression extends Expression { public String getEquation(Variable variable) { return " " + variable.getName() + " = " + equation + ";\n"; } - + } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/ParameterExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/ParameterExpression.java index 26d5d09f..4b650367 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/ParameterExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/ParameterExpression.java @@ -4,10 +4,10 @@ import org.simantics.objmap.annotations.GraphType; import org.simantics.objmap.annotations.RelatedValue; import org.simantics.sysdyn.representation.Variable; -@GraphType("http://www.simantics.org/Sysdyn#ParameterExpression") +@GraphType("http://www.simantics.org/Sysdyn-1.0/ParameterExpression") public class ParameterExpression extends Expression { - @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation") + @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasEquation") private String equation; @Override diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java index 5ab28c21..ca7f4506 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/StockExpression.java @@ -5,12 +5,12 @@ import org.simantics.objmap.annotations.RelatedValue; import org.simantics.sysdyn.representation.Stock; import org.simantics.sysdyn.representation.Variable; -@GraphType("http://www.simantics.org/Sysdyn#StockExpression") +@GraphType("http://www.simantics.org/Sysdyn-1.0/StockExpression") public class StockExpression extends Expression { - - @RelatedValue("http://www.simantics.org/Sysdyn#HasInitialEquation") + + @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasInitialEquation") private String initialEquation; - + @Override public String getDeclaration(Variable variable) { Double value = null; @@ -33,12 +33,12 @@ public class StockExpression extends Expression { b.append(" der(") .append(variable.getName()) .append(") ="); - for(Variable flow : ((Stock)variable).incomingFlows) - b.append("\n + ").append(flow.getName()); - for(Variable flow : ((Stock)variable).outgoingFlows) - b.append("\n - ").append(flow.getName()); - b.append(";\n"); - return b.toString(); + for(Variable flow : ((Stock)variable).incomingFlows) + b.append("\n + ").append(flow.getName()); + for(Variable flow : ((Stock)variable).outgoingFlows) + b.append("\n - ").append(flow.getName()); + b.append(";\n"); + return b.toString(); } @Override diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/WithLookupExpression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/WithLookupExpression.java index 56775723..7179d6e8 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/WithLookupExpression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/WithLookupExpression.java @@ -5,12 +5,12 @@ import org.simantics.objmap.annotations.RelatedValue; import org.simantics.sysdyn.representation.Variable; -@GraphType("http://www.simantics.org/Sysdyn#WithLookupExpression") +@GraphType("http://www.simantics.org/Sysdyn-1.0/WithLookupExpression") public class WithLookupExpression extends Expression { - @RelatedValue("http://www.simantics.org/Sysdyn#HasLookup") + @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasLookup") private String lookupTable; - @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation") + @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasEquation") private String equation; @Override -- 2.47.1