diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java index 08739af..29c0dda 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java @@ -377,6 +377,18 @@ Map channelsOut = new HashMap<>(); Map resources = new HashMap<>(); + // create resource vertices + for (ResourceNode resNode: dataFlowGraph.getRootResourceNodes()) { + int w = 80; + int h = 30; + ResourcePath res = resNode.getOutSideResource(); + Object resource = graph.insertVertex(parent, null, + res.getResourceName(), 20, 20, w, h, + "shape=ellipse;perimeter=ellipsePerimeter"); // insert a resource as a vertex + resources.put(System.identityHashCode(res), resource); + getChildResource(resource, resNode, resources, w, h); + } + // create channel vertices for (ChannelNode c: dataFlowGraph.getRootChannelNodes()) { DataTransferChannel channel = (DataTransferChannel) c.getChannel(); @@ -446,18 +458,6 @@ } } } - - // create resource vertices - for (ResourceNode resNode: dataFlowGraph.getRootResourceNodes()) { - int w = 80; - int h = 30; - ResourcePath res = resNode.getOutSideResource(); - Object resource = graph.insertVertex(parent, null, - res.getResourceName(), 20, 20, w, h, - "shape=ellipse;perimeter=ellipsePerimeter"); // insert a resource as a vertex - resources.put(System.identityHashCode(res), resource); - getChildResource(resource, resNode, resources, w, h); - } // add input, output and reference edges for (Edge edge: dataFlowGraph.getEdges()) { @@ -501,11 +501,6 @@ public void getChildResource(Object resource, ResourceNode resNode, Map resources, int w, int h) { for (ResourceNode c: resNode.getChildren()) { -// w = w - 100; -// if(w <= 0) { -// w = 100; -// } -// h = (2 * w) / 3; ResourcePath chRes = c.getOutSideResource(); Object chResource = graph.insertVertex(resource, null, chRes.getName(), 0, 0, w, h,