diff --git a/AlgebraicDataflowArchitectureModel/src/simulator/interfaces/swing/SwingPresenter.java b/AlgebraicDataflowArchitectureModel/src/simulator/interfaces/swing/SwingPresenter.java index 4d95497..11ac366 100644 --- a/AlgebraicDataflowArchitectureModel/src/simulator/interfaces/swing/SwingPresenter.java +++ b/AlgebraicDataflowArchitectureModel/src/simulator/interfaces/swing/SwingPresenter.java @@ -2,16 +2,17 @@ import java.awt.Component; import java.awt.FlowLayout; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + import models.algebra.Constant; import models.algebra.Expression; import models.algebra.Term; @@ -146,7 +147,7 @@ button.addMouseListener(new ComponentMouseSender(simulator, mouseEventChannel, resPath, widgetResource)); // button => widgetResource ComponentVisibilityReceiver nativeVisibilityReceiver = new ComponentVisibilityReceiver(button); // widgetResource => button - simulator.addNativeReceiver(nativeVisibilityReceiver, setVisibleChannel, widgetResource); + simulator.addNativeReceiver(nativeVisibilityReceiver, setVisibleChannel, widgetResource.getChildrenMap().get("visible")); Map resources = channelAndResourcesForReceiving.get(setVisibleChannel); if (resources == null) { resources = new HashMap<>(); @@ -155,7 +156,7 @@ resources.put(newWid, widgetResource); ComponentTextReceiver nativeTextReceiver = new ComponentTextReceiver(button); // widgetResource => button - simulator.addNativeReceiver(nativeTextReceiver, setTextChannel, widgetResource); + simulator.addNativeReceiver(nativeTextReceiver, setTextChannel, widgetResource.getChildrenMap().get("text")); resources = channelAndResourcesForReceiving.get(setTextChannel); if (resources == null) { resources = new HashMap<>(); @@ -229,7 +230,7 @@ // Connect swing component and model. ComponentVisibilityReceiver nativeVisibilityReceiver = new ComponentVisibilityReceiver(label); // widgetResource => label - simulator.addNativeReceiver(nativeVisibilityReceiver, setVisibleChannel, widgetResource); + simulator.addNativeReceiver(nativeVisibilityReceiver, setVisibleChannel, widgetResource.getChildrenMap().get("visible")); Map resources = channelAndResourcesForReceiving.get(setVisibleChannel); if (resources == null) { resources = new HashMap<>(); @@ -238,7 +239,7 @@ resources.put(newWid, widgetResource); ComponentTextReceiver nativeTextReceiver = new ComponentTextReceiver(label); // widgetResource => label - simulator.addNativeReceiver(nativeTextReceiver, setTextChannel, widgetResource); + simulator.addNativeReceiver(nativeTextReceiver, setTextChannel, widgetResource.getChildrenMap().get("text")); resources = channelAndResourcesForReceiving.get(setTextChannel); if (resources == null) { resources = new HashMap<>(); @@ -313,7 +314,7 @@ textField.getDocument().addDocumentListener(new ComponentTextSender(simulator, textEventChannel, resPath, widgetResource)); // textField => widgetResource ComponentVisibilityReceiver nativeReceiver = new ComponentVisibilityReceiver(textField); // widgetResource => textField - simulator.addNativeReceiver(nativeReceiver, setVisibleChannel, widgetResource); + simulator.addNativeReceiver(nativeReceiver, setVisibleChannel, widgetResource.getChildrenMap().get("visible")); Map resources = channelAndResourcesForReceiving.get(setVisibleChannel); if (resources == null) { resources = new HashMap<>();