From bedef06cf9b3fdd815dd8cf8925aeb159381d59d Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Wed, 29 May 2019 17:36:37 +0200 Subject: [PATCH] Logic model binding of WireCrossPoints is now being set --- LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java | 9 ++++++++- .../era/mi/gui/modeladapter/ViewLogicModelAdapter.java | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java b/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java index 73d98f53..724de54b 100644 --- a/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java +++ b/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java @@ -10,6 +10,8 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; public class WireCrossPoint extends GUIComponent { + private final Pin pin; + private ReadEnd end; private final int logicWidth; @@ -18,7 +20,7 @@ public class WireCrossPoint extends GUIComponent super(model); this.logicWidth = logicWidth; setSize(0, 0); - addPin(new Pin(this, logicWidth, 0, 0)); + addPin(this.pin = new Pin(this, logicWidth, 0, 0)); } @Override @@ -37,4 +39,9 @@ public class WireCrossPoint extends GUIComponent { return logicWidth; } + + public Pin getPin() + { + return pin; + } } \ No newline at end of file diff --git a/LogicUI/src/era/mi/gui/modeladapter/ViewLogicModelAdapter.java b/LogicUI/src/era/mi/gui/modeladapter/ViewLogicModelAdapter.java index 3cb593ff..1e7d341e 100644 --- a/LogicUI/src/era/mi/gui/modeladapter/ViewLogicModelAdapter.java +++ b/LogicUI/src/era/mi/gui/modeladapter/ViewLogicModelAdapter.java @@ -58,10 +58,14 @@ public class ViewLogicModelAdapter Map oneToOneComponents = new HashMap<>(); for (GUIComponent guiComp : viewModel.getComponents()) { - // WireCrossPoints just vanish if (!(guiComp instanceof WireCrossPoint)) oneToOneComponents.put(guiComp, createAndLinkComponent(timeline, params, guiComp, logicWiresPerPinUnmodifiable, componentAdapters.get(guiComp.getClass()))); + else + { + WireCrossPoint guiCompCasted = (WireCrossPoint) guiComp; + guiCompCasted.setLogicModelBinding(logicWiresPerPin.get(guiCompCasted.getPin()).createReadOnlyEnd()); + } } // TODO handle complex components -- 2.17.1