From: lempinen Date: Thu, 27 May 2010 14:27:17 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15964 ac1ea38d-2e2b... X-Git-Tag: simantics-1.2.0~235 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=4feca5401b12b8b49cb7813753f54969c8b799bc;p=simantics%2Fsysdyn.git git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15964 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/CreateDependencyGraph.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/CreateDependencyGraph.java index 2d6f5e00..ea278090 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/CreateDependencyGraph.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/CreateDependencyGraph.java @@ -23,13 +23,13 @@ public class CreateDependencyGraph implements Read { public CreateDependencyGraph(Resource root, int levels, boolean isInverted) { this.root = root; - this.nodes = new HashMap(); this.isInverted = isInverted; this.levels = levels; } @Override public Graph perform(ReadGraph g) throws DatabaseException { + nodes = new HashMap(); Graph graph = new Graph(); graph.setRankdir("LR"); if (g.isInstanceOf(root, SysdynResource.getInstance(g).IndependentVariable)) { @@ -67,7 +67,9 @@ public class CreateDependencyGraph implements Read { Collection dependencies = g.getObjects(r, headRelation); Collection dependants = new ArrayList(); for(Resource d : dependencies) { - Resource dependant = g.getSingleObject(d, tailRelation); + Resource dependant = g.getPossibleObject(d, tailRelation); + if(dependant == null) + continue; if(!g.isInstanceOf(dependant, sr.IndependentVariable)) { break; }