Browse Source

REPORT-21203 【水印密度】水印密度框输入特殊符号--,输入小数应该不让允许

research/11.0
Hugh.C 5 years ago
parent
commit
d00463cf18
  1. 33
      designer-base/src/main/java/com/fr/design/gui/ispinner/UnsignedIntUISpinner.java
  2. 5
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

33
designer-base/src/main/java/com/fr/design/gui/ispinner/UnsignedIntUISpinner.java

@ -0,0 +1,33 @@
package com.fr.design.gui.ispinner;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver;
import com.fr.design.gui.itextfield.UIIntNumberField;
import com.fr.design.gui.itextfield.UINumberField;
/**
* Created by IntelliJ IDEA.
* Author : Hugh.C
* Date: 19-08-28
* Time: 下午2:19
*/
public class UnsignedIntUISpinner extends UISpinner implements UIObserver, GlobalNameObserver {
public UnsignedIntUISpinner(double minValue, double maxValue, double dierta) {
super(minValue, maxValue, dierta);
}
public UnsignedIntUISpinner(double minValue, double maxValue, double dierta, double defaultValue) {
super(minValue, maxValue, dierta, defaultValue);
}
@Override
protected UINumberField initNumberField() {
return new UIIntNumberField() {
public boolean shouldResponseChangeListener() {
return false;
}
};
}
}

5
designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

@ -7,6 +7,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.UnsignedIntUISpinner;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
@ -112,8 +113,8 @@ public class WatermarkPane extends BasicPane {
formulaPane = new TinyFormulaPane();
fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES);
fontSizeComboBox.setEditable(true);
horizontalGapSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 200);
verticalGapSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 100);
horizontalGapSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, 200);
verticalGapSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, 100);
horizontalGapSpinner.setPreferredSize(SPINNER_DIMENSION);
verticalGapSpinner.setPreferredSize(SPINNER_DIMENSION);
JPanel fontSizeTypePane = new JPanel(new BorderLayout(10,0));

Loading…
Cancel
Save