From 6e1533c3fd8ce85a4e471d322fdf8af93c96b320 Mon Sep 17 00:00:00 2001 From: lehtonen Date: Sat, 13 Mar 2010 21:20:53 +0000 Subject: [PATCH] Fixing brakage caused by changed Layer0 URI's git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14900 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../org/simantics/h2d/diagram/Diagram.java | 2 +- .../objmap/examples/SysdynExample.java | 22 +++++++++---------- .../sysdyn/ui/elements/TextElement.java | 4 ++-- .../org/simantics/sysdyn/SysdynResource.java | 4 ++-- .../sysdyn/representation/Configuration.java | 4 ++-- .../sysdyn/representation/Variable.java | 8 +++---- 6 files changed, 22 insertions(+), 22 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 102482c5..dc9e4a81 100644 --- a/org.simantics.h2d/src/org/simantics/h2d/diagram/Diagram.java +++ b/org.simantics.h2d/src/org/simantics/h2d/diagram/Diagram.java @@ -21,7 +21,7 @@ import org.simantics.objmap.annotations.GraphType; @GraphType("http://www.simantics.org/Sysdyn-1.0/Configuration") public class Diagram implements IDiagram { - @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/ConsistsOf") + @RelatedValue("http://www.simantics.org/Layer0-1.0/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 e3aeac06..a7b3d0a8 100644 --- a/org.simantics.objmap/examples/org/simantics/objmap/examples/SysdynExample.java +++ b/org.simantics.objmap/examples/org/simantics/objmap/examples/SysdynExample.java @@ -27,13 +27,13 @@ public class SysdynExample { @GraphType("http://www.simantics.org/Sysdyn-1.0/Configuration") static class Configuration { - @RelatedElements("http://www.simantics.org/Layer0-1.0/Relations/ConsistsOf") - Collection components; + @RelatedElements("http://www.simantics.org/Layer0-1.0/ConsistsOf") + Collection components; } - - static abstract class Component { + + static abstract class Component { } - + @GraphType("http://www.simantics.org/Sysdyn-1.0/Dependency") static class Dependency extends Component { @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasTail") @@ -41,22 +41,22 @@ public class SysdynExample { @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasHead") Auxiliary head; } - + static abstract class Variable extends Component { - @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasName") + @RelatedValue("http://www.simantics.org/Layer0-1.0/HasName") String name; } - + @GraphType("http://www.simantics.org/Sysdyn-1.0/Auxiliary") static class Auxiliary extends Variable { } - + public static IMappingSchema createSchema(ReadGraph g) throws DatabaseException, InstantiationException, IllegalAccessException { SimpleSchema schema = new SimpleSchema(); schema.addLinkType(MappingSchemas.fromAnnotations(g, Configuration.class)); schema.addLinkType(MappingSchemas.fromAnnotations(g, Dependency.class)); schema.addLinkType(MappingSchemas.fromAnnotations(g, Auxiliary.class)); return schema; - } - + } + } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java index 3c6d7eeb..ad451404 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java @@ -50,10 +50,10 @@ public class TextElement extends RectangularElement implements Movable, Connecta static final FontRenderContext FRC = new FontRenderContext(FONT_TRANSFORM, true, true); // Properties - @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations/HasName") + @RelatedValue("http://www.simantics.org/Layer0-1.0/HasName") public String label = "Unnamed"; - @RelatedValue("http://www.vtt.fi/Simantics/Layer0/1.0/Relations/HasType") + @RelatedValue("http://www.simantics.org/Layer0-1.0/HasType") public String type = "Real"; // Auxiliary fields diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java index 155bea64..abb491ff 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java @@ -136,7 +136,7 @@ public class SysdynResource { public static SysdynResource getInstance(ReadGraph graph) { Session session = graph.getSession(); - SysdynResource ret = session.getService(SysdynResource.class); + SysdynResource ret = session.peekService(SysdynResource.class); if(ret == null) { ret = new SysdynResource(graph); session.registerService(SysdynResource.class, ret); @@ -145,7 +145,7 @@ public class SysdynResource { } public static SysdynResource getInstance(Session session) throws DatabaseException { - SysdynResource ret = session.getService(SysdynResource.class); + SysdynResource ret = session.peekService(SysdynResource.class); if(ret == null) { ret = session.syncRequest(new Read() { public SysdynResource perform(ReadGraph graph) throws DatabaseException { diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Configuration.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Configuration.java index 87820f49..cc0df887 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Configuration.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Configuration.java @@ -22,7 +22,7 @@ import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid; @GraphType("http://www.simantics.org/Sysdyn-1.0/Configuration") public class Configuration { - @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasName") + @RelatedValue("http://www.simantics.org/Layer0-1.0/HasName") public String name = "Unnamed"; @RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasStartTime") @@ -32,7 +32,7 @@ public class Configuration { public Double stopTime = 10.0; @RelatedElements( - value = "http://www.simantics.org/Layer0-1.0/Relations/ConsistsOf", + value = "http://www.simantics.org/Layer0-1.0/ConsistsOf", composition = true) public ArrayList elements = new ArrayList(); 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 d1a14f59..10372b32 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Variable.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Variable.java @@ -16,19 +16,19 @@ import org.simantics.objmap.annotations.RelatedValue; import org.simantics.sysdyn.representation.expressions.IExpression; public abstract class Variable implements IElement { - @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasName") + @RelatedValue("http://www.simantics.org/Layer0-1.0/HasName") protected String name; - @RelatedValue("http://www.simantics.org/Layer0-1.0/Relations/HasType") + @RelatedValue("http://www.simantics.org/Layer0-1.0/HasType") protected String type; //@RelatedValue("http://www.simantics.org/Sysdyn-1.0/HasValue") //public String value; @RelatedElement("http://www.simantics.org/Sysdyn-1.0/HasExpression") public IExpression expression; - + public String getName() { return this.name; } - + public String getType() { return this.type; } -- 2.47.1