Browse Source

REPORT-39952 【产品验收】【JDK11设计器】150%时 插件管理显示过大

final/10.0
hades 4 years ago
parent
commit
393f2c7c9f
  1. 14
      designer-base/src/main/java/com/fr/design/extra/ShopDialog.java

14
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

Loading…
Cancel
Save