import org.simantics.objmap.annotations.RelatedValue;\r
import org.simantics.objmap.annotations.GraphType;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Configuration")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Configuration")\r
public class Diagram implements IDiagram {\r
\r
- @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#ConsistsOf")\r
+ @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/ConsistsOf")\r
public ArrayList<IElement> elements = new ArrayList<IElement>();\r
ArrayList<IDiagramListener> listeners = new ArrayList<IDiagramListener>();\r
\r
\r
public class SysdynExample {\r
\r
- @GraphType("http://www.simantics.org/Sysdyn#Configuration")\r
+ @GraphType("http://www.simantics.org/Sysdyn-1.0/Configuration")\r
static class Configuration {\r
- @RelatedElements("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#ConsistsOf")\r
+ @RelatedElements("http://www.simantics.org/Layer0-1.0/Relations/ConsistsOf")\r
Collection<Component> components; \r
}\r
\r
static abstract class Component { \r
}\r
\r
- @GraphType("http://www.simantics.org/Sysdyn#Dependency")\r
+ @GraphType("http://www.simantics.org/Sysdyn-1.0/Dependency")\r
static class Dependency extends Component {\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasTail")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail")\r
Variable tail;\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasHead")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead")\r
Auxiliary head;\r
}\r
\r
static abstract class Variable extends Component {\r
- @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasName")\r
+ @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasName")\r
String name;\r
}\r
\r
- @GraphType("http://www.simantics.org/Sysdyn#Auxiliary")\r
+ @GraphType("http://www.simantics.org/Sysdyn-1.0/Auxiliary")\r
static class Auxiliary extends Variable {\r
}\r
\r
public IMappingRule create(ReadGraph g, Annotation _annotation, Field field) throws ResourceNotFoundException, ValidationException, ServiceException {\r
RelatedElement annotation = (RelatedElement)_annotation;\r
return new MappedElementRule(\r
- new RelatedObjectAccessor(g.getResourceByURI(annotation.value())),\r
+ new RelatedObjectAccessor(g.getResource(annotation.value())),\r
new FieldAccessor<Object>(field)\r
);\r
}\r
public IMappingRule create(ReadGraph g, Annotation _annotation, Field field) throws ResourceNotFoundException, ValidationException, ServiceException {\r
RelatedElements annotation = (RelatedElements)_annotation;\r
return new MappedElementsRule(\r
- new RelatedObjectsAccessor(g.getResourceByURI(annotation.value()),\r
+ new RelatedObjectsAccessor(g.getResource(annotation.value()),\r
annotation.composition()),\r
new FieldAccessor<Collection<Object>>(field)\r
);\r
import java.lang.annotation.Annotation;\r
import java.lang.reflect.Field;\r
\r
-import org.simantics.db.Builtins;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.exception.ResourceNotFoundException;\r
import org.simantics.db.exception.ServiceException;\r
@Override\r
public IMappingRule create(ReadGraph g, Annotation _annotation, Field field) throws ResourceNotFoundException, ValidationException, ServiceException {\r
RelatedValue annotation = (RelatedValue)_annotation;\r
- Builtins b = g.getBuiltins();\r
+ //Builtins b = g.getBuiltins();\r
return new ValueRule(\r
new RelatedValueAccessor(\r
- g.getResourceByURI(annotation.value()), \r
+ g.getResource(annotation.value()), \r
DataTypeUtils.dataTypeOfClass(g, field.getType())\r
),\r
new FieldAccessor<Object>(field)\r
package org.simantics.objmap.rules;\r
\r
-import java.util.ArrayList;\r
-\r
import org.apache.log4j.Logger;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.objmap.IFunction;\r
import org.simantics.objmap.IMappingRule;\r
import org.simantics.objmap.MappingException;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.objmap.IFunction;\r
import org.simantics.objmap.IMappingRule;\r
import org.simantics.objmap.MappingException;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.WriteGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.ServiceException;\r
-import org.simantics.db.exception.ValidationException;\r
-import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.objmap.IFunction;\r
import org.simantics.objmap.IMappingRule;\r
import org.simantics.objmap.MappingException;\r
import java.lang.reflect.Field;\r
\r
import org.apache.log4j.Logger;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.objmap.MappingException;\r
\r
/**\r
collectRulesFromAnnotations(g, clazz, rules);\r
\r
return new SimpleLinkType(\r
- g.getResourceByURI(graphType.value()), \r
+ g.getResource(graphType.value()), \r
clazz, rules); \r
}\r
\r
<target\r
interface="org.simantics.project.features.IProjectFeature">\r
<resource\r
- uri="http://www.simantics.org/Sysdyn#SysdynProject"\r
+ uri="http://www.simantics.org/Sysdyn-1.0/SysdynProject"\r
class="org.simantics.sysdyn.ui.project.SysdynProject" />\r
</target>\r
<target\r
interface="org.simantics.scenegraph.adapters.ISceneGraphProvider">\r
<type\r
- uri="http://www.simantics.org/Sysdyn#Configuration"\r
+ uri="http://www.simantics.org/Sysdyn-1.0/Configuration"\r
class="org.simantics.sysdyn.ui.sg.SysdynSceneGraphProvider">\r
<graph />\r
<this />\r
<adapter\r
editorId="org.simantics.sysdyn.ui.diagramEditor"\r
priority="3"\r
- type_uris="http://www.simantics.org/Sysdyn#Configuration">\r
+ type_uris="http://www.simantics.org/Sysdyn-1.0/Configuration">\r
</adapter>\r
<adapter\r
editorId="org.simantics.sysdyn.ui.modelicaEditor"\r
priority="2"\r
- type_uris="http://www.simantics.org/Sysdyn#Configuration">\r
+ type_uris="http://www.simantics.org/Sysdyn-1.0/Configuration">\r
</adapter>\r
</extension>\r
<extension\r
\r
import org.simantics.objmap.annotations.GraphType;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Auxiliary")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Auxiliary")\r
public class AuxiliaryElement extends TextElement {\r
\r
public AuxiliaryElement() { \r
import org.simantics.objmap.annotations.GraphType;\r
import org.simantics.scenegraph.g2d.G2DParentNode;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Cloud")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Cloud")\r
public class CloudElement extends RectangularElement implements Connectable {\r
\r
public static final double CLOUD_SIZE_X = 5.0;\r
import org.simantics.objmap.annotations.RelatedValue;\r
import org.simantics.scenegraph.g2d.G2DParentNode;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Dependency")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Dependency")\r
public class DependencyElement extends Element implements IElementListener {\r
\r
/*\r
public static double ARROW_LENGTH2 = 3.0;\r
public static double ARROW_WIDTH = 1.8;\r
\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasTail")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail")\r
Connectable tail;\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasHead")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead")\r
Connectable head;\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasAngle")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasAngle")\r
double angle = 0.1;\r
\r
// Auxiliary \r
import org.simantics.objmap.annotations.RelatedElement;\r
import org.simantics.scenegraph.g2d.G2DParentNode;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Flow")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Flow")\r
public class FlowElement extends Element implements IElementListener {\r
\r
public static double ARROW_LENGTH = 3.2;\r
/*\r
* Total length of the arrow is ARROW_LENGTH1 + ARROW_LENGTH2\r
*/ \r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasTail")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail")\r
Connectable tail;\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasHead")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead")\r
Connectable head;\r
\r
// Auxiliary \r
\r
protected Rectangle2D bounds = new Rectangle2D.Double();\r
\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasX")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasX")\r
protected double posX;\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasY")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasY")\r
protected double posY; \r
\r
public RectangularElement() { \r
import org.simantics.objmap.annotations.UpdateMethod;\r
import org.simantics.scenegraph.g2d.G2DParentNode;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Stock")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Stock")\r
public class StockElement extends TextElement {\r
\r
RectangleNode rectangleNode;\r
import org.simantics.scenegraph.g2d.G2DParentNode;\r
import org.simantics.sysdyn.SysdynResource;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Auxiliary")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Auxiliary")\r
public class TextElement extends RectangularElement implements Movable, Connectable, IEventHandler {\r
\r
static final Font FONT = new Font("sans-serif", Font.PLAIN, 12);\r
static final FontRenderContext FRC = new FontRenderContext(FONT_TRANSFORM, true, true);\r
\r
// Properties\r
- @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasName")\r
+ @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations-1.0/HasName")\r
public String label = "Unnamed";\r
\r
- @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasType")\r
+ @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations-1.0/HasType")\r
public String type = "Real";\r
\r
// Auxiliary fields\r
import org.simantics.objmap.annotations.GraphType;\r
import org.simantics.scenegraph.g2d.G2DParentNode;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Valve")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Valve")\r
public class ValveElement extends TextElement implements Rotatable {\r
\r
public static final double VALVE_SIZE = 5.0;\r
import org.simantics.objmap.annotations.GraphType;\r
import org.simantics.scenegraph.g2d.G2DParentNode;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Valve")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Valve")\r
public class ValveElementOld extends RectangularElement implements Connectable, Rotatable {\r
\r
public static final double VALVE_SIZE = 5.0;\r
public final Resource WithLookupExpression;\r
\r
public static class URIs {\r
- public static final String Auxiliary = "http://www.simantics.org/Sysdyn#Auxiliary";\r
- public static final String Cloud = "http://www.simantics.org/Sysdyn#Cloud";\r
- public static final String Configuration = "http://www.simantics.org/Sysdyn#Configuration";\r
- public static final String ConstantExpression = "http://www.simantics.org/Sysdyn#ConstantExpression";\r
- public static final String DelayExpression = "http://www.simantics.org/Sysdyn#DelayExpression";\r
- public static final String Dependency = "http://www.simantics.org/Sysdyn#Dependency";\r
- public static final String Expression = "http://www.simantics.org/Sysdyn#Expression";\r
- public static final String Flow = "http://www.simantics.org/Sysdyn#Flow";\r
- public static final String HasAngle = "http://www.simantics.org/Sysdyn#HasAngle";\r
- public static final String HasEquation = "http://www.simantics.org/Sysdyn#HasEquation";\r
- public static final String HasExpression = "http://www.simantics.org/Sysdyn#HasExpression";\r
- public static final String HasHead = "http://www.simantics.org/Sysdyn#HasHead";\r
- public static final String HasInitialEquation = "http://www.simantics.org/Sysdyn#HasInitialEquation";\r
- public static final String HasLookup = "http://www.simantics.org/Sysdyn#HasLookup";\r
- public static final String HasStartTime = "http://www.simantics.org/Sysdyn#HasStartTime";\r
- public static final String HasStopTime = "http://www.simantics.org/Sysdyn#HasStopTime";\r
- public static final String HasTail = "http://www.simantics.org/Sysdyn#HasTail";\r
- public static final String HasType = "http://www.simantics.org/Sysdyn#HasType";\r
- public static final String HasUnit = "http://www.simantics.org/Sysdyn#HasUnit";\r
- public static final String HasX = "http://www.simantics.org/Sysdyn#HasX";\r
- public static final String HasY = "http://www.simantics.org/Sysdyn#HasY";\r
- public static final String IndependentVariable = "http://www.simantics.org/Sysdyn#IndependentVariable";\r
- public static final String IsHeadOf = "http://www.simantics.org/Sysdyn#IsHeadOf";\r
- public static final String IsTailOf = "http://www.simantics.org/Sysdyn#IsTailOf";\r
- public static final String LookupExpression = "http://www.simantics.org/Sysdyn#LookupExpression";\r
- public static final String NormalExpression = "http://www.simantics.org/Sysdyn#NormalExpression";\r
- public static final String ParameterExpression = "http://www.simantics.org/Sysdyn#ParameterExpression";\r
- public static final String Stock = "http://www.simantics.org/Sysdyn#Stock";\r
- public static final String StockExpression = "http://www.simantics.org/Sysdyn#StockExpression";\r
- public static final String SysdynProject = "http://www.simantics.org/Sysdyn#SysdynProject";\r
- public static final String Valve = "http://www.simantics.org/Sysdyn#Valve";\r
- public static final String Variable = "http://www.simantics.org/Sysdyn#Variable";\r
- public static final String WithLookupExpression = "http://www.simantics.org/Sysdyn#WithLookupExpression";\r
+ public static final String Auxiliary = "http://www.simantics.org/Sysdyn-1.0/Auxiliary";\r
+ public static final String Cloud = "http://www.simantics.org/Sysdyn-1.0/Cloud";\r
+ public static final String Configuration = "http://www.simantics.org/Sysdyn-1.0/Configuration";\r
+ public static final String ConstantExpression = "http://www.simantics.org/Sysdyn-1.0/ConstantExpression";\r
+ public static final String DelayExpression = "http://www.simantics.org/Sysdyn-1.0/DelayExpression";\r
+ public static final String Dependency = "http://www.simantics.org/Sysdyn-1.0/Dependency";\r
+ public static final String Expression = "http://www.simantics.org/Sysdyn-1.0/Expression";\r
+ public static final String Flow = "http://www.simantics.org/Sysdyn-1.0/Flow";\r
+ public static final String HasAngle = "http://www.simantics.org/Sysdyn-1.0/HasAngle";\r
+ public static final String HasEquation = "http://www.simantics.org/Sysdyn-1.0/HasEquation";\r
+ public static final String HasExpression = "http://www.simantics.org/Sysdyn-1.0/HasExpression";\r
+ public static final String HasHead = "http://www.simantics.org/Sysdyn-1.0/HasHead";\r
+ public static final String HasInitialEquation = "http://www.simantics.org/Sysdyn-1.0/HasInitialEquation";\r
+ public static final String HasLookup = "http://www.simantics.org/Sysdyn-1.0/HasLookup";\r
+ public static final String HasStartTime = "http://www.simantics.org/Sysdyn-1.0/HasStartTime";\r
+ public static final String HasStopTime = "http://www.simantics.org/Sysdyn-1.0/HasStopTime";\r
+ public static final String HasTail = "http://www.simantics.org/Sysdyn-1.0/HasTail";\r
+ public static final String HasType = "http://www.simantics.org/Sysdyn-1.0/HasType";\r
+ public static final String HasUnit = "http://www.simantics.org/Sysdyn-1.0/HasUnit";\r
+ public static final String HasX = "http://www.simantics.org/Sysdyn-1.0/HasX";\r
+ public static final String HasY = "http://www.simantics.org/Sysdyn-1.0/HasY";\r
+ public static final String IndependentVariable = "http://www.simantics.org/Sysdyn-1.0/IndependentVariable";\r
+ public static final String IsHeadOf = "http://www.simantics.org/Sysdyn-1.0/IsHeadOf";\r
+ public static final String IsTailOf = "http://www.simantics.org/Sysdyn-1.0/IsTailOf";\r
+ public static final String LookupExpression = "http://www.simantics.org/Sysdyn-1.0/LookupExpression";\r
+ public static final String NormalExpression = "http://www.simantics.org/Sysdyn-1.0/NormalExpression";\r
+ public static final String ParameterExpression = "http://www.simantics.org/Sysdyn-1.0/ParameterExpression";\r
+ public static final String Stock = "http://www.simantics.org/Sysdyn-1.0/Stock";\r
+ public static final String StockExpression = "http://www.simantics.org/Sysdyn-1.0/StockExpression";\r
+ public static final String SysdynProject = "http://www.simantics.org/Sysdyn-1.0/SysdynProject";\r
+ public static final String Valve = "http://www.simantics.org/Sysdyn-1.0/Valve";\r
+ public static final String Variable = "http://www.simantics.org/Sysdyn-1.0/Variable";\r
+ public static final String WithLookupExpression = "http://www.simantics.org/Sysdyn-1.0/WithLookupExpression";\r
}\r
\r
public static Resource getResourceOrNull(ReadGraph graph, String uri) {\r
try {\r
- return graph.getResourceByURI(uri);\r
+ return graph.getResource(uri);\r
} catch(DatabaseException e) {\r
System.err.println(e.getMessage());\r
return null;\r
import org.simantics.objmap.annotations.GraphType;\r
import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Auxiliary")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Auxiliary")\r
public class Auxiliary extends Variable {\r
@Override\r
public void accept(IElementVisitorVoid v) {\r
- v.visit(this); \r
+ v.visit(this);\r
}\r
}\r
import org.simantics.objmap.annotations.GraphType;\r
import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Cloud")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Cloud")\r
public class Cloud implements IElement {\r
@Override\r
public void accept(IElementVisitorVoid v) {\r
- v.visit(this); \r
+ v.visit(this);\r
}\r
}\r
import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Configuration")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Configuration")\r
public class Configuration {\r
- @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasName")\r
+ @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasName")\r
public String name = "Unnamed";\r
\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasStartTime")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasStartTime")\r
public Double startTime = 0.0;\r
\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasStopTime")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasStopTime")\r
public Double stopTime = 10.0;\r
\r
@RelatedElements(\r
- value = "http://www.vtt.fi/Simantics/Layer0/1.0/Relations#ConsistsOf",\r
+ value = "http://www.simantics.org/Layer0-1.0/Relations/ConsistsOf",\r
composition = true)\r
public ArrayList<IElement> elements = new ArrayList<IElement>();\r
\r
import org.simantics.objmap.annotations.RelatedElement;\r
import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Dependency")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Dependency")\r
public class Dependency implements IElement {\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasTail")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail")\r
public IElement tail;\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasHead")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead")\r
public IElement head;\r
\r
@Override\r
import org.simantics.objmap.annotations.RelatedElement;\r
import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Flow")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Flow")\r
public class Flow implements IElement {\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasTail")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail")\r
public IElement tail;\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasHead")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead")\r
public IElement head;\r
\r
@Override\r
import org.simantics.objmap.annotations.GraphType;\r
import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Stock")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Stock")\r
public class Stock extends Variable {\r
public ArrayList<Variable> incomingFlows = new ArrayList<Variable>(2);\r
public ArrayList<Variable> outgoingFlows = new ArrayList<Variable>(2);\r
import org.simantics.objmap.annotations.GraphType;\r
import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Valve")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/Valve")\r
public class Valve extends Variable {\r
@Override\r
public void accept(IElementVisitorVoid v) {\r
- v.visit(this); \r
+ v.visit(this);\r
}\r
}\r
import org.simantics.sysdyn.representation.expressions.IExpression;\r
\r
public abstract class Variable implements IElement {\r
- @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasName")\r
+ @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasName")\r
protected String name;\r
- @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasType")\r
+ @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasType")\r
protected String type;\r
- //@RelatedValue("http://www.simantics.org/Sysdyn#HasValue")\r
+ //@RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasValue")\r
//public String value;\r
- @RelatedElement("http://www.simantics.org/Sysdyn#HasExpression")\r
+ @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasExpression")\r
public IExpression expression;\r
\r
public String getName() {\r
import org.simantics.objmap.annotations.RelatedValue;\r
import org.simantics.sysdyn.representation.Variable;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#ConstantExpression")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/ConstantExpression")\r
public class ConstantExpression extends Expression {\r
- \r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation")\r
+\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasEquation")\r
private String equation;\r
- \r
+\r
@Override\r
public String getDeclaration(Variable variable) {\r
return " constant " + variable.getType() + " " + variable.getName() + " = " + equation + ";\n";\r
\r
import org.simantics.objmap.annotations.GraphType;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#Delayxpression")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/DelayExpression")\r
public class DelayExpression extends Expression {\r
\r
}\r
\r
import org.simantics.objmap.annotations.GraphType;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#LookupExpression")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/LookupExpression")\r
public class LookupExpression extends Expression {\r
\r
}\r
import org.simantics.objmap.annotations.RelatedValue;\r
import org.simantics.sysdyn.representation.Variable;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#NormalExpression")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/NormalExpression")\r
public class NormalExpression extends Expression {\r
\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasEquation")\r
private String equation;\r
- \r
+\r
@Override\r
public String getDeclaration(Variable variable) {\r
return " " + variable.getType() + " " + variable.getName() + ";\n";\r
public String getEquation(Variable variable) {\r
return " " + variable.getName() + " = " + equation + ";\n";\r
}\r
- \r
+\r
}\r
import org.simantics.objmap.annotations.RelatedValue;\r
import org.simantics.sysdyn.representation.Variable;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#ParameterExpression")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/ParameterExpression")\r
public class ParameterExpression extends Expression {\r
\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasEquation")\r
private String equation;\r
\r
@Override\r
import org.simantics.sysdyn.representation.Stock;\r
import org.simantics.sysdyn.representation.Variable;\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#StockExpression")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/StockExpression")\r
public class StockExpression extends Expression {\r
- \r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasInitialEquation")\r
+\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasInitialEquation")\r
private String initialEquation;\r
- \r
+\r
@Override\r
public String getDeclaration(Variable variable) {\r
Double value = null;\r
b.append(" der(")\r
.append(variable.getName())\r
.append(") =");\r
- for(Variable flow : ((Stock)variable).incomingFlows)\r
- b.append("\n + ").append(flow.getName());\r
- for(Variable flow : ((Stock)variable).outgoingFlows)\r
- b.append("\n - ").append(flow.getName());\r
- b.append(";\n");\r
- return b.toString();\r
+ for(Variable flow : ((Stock)variable).incomingFlows)\r
+ b.append("\n + ").append(flow.getName());\r
+ for(Variable flow : ((Stock)variable).outgoingFlows)\r
+ b.append("\n - ").append(flow.getName());\r
+ b.append(";\n");\r
+ return b.toString();\r
}\r
\r
@Override\r
import org.simantics.sysdyn.representation.Variable;\r
\r
\r
-@GraphType("http://www.simantics.org/Sysdyn#WithLookupExpression")\r
+@GraphType("http://www.simantics.org/Sysdyn-1.0/WithLookupExpression")\r
public class WithLookupExpression extends Expression {\r
\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasLookup")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasLookup")\r
private String lookupTable;\r
- @RelatedValue("http://www.simantics.org/Sysdyn#HasEquation")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasEquation")\r
private String equation;\r
\r
@Override\r