From a2168ed84f4e8d2465ac92ea244ccd0af39a7b70 Mon Sep 17 00:00:00 2001 From: Billy Olsen Date: Wed, 4 Mar 2020 16:58:26 -0700 Subject: [PATCH] Notify all event listeners when DoubleModel.setValue called Previous refactoring of the event listeners lost notifications to classes which care about changes to the DoubleModel. One such example is the UnitSelector. Ensure that all the ChangeEventListeners and StateChangeEventListeners are called when the setValue method is invoked. Closes #553 Signed-off-by: Billy Olsen --- swing/src/net/sf/openrocket/gui/adaptors/DoubleModel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swing/src/net/sf/openrocket/gui/adaptors/DoubleModel.java b/swing/src/net/sf/openrocket/gui/adaptors/DoubleModel.java index 6fb903c53..b9df44786 100644 --- a/swing/src/net/sf/openrocket/gui/adaptors/DoubleModel.java +++ b/swing/src/net/sf/openrocket/gui/adaptors/DoubleModel.java @@ -770,6 +770,8 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat try { setMethod.invoke(source, v / multiplier); + // Make sure to notify all the listeners that have registered + fireStateChanged(); } catch (IllegalArgumentException e) { throw new BugException("Unable to invoke setMethod of " + this, e); } catch (IllegalAccessException e) {