Browse Source

Merge pull request #1031 in DESIGN/design from ~HUGH.C/design:feature/10.0 to feature/10.0

* commit '7574a965388df153045fd737a230dd9d2867acf4':
  REPORT-20329 sonar问题修复
persist/11.0
Hugh.C 5 years ago
parent
commit
a19a95a165
  1. 3
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberSlidePane.java
  2. 3
      designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java

3
designer-base/src/main/java/com/fr/design/gui/frpane/UINumberSlidePane.java

@ -14,6 +14,7 @@ import javax.swing.event.ChangeListener;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.style.NumberDragBar; import com.fr.design.gui.style.NumberDragBar;
import com.fr.stable.AssistUtils;
/** /**
* 拖拽的滑条和对应滑条值的数字 * 拖拽的滑条和对应滑条值的数字
@ -65,7 +66,7 @@ public class UINumberSlidePane extends BasicBeanPane<Double> {
public void checkValue(double value) { public void checkValue(double value) {
value = Math.max(value, minValue); value = Math.max(value, minValue);
value = Math.min(value, maxValue); value = Math.min(value, maxValue);
if (this.value == value) { if (AssistUtils.equals(this.value, value)) {
return; return;
} }
double diff = Math.abs(value - this.value); double diff = Math.abs(value - this.value);

3
designer-base/src/main/java/com/fr/design/gui/frpane/UnitInputPane.java

@ -10,6 +10,7 @@ import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -81,7 +82,7 @@ public abstract class UnitInputPane extends BasicPane {
floatValue = de.floatValue(); floatValue = de.floatValue();
} }
//选中多列, 并且列宽不完全一致的话, 就不显示值了. //选中多列, 并且列宽不完全一致的话, 就不显示值了.
temp.setText(floatValue == 0 ? StringUtils.EMPTY : Utils.convertNumberStringToString(new Float(floatValue))); temp.setText(AssistUtils.equals(floatValue, 0) ? StringUtils.EMPTY : Utils.convertNumberStringToString(new Float(floatValue)));
// denny:默认应该为选中,方便用户修改 // denny:默认应该为选中,方便用户修改
temp.selectAll(); temp.selectAll();

Loading…
Cancel
Save