From 7697ec5fa790e0967e67c5cb5d156335234d5533 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Dec 2020 15:27:24 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-44803=20=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=8B=96=E5=8A=A8=E7=BB=84=E4=BB=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E4=B8=8D=E8=83=BD=E8=B7=9F=E9=9A=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A4=A7=E5=B0=8F--=E6=9D=A5=E6=BA=90=E3=80=90?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=9C=80=E6=B1=82=20508884=E3=80=91=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E7=9A=84frm=E7=BC=A9=E6=94=BE=E7=9A=84=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E2=80=94=E2=80=94REPORT-37353=EF=BC=8C=E6=8A=8A?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=9A=84=E5=83=8F=E7=B4=A0=E5=80=BC=E7=BB=99?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=88=90=E4=BA=86=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?x=E3=80=81y=E5=80=BC=EF=BC=8C=E8=BF=99=E6=A0=B7=E5=BD=93?= =?UTF-8?q?=E6=8B=96=E5=8A=A8=E7=BB=84=E4=BB=B6=E6=94=B9=E5=8F=98=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8Cx=E3=80=81y?= =?UTF-8?q?=E4=B8=8D=E5=8F=98=EF=BC=8C=E5=8F=B3=E4=BE=A7=E4=B9=9F=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E5=8F=98=E5=8A=A8=EF=BC=8C=E5=9B=A0=E4=B8=BA=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8A=A0=E4=B8=8A=E7=BB=84=E4=BB=B6=E5=AE=BD=E9=AB=98?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91?= =?UTF-8?q?=E4=B8=BAx=E3=80=81y=E5=8A=A0=E4=B8=8A=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=BD=E9=AB=98=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 9 ++------- .../main/java/com/fr/file/FILEChooserPane.java | 8 -------- .../com/fr/design/mainframe/FormDesignerUI.java | 4 ++-- .../mainframe/socketio/DesignerSocketIO.java | 16 +++++----------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 67e4ed905f..a1e0c48316 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -51,7 +51,6 @@ import com.fr.workspace.engine.rpc.WorkspaceProxyPool; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; -import java.awt.Window; import java.lang.reflect.Method; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -59,10 +58,10 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; -import java.util.HashSet; import static javax.swing.JOptionPane.ERROR_MESSAGE; import static javax.swing.JOptionPane.QUESTION_MESSAGE; @@ -412,12 +411,8 @@ public class EnvChangeEntrance { } public void chooseEnv(final String envName) { - chooseEnv(envName, SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); - } - - public void chooseEnv(final String envName, Window window) { final EnvListPane envListPane = new EnvListPane(); - final BasicDialog envListDialog = envListPane.showWindow(window); + final BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); envListPane.populateEnvManager(envName); envListDialog.addDialogActionListener(new DialogActionAdapter() { diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 382732dd97..43c3f43ad8 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -1774,12 +1774,4 @@ public class FILEChooserPane extends BasicPane { } } } - - public boolean isDialogVisible() { - return dialog != null && dialog.isVisible(); - } - - public UIDialog getDialog() { - return dialog; - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index a21a2efad5..8f731d8114 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -183,12 +183,12 @@ public class FormDesignerUI extends ComponentUI { x1 = 0; x2 = 6; y2 = y1 = bounds.y - designer.getVerticalScaleValue() + (k == 1 ? 0 : bounds.height); - text = Utils.objectToString(bounds.y); + text = Utils.objectToString(y1 + designer.getVerticalScaleValue()); } else { y1 = 0; y2 = 6; x1 = x2 = bounds.x - designer.getHorizontalScaleValue()+ (k == 3 ? 0 : bounds.width); - text = Utils.objectToString(bounds.x); + text = Utils.objectToString(x1 + designer.getHorizontalScaleValue()); } text += com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel"); g2d.setColor(XCreatorConstants.RESIZE_BOX_BORDER_COLOR); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 19754bfc4a..512ea41c43 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -12,7 +12,6 @@ import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; -import com.fr.file.FILEChooserPane; import com.fr.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; @@ -28,12 +27,12 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; -import java.awt.Window; -import java.util.Arrays; -import javax.swing.*; +import javax.swing.JOptionPane; +import javax.swing.UIManager; import java.io.IOException; import java.net.URI; import java.net.URL; +import java.util.Arrays; public class DesignerSocketIO { @@ -177,18 +176,13 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { - // 因为有可能在文件保存界面的时候,弹出连接失败弹窗,为了避免二级弹窗问题,这边对父窗口做个判断 - boolean isFileChooserPaneExist = FILEChooserPane.getInstance().isDialogVisible(); - Window window = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : DesignerContext.getDesignerFrame(); FineJOptionPane.showMessageDialog( - window, + DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); - // 紧接着弹出的选择工作环境的窗口也判断一下父窗口,否则会被文件保存界面覆盖掉 - Window window1 = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()); - EnvChangeEntrance.getInstance().chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName(), window1); + EnvChangeEntrance.getInstance().chooseEnv(); } }); } catch (Exception e) {