Browse Source

REPORT-69532 10.0创建复用组件超出960*540时,给出提示

release/10.0
方磊 3 years ago
parent
commit
236dece1d8
  1. 23
      designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java

23
designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java

@ -85,6 +85,8 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE;
* 创建组件事件
*/
public class CreateComponentAction extends UpdateAction {
private static final double MAX_WIDTH = 960.0;
private static final double MAX_HEIGHT = 540.0;
ShareUIAspect aspect;
/**
* 等待时间 500 ms.
@ -123,6 +125,11 @@ public class CreateComponentAction extends UpdateAction {
return;
}
if (isBeyondMaxSize(sharedTriple.getRight())) {
showErrMsgDialog(Toolkit.i18nText("Fine-Design_Share_Widget_Size_Error_Tip"));
return;
}
Widget widget = sharedTriple.getLeft();
try {
@ -410,4 +417,20 @@ public class CreateComponentAction extends UpdateAction {
}
return paras;
}
private boolean isBeyondMaxSize(Rectangle rec) {
double width = rec.getWidth();
double height = rec.getHeight();
return width > 0 && height > 0 && (width > MAX_WIDTH || height > MAX_HEIGHT);
}
private void showErrMsgDialog(String err) {
FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
err,
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
ERROR_MESSAGE,
IOUtils.readIcon("/com/fr/base/images/share/Information_Icon_warning_normal_32x32.png")
);
}
}

Loading…
Cancel
Save