Browse Source

REPORT-21689 水印密度最小值限制,根据交互提供的内容补充

research/11.0
Hugh.C 5 years ago
parent
commit
d7b8ba9f39
  1. 11
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  2. 13
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

11
designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java

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

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

@ -36,6 +36,7 @@ import java.awt.event.ItemListener;
import java.awt.event.MouseListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.FocusAdapter;
import java.awt.Dialog;
import java.awt.FlowLayout;
@ -269,14 +270,10 @@ public class WatermarkPane extends BasicPane {
* @return
*/
private FocusListener createFocusListener4GapNumberField(final UISpinner spinner, final int limitMinValue, final String messageStr) {
return new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
}
return new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
if (spinner.getValue() >= limitMinValue) {
if (!spinner.isLessMinValue()) {
return;
}
createGapDialog(new StringBuilder(messageStr).append(limitMinValue).toString());
@ -294,8 +291,8 @@ public class WatermarkPane extends BasicPane {
private MouseListener createMouseListener4GapNextButton(final UISpinner spinner, final int limitMinValue, final String messageStr) {
MouseAdapter mouseAdapter = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (spinner.getValue() >= limitMinValue) {
public void mouseReleased(MouseEvent e) {
if (!spinner.isLessMinValue()) {
return;
}
createGapDialog(new StringBuilder(messageStr).append(limitMinValue).toString());

Loading…
Cancel
Save