]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Valves are recognized in dependencies view to affect Stocks. (fixes #3707)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 11 Oct 2012 09:52:25 +0000 (09:52 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 11 Oct 2012 09:52:25 +0000 (09:52 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25979 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/structure/DependencyGraphRequest.java

index 27c95d3ef4069ee084fe6956d5d47e7d05a44d08..ca898582fe41f6c7880b84b92d28ebf076e0d004 100644 (file)
@@ -149,14 +149,18 @@ public class DependencyGraphRequest implements Read<Graph> {
                        return Collections.emptyList();\r
 \r
                Collection<Resource> dependants;\r
-               if(isInverted)\r
-                       dependants = getDependants(g, graph, r, sr.Variable_isTailOf, sr.Variable_HasHead, sr.Dependency);\r
-               else {\r
-                       dependants = getDependants(g, graph, r, sr.Variable_isHeadOf, sr.Variable_HasTail, sr.Dependency);\r
-                       if (g.isInstanceOf(r, sr.Stock)) {\r
-                               dependants.addAll(getDependants(g, graph, r, sr.Variable_isTailOf, sr.Variable_HasHead, sr.Flow));\r
-                               dependants.addAll(getDependants(g, graph, r, sr.Variable_isHeadOf, sr.Variable_HasTail, sr.Flow));\r
-                       }\r
+               if(isInverted) {\r
+                   dependants = getDependants(g, graph, r, sr.Variable_isTailOf, sr.Variable_HasHead, sr.Dependency);\r
+                   if (g.isInstanceOf(r, sr.Valve)) {\r
+                       dependants.addAll(getDependants(g, graph, r, sr.Variable_isTailOf, sr.Variable_HasHead, sr.Flow));\r
+                       dependants.addAll(getDependants(g, graph, r, sr.Variable_isHeadOf, sr.Variable_HasTail, sr.Flow));\r
+                   }\r
+               } else {\r
+                   dependants = getDependants(g, graph, r, sr.Variable_isHeadOf, sr.Variable_HasTail, sr.Dependency);\r
+                   if (g.isInstanceOf(r, sr.Stock)) {\r
+                       dependants.addAll(getDependants(g, graph, r, sr.Variable_isTailOf, sr.Variable_HasHead, sr.Flow));\r
+                       dependants.addAll(getDependants(g, graph, r, sr.Variable_isHeadOf, sr.Variable_HasTail, sr.Flow));\r
+                   }\r
                }\r
 \r
                return dependants;\r