Browse Source

REPORT-85611 FR10组件复用-多组件生成的复用组件,绝对画布块缩小到500*260的尺寸限制了,但内部组件没等比例缩小

bugfix/10.0
kerry 2 years ago
parent
commit
54f2e87006
  1. 36
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java

36
designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java

@ -65,8 +65,6 @@ public class ShareGeneratePane extends BasicPane {
private static final Dimension DIALOG_SIZE = new Dimension(670, 760); private static final Dimension DIALOG_SIZE = new Dimension(670, 760);
private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610); private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610);
private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6);
private static final double MAX_WIDTH = 500.0;
private static final double MAX_HEIGHT = 260.0;
private JPanel mainPane = null; private JPanel mainPane = null;
private ShareMainPane uploadPane = null; private ShareMainPane uploadPane = null;
@ -298,28 +296,11 @@ public class ShareGeneratePane extends BasicPane {
private boolean generateModule(DefaultSharableWidget info) throws Exception { private boolean generateModule(DefaultSharableWidget info) throws Exception {
DefaultSharableWidget transformInfo = transform(info); ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, info);
ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, transformInfo);
ComponentGeneratorCenter center = new ComponentGeneratorCenter(generateInfo); ComponentGeneratorCenter center = new ComponentGeneratorCenter(generateInfo);
return center.generate(); return center.generate();
} }
private DefaultSharableWidget transform(DefaultSharableWidget info) {
confineSize(info);
//先屏蔽
//if (shareWidget instanceof AbstractBorderStyleWidget) {
// AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) shareWidget;
// ExtendSharableAttrMark attrMark = styleWidget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG);
// if (attrMark != null) {
// String shareId = attrMark.getShareId();
// info.setId(shareId);
// }
//}
return info;
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Share_Module_Msg"); return Toolkit.i18nText("Fine-Design_Share_Module_Msg");
@ -329,19 +310,4 @@ public class ShareGeneratePane extends BasicPane {
return effectItemGroups.size() > 0 ? DIALOG_SIZE : DIALOG_NORMAL_SIZE; return effectItemGroups.size() > 0 ? DIALOG_SIZE : DIALOG_NORMAL_SIZE;
} }
private void confineSize(DefaultSharableWidget info) {
double width = info.getWidth();
double height = info.getHeight();
if (width > 0 && height > 0 && (width > MAX_WIDTH || height > MAX_HEIGHT)) {
double aspectRatio = width / height;
if (width / height > MAX_WIDTH / MAX_HEIGHT) {
info.setWidth((int) MAX_WIDTH);
info.setHeight((int) (MAX_WIDTH / aspectRatio));
} else {
info.setHeight((int) MAX_HEIGHT);
info.setWidth((int) (MAX_HEIGHT * aspectRatio));
}
}
}
} }

Loading…
Cancel
Save