+
+ /**
+ * Set the current double model.
+ *
+ * @param model the model to set, <code>null</code> is NOT allowed.
+ */
+ public void setModel(DoubleModel model) {
+ if (this.model != null && showValue) {
+ this.model.removeChangeListener(this);
+ }
+ this.model = model;
+ this.unitGroup = model.getUnitGroup();
+ this.currentUnit = model.getCurrentUnit();
+ if (showValue) {
+ this.model.addChangeListener(this);
+ }
+ updateText();
+ }
+
+