Browse Source

Pull request #5978: REPORT-56481 决策报表-模板打开时一直弹出提醒

Merge in DESIGN/design from ~FANGLEI/design10.0:release/11.0 to release/11.0

* commit 'cd8c8d3108c8686399fb0342c21b7493bc8b7437':
  REPORT-56481 修正错误
  REPORT-56481 决策报表-模板打开时一直弹出提醒
bugfix/11.0
fanglei 3 years ago
parent
commit
a73a338215
  1. 31
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

31
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

@ -7,8 +7,6 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.form.layout.FRBorderLayout; import com.fr.design.form.layout.FRBorderLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import javax.swing.JOptionPane;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Rectangle; import java.awt.Rectangle;
@ -46,18 +44,27 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter {
Rectangle rectangle = creator.getBounds(); Rectangle rectangle = creator.getBounds();
//不能超出控件边界 //不能超出控件边界
if (ComparatorUtils.equals(constraints, BorderLayout.NORTH) || ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) { if (ComparatorUtils.equals(constraints, BorderLayout.NORTH) || ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) {
int containerHeight = container.getHeight(); return isBeyondMinConstraint(rectangle.height, container.getHeight());
if (rectangle.height > containerHeight) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
return true;
}
} else if (ComparatorUtils.equals(constraints, BorderLayout.EAST) || ComparatorUtils.equals(constraints, BorderLayout.WEST)) { } else if (ComparatorUtils.equals(constraints, BorderLayout.EAST) || ComparatorUtils.equals(constraints, BorderLayout.WEST)) {
int containerWidth = container.getWidth(); return isBeyondMinConstraint(rectangle.width, container.getWidth());
if (rectangle.width > containerWidth) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
return true;
}
} }
return false; return false;
} }
/**
* 是否超出最小限制
*
* @param minConstraint 最小限制
* @param value 数值
* @return 是否超出最小限制
*/
private boolean isBeyondMinConstraint(int minConstraint, int value) {
if (minConstraint > value) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
container.setSize(container.getBackupBound().getSize());
return true;
} else {
return false;
}
}
} }

Loading…
Cancel
Save