]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Labelers show the actual variable type for components in configurations, not "default...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 31 Aug 2010 07:50:22 +0000 (07:50 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 31 Aug 2010 07:50:22 +0000 (07:50 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17706 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/InputLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/ModuleLabeler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/contributions/VariableLabeler.java

index d2c60c8a515281de7ac4b8fd9384022a99712077..286f57cbd72e167ef267e31cd656e846558eea89 100644 (file)
@@ -17,7 +17,9 @@ public class InputLabeler extends LabelerContributor<InputNode>{
         for(Resource r : graph.getObjects(varres, l0.HasName))\r
             sb.append(graph.getValue(r));\r
         sb.append(" : ");\r
-        for(Resource t : graph.getObjects(varres, l0.InstanceOf))\r
+        Resource represents = graph.getPossibleObject(varres, l0.Represents);\r
+        if(represents == null) return sb.toString();\r
+        for(Resource t : graph.getObjects(represents, l0.InstanceOf))\r
             for(Resource r : graph.getObjects(t, l0.HasName))\r
                 sb.append(graph.getValue(r));\r
         return sb.toString();\r
index abaf0c6510e9c665d9c9e7da3e152dd08d891990..51f47eae36fae66d3fe9cf0da27b5d60162d7709 100644 (file)
@@ -28,7 +28,9 @@ public class ModuleLabeler  extends LabelerContributor<ModuleNode>{
         for(Resource r : graph.getObjects(resource, l0.HasName))\r
             sb.append(graph.getValue(r));\r
         sb.append(" : ");\r
-        for(Resource t : graph.getObjects(resource, l0.InstanceOf))\r
+        Resource represents = graph.getPossibleObject(resource, l0.Represents);\r
+        if(represents == null) return sb.toString();\r
+        for(Resource t : graph.getObjects(represents, l0.InstanceOf))\r
             for(Resource r : graph.getObjects(t, l0.HasName))\r
                 sb.append(graph.getValue(r));\r
         return sb.toString();\r
index 7e78b3a8379177c0c414de9d85905283d3063baf..ac92c4b916c8f6a349600b244e2c76a6f463c27f 100644 (file)
@@ -28,7 +28,9 @@ public class VariableLabeler  extends LabelerContributor<VariableNode<Resource>>
         for(Resource r : graph.getObjects(varres, l0.HasName))\r
             sb.append(graph.getValue(r));\r
         sb.append(" : ");\r
-        for(Resource t : graph.getObjects(varres, l0.InstanceOf))\r
+        Resource represents = graph.getPossibleObject(varres, l0.Represents);\r
+        if(represents == null) return sb.toString();\r
+        for(Resource t : graph.getObjects(represents, l0.InstanceOf))\r
             for(Resource r : graph.getObjects(t, l0.HasName))\r
                 sb.append(graph.getValue(r));\r
         return sb.toString();\r