sclass DoubleVarWithNotify extends DoubleVar { event fireChange; *() {} *(double value) { super(value); } @Override public synchronized void set(double a) { if (get() != a) { super.set(a); fireChange(); } } selfType onChangeAndNow(Runnable r) { onChange(r); r.run(); this; } }