Browse Source

REPORT-47438 设计器弹窗在多屏情况下部分弹窗显示在另一块屏幕

feature/big-screen
hades 4 years ago
parent
commit
6e396f6a89
  1. 1
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
  2. 2
      designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java
  3. 2
      designer-base/src/main/java/com/fr/design/extra/ShopDialog.java
  4. 5
      designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java
  5. 21
      designer-base/src/main/java/com/fr/design/plugin/DesignerPluginContext.java
  6. 2
      designer-base/src/main/java/com/fr/design/upm/UpmFinder.java
  7. 2
      designer-base/src/main/java/com/fr/design/upm/UpmShowDialog.java
  8. 7
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

1
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -169,7 +169,6 @@ public class PreviewTablePane extends BasicPane {
this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER);
if (this.dialog == null) {
this.dialog = this.showWindow(new JFrame());
GUICoreUtils.centerWindow(DesignerContext.getDesignerFrame(), this.dialog);
}
progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) {
public void doMonitorCanceled() {

2
designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java

@ -16,6 +16,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.locale.impl.BbsRegisterMark;
import com.fr.design.locale.impl.BbsResetMark;
import com.fr.design.locale.impl.BbsSpaceMark;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.general.CloudCenter;
import com.fr.general.locale.LocaleCenter;
@ -401,6 +402,7 @@ public class PluginWebBridge {
if (uiDialog != null) {
uiDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
uiDialog.setVisible(false);
DesignerPluginContext.setPluginDialog(null);
}
}

2
designer-base/src/main/java/com/fr/design/extra/ShopDialog.java

@ -3,6 +3,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.plugin.DesignerPluginContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StableUtils;
@ -25,6 +26,7 @@ public class ShopDialog extends UIDialog {
setSize(createDefaultDimension());
GUICoreUtils.centerWindow(this);
setResizable(false);
DesignerPluginContext.setPluginDialog(this);
}
private Dimension createDefaultDimension() {

5
designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java

@ -5,6 +5,7 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginOperateUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult;
@ -31,9 +32,9 @@ public class ModifyStatusCallback implements PluginTaskCallback{
pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") :
pluginInfo + Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate");
FineLoggerFactory.getLogger().info(modifyMessage);
FineJOptionPane.showMessageDialog(null, modifyMessage);
FineJOptionPane.showMessageDialog(DesignerPluginContext.getPluginDialog(), modifyMessage);
} else {
FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
FineJOptionPane.showMessageDialog(DesignerPluginContext.getPluginDialog(), pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}

21
designer-base/src/main/java/com/fr/design/plugin/DesignerPluginContext.java

@ -0,0 +1,21 @@
package com.fr.design.plugin;
import com.fr.design.dialog.UIDialog;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/3/8
*/
public class DesignerPluginContext {
private static UIDialog DIALOG;
public static UIDialog getPluginDialog() {
return DIALOG;
}
public static void setPluginDialog(UIDialog pluginDialog) {
DesignerPluginContext.DIALOG = pluginDialog;
}
}

2
designer-base/src/main/java/com/fr/design/upm/UpmFinder.java

@ -6,6 +6,7 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.design.update.ui.dialog.UpdateMainDialog;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
@ -114,6 +115,7 @@ public class UpmFinder {
dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
dialog.setVisible(false);
dialog = null;
DesignerPluginContext.setPluginDialog(null);
}
}
}

2
designer-base/src/main/java/com/fr/design/upm/UpmShowDialog.java

@ -2,6 +2,7 @@ package com.fr.design.upm;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
@ -25,6 +26,7 @@ public class UpmShowDialog extends UIDialog {
setSize(DEFAULT_SHOP);
GUICoreUtils.centerWindow(this);
setResizable(false);
DesignerPluginContext.setPluginDialog(this);
}
@Override

7
designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

@ -318,7 +318,12 @@ public final class GUICoreUtils {
public static void centerWindow(Window win) {
// Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小
// getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标
Rectangle rectangle = win.getGraphicsConfiguration().getBounds();
Rectangle rectangle;
if (DesignerContext.getDesignerFrame() != null) {
rectangle = DesignerContext.getDesignerFrame().getGraphicsConfiguration().getBounds();
} else {
rectangle = win.getGraphicsConfiguration().getBounds();
}
centerWindow(win, rectangle);
}

Loading…
Cancel
Save