diff --git a/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java b/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java index 69ad0f08d1..e0170cef88 100644 --- a/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java +++ b/designer-base/src/main/java/com/fr/design/extra/ShopDialog.java @@ -2,6 +2,7 @@ package com.fr.design.extra; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.UIDialog; +import com.fr.design.jdk.JdkVersion; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StableUtils; @@ -12,7 +13,6 @@ import java.awt.*; * Created by vito on 16/4/18. */ public class ShopDialog extends UIDialog { - private static final Dimension DEFAULT_SHOP = new Dimension(900, 700); public ShopDialog(Frame frame, BasicPane pane) { super(frame); @@ -22,11 +22,21 @@ public class ShopDialog extends UIDialog { JPanel panel = (JPanel) getContentPane(); panel.setLayout(new BorderLayout()); add(pane, BorderLayout.CENTER); - setSize(DEFAULT_SHOP); + setSize(createDefaultDimension()); GUICoreUtils.centerWindow(this); setResizable(false); } + private Dimension createDefaultDimension() { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + // jdk11 分辨率较低 缩放较大时 屏幕高度小于或接近设定的高度 需要调整下 + if (JdkVersion.GE_9.support() && screenSize.height - 700 < 50) { + return new Dimension(900, screenSize.height - 100); + } else { + return new Dimension(900, 700); + } + } + @Override public void checkValid() throws Exception { // do nothing diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index b6a6b7eaf0..af591abddd 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -24,6 +24,7 @@ import com.fr.design.widget.ui.designer.mobile.component.MobileTabCommonSettingP import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import java.awt.Dimension; import javax.swing.JPanel; import javax.swing.BorderFactory; import java.awt.BorderLayout; @@ -40,10 +41,12 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private MobileTabCommonSettingPane mobileTabCommonSettingPane; private JPanel contentJPanel; private BasicScrollPane scrollPane; + private JPanel holder; + private Dimension dimension; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; - contentJPanel = new JPanel(); + contentJPanel = FRGUIPaneFactory.createCenterFlowZeroGapBorderPane(); scrollPane = new AttrScrollPane() { @Override protected JPanel createContentPane() { @@ -79,7 +82,18 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template")); templateStyleEditor = new AccessibleTemplateStyleEditor(new MobileTemplateStylePane((WCardTagLayout) xCreator.toData())); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{label, templateStyleEditor}, {new UILabel()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_LARGE); - JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane(); + holder = new JPanel(new BorderLayout()) { + @Override + public Dimension getPreferredSize() { + if (dimension == null) { + return super.getPreferredSize(); + } else { + Dimension defaultDimension = super.getPreferredSize(); + defaultDimension.width = dimension.width; + return defaultDimension; + } + } + }; holder.add(jPanel, BorderLayout.NORTH); JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); if (!shouldHidePadding(designer)) { @@ -111,6 +125,9 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { public void populate(FormDesigner designer) { WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle(); + if (dimension == null) { + dimension = holder.getPreferredSize(); + } templateStyleEditor.setValue(mobileTemplateStyle); // 数据 populate 完成后,再设置监听 this.bindListeners2Widgets();