|
|
@ -2,6 +2,7 @@ package com.fr.design.extra; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.UIDialog; |
|
|
|
import com.fr.design.dialog.UIDialog; |
|
|
|
|
|
|
|
import com.fr.design.jdk.JdkVersion; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
|
|
|
|
|
|
@ -12,7 +13,6 @@ import java.awt.*; |
|
|
|
* Created by vito on 16/4/18. |
|
|
|
* Created by vito on 16/4/18. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class ShopDialog extends UIDialog { |
|
|
|
public class ShopDialog extends UIDialog { |
|
|
|
private static final Dimension DEFAULT_SHOP = new Dimension(900, 700); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ShopDialog(Frame frame, BasicPane pane) { |
|
|
|
public ShopDialog(Frame frame, BasicPane pane) { |
|
|
|
super(frame); |
|
|
|
super(frame); |
|
|
@ -22,11 +22,21 @@ public class ShopDialog extends UIDialog { |
|
|
|
JPanel panel = (JPanel) getContentPane(); |
|
|
|
JPanel panel = (JPanel) getContentPane(); |
|
|
|
panel.setLayout(new BorderLayout()); |
|
|
|
panel.setLayout(new BorderLayout()); |
|
|
|
add(pane, BorderLayout.CENTER); |
|
|
|
add(pane, BorderLayout.CENTER); |
|
|
|
setSize(DEFAULT_SHOP); |
|
|
|
setSize(createDefaultDimension()); |
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
|
setResizable(false); |
|
|
|
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 |
|
|
|
@Override |
|
|
|
public void checkValid() throws Exception { |
|
|
|
public void checkValid() throws Exception { |
|
|
|
// do nothing
|
|
|
|
// do nothing
|
|
|
|