|
|
@ -39,6 +39,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver |
|
|
|
private String spinnerName = StringUtils.EMPTY; |
|
|
|
private String spinnerName = StringUtils.EMPTY; |
|
|
|
private UIObserverListener uiObserverListener; |
|
|
|
private UIObserverListener uiObserverListener; |
|
|
|
private GlobalNameListener globalNameListener = null; |
|
|
|
private GlobalNameListener globalNameListener = null; |
|
|
|
|
|
|
|
private boolean lessMinValue = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UISpinner(double minValue, double maxValue, double dierta) { |
|
|
|
public UISpinner(double minValue, double maxValue, double dierta) { |
|
|
@ -97,6 +98,10 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver |
|
|
|
return nextButton; |
|
|
|
return nextButton; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isLessMinValue() { |
|
|
|
|
|
|
|
return lessMinValue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setValue(double value) { |
|
|
|
public void setValue(double value) { |
|
|
|
setValue(value, true); |
|
|
|
setValue(value, true); |
|
|
|
} |
|
|
|
} |
|
|
@ -113,7 +118,8 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver |
|
|
|
if (globalNameListener != null && shouldResponseNameListener()) { |
|
|
|
if (globalNameListener != null && shouldResponseNameListener()) { |
|
|
|
globalNameListener.setGlobalName(spinnerName); |
|
|
|
globalNameListener.setGlobalName(spinnerName); |
|
|
|
} |
|
|
|
} |
|
|
|
value = value < minValue ? minValue : value; |
|
|
|
lessMinValue = value < minValue; |
|
|
|
|
|
|
|
value = lessMinValue ? minValue : value; |
|
|
|
value = value > maxValue ? maxValue : value; |
|
|
|
value = value > maxValue ? maxValue : value; |
|
|
|
if (CommonUtils.equals(value, this.value)) { |
|
|
|
if (CommonUtils.equals(value, this.value)) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -135,7 +141,8 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver |
|
|
|
if (globalNameListener != null && shouldResponseNameListener()) { |
|
|
|
if (globalNameListener != null && shouldResponseNameListener()) { |
|
|
|
globalNameListener.setGlobalName(spinnerName); |
|
|
|
globalNameListener.setGlobalName(spinnerName); |
|
|
|
} |
|
|
|
} |
|
|
|
value = value < minValue ? minValue : value; |
|
|
|
lessMinValue = value < minValue; |
|
|
|
|
|
|
|
value = lessMinValue ? minValue : value; |
|
|
|
value = value > maxValue ? maxValue : value; |
|
|
|
value = value > maxValue ? maxValue : value; |
|
|
|
|
|
|
|
|
|
|
|
if (CommonUtils.equals(value, this.value)) { |
|
|
|
if (CommonUtils.equals(value, this.value)) { |
|
|
|