From 2a947ac8256f736ec57e6f2c48f649e5ceb9056a Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 3 Dec 2020 17:25:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-44581=20=E8=BF=9C=E7=A8=8B=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=96=AD=E5=BC=80=E5=90=8Emac=E9=80=89=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=8F=AA=E8=83=BD=E9=87=8D?= =?UTF-8?q?=E5=90=AF=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=AF=E4=B8=80=E4=B8=AA=E9=A1=B6=E5=B1=82=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=AE=A2=E6=88=B7=E5=9C=A8=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=93=8D=E4=BD=9C=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8Ctomcat=E7=AA=81=E7=84=B6=E6=96=AD=E5=BC=80=EF=BC=8C?= =?UTF-8?q?=E4=BC=9A=E8=A7=A6=E5=8F=91"=E8=BF=9E=E6=8E=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5"=E7=9A=84=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E7=BB=99=E8=A6=86=E7=9B=96=E6=8E=89=EF=BC=8C=E8=A1=A8=E7=8E=B0?= =?U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B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=E4=BA=8C=E7=BA=A7=E5=BC=B9=E7=AA=97=E5=B9=B6?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=9B=A0=E4=B8=BA"=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"=E5=8F=98=E6=88=90?= =?UTF-8?q?=E9=A1=B6=E5=B1=82=E5=BC=B9=E7=AA=97=E8=80=8C=E8=A2=AB=E8=A6=86?= =?UTF-8?q?=E7=9B=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 1 + .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 0ddb749269..1c05b23a5c 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -430,6 +430,7 @@ public class EnvChangeEntrance { // todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口 } }); + envListDialog.setAlwaysOnTop(true); envListDialog.setVisible(true); } 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 33b3b80f7d..48b6eec563 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 @@ -175,12 +175,16 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { + JDialog jDialog = new JDialog(); + jDialog.setAlwaysOnTop(true); + jDialog.setVisible(false); FineJOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), + jDialog, Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + jDialog.dispose(); EnvChangeEntrance.getInstance().chooseEnv(); } }); From 972e7f8cd64a5de44a911f4e41223e80c7117265 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 14:49:20 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-44581=20=E8=BF=9C=E7=A8=8B=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=96=AD=E5=BC=80=E5=90=8Emac=E9=80=89=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=8F=AA=E8=83=BD=E9=87=8D?= =?UTF-8?q?=E5=90=AF=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=AF=E4=B8=80=E4=B8=AA=E9=A1=B6=E5=B1=82=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=AE=A2=E6=88=B7=E5=9C=A8=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=93=8D=E4=BD=9C=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E8=BF=9C=E7=A8=8B=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=AA=81?= =?UTF-8?q?=E7=84=B6=E6=96=AD=E5=BC=80=EF=BC=8C=E4=BC=9A=E8=A7=A6=E5=8F=91?= =?UTF-8?q?"=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5"=E7=9A=84=E6=8F=90?= =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E4=BB=8D=E7=84=B6=E4=BC=9A=E8=A2=AB"=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BF=9D=E5=AD=98"=E7=95=8C=E9=9D=A2=E8=A6=86=E7=9B=96?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E5=9C=A8"=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95"=E7=95=8C=E9=9D=A2EnvChang?= =?UTF-8?q?eEntrance=E4=B8=AD=E5=A2=9E=E5=8A=A0=E7=9B=B8=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=BC=A0=E5=85=A5=E7=88=B6=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=B0=86"=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=9D=E5=AD=98"=E4=BC=A0=E5=85=A5=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E7=88=B6=E7=AA=97=E5=8F=A3=EF=BC=8C=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E7=95=8C=E9=9D=A2=E9=83=BD=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E8=A2=AB"=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98"=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 8 ++++++-- .../main/java/com/fr/file/FILEChooserPane.java | 8 ++++++++ .../mainframe/socketio/DesignerSocketIO.java | 15 +++++++++------ 3 files changed, 23 insertions(+), 8 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 1c05b23a5c..67e4ed905f 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -51,6 +51,7 @@ 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; @@ -411,8 +412,12 @@ 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(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); + final BasicDialog envListDialog = envListPane.showWindow(window); envListPane.populateEnvManager(envName); envListDialog.addDialogActionListener(new DialogActionAdapter() { @@ -430,7 +435,6 @@ public class EnvChangeEntrance { // todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口 } }); - envListDialog.setAlwaysOnTop(true); envListDialog.setVisible(true); } 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 43c3f43ad8..382732dd97 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -1774,4 +1774,12 @@ public class FILEChooserPane extends BasicPane { } } } + + public boolean isDialogVisible() { + return dialog != null && dialog.isVisible(); + } + + public UIDialog getDialog() { + return dialog; + } } 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 48b6eec563..19754bfc4a 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,6 +12,7 @@ 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; @@ -27,6 +28,7 @@ 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 java.io.IOException; @@ -175,17 +177,18 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { - JDialog jDialog = new JDialog(); - jDialog.setAlwaysOnTop(true); - jDialog.setVisible(false); + // 因为有可能在文件保存界面的时候,弹出连接失败弹窗,为了避免二级弹窗问题,这边对父窗口做个判断 + boolean isFileChooserPaneExist = FILEChooserPane.getInstance().isDialogVisible(); + Window window = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : DesignerContext.getDesignerFrame(); FineJOptionPane.showMessageDialog( - jDialog, + window, Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); - jDialog.dispose(); - EnvChangeEntrance.getInstance().chooseEnv(); + // 紧接着弹出的选择工作环境的窗口也判断一下父窗口,否则会被文件保存界面覆盖掉 + Window window1 = isFileChooserPaneExist ? FILEChooserPane.getInstance().getDialog() : SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame()); + EnvChangeEntrance.getInstance().chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName(), window1); } }); } catch (Exception e) { From 7697ec5fa790e0967e67c5cb5d156335234d5533 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Dec 2020 15:27:24 +0800 Subject: [PATCH 3/4] =?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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=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) { From 5cbbe6a541f7bb93bea24e2b2e570b4c6d7ff7fd Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 25 Dec 2020 15:34:42 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-44803=20=E6=B8=85=E9=99=A4=E4=B8=8B?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E5=85=B3=E9=97=AD=E7=9A=84pr=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=B7=B2=E6=94=B9=E5=8A=A8=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 2 +- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 5 ++--- 2 files changed, 3 insertions(+), 4 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 a1e0c48316..0ddb749269 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -58,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; 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 512ea41c43..33b3b80f7d 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 @@ -27,12 +27,11 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; -import javax.swing.JOptionPane; -import javax.swing.UIManager; +import java.util.Arrays; +import javax.swing.*; import java.io.IOException; import java.net.URI; import java.net.URL; -import java.util.Arrays; public class DesignerSocketIO {