diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java index 1ffb3c1dde..12b894ddce 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java @@ -35,6 +35,7 @@ public class UINumberField extends UITextField { private double maxValue = Double.MAX_VALUE; private boolean isContentChanged = false; + private boolean fillNegativeNumber = true; public UINumberField() { this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH); @@ -62,6 +63,10 @@ public class UINumberField extends UITextField { initListener(); } + public void canFillNegativeNumber(boolean fillNegativeNumber) { + this.fillNegativeNumber = fillNegativeNumber; + } + public int getMaxIntegerLength() { return maxIntegerLength; } @@ -185,6 +190,9 @@ public class UINumberField extends UITextField { // kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100. // 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难.. private boolean notChange(String strNew) { + if (!fillNegativeNumber && strNew.contains("-")) { + return true; + } boolean noChange = false; boolean isMinus = strNew.startsWith("-"); strNew = strNew.replaceFirst("-", StringUtils.EMPTY); // 控制能输入负数 diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index c1e454f1b0..43710cd0f2 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -368,6 +368,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane { private Widget widget; private MobileStyleCustomDefinePane customBeanPane; private Class mobileStyleClazz; - private NewColorSelectBox colorSelectBox; + private ColorSelectBox colorSelectBox; private Color titleColor = new Color(47, 142, 241); MobileStyleDefinePane(Widget widget, Class customBeanPaneClass, @@ -91,7 +91,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { UILabel colorSelectLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Widget_Background"), UILabel.RIGHT); colorSelectLabel.setPreferredSize(new Dimension(65, 20)); - colorSelectBox = new NewColorSelectBox(152); + colorSelectBox = new ColorSelectBox(152); colorSelectBox.addSelectChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java index a281561103..4e12bd5f85 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java @@ -863,7 +863,7 @@ public abstract class ElementCasePane extends Tar // those that are interested in this event for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == SelectionListener.class) { - ((SelectionListener) listeners[i + 1]).selectionChanged(new SelectionEvent(this)); + ((SelectionListener) listeners[i + 1]).selectionChanged(new SelectionEvent(ElementCasePane.this)); } } }