diff --git a/AlgebraicDataflowArchitectureModel/src/application/actions/NewChannelAction.java b/AlgebraicDataflowArchitectureModel/src/application/actions/NewChannelAction.java index 6ee664c..1006055 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/actions/NewChannelAction.java +++ b/AlgebraicDataflowArchitectureModel/src/application/actions/NewChannelAction.java @@ -22,7 +22,7 @@ public void actionPerformed(ActionEvent e) { String channelName = JOptionPane.showInputDialog("Channel Name:"); if (channelName == null) return; - editor.addChannel(new DataTransferChannel(channelName)); + editor.addChannel(channelName); } } diff --git a/AlgebraicDataflowArchitectureModel/src/application/actions/NewEventChannelAction.java b/AlgebraicDataflowArchitectureModel/src/application/actions/NewEventChannelAction.java index b7b59e8..df10657 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/actions/NewEventChannelAction.java +++ b/AlgebraicDataflowArchitectureModel/src/application/actions/NewEventChannelAction.java @@ -22,7 +22,7 @@ public void actionPerformed(ActionEvent e) { String channelName = JOptionPane.showInputDialog("Event Channel Name:"); if (channelName == null) return; - editor.addIOChannel(new DataTransferChannel(channelName)); + editor.addEventChannel(channelName); } } diff --git a/AlgebraicDataflowArchitectureModel/src/application/actions/NewFormulaChannelAction.java b/AlgebraicDataflowArchitectureModel/src/application/actions/NewFormulaChannelAction.java index 068c758..245be58 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/actions/NewFormulaChannelAction.java +++ b/AlgebraicDataflowArchitectureModel/src/application/actions/NewFormulaChannelAction.java @@ -56,7 +56,7 @@ String channelName = channelText.getText(); String symbol = symbolText.getText(); if(r == JOptionPane.OK_OPTION) { - editor.addFormulaChannel(new FormulaChannel(channelName, editor.getModel().getSymbol(symbol))); + editor.addFormulaChannel(channelName, editor.getModel().getSymbol(symbol)); } } } diff --git a/AlgebraicDataflowArchitectureModel/src/application/actions/NewResourceAction.java b/AlgebraicDataflowArchitectureModel/src/application/actions/NewResourceAction.java index bd9aad2..fd51111 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/actions/NewResourceAction.java +++ b/AlgebraicDataflowArchitectureModel/src/application/actions/NewResourceAction.java @@ -1,9 +1,11 @@ package application.actions; import application.editor.Editor; +import models.dataConstraintModel.ResourcePath; import javax.swing.*; import java.awt.event.ActionEvent; +import java.util.List; public class NewResourceAction extends AbstractEditorAction { @@ -15,10 +17,25 @@ @Override public void actionPerformed(ActionEvent e) { - String resName = JOptionPane.showInputDialog("Resource Name:"); + List selectedResPaths = editor.getSelectedResourcePaths(); + String initialName = ""; + if (selectedResPaths != null && selectedResPaths.size() == 1) { + initialName = selectedResPaths.get(0).toString(); + } + String resName = JOptionPane.showInputDialog("Resource Name:", initialName); if (resName == null) { return; } - editor.addResourcePath(null, resName); + if (selectedResPaths == null || selectedResPaths.size() == 0) { + editor.addResourcePath(null, resName); + } else if (selectedResPaths.size() == 1) { + if (initialName.length() > 0 && resName.startsWith(initialName)) { + resName = resName.substring(initialName.length()); + if (resName.startsWith(".")) { + resName = resName.substring(1); + } + } + editor.addResourcePath(selectedResPaths.get(0), resName); + } } } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java index 48c7484..034cbb6 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/Editor.java @@ -14,6 +14,9 @@ import com.mxgraph.view.mxGraph; import com.mxgraph.view.mxGraphView; import models.EdgeAttribute; +import models.algebra.Expression; +import models.algebra.Symbol; +import models.algebra.Variable; import models.dataConstraintModel.Channel; import models.dataConstraintModel.ResourcePath; import models.dataFlowModel.DataFlowGraph; @@ -313,14 +316,6 @@ return fileString.toString(); } - public void delete() { - boolean stageChanged = changeStage(STAGE_DATA_FLOW_MODELING); - if (!stageChanged) { - return; - } - ((DataFlowModelingStage) curStage).delete(); - } - public void setDAGLayout() { mxCell root = (mxCell) graph.getDefaultParent(); @@ -363,6 +358,49 @@ graph.getModel().endUpdate(); } } + + public List getSelectedResourcePaths() { + Object[] sels = graph.getSelectionCells(); + List resPaths = new ArrayList<>(); + for (Object sel: sels) { + if (sel instanceof mxCell && ((mxCell) sel).isVertex()) { + mxCell cell = ((mxCell) sel); + ResourcePath resPath = model.getResourcePath((String) cell.getValue()); + if (resPath != null) { + resPaths.add(resPath); + } + } + } + return resPaths; + } + + public List getSelectedChannels() { + Object[] sels = graph.getSelectionCells(); + List channels = new ArrayList<>(); + for (Object sel: sels) { + if (sel instanceof mxCell && ((mxCell) sel).isVertex()) { + mxCell cell = ((mxCell) sel); + Channel channel = model.getChannel((String) cell.getValue()); + if (channel != null) { + channels.add(channel); + } else { + channel = model.getInputChannel((String) cell.getValue()); + if (channel != null) { + channels.add(channel); + } + } + } + } + return channels; + } + + public void delete() { + boolean stageChanged = changeStage(STAGE_DATA_FLOW_MODELING); + if (!stageChanged) { + return; + } + ((DataFlowModelingStage) curStage).delete(); + } public void addResourcePath(ResourcePath parentPath, String resName) { // Force to change to data-flow modeling stage @@ -374,33 +412,86 @@ model = curStage.getModel(); } - public void addChannel(DataTransferChannel channelGen) { + public void addChannel(String channelName) { // Force to change to data-flow modeling stage boolean stageChanged = changeStage(STAGE_DATA_FLOW_MODELING); if (!stageChanged) { return; } - ((DataFlowModelingStage) curStage).addChannel(channelGen); + DataTransferChannel channel = null; + if (channelName.contains(Parser.LEFT_BRACKET) && channelName.contains(Parser.RIGHT_BRACKET)) { + channel = new DataTransferChannel(channelName.substring(0, channelName.indexOf(Parser.LEFT_BRACKET))); + Parser.TokenStream stream = new Parser.TokenStream(); + Parser parser = new Parser(stream); + stream.addLine(channelName.substring(channelName.indexOf(Parser.LEFT_BRACKET), channelName.length())); + try { + String leftBracket = stream.next(); + if (leftBracket.equals(Parser.LEFT_BRACKET)) { + // has selectors + String rightBracket = null; + do { + String selector = stream.next(); + Variable var = parser.parseVariable(stream, model, selector); + channel.addSelector(var); + rightBracket = stream.next(); + } while (rightBracket.equals(Parser.COMMA)); + if (!rightBracket.equals(Parser.RIGHT_BRACKET)) throw new ExpectedRightBracket(stream.getLine()); + leftBracket = stream.next(); + } + } catch (ExpectedRightBracket e) { + e.printStackTrace(); + } + } else { + channel = new DataTransferChannel(channelName); + } + ((DataFlowModelingStage) curStage).addChannel(channel); model = curStage.getModel(); } - public void addIOChannel(DataTransferChannel ioChannelGen) { + public void addEventChannel(String channelName) { // Force to change to data-flow modeling stage boolean stageChanged = changeStage(STAGE_DATA_FLOW_MODELING); if (!stageChanged) { return; } - ((DataFlowModelingStage) curStage).addIOChannel(ioChannelGen); + DataTransferChannel eventChannel = null; + if (channelName.contains(Parser.LEFT_BRACKET) && channelName.contains(Parser.RIGHT_BRACKET)) { + eventChannel = new DataTransferChannel(channelName.substring(0, channelName.indexOf(Parser.LEFT_BRACKET))); + Parser.TokenStream stream = new Parser.TokenStream(); + Parser parser = new Parser(stream); + stream.addLine(channelName.substring(channelName.indexOf(Parser.LEFT_BRACKET), channelName.length())); + try { + String leftBracket = stream.next(); + if (leftBracket.equals(Parser.LEFT_BRACKET)) { + // has selectors + String rightBracket = null; + do { + String selector = stream.next(); + Variable var = parser.parseVariable(stream, model, selector); + eventChannel.addSelector(var); + rightBracket = stream.next(); + } while (rightBracket.equals(Parser.COMMA)); + if (!rightBracket.equals(Parser.RIGHT_BRACKET)) throw new ExpectedRightBracket(stream.getLine()); + leftBracket = stream.next(); + } + } catch (ExpectedRightBracket e) { + e.printStackTrace(); + } + } else { + eventChannel = new DataTransferChannel(channelName); + } + ((DataFlowModelingStage) curStage).addEventChannel(eventChannel); model = curStage.getModel(); } - public void addFormulaChannel(FormulaChannel formulaChannelGen) { + public void addFormulaChannel(String channelName, Symbol op) { // Force to change to data-flow modeling stage boolean stageChanged = changeStage(STAGE_DATA_FLOW_MODELING); if (!stageChanged) { return; } - ((DataFlowModelingStage) curStage).addFormulaChannel(formulaChannelGen); + FormulaChannel formulaChannel = new FormulaChannel(channelName, op); + ((DataFlowModelingStage) curStage).addFormulaChannel(formulaChannel); model = curStage.getModel(); } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowCellEditor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowCellEditor.java index c0709b6..f8e85fc 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowCellEditor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowCellEditor.java @@ -34,14 +34,10 @@ if (graphComponent.getGraph().getModel().isEdge(cellObj)) { return; } - DataTransferModel model = stage.getModel(); - DataTransferChannel ch = (DataTransferChannel) model.getChannel((String) ((mxCell) cellObj).getValue()); + DataTransferChannel ch = (DataTransferChannel) ((DataFlowModelingStage) stage).getChannel((mxCell) cellObj); if (ch == null) { - ch = (DataTransferChannel) model.getInputChannel((String) ((mxCell) cellObj).getValue()); - if (ch == null) { - // selected cell is a resource - return; - } + // selected cell is a resource + return; } JPanel panel = new JPanel(); if (ch instanceof FormulaChannel) { @@ -91,7 +87,9 @@ } } } else { - JTextArea textArea = new JTextArea(ch.getSourceText(), 10, 20); + JTextArea textArea = new JTextArea(ch.getSourceText(), 15, 50); + textArea.setLineWrap(true); + textArea.setTabSize(4); panel.add(textArea); int option = JOptionPane.showConfirmDialog(null, panel, "Channel Code", JOptionPane.OK_CANCEL_OPTION); diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java index d4d0006..4722df8 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java @@ -15,6 +15,7 @@ import models.dataConstraintModel.Channel; import models.dataConstraintModel.ChannelMember; import models.dataConstraintModel.ResourcePath; +import models.dataConstraintModel.Selector; import models.dataFlowModel.DataTransferChannel; import models.dataFlowModel.DataTransferModel; import models.visualModel.FormulaChannel; @@ -23,9 +24,14 @@ import java.awt.event.MouseListener; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; public class DataFlowModelingStage extends Stage { + private HashMap resPathToCell = new HashMap<>(); + private HashMap channelToCell = new HashMap<>(); + private HashMap cellToResPath = new HashMap<>(); + private HashMap cellToChannel = new HashMap<>(); public DataFlowModelingStage(mxGraphComponent graphComponent) { super(graphComponent); @@ -98,9 +104,17 @@ } return Validation.checkUpdateConflict(model); } + + public ResourcePath getResourcePath(mxCell cell) { + return cellToResPath.get(cell); + } + + public Channel getChannel(mxCell cell) { + return cellToChannel.get(cell); + } public void addResourcePath(ResourcePath parentPath, String resName) { - ResourcePath resourcePath; + ResourcePath resourcePath = null; if (parentPath == null) { resourcePath = new ResourcePath(resName); getModel().addResourcePath(resourcePath); @@ -125,14 +139,101 @@ graph.getModel().beginUpdate(); mxCell root = (mxCell) graph.getDefaultParent(); try { - graph.insertVertex(root, null, resName, 20, 20, 80, 30, "shape=ellipse;perimeter=ellipsePerimeter"); // insert a resource as a vertex + if (parentPath == null) { + mxCell resCell = (mxCell) graph.insertVertex(root, null, resourcePath.getName(), 20, 20, 80, 30, "shape=ellipse;perimeter=ellipsePerimeter;verticalAlign=top"); // insert a resource as a vertex + resPathToCell.put(resourcePath, resCell); + cellToResPath.put(resCell, resourcePath); + } else { + mxCell parentCell = resPathToCell.get(parentPath); + double pw = parentCell.getGeometry().getWidth(); + double ph = parentCell.getGeometry().getHeight(); + mxCell resCell = (mxCell) graph.insertVertex(parentCell, null, resourcePath.getName(), 20, 20, pw * 0.8, ph * 0.8, "shape=ellipse;perimeter=ellipsePerimeter;verticalAlign=top"); // insert a resource as a vertex + resPathToCell.put(resourcePath, resCell); + cellToResPath.put(resCell, resourcePath); + } } finally { graph.getModel().endUpdate(); } } - public void addChannel(DataTransferChannel channelGen) { - getModel().addChannel(channelGen); + public void addChannel(DataTransferChannel channel) { + getModel().addChannel(channel); + + graph.getModel().beginUpdate(); + mxCell root = (mxCell) graph.getDefaultParent(); + try { + mxGeometry geo1 = new mxGeometry(0, 0.5, PORT_DIAMETER, PORT_DIAMETER); + geo1.setOffset(new mxPoint(-PORT_RADIUS, -PORT_RADIUS)); + geo1.setRelative(true); + + mxGeometry geo2 = new mxGeometry(1.0, 0.5, PORT_DIAMETER, PORT_DIAMETER); + geo2.setOffset(new mxPoint(-PORT_RADIUS, -PORT_RADIUS)); + geo2.setRelative(true); + + String channelName = channel.getChannelName(); + if (channel.getSelectors().size() > 0) { + channelName += "("; + String delimiter = ""; + for (Selector s: channel.getSelectors()) { + Expression exp = s.getExpression(); + String selectorName = exp.toString(); + channelName += delimiter + selectorName; + delimiter = ", "; + } + channelName += ")"; + } + Object chCell = graph.insertVertex(root, null, channelName, 150, 20, 30, 30, "verticalAlign=top"); // insert a channel as a vertex + mxCell port_in = new mxCell(null, geo1, "shape=ellipse;perimter=ellipsePerimeter"); + port_in.setVertex(true); + graph.addCell(port_in, chCell); // insert the input port of a channel + mxCell port_out = new mxCell(null, geo2, "shape=ellipse;perimter=ellipsePerimeter"); + port_out.setVertex(true); + graph.addCell(port_out, chCell); // insert the output port of a channel + channelToCell.put(channel, (mxCell) chCell); + cellToChannel.put((mxCell) chCell, channel); + cellToChannel.put(port_in, channel); + cellToChannel.put(port_out, channel); + } finally { + graph.getModel().endUpdate(); + } + } + + public void addEventChannel(DataTransferChannel eventChannel) { + getModel().addInputChannel(eventChannel); + + graph.getModel().beginUpdate(); + mxCell root = (mxCell) graph.getDefaultParent(); + try { + mxGeometry geo2 = new mxGeometry(1.0, 0.5, PORT_DIAMETER, PORT_DIAMETER); + geo2.setOffset(new mxPoint(-PORT_RADIUS, -PORT_RADIUS)); + geo2.setRelative(true); + + String channelName = eventChannel.getChannelName(); + if (eventChannel.getSelectors().size() > 0) { + channelName += "("; + String delimiter = ""; + for (Selector s: eventChannel.getSelectors()) { + Expression exp = s.getExpression(); + String selectorName = exp.toString(); + channelName += delimiter + selectorName; + delimiter = ", "; + } + channelName += ")"; + } + Object chCell = graph.insertVertex(root, null, channelName, 150, 20, 30, 30, "verticalAlign=top"); // insert an I/O channel as a vertex + mxCell port_out = new mxCell(null, geo2, "shape=ellipse;perimter=ellipsePerimeter"); + port_out.setVertex(true); + graph.addCell(port_out, chCell); // insert the output port of a channel + channelToCell.put(eventChannel, (mxCell) chCell); + cellToChannel.put((mxCell) chCell, eventChannel); + cellToChannel.put(port_out, eventChannel); + } finally { + graph.getModel().endUpdate(); + } + } + + public void addFormulaChannel(FormulaChannel formulaChannel) { + getModel().addChannel(formulaChannel); graph.getModel().beginUpdate(); mxCell root = (mxCell) graph.getDefaultParent(); @@ -145,82 +246,49 @@ geo2.setOffset(new mxPoint(-PORT_RADIUS, -PORT_RADIUS)); geo2.setRelative(true); - Object channel = graph.insertVertex(root, null, channelGen.getChannelName(), 150, 20, 30, 30); // insert a channel as a vertex + String channelName = formulaChannel.getChannelName(); + if (formulaChannel.getSelectors().size() > 0) { + channelName += "("; + String delimiter = ""; + for (Selector s: formulaChannel.getSelectors()) { + Expression exp = s.getExpression(); + String selectorName = exp.toString(); + channelName += delimiter + selectorName; + delimiter = ", "; + } + channelName += ")"; + } + Object chCell = graph.insertVertex(root, null, channelName, 150, 20, 30, 30, "verticalAlign=top"); // insert a channel as a vertex mxCell port_in = new mxCell(null, geo1, "shape=ellipse;perimter=ellipsePerimeter"); port_in.setVertex(true); - graph.addCell(port_in, channel); // insert the input port of a channel + graph.addCell(port_in, chCell); // insert the input port of a channel mxCell port_out = new mxCell(null, geo2, "shape=ellipse;perimter=ellipsePerimeter"); port_out.setVertex(true); - graph.addCell(port_out, channel); // insert the output port of a channel - } finally { - graph.getModel().endUpdate(); - } - } - - public void addIOChannel(DataTransferChannel ioChannelGen) { - getModel().addInputChannel(ioChannelGen); - - graph.getModel().beginUpdate(); - mxCell root = (mxCell) graph.getDefaultParent(); - try { - mxGeometry geo2 = new mxGeometry(1.0, 0.5, PORT_DIAMETER, PORT_DIAMETER); - geo2.setOffset(new mxPoint(-PORT_RADIUS, -PORT_RADIUS)); - geo2.setRelative(true); - - Object channel = graph.insertVertex(root, null, ioChannelGen.getChannelName(), 150, 20, 30, 30); // insert an I/O channel as a vertex - mxCell port_out = new mxCell(null, geo2, "shape=ellipse;perimter=ellipsePerimeter"); - port_out.setVertex(true); - graph.addCell(port_out, channel); // insert the output port of a channel - } finally { - graph.getModel().endUpdate(); - } - } - - public void addFormulaChannel(FormulaChannel formulaChannelGen) { - getModel().addChannel(formulaChannelGen); - - graph.getModel().beginUpdate(); - mxCell root = (mxCell) graph.getDefaultParent(); - try { - mxGeometry geo1 = new mxGeometry(0, 0.5, PORT_DIAMETER, PORT_DIAMETER); - geo1.setOffset(new mxPoint(-PORT_RADIUS, -PORT_RADIUS)); - geo1.setRelative(true); - - mxGeometry geo2 = new mxGeometry(1.0, 0.5, PORT_DIAMETER, PORT_DIAMETER); - geo2.setOffset(new mxPoint(-PORT_RADIUS, -PORT_RADIUS)); - geo2.setRelative(true); - - Object channel = graph.insertVertex(root, null, formulaChannelGen.getChannelName(), 150, 20, 30, 30); // insert a channel as a vertex - mxCell port_in = new mxCell(null, geo1, "shape=ellipse;perimter=ellipsePerimeter"); - port_in.setVertex(true); - graph.addCell(port_in, channel); // insert the input port of a channel - mxCell port_out = new mxCell(null, geo2, "shape=ellipse;perimter=ellipsePerimeter"); - port_out.setVertex(true); - graph.addCell(port_out, channel); // insert the output port of a channel + graph.addCell(port_out, chCell); // insert the output port of a channel + channelToCell.put(formulaChannel, (mxCell) chCell); + cellToChannel.put((mxCell) chCell, formulaChannel); + cellToChannel.put(port_in, formulaChannel); + cellToChannel.put(port_out, formulaChannel); } finally { graph.getModel().endUpdate(); } } public boolean connectEdge(mxCell edge, mxCell src, mxCell dst) { - DataTransferModel model = getModel(); - Channel srcCh = model.getChannel((String) src.getValue()); + Channel srcCh = cellToChannel.get(src); if (srcCh == null) { - srcCh = model.getInputChannel((String) src.getValue()); - if (srcCh == null) { - ResourcePath srcRes = model.getResourcePath((String) src.getValue()); - Channel dstCh = model.getChannel((String) dst.getValue()); - if (srcRes == null || dstCh == null) { - return false; - } - // resource to channel edge - ChannelMember srcCm = new ChannelMember(srcRes); - ((DataTransferChannel) dstCh).addChannelMemberAsInput(srcCm); - edge.setValue(new Editor.SrcDstAttribute(srcRes, dstCh)); - return true; + ResourcePath srcRes = cellToResPath.get(src); + Channel dstCh = cellToChannel.get(dst); + if (srcRes == null || dstCh == null) { + return false; } + // resource to channel edge + ChannelMember srcCm = new ChannelMember(srcRes); + ((DataTransferChannel) dstCh).addChannelMemberAsInput(srcCm); + edge.setValue(new Editor.SrcDstAttribute(srcRes, dstCh)); + return true; } - ResourcePath dstRes = model.getResourcePath((String) dst.getValue()); + ResourcePath dstRes = cellToResPath.get(dst); if (dstRes == null) { return false; } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java index 6423df6..eeb814c 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java @@ -142,7 +142,7 @@ int w = 80; int h = 30; ResourcePath resourcePath = resourceNode.getPrimaryResourcePath(); - Object resourceCell = graph.insertVertex(parent, null, resourcePath.getLeafResourceName(), 20, 20, w, h, "shape=ellipse;perimeter=ellipsePerimeter"); // insert a resource as a vertex + Object resourceCell = graph.insertVertex(parent, null, resourcePath.getLeafResourceName(), 20, 20, w, h, "shape=ellipse;perimeter=ellipsePerimeter;verticalAlign=top"); // insert a resource as a vertex resources.put(resourceNode, resourceCell); createChildResourceVertices(resourceCell, resourceNode, resources, w, h); } @@ -252,7 +252,7 @@ private void createChildResourceVertices(Object parentCell, ResourceNode parentResNode, Map resources, int w, int h) { for (ResourceNode resNode: parentResNode.getChildren()) { ResourcePath resPath = resNode.getPrimaryResourcePath(); - Object resourceCell = graph.insertVertex(parentCell, null, resPath.getName(), 0, 0, w, h, "shape=ellipse;perimeter=ellipsePerimeter"); // insert a resource as a vertex + Object resourceCell = graph.insertVertex(parentCell, null, resPath.getName(), 0, 0, w, h, "shape=ellipse;perimeter=ellipsePerimeter;verticalAlign=top"); // insert a resource as a vertex resources.put(resNode, resourceCell); createChildResourceVertices(resourceCell, resNode, resources, w, h); } diff --git a/AlgebraicDataflowArchitectureModel/src/parser/Parser.java b/AlgebraicDataflowArchitectureModel/src/parser/Parser.java index 90b1174..b3c952c 100644 --- a/AlgebraicDataflowArchitectureModel/src/parser/Parser.java +++ b/AlgebraicDataflowArchitectureModel/src/parser/Parser.java @@ -648,7 +648,7 @@ return listTerm; } - private Variable parseVariable(TokenStream stream, DataTransferModel model, String symbolName) { + public Variable parseVariable(TokenStream stream, DataTransferModel model, String symbolName) { Variable var; if (stream.checkNext() != null && stream.checkNext().equals(COLON)) { // when a type is specified.