From edbe7dc9208d8326e35b208c1bf864985fd667ac Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 3 Nov 2017 11:40:03 +0800 Subject: [PATCH 01/15] =?UTF-8?q?REPORT-5402=208.0=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=AE=89=E8=A3=85=EF=BC=8C=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=BF=80=E6=B4=BB=E7=A0=81=E7=95=8C=E9=9D=A2=EF=BC=8C=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/locale/designer.properties | 3 ++- .../src/com/fr/design/locale/designer_en_US.properties | 3 ++- .../src/com/fr/design/locale/designer_ja_JP.properties | 3 ++- .../src/com/fr/design/locale/designer_ko_KR.properties | 3 ++- .../src/com/fr/design/locale/designer_zh_CN.properties | 3 ++- .../src/com/fr/design/locale/designer_zh_TW.properties | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 7e96574d4c..bd7b26a42e 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -1943,4 +1943,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location: FR-Designer_Provide_Choose_All=Provide Select All FR-Designer_Decimal_Places=Decimal Places: FR-Base-Load_Resource_File=Load resource file - +Collect-Click\!_Get_user_information_code=Click\! Get user information code +Display\ position=Display position diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 2ca39665a6..ccebb5cc7d 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -1944,4 +1944,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location: FR-Designer_Provide_Choose_All=Provide Select All FR-Designer_Decimal_Places=Decimal Places: FR-Base-Load_Resource_File=Load Configuration File - +Collect-Click\!_Get_user_information_code=Get Activation Code +Display\ position=Position diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index c0ef55e166..a7be356076 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -1944,4 +1944,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet\u30E9\u30D9\u30EB\u30DA\u30F FR-Designer_Provide_Choose_All=\u5168\u9078\u629E\u53EF\u80FD FR-Designer_Decimal_Places=\u5C0F\u6570\u67A0\u6570: FR-Base-Load_Resource_File=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9 - +Collect-Click\!_Get_user_information_code=\u30AF\u30EA\u30C3\u30AF\u3057\u3066\!\u30A2\u30AF\u30C6\u30A3\u30D9\u30FC\u30C8\u30B3\u30FC\u30C9\u3092\u53D6\u5F97 +Display\ position=\u8868\u793A\u4F4D\u7F6E diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 51b97b98bc..72a07a044a 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -1943,4 +1943,5 @@ FR-Designer_Sheet_Label_Page_Display_Position= FR-Designer_Provide_Choose_All=\uC81C\uACF5\uBAA8\uB450\uC120\uD0DD FR-Designer_Decimal_Places=\uC18C\uC218\uC218\uB7C9: FR-Base-Load_Resource_File=\uB85C\uB529\uAD6C\uC131\uD30C\uC77C - +Collect-Click\!_Get_user_information_code=\!\uB97C\uD074\uB9AD\uD558\uC5EC\uD65C\uC131\uCF54\uB4DC\uB97C\uC5BB\uC2B5\uB2C8\uB2E4. +Display\ position=\uC704\uCE58\uBCF4\uC774\uAE30 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index b02c6d1942..61c5929828 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -1943,4 +1943,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6807\u7B7E\u9875\u663E\u793 FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9009 FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u76EE\uFF1A FR-Base-Load_Resource_File=\u52A0\u8F7D\u914D\u7F6E\u6587\u4EF6 - +Collect-Click\!_Get_user_information_code=\u70B9\u51FB\!\u83B7\u53D6\u6FC0\u6D3B\u7801 +Display\ position=\u663E\u793A\u4F4D\u7F6E diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 4524283848..8469700862 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -1944,4 +1944,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6A19\u7C64\u9801\u986F\u793 FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9078 FR-Designer_Decimal_Places=\u5C0F\u6578\u6578\u76EE\uFF1A FR-Base-Load_Resource_File=\u52A0\u8F09\u914D\u7F6E\u6A94\u6848 - +Collect-Click\!_Get_user_information_code=\u9EDE\u64CA\!\u7372\u53D6\u7528\u6236\u8A0A\u606F\u78BC +Display\ position=\u986F\u793A\u4F4D\u7F6E From 359be8622616b42c5fa4d4b7fbca170adc3a840c Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 3 Nov 2017 14:10:42 +0800 Subject: [PATCH 02/15] =?UTF-8?q?REPORT-5402=20=E4=BF=AE=E6=94=B9=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/webattr/WriteToolBarPane.java | 2 +- designer/src/com/fr/start/CollectUserInformationDialog.java | 2 +- designer_base/src/com/fr/design/locale/designer.properties | 6 +++--- .../src/com/fr/design/locale/designer_en_US.properties | 6 +++--- .../src/com/fr/design/locale/designer_ja_JP.properties | 6 +++--- .../src/com/fr/design/locale/designer_ko_KR.properties | 6 +++--- .../src/com/fr/design/locale/designer_zh_CN.properties | 6 +++--- .../src/com/fr/design/locale/designer_zh_TW.properties | 6 +++--- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/designer/src/com/fr/design/webattr/WriteToolBarPane.java b/designer/src/com/fr/design/webattr/WriteToolBarPane.java index 70cf35af90..264ad15f32 100644 --- a/designer/src/com/fr/design/webattr/WriteToolBarPane.java +++ b/designer/src/com/fr/design/webattr/WriteToolBarPane.java @@ -38,7 +38,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { private DragToolBarPane dragToolbarPane; private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top")); private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom")); - private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":"); + private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "FR-Designer_Display_Position"}) + ":"); private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display")); private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display")); private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT); diff --git a/designer/src/com/fr/start/CollectUserInformationDialog.java b/designer/src/com/fr/start/CollectUserInformationDialog.java index 64d5738552..d8fbcaf78b 100644 --- a/designer/src/com/fr/start/CollectUserInformationDialog.java +++ b/designer/src/com/fr/start/CollectUserInformationDialog.java @@ -72,7 +72,7 @@ public class CollectUserInformationDialog extends UIDialog { macSystemHit(keyPane); UIButton getKeyButton = new UIButton( - Inter.getLocText("Collect-Click!_Get_user_information_code")); + Inter.getLocText("FR-Designer_Get_Activation_Code")); getKeyButton.setMnemonic('F'); keyPane.add(getKeyButton, BorderLayout.EAST); getKeyButton.addActionListener(actionListener); diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index bd7b26a42e..71bbf55272 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -1,4 +1,4 @@ -# generated time: 星期二 十月 24 16:58:25 CST 2017 +# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017 FR-Designer-BBSLogin_Account= FR-Designer-BBSLogin_Connection-Failure= FR-Designer-BBSLogin_Forgot-Password= @@ -1943,5 +1943,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location: FR-Designer_Provide_Choose_All=Provide Select All FR-Designer_Decimal_Places=Decimal Places: FR-Base-Load_Resource_File=Load resource file -Collect-Click\!_Get_user_information_code=Click\! Get user information code -Display\ position=Display position +FR-Designer_Get_Activation_Code=Click\! Get user information code +FR-Designer_Display_Position=Display position diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index ccebb5cc7d..7b26e8cb55 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -1,4 +1,4 @@ -# generated time: 星期二 十月 24 16:58:25 CST 2017 +# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017 FR-Designer-BBSLogin_Account=User name FR-Designer-BBSLogin_Connection-Failure=Connection failure, check your network status FR-Designer-BBSLogin_Forgot-Password=Forget Password @@ -1944,5 +1944,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location: FR-Designer_Provide_Choose_All=Provide Select All FR-Designer_Decimal_Places=Decimal Places: FR-Base-Load_Resource_File=Load Configuration File -Collect-Click\!_Get_user_information_code=Get Activation Code -Display\ position=Position +FR-Designer_Get_Activation_Code=Get Activation Code +FR-Designer_Display_Position=Position diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index a7be356076..548c6b0385 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -1,4 +1,4 @@ -# generated time: 星期二 十月 24 16:58:25 CST 2017 +# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017 FR-Designer-BBSLogin_Account=\u30E6\u30FC\u30B6\u30FC\u540D FR-Designer-BBSLogin_Connection-Failure=\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u73FE\u5728\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044 FR-Designer-BBSLogin_Forgot-Password=\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5FD8\u308C\u305F @@ -1944,5 +1944,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet\u30E9\u30D9\u30EB\u30DA\u30F FR-Designer_Provide_Choose_All=\u5168\u9078\u629E\u53EF\u80FD FR-Designer_Decimal_Places=\u5C0F\u6570\u67A0\u6570: FR-Base-Load_Resource_File=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9 -Collect-Click\!_Get_user_information_code=\u30AF\u30EA\u30C3\u30AF\u3057\u3066\!\u30A2\u30AF\u30C6\u30A3\u30D9\u30FC\u30C8\u30B3\u30FC\u30C9\u3092\u53D6\u5F97 -Display\ position=\u8868\u793A\u4F4D\u7F6E +FR-Designer_Get_Activation_Code=\u30AF\u30EA\u30C3\u30AF\u3057\u3066\!\u30A2\u30AF\u30C6\u30A3\u30D9\u30FC\u30C8\u30B3\u30FC\u30C9\u3092\u53D6\u5F97 +FR-Designer_Display_Position=\u8868\u793A\u4F4D\u7F6E diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 72a07a044a..a121f57ed7 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -1,4 +1,4 @@ -# generated time: 星期二 十月 24 16:58:25 CST 2017 +# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017 FR-Designer-BBSLogin_Account=\u7528\u6237\u540D FR-Designer-BBSLogin_Connection-Failure=\uB124\uD2B8\uC6CC\uD06C\uB9C1\uD06C\uC2E4\uD328.\uD604\uC7AC\uB124\uD2B8\uC6CC\uD06C\uC0C1\uD0DC\uB97C\uAC80\uC0AC\uD574\uC8FC\uC2ED\uC2DC\uC624. FR-Designer-BBSLogin_Forgot-Password=\u5FD8\u8BB0\u5BC6\u7801 @@ -1943,5 +1943,5 @@ FR-Designer_Sheet_Label_Page_Display_Position= FR-Designer_Provide_Choose_All=\uC81C\uACF5\uBAA8\uB450\uC120\uD0DD FR-Designer_Decimal_Places=\uC18C\uC218\uC218\uB7C9: FR-Base-Load_Resource_File=\uB85C\uB529\uAD6C\uC131\uD30C\uC77C -Collect-Click\!_Get_user_information_code=\!\uB97C\uD074\uB9AD\uD558\uC5EC\uD65C\uC131\uCF54\uB4DC\uB97C\uC5BB\uC2B5\uB2C8\uB2E4. -Display\ position=\uC704\uCE58\uBCF4\uC774\uAE30 +FR-Designer_Get_Activation_Code=\!\uB97C\uD074\uB9AD\uD558\uC5EC\uD65C\uC131\uCF54\uB4DC\uB97C\uC5BB\uC2B5\uB2C8\uB2E4. +FR-Designer_Display_Position=\uC704\uCE58\uBCF4\uC774\uAE30 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 61c5929828..d47f0b4e80 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -1,4 +1,4 @@ -# generated time: 星期二 十月 24 16:58:25 CST 2017 +# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017 FR-Designer-BBSLogin_Account=\u7528\u6237\u540D FR-Designer-BBSLogin_Connection-Failure=\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5F53\u524D\u7F51\u7EDC\u72B6\u6001 FR-Designer-BBSLogin_Forgot-Password=\u5FD8\u8BB0\u5BC6\u7801 @@ -1943,5 +1943,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6807\u7B7E\u9875\u663E\u793 FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9009 FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u76EE\uFF1A FR-Base-Load_Resource_File=\u52A0\u8F7D\u914D\u7F6E\u6587\u4EF6 -Collect-Click\!_Get_user_information_code=\u70B9\u51FB\!\u83B7\u53D6\u6FC0\u6D3B\u7801 -Display\ position=\u663E\u793A\u4F4D\u7F6E +FR-Designer_Get_Activation_Code=\u70B9\u51FB\!\u83B7\u53D6\u6FC0\u6D3B\u7801 +FR-Designer_Display_Position=\u663E\u793A\u4F4D\u7F6E diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 8469700862..d4afa8791e 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -1,4 +1,4 @@ -# generated time: 星期二 十月 24 16:58:25 CST 2017 +# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017 FR-Designer-BBSLogin_Account=\u767B\u5165\u5E33\u865F FR-Designer-BBSLogin_Connection-Failure=\u767B\u5165\u9023\u63A5\u5931\u6557\uFF0C\u8ACB\u6AA2\u67E5\u7576\u524D\u7DB2\u8DEF\u72C0\u614B FR-Designer-BBSLogin_Forgot-Password=\u5FD8\u8A18\u5BC6\u78BC @@ -1944,5 +1944,5 @@ FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6A19\u7C64\u9801\u986F\u793 FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9078 FR-Designer_Decimal_Places=\u5C0F\u6578\u6578\u76EE\uFF1A FR-Base-Load_Resource_File=\u52A0\u8F09\u914D\u7F6E\u6A94\u6848 -Collect-Click\!_Get_user_information_code=\u9EDE\u64CA\!\u7372\u53D6\u7528\u6236\u8A0A\u606F\u78BC -Display\ position=\u986F\u793A\u4F4D\u7F6E +FR-Designer_Get_Activation_Code=\u9EDE\u64CA\!\u7372\u53D6\u7528\u6236\u8A0A\u606F\u78BC +FR-Designer_Display_Position=\u986F\u793A\u4F4D\u7F6E From 7243c312444ae3d6f7141d34be8e31d9c98b1c3a Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 3 Nov 2017 14:27:04 +0800 Subject: [PATCH 03/15] =?UTF-8?q?REPORT-5402=20=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/webattr/WriteToolBarPane.java | 6 +++- .../start/CollectUserInformationDialog.java | 31 ++++++++++++------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/designer/src/com/fr/design/webattr/WriteToolBarPane.java b/designer/src/com/fr/design/webattr/WriteToolBarPane.java index 264ad15f32..f9f5991775 100644 --- a/designer/src/com/fr/design/webattr/WriteToolBarPane.java +++ b/designer/src/com/fr/design/webattr/WriteToolBarPane.java @@ -50,6 +50,10 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { private UICheckBox isAutoStash;//自动暂存 public WriteToolBarPane() { + init(); + } + + private void init() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); this.add(allPanel, BorderLayout.CENTER); @@ -106,7 +110,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { toolBarManager.setToolBarLocation(Location.createTopEmbedLocation()); this.toolBarManagers = new ToolBarManager[]{toolBarManager}; } - + private ActionListener editBtnListener = new ActionListener() { public void actionPerformed(ActionEvent e) { diff --git a/designer/src/com/fr/start/CollectUserInformationDialog.java b/designer/src/com/fr/start/CollectUserInformationDialog.java index d8fbcaf78b..3eb0e45ae2 100644 --- a/designer/src/com/fr/start/CollectUserInformationDialog.java +++ b/designer/src/com/fr/start/CollectUserInformationDialog.java @@ -33,6 +33,15 @@ public class CollectUserInformationDialog extends UIDialog { private static final String TW_LOGIN_HTML = "http://www.finereport.com/tw/products/frlogin"; private static final String JP_LOGIN_HTML = "http://www.finereport.com/jp/products/frlogin"; private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; + private static final int DIALOG_WIDTH = 480; + private static final int DIALOG_HEIGHT = 300; + private static final int DESCRIPTION_ROWS = 5; + private static final int KEYPANE_PADDING_TOP = 32; + private static final int KEYPANE_PADDING_LEFT = 2; + private static final int KEYPANE_PADDING_DOWN = 32; + private static final int KEYPANE_PADDING_RIGHT = 2; + private static final int DEFAULTPANE_PADDING_TOP = 2; + private static final int DEFAULTPANE_PADDING = 4; private UITextField keyTextField; private DescriptionTextArea descriptionTextArea; @@ -47,7 +56,7 @@ public class CollectUserInformationDialog extends UIDialog { protected void initComponents() { JPanel defaultPane = (JPanel) this.getContentPane(); defaultPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - defaultPane.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4)); + defaultPane.setBorder(BorderFactory.createEmptyBorder(DEFAULTPANE_PADDING_TOP, DEFAULTPANE_PADDING, DEFAULTPANE_PADDING, DEFAULTPANE_PADDING)); this.applyClosingAction(); //this.applyEscapeAction(); JPanel centPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -60,7 +69,7 @@ public class CollectUserInformationDialog extends UIDialog { Inter.getLocText("Collect-Enter_your_user_information_code(It's_free_to_get_from_product's_official_website)"), TitledBorder.LEADING, TitledBorder.TOP)); JPanel keyPane = new JPanel(new BorderLayout(4, 4)); - keyPane.setBorder(BorderFactory.createEmptyBorder(32, 2, 32, 2)); + keyPane.setBorder(BorderFactory.createEmptyBorder(KEYPANE_PADDING_TOP, KEYPANE_PADDING_LEFT, KEYPANE_PADDING_DOWN, KEYPANE_PADDING_RIGHT)); topPane.add(keyPane); UILabel avctivenumberLabel = new UILabel(); @@ -78,7 +87,7 @@ public class CollectUserInformationDialog extends UIDialog { getKeyButton.addActionListener(actionListener); descriptionTextArea = new DescriptionTextArea(); - descriptionTextArea.setRows(5); + descriptionTextArea.setRows(DESCRIPTION_ROWS); descriptionTextArea.setBorder( BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Collect_Information_Description"))); descriptionTextArea.setText(Inter.getLocText("Collect-User_Information_DES")); @@ -88,13 +97,13 @@ public class CollectUserInformationDialog extends UIDialog { defaultPane.add(this.createControlButtonPane(), BorderLayout.SOUTH); this.setTitle(Inter.getLocText("Collect-Collect_User_Information")); - this.setSize(480, 300); + this.setSize(DIALOG_WIDTH, DIALOG_HEIGHT); this.setModal(true); GUICoreUtils.centerWindow(this); } private void macSystemHit(JPanel keyPane) { - if(OperatingSystem.isMacOS()) { + if (OperatingSystem.isMacOS()) { UITextArea macHit = new UITextArea(); macHit.setText(Inter.getLocText("FR-Designer-Collect_OSXTips")); macHit.setEditable(false); @@ -119,22 +128,19 @@ public class CollectUserInformationDialog extends UIDialog { private void getKeyAction(){ Locale locale = FRContext.getLocale(); String url = EN_LOGIN_HTML; - if (ComparatorUtils.equals(locale, Locale.TAIWAN)) - { + if (ComparatorUtils.equals(locale, Locale.TAIWAN)) { url = TW_LOGIN_HTML; } - if (ComparatorUtils.equals(locale, Locale.CHINA)) - { + if (ComparatorUtils.equals(locale, Locale.CHINA)) { url = CN_LOGIN_HTML; } - if (ComparatorUtils.equals(locale, Locale.JAPAN)) - { + if (ComparatorUtils.equals(locale, Locale.JAPAN)) { url = JP_LOGIN_HTML; } try { Desktop.getDesktop().browse(new URI(url)); } catch (Exception ioe) { - + // do nothing } }; @@ -189,5 +195,6 @@ public class CollectUserInformationDialog extends UIDialog { * */ public void checkValid() throws Exception { + // do nothing } } \ No newline at end of file From eb60891c4dc02d8448ff78e2a36cd44e443f83ed Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 3 Nov 2017 16:10:04 +0800 Subject: [PATCH 04/15] =?UTF-8?q?REPORT-5308=20[9.0=E4=B8=89=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E3=80=908.0=20master=20=E4=B9=9F=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E3=80=91=20=E4=BF=AE=E6=94=B9=E5=90=8E=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E9=A2=84=E8=A7=88=E6=B2=A1=E6=9C=89=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=EF=BC=8C=E5=86=8D=E9=A2=84=E8=A7=88=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E5=B0=B1=E5=A5=BD=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/data/datapane/TableDataTreePane.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index c8f5ba3176..d8a553a187 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -3,6 +3,7 @@ package com.fr.design.data.datapane; import com.fr.base.BaseUtils; import com.fr.base.TableData; import com.fr.data.TableDataSource; +import com.fr.data.impl.ConditionTableData; import com.fr.design.DesignModelAdapter; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; @@ -187,6 +188,9 @@ public class TableDataTreePane extends BasicTableDataTreePane { tc.renameTableData(oldName, nPanel.getObjectName(), false); TableDataSource tds = tc.getBook(); TableData td = uPanel.updateBean(); + if (td instanceof ConditionTableData) { + ((ConditionTableData) td).setTableDataSource(tds); + } String tdName = nPanel.getObjectName(); tds.putTableData(tdName, td); Map map = new HashMap(); From f9bbca36e38ccda7df3bb30ee7bc335b0e452dfc Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 6 Nov 2017 09:35:46 +0800 Subject: [PATCH 05/15] =?UTF-8?q?REPORT-5308=20=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/data/datapane/TableDataTreePane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index d8a553a187..7450b5ede2 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -3,7 +3,7 @@ package com.fr.design.data.datapane; import com.fr.base.BaseUtils; import com.fr.base.TableData; import com.fr.data.TableDataSource; -import com.fr.data.impl.ConditionTableData; +import com.fr.data.impl.TableDataSourceDependent; import com.fr.design.DesignModelAdapter; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; @@ -188,8 +188,8 @@ public class TableDataTreePane extends BasicTableDataTreePane { tc.renameTableData(oldName, nPanel.getObjectName(), false); TableDataSource tds = tc.getBook(); TableData td = uPanel.updateBean(); - if (td instanceof ConditionTableData) { - ((ConditionTableData) td).setTableDataSource(tds); + if (td instanceof TableDataSourceDependent) { + ((TableDataSourceDependent) td).setTableDataSource(tds); } String tdName = nPanel.getObjectName(); tds.putTableData(tdName, td); From 3770a983afaefd3c41e42b6161d20ad36439b3e6 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 6 Nov 2017 09:47:38 +0800 Subject: [PATCH 06/15] =?UTF-8?q?REPORT-5308=20=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataTreePane.java | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index 7450b5ede2..ddf8de49c3 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -46,6 +46,7 @@ import java.util.Map; public class TableDataTreePane extends BasicTableDataTreePane { private static TableDataTreePane singleton = new TableDataTreePane(); + private static final int TIP_DISMISS_DELAY = 3000; public synchronized static BasicTableDataTreePane getInstance(DesignModelAdapter tc) { @@ -72,25 +73,21 @@ public class TableDataTreePane extends BasicTableDataTreePane { private PreviewTableDataAction previewTableDataAction; private TableDataTreePane() { + init(); + } + + private void init() { this.setLayout(new BorderLayout(4, 0)); this.setBorder(null); dataTree = new TableDataTree(); ToolTipManager.sharedInstance().registerComponent(dataTree); - ToolTipManager.sharedInstance().setDismissDelay(3000); + ToolTipManager.sharedInstance().setDismissDelay(TIP_DISMISS_DELAY); ToolTipManager.sharedInstance().setInitialDelay(0); addMenuDef = new MenuDef(Inter.getLocText("FR-Action_Add")); addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH); createAddMenuDef(); - GeneralContext.addPluginReadListener(new PluginReadListener() { - @Override - public void success(Status status) { - addMenuDef.clearShortCuts(); - createAddMenuDef(); - } - }); - editAction = new EditAction(); removeAction = new RemoveAction(); previewTableDataAction = new PreviewTableDataAction(dataTree); @@ -113,13 +110,9 @@ public class TableDataTreePane extends BasicTableDataTreePane { jPanel.add(buttonPane, BorderLayout.NORTH); jPanel.add(scrollPane, BorderLayout.CENTER); this.add(jPanel, BorderLayout.CENTER); - dataTree.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent e) { - checkButtonEnabled(); - } - }); - dataTree.addKeyListener(getTableTreeNodeListener(editAction, previewTableDataAction, removeAction, op, dataTree)); + + initListeners(); + // TreeCellEditor dataTree.setEditable(true); TableDataTreeCellEditor treeCellEditor = new TableDataTreeCellEditor(new UITextField(), dataTree, this); @@ -129,6 +122,23 @@ public class TableDataTreePane extends BasicTableDataTreePane { checkButtonEnabled(); } + private void initListeners() { + GeneralContext.addPluginReadListener(new PluginReadListener() { + @Override + public void success(Status status) { + addMenuDef.clearShortCuts(); + createAddMenuDef(); + } + }); + dataTree.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + checkButtonEnabled(); + } + }); + dataTree.addKeyListener(getTableTreeNodeListener(editAction, previewTableDataAction, removeAction, op, dataTree)); + } + protected void checkButtonEnabled() { super.checkButtonEnabled(editAction, previewTableDataAction, removeAction, op, dataTree); From 286cdada9fa5bc07e3ae0edf1a863ef21a084c8b Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 6 Nov 2017 16:05:18 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/locale/designer.properties | 1 + designer_base/src/com/fr/design/locale/designer_en_US.properties | 1 + designer_base/src/com/fr/design/locale/designer_ja_JP.properties | 1 + designer_base/src/com/fr/design/locale/designer_ko_KR.properties | 1 + designer_base/src/com/fr/design/locale/designer_zh_CN.properties | 1 + designer_base/src/com/fr/design/locale/designer_zh_TW.properties | 1 + 6 files changed, 6 insertions(+) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 71bbf55272..9e1bf928c8 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -1945,3 +1945,4 @@ FR-Designer_Decimal_Places=Decimal Places: FR-Base-Load_Resource_File=Load resource file FR-Designer_Get_Activation_Code=Click\! Get user information code FR-Designer_Display_Position=Display position +FR-Designer_Template-Version-Warning="Your template file is currently open by a later production designer, will continue to open the original template properties mistakes or risk losing Make sure your design template designer version lower than the deployment server version." diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 7b26e8cb55..d541982c13 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -1946,3 +1946,4 @@ FR-Designer_Decimal_Places=Decimal Places: FR-Base-Load_Resource_File=Load Configuration File FR-Designer_Get_Activation_Code=Get Activation Code FR-Designer_Display_Position=Position +FR-Designer_Template-Version-Warning=The current template file is designed by higher vision designer. Open it may result in losing original attributes or error. Please upgrade your designer. Make sure your designer version lower than the deployment server version. diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 548c6b0385..28312b802d 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -1946,3 +1946,4 @@ FR-Designer_Decimal_Places=\u5C0F\u6570\u67A0\u6570: FR-Base-Load_Resource_File=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9 FR-Designer_Get_Activation_Code=\u30AF\u30EA\u30C3\u30AF\u3057\u3066\!\u30A2\u30AF\u30C6\u30A3\u30D9\u30FC\u30C8\u30B3\u30FC\u30C9\u3092\u53D6\u5F97 FR-Designer_Display_Position=\u8868\u793A\u4F4D\u7F6E +FR-Designer_Template-Version-Warning=\u958B\u3044\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u4E0A\u4F4D\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3\u306E\u30C7\u30B6\u30A4\u30CA\u30FC\u3067\u4F5C\u6210\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u4E0A\u4F4D\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3\u3067\u4F5C\u6210\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304F\u3068\u30A8\u30E9\u30FC\u306E\u767A\u751F\u539F\u56E0\u3068\u306A\u308B\u307B\u304B\u3001\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u6A5F\u80FD\u3084\u5C5E\u6027\u306E\u4E00\u90E8\u3092\u5931\u3046\u6050\u308C\u304C\u3042\u308A\u307E\u3059\u3002\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u4F5C\u6210\u7528\u306E\u30C7\u30B6\u30A4\u30CA\u30FC\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u3001\u914D\u5099\u3055\u308C\u308B\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3\u3088\u308A\u3082\u4E0B\u4F4D\u306E\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index a121f57ed7..14bd879e7f 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -1945,3 +1945,4 @@ FR-Designer_Decimal_Places=\uC18C\uC218\uC218\uB7C9: FR-Base-Load_Resource_File=\uB85C\uB529\uAD6C\uC131\uD30C\uC77C FR-Designer_Get_Activation_Code=\!\uB97C\uD074\uB9AD\uD558\uC5EC\uD65C\uC131\uCF54\uB4DC\uB97C\uC5BB\uC2B5\uB2C8\uB2E4. FR-Designer_Display_Position=\uC704\uCE58\uBCF4\uC774\uAE30 +FR-Designer_Template-Version-Warning=\uD604\uC7AC\uC5F0\uD15C\uD50C\uB9BF\uD30C\uC77C\uC740\uB354\uB192\uC740\uBC84\uC804\uC758\uC124\uACC4\uAE30\uB85C\uC791\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\uC5F4\uACBD\uC6B0\uAE30\uC874\uD15C\uD50C\uB9BF\uC18D\uC131\uC774\uC624\uB958\uAC00\uB098\uAC70\uB098\uC190\uC0C1\uB420\uC704\uD5D8\uC774\uC788\uC2B5\uB2C8\uB2E4. \uC124\uACC4\uD55C\uD15C\uD50C\uB9BF\uC758\uC124\uACC4\uAE30\uBC84\uC804\uC774\uC124\uCE58\uB41C\uC11C\uBC84\uBC84\uC804\uBCF4\uB2E4\uB0AE\uC9C0\uC54A\uB3C4\uB85D\uD558\uC2ED\uC2DC\uC624. diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index d47f0b4e80..08b4bc1975 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -1945,3 +1945,4 @@ FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u76EE\uFF1A FR-Base-Load_Resource_File=\u52A0\u8F7D\u914D\u7F6E\u6587\u4EF6 FR-Designer_Get_Activation_Code=\u70B9\u51FB\!\u83B7\u53D6\u6FC0\u6D3B\u7801 FR-Designer_Display_Position=\u663E\u793A\u4F4D\u7F6E +FR-Designer_Template-Version-Warning="\u60A8\u5F53\u524D\u6253\u5F00\u7684\u6A21\u677F\u6587\u4EF6\u662F\u7531\u66F4\u9AD8\u7248\u672C\u7684\u8BBE\u8BA1\u5668\u5236\u4F5C\u7684\uFF0C\u7EE7\u7EED\u6253\u5F00\u4F1A\u6709\u51FA\u9519\u6216\u8005\u4E22\u5931\u539F\u6709\u6A21\u677F\u5C5E\u6027\u7684\u98CE\u9669\u3002 \u8BF7\u786E\u4FDD\u60A8\u8BBE\u8BA1\u7684\u6A21\u677F\u7684\u8BBE\u8BA1\u5668\u7248\u672C\u4F4E\u4E8E\u90E8\u7F72\u7684\u670D\u52A1\u5668\u7248\u672C\u3002" diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index d4afa8791e..8de42bf904 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -1946,3 +1946,4 @@ FR-Designer_Decimal_Places=\u5C0F\u6578\u6578\u76EE\uFF1A FR-Base-Load_Resource_File=\u52A0\u8F09\u914D\u7F6E\u6A94\u6848 FR-Designer_Get_Activation_Code=\u9EDE\u64CA\!\u7372\u53D6\u7528\u6236\u8A0A\u606F\u78BC FR-Designer_Display_Position=\u986F\u793A\u4F4D\u7F6E +FR-Designer_Template-Version-Warning="\u60A8\u7576\u524D\u6253\u958B\u7684\u6A21\u677F\u6A94\u6848\u662F\u7531\u66F4\u9AD8\u7248\u672C\u7684\u8A2D\u8A08\u5668\u88FD\u4F5C\u7684\uFF0C\u7E7C\u7E8C\u6253\u958B\u6703\u6709\u51FA\u932F\u6216\u8005\u4E1F\u5931\u539F\u6709\u6A21\u677F\u5C6C\u6027\u7684\u98A8\u96AA\u3002 \u8ACB\u78BA\u4FDD\u60A8\u8A2D\u8A08\u7684\u6A21\u677F\u7684\u8A2D\u8A08\u5668\u7248\u672C\u4F4E\u65BC\u90E8\u7F72\u7684\u4F3A\u670D\u5668\u7248\u672C\u3002" From 83ffaf32185b3616730b9b63add489a100e7a860 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 7 Nov 2017 10:23:27 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D8.0=20mac=E4=B8=8Bdemo=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/start/Demo.java | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/designer_base/src/com/fr/start/Demo.java b/designer_base/src/com/fr/start/Demo.java index 042a621b31..523c87b795 100644 --- a/designer_base/src/com/fr/start/Demo.java +++ b/designer_base/src/com/fr/start/Demo.java @@ -8,42 +8,42 @@ import com.fr.stable.StableUtils; import java.io.IOException; public class Demo { - public static void main(String[] args) { - String installHome = StableUtils.getInstallHome(); - if (installHome == null) { - FRContext.getLogger().error("Can not find the install home, please check it."); - return; - } + public static void main(String[] args) { + String installHome = StableUtils.getInstallHome(); + if (installHome == null) { + FRContext.getLogger().error("Can not find the install home, please check it."); + return; + } String executorPath; if (OperatingSystem.isMacOS()) { - executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app --args demo"); + executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app"); } else { executorPath = StableUtils.pathJoin(installHome, "bin", "designer.exe demo"); } - if (!new java.io.File(executorPath).exists()) { - FRContext.getLogger().error(executorPath + " can not be found."); - } + if (!new java.io.File(executorPath).exists()) { + FRContext.getLogger().error(executorPath + " can not be found."); + } if (OperatingSystem.isMacOS()) { - ProcessBuilder builder = new ProcessBuilder(); - builder.command("open -a", executorPath); + ProcessBuilder builder = new ProcessBuilder(); + builder.command("open", "-a", executorPath, "--args", "demo"); try { builder.start(); } catch (IOException e) { FRContext.getLogger().error(e.getMessage(), e); } } else { - // ProcessBuilder这种方式在window下报错:系统找不到指定文件 - Runtime rt = Runtime.getRuntime(); - try { - rt.exec(executorPath); - } catch (IOException e) { - FRContext.getLogger().error(e.getMessage(), e); - } + // ProcessBuilder这种方式在window下报错:系统找不到指定文件 + Runtime rt = Runtime.getRuntime(); + try { + rt.exec(executorPath); + } catch (IOException e) { + FRContext.getLogger().error(e.getMessage(), e); + } } - System.exit(0); - } + System.exit(0); + } } \ No newline at end of file From 08ec8d07da2ce06de2d8742b8359502cb383daf0 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 7 Nov 2017 13:32:53 +0800 Subject: [PATCH 09/15] =?UTF-8?q?CHART-1690=20=208.0=E4=B8=AD=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E4=B8=8D=E6=94=AF=E6=8C=81=E5=B9=B3=E5=8F=B0=E5=86=85?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/other/ChartInteractivePane.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java index 0f0df0e7c7..566dae4837 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java @@ -659,13 +659,6 @@ public class ChartInteractivePane extends BasicScrollPane implements UIOb private void populateHyperlink(Plot plot) { HashMap paneMap = renewMapWithPlot(plot); - //安装平台内打开插件时,添加相应按钮 - Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); - for (HyperlinkProvider provider : providers) { - NameableCreator nc = provider.createHyperlinkCreator(); - paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); - } - List list = refreshList(paneMap); superLink.refreshMenuAndAddMenuAction(list); From 48657b06a3ef2101c6a2278a026b703f326bb30a Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 9 Nov 2017 09:57:04 +0800 Subject: [PATCH 10/15] =?UTF-8?q?REPORT-5503=20=E8=A1=A8=E5=8D=95=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E4=B8=8D=E8=83=BD=E9=93=BA=E6=BB=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FRAbsoluteBodyLayoutPropertiesGroupModel.java | 7 +++++++ .../properties/FRFitLayoutPropertiesGroupModel.java | 2 ++ 2 files changed, 9 insertions(+) diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index eb4b31154e..b648121b3c 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -2,6 +2,7 @@ package com.fr.design.designer.properties; import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.mainframe.WidgetPropertyPane; @@ -97,6 +98,11 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr if (row == 0) { if (state == WBodyLayoutType.FIT.getTypeValue()) { return switch2FitBodyLayout(); + } else { + XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent(); + if (xfl.toData().stashAndRemoveMargin()) { + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } } } if (row == 1) { @@ -142,6 +148,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight()); xfl.remove(xwAbsoluteLayout); + xfl.toData().restoreMargin(); for (Component comp : components) { XCreator xCreator = (XCreator) comp; diff --git a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java index 9ffad45338..c40725203a 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java @@ -12,6 +12,7 @@ import com.fr.design.mainframe.widget.editors.FitLayoutDirectionEditor; import com.fr.design.mainframe.widget.editors.LayoutTypeEditor; import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor; import com.fr.design.mainframe.widget.editors.PropertyCellEditor; +import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; @@ -152,6 +153,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel { wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); Component[] components = xfl.getComponents(); xfl.removeAll(); + xfl.toData().stashAndRemoveMargin(); XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)); xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); for (Component component : components) { From e40a987ee31c143c3cbffc935fcf3c68d7d03eda Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 9 Nov 2017 10:24:44 +0800 Subject: [PATCH 11/15] =?UTF-8?q?REPORT-5503=20=E8=A1=A8=E5=8D=95=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E4=B8=8D=E8=83=BD=E9=93=BA=E6=BB=A1=3D>=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java | 3 +-- .../designer/properties/FRFitLayoutPropertiesGroupModel.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index b648121b3c..20702ec8f4 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -100,7 +100,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr return switch2FitBodyLayout(); } else { XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent(); - if (xfl.toData().stashAndRemoveMargin()) { + if (xfl.toData().removeMargin()) { DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); } } @@ -148,7 +148,6 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight()); xfl.remove(xwAbsoluteLayout); - xfl.toData().restoreMargin(); for (Component comp : components) { XCreator xCreator = (XCreator) comp; diff --git a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java index c40725203a..b930b99ce1 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java @@ -153,7 +153,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel { wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); Component[] components = xfl.getComponents(); xfl.removeAll(); - xfl.toData().stashAndRemoveMargin(); + xfl.toData().removeMargin(); XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)); xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); for (Component component : components) { From 6fc5cad85e08e840c741918a841d5aac87f3fbf3 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 9 Nov 2017 15:35:30 +0800 Subject: [PATCH 12/15] =?UTF-8?q?REPORT-5518=20[9.0=E4=B8=89=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]jdk1.7=E7=9A=84=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=B5=B7=E4=B8=8D=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/bbs/UserInfoLabel.java | 58 ++--- designer/src/com/fr/start/Designer.java | 204 ++++++++++-------- .../com/fr/design/extra/LoginWebBridge.java | 2 +- .../com/fr/design/extra/ShopManagerPane.java | 6 +- .../com/fr/design/extra/WebViewDlgHelper.java | 50 +++-- 5 files changed, 187 insertions(+), 133 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index c671f0fdcd..4527ecfb81 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -5,7 +5,11 @@ package com.fr.design.mainframe.bbs; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; -import com.fr.design.extra.*; +import com.fr.design.extra.LoginContextListener; +import com.fr.design.extra.LoginWebBridge; +import com.fr.design.extra.PluginWebBridge; +import com.fr.design.extra.UserLoginContext; +import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; @@ -20,16 +24,25 @@ import com.fr.stable.EncodeConstants; import com.fr.stable.OperatingSystem; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import net.sf.ehcache.util.NamedThreadFactory; -import javax.swing.*; -import java.awt.*; +import javax.swing.SwingConstants; +import java.awt.Cursor; +import java.awt.Desktop; +import java.awt.Frame; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.UnsupportedEncodingException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; import java.net.URI; import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; /** * @author neil @@ -83,21 +96,6 @@ public class UserInfoLabel extends UILabel { LoginWebBridge loginWebBridge = new LoginWebBridge(); loginWebBridge.setUserName(userName, UserInfoLabel.this); - LoginCheckContext.addLoginCheckListener(new LoginCheckListener() { - @Override - public void loginChecked() { - /* - if (bbsLoginDialog == null) { - bbsLoginDialog = new BBSLoginDialog(DesignerContext.getDesignerFrame(), UserInfoLabel.this); - } - bbsLoginDialog.clearLoginInformation(); - bbsLoginDialog.showTipForDownloadPluginWithoutLogin(); - bbsLoginDialog.setModal(true); - bbsLoginDialog.showWindow(); - */ - } - }); - if (StableUtils.getMajorJavaVersion() == 8) { PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); } @@ -125,12 +123,13 @@ public class UserInfoLabel extends UILabel { userInfoPane.markUnSignIn(); } - /** - * showBBSDialog 弹出BBS资讯框 - */ public static void showBBSDialog() { - Thread showBBSThread = new Thread(new Runnable() { - + ThreadFactory namedThread = new NamedThreadFactory("bbs-dlg"); + ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor( + 1, 1, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1), namedThread); + threadPoolExecutor.execute(new Runnable() { @Override public void run() { // vito:最新mac10.12和javafx弹出框初始化时会有大几率卡死在native方法,这里先屏蔽一下。 @@ -156,14 +155,16 @@ public class UserInfoLabel extends UILabel { return; } try { - BBSDialog bbsLabel = new BBSDialog(DesignerContext.getDesignerFrame()); - bbsLabel.showWindow(SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); + Class clazz = Class.forName("com.fr.design.mainframe.bbs.BBSDialog"); + Constructor constructor = clazz.getConstructor(Frame.class); + Object instance = constructor.newInstance(DesignerContext.getDesignerFrame()); + Method showWindow = clazz.getMethod("showWindow", String.class); + showWindow.invoke(instance, SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date())); - } catch (Throwable e) { + } catch (Throwable ignored) { } } }); - showBBSThread.start(); } private void sleep(long millis) { @@ -230,6 +231,7 @@ public class UserInfoLabel extends UILabel { private MouseAdapter userInfoAdapter = new MouseAdapter() { + @Override public void mouseEntered(MouseEvent e) { UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR)); } @@ -245,6 +247,7 @@ public class UserInfoLabel extends UILabel { //私人消息 UIMenuItem priviteMessage = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Privite-Message")); priviteMessage.addMouseListener(new MouseAdapter() { + @Override public void mousePressed(MouseEvent e) { if (StringUtils.isNotEmpty(userName)) { try { @@ -261,6 +264,7 @@ public class UserInfoLabel extends UILabel { //切换账号 UIMenuItem closeOther = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Switch-Account")); closeOther.addMouseListener(new MouseAdapter() { + @Override public void mousePressed(MouseEvent e) { UserLoginContext.fireLoginContextListener(); } diff --git a/designer/src/com/fr/start/Designer.java b/designer/src/com/fr/start/Designer.java index 526df8f096..88f9dd5422 100644 --- a/designer/src/com/fr/start/Designer.java +++ b/designer/src/com/fr/start/Designer.java @@ -20,7 +20,12 @@ import com.fr.design.gui.ibutton.UIPreviewButton; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.itoolbar.UILargeToolbar; -import com.fr.design.mainframe.*; +import com.fr.design.mainframe.ActiveKeyGenerator; +import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.InformationCollector; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.JWorkBook; import com.fr.design.mainframe.bbs.UserInfoLabel; import com.fr.design.mainframe.bbs.UserInfoPane; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; @@ -37,30 +42,39 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLTools; +import net.sf.ehcache.util.NamedThreadFactory; -import javax.swing.*; +import javax.swing.JComponent; +import javax.swing.JPanel; import javax.swing.border.MatteBorder; -import java.awt.*; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.ArrayList; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; public class Designer extends BaseDesigner { private static final int TOOLBARPANEVGAP = -4; private static final int PREVIEW_DOWN_X_GAP = 92; private static final int GAP = 7; - + private static final String OLD_ENV_FOLDER_71 = ".FineReport71"; private static final String OLD_ENV_FOLDER_70 = ".FineReport70"; private UserInfoPane userInfoPane; - + private UIButton saveButton; private UIButton undo; private UIButton redo; private UIPreviewButton run; - + /** * 设计器启动的Main方法 @@ -132,6 +146,7 @@ public class Designer extends BaseDesigner { UILargeToolbar largeToolbar = super.createLargeToolbar(); largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4)); largeToolbar.add(new JPanel() { + @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); dim.width = 1; @@ -141,6 +156,7 @@ public class Designer extends BaseDesigner { createRunButton(largeToolbar); largeToolbar.add(run); largeToolbar.add(new JPanel() { + @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); dim.width = GAP; @@ -154,8 +170,10 @@ public class Designer extends BaseDesigner { /** * 创建上面一排的工具栏按钮 + * * @return 按钮 */ + @Override public UIButton[] createUp() { return new UIButton[]{createSaveButton(), createUndoButton(), createRedoButton()}; } @@ -176,7 +194,7 @@ public class Designer extends BaseDesigner { }); return saveButton; } - + private UIButton createUndoButton() { undo = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/undo.png")); undo.setToolTipText(KeySetUtils.UNDO.getMenuKeySetName()); @@ -211,10 +229,12 @@ public class Designer extends BaseDesigner { private void createRunButton(UILargeToolbar largeToolbar) { run = new UIPreviewButton(new UIButton(UIConstants.PAGE_BIG_ICON) { + @Override public Dimension getPreferredSize() { return new Dimension(34, 34); } }, new UIButton(UIConstants.PREVIEW_DOWN) { + @Override public Dimension getPreferredSize() { return new Dimension(34, 10); } @@ -284,10 +304,12 @@ public class Designer extends BaseDesigner { /** * 生成工具栏 + * * @param toolbarComponent 工具栏 * @param plus 对象 - * @return 更新后的toolbar + * @return 更新后的toolbar */ + @Override public JComponent resetToolBar(JComponent toolbarComponent, ToolBarMenuDockPlus plus) { //如果是处于权限编辑状态 if (BaseUtils.isAuthorityEditing()) { @@ -325,85 +347,91 @@ public class Designer extends BaseDesigner { public JTemplate createNewTemplate() { return new JWorkBook(); } - + /** - * 创建论坛登录面板, chart那边不需要 - * - * @return 面板组件 - * - */ - public Component createBBSLoginPane(){ - if (userInfoPane == null){ - userInfoPane = new UserInfoPane(); + * 创建论坛登录面板, chart那边不需要 + * + * @return 面板组件 + */ + @Override + public Component createBBSLoginPane() { + if (userInfoPane == null) { + userInfoPane = new UserInfoPane(); } return userInfoPane; } - + + @Override protected SplashPane createSplashPane() { return new ReportSplashPane(); } - + /** - * 收集用户信息吗 - * - */ + * 收集用户信息吗 + */ + @Override protected void collectUserInformation() { - //定制的就不弹出来了 - if (!ComparatorUtils.equals(ProductConstants.APP_NAME, ProductConstants.DEFAULT_APPNAME)) { - return; - } - - DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - final String key = envManager.getActivationKey(); - //本地验证通过 - if(ActiveKeyGenerator.localVerify(key)){ - onLineVerify(envManager, key); - UserInfoLabel.showBBSDialog(); - return; - } - - if(StableUtils.checkDesignerActive(readOldKey())){ - //只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行. - String newKey = ActiveKeyGenerator.generateActiveKey(); - envManager.setActivationKey(newKey); - UserInfoLabel.showBBSDialog(); - return; - } - + //定制的就不弹出来了 + if (!ComparatorUtils.equals(ProductConstants.APP_NAME, ProductConstants.DEFAULT_APPNAME)) { + return; + } + + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); + final String key = envManager.getActivationKey(); + //本地验证通过 + if (ActiveKeyGenerator.localVerify(key)) { + onLineVerify(envManager, key); + UserInfoLabel.showBBSDialog(); + return; + } + + if (StableUtils.checkDesignerActive(readOldKey())) { + //只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行. + String newKey = ActiveKeyGenerator.generateActiveKey(); + envManager.setActivationKey(newKey); + UserInfoLabel.showBBSDialog(); + return; + } + CollectUserInformationDialog activeDialog = new CollectUserInformationDialog( - DesignerContext.getDesignerFrame()); + DesignerContext.getDesignerFrame()); activeDialog.setVisible(true); } - - private void onLineVerify(DesignerEnvManager envManager, final String key){ - int status = envManager.getActiveKeyStatus(); - //没有联网验证过 - if (status != 0) { - Thread authThread = new Thread(new Runnable() { - - @Override - public void run() { - ActiveKeyGenerator.onLineVerify(key); - } - }); - authThread.start(); - } + + private void onLineVerify(DesignerEnvManager envManager, final String key) { + int status = envManager.getActiveKeyStatus(); + //没有联网验证过 + if (status != 0) { + ThreadFactory namedThread = new NamedThreadFactory("net-verify"); + ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor( + 1, 1, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1), + namedThread); + threadPoolExecutor.execute(new Runnable() { + + @Override + public void run() { + ActiveKeyGenerator.onLineVerify(key); + } + }); + } } - - private File getOldEnvFile(String folderName){ - String userHome = System.getProperty("user.home"); - if (userHome == null) { - userHome = System.getProperty("userHome"); - } - String filePath = StableUtils.pathJoin(userHome, folderName, ProductConstants.APP_NAME + "Env.xml"); + + private File getOldEnvFile(String folderName) { + String userHome = System.getProperty("user.home"); + if (userHome == null) { + userHome = System.getProperty("userHome"); + } + String filePath = StableUtils.pathJoin(userHome, folderName, ProductConstants.APP_NAME + "Env.xml"); return new File(filePath); } - - private String getOldActiveKeyFromFile(File envFile){ + + private String getOldActiveKeyFromFile(File envFile) { if (!envFile.exists()) { - return StringUtils.EMPTY; - } - + return StringUtils.EMPTY; + } + DesignerEnvManager temp = new DesignerEnvManager(); try { XMLTools.readFileXML(temp, envFile); @@ -412,26 +440,26 @@ public class Designer extends BaseDesigner { } return temp.getActivationKey(); } - + //默认只从7.0和711的设计器里读取key - private String readOldKey(){ - File file71 = getOldEnvFile(OLD_ENV_FOLDER_71); - if (!file71.exists()) { - File file70 = getOldEnvFile(OLD_ENV_FOLDER_70); - return getOldActiveKeyFromFile(file70); - } - - return getOldActiveKeyFromFile(file71); + private String readOldKey() { + File file71 = getOldEnvFile(OLD_ENV_FOLDER_71); + if (!file71.exists()) { + File file70 = getOldEnvFile(OLD_ENV_FOLDER_70); + return getOldActiveKeyFromFile(file70); + } + + return getOldActiveKeyFromFile(file71); } - + /** - * 设计器退出时, 做的一些操作. - * - */ - public void shutDown(){ - InformationCollector collector = InformationCollector.getInstance(); - collector.collectStopTime(); - collector.saveXMLFile(); + * 设计器退出时, 做的一些操作. + */ + @Override + public void shutDown() { + InformationCollector collector = InformationCollector.getInstance(); + collector.collectStopTime(); + collector.saveXMLFile(); Env currentEnv = FRContext.getCurrentEnv(); currentEnv.doWhenServerShutDown(); } diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index de0be5c91d..a579cbd51e 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -79,7 +79,7 @@ public class LoginWebBridge { this.pluginuiLabel = uiLabel; } - public void setQqDialog(UIDialog qqDialog) { + public void setQQDialog(UIDialog qqDialog) { closeQQWindow(); this.qqDialog = qqDialog; } diff --git a/designer_base/src/com/fr/design/extra/ShopManagerPane.java b/designer_base/src/com/fr/design/extra/ShopManagerPane.java index 857e96cc8d..49d89733db 100644 --- a/designer_base/src/com/fr/design/extra/ShopManagerPane.java +++ b/designer_base/src/com/fr/design/extra/ShopManagerPane.java @@ -2,9 +2,9 @@ package com.fr.design.extra; import com.fr.design.dialog.BasicPane; import com.fr.general.Inter; -import javafx.embed.swing.JFXPanel; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; /** * @author richie @@ -19,7 +19,7 @@ import java.awt.*; */ public class ShopManagerPane extends BasicPane { - public ShopManagerPane(JFXPanel webPane) { + public ShopManagerPane(Component webPane) { setLayout(new BorderLayout()); add(webPane, BorderLayout.CENTER); } diff --git a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java index 481498fc88..9978ac545a 100644 --- a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -15,9 +15,12 @@ import com.fr.general.http.HttpClient; import com.fr.plugin.PluginVerifyException; import com.fr.stable.StableUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.JOptionPane; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.Component; import java.io.File; +import java.lang.reflect.Constructor; import java.net.HttpURLConnection; import java.util.concurrent.ExecutionException; @@ -97,24 +100,43 @@ public class WebViewDlgHelper { } public static void createQQLoginDialog() { - QQLoginWebPane webPane = new QQLoginWebPane(new File(installHome).getAbsolutePath()); - UIDialog qqlog = new QQLoginDialog(DesignerContext.getDesignerFrame(), webPane); - LoginWebBridge.getHelper().setQqDialog(qqlog); - qqlog.setVisible(true); + try { + Class clazz = Class.forName("com.fr.design.extra.QQLoginWebPane"); + Constructor constructor = clazz.getConstructor(String.class); + Component webPane = (Component) constructor.newInstance(new File(installHome).getAbsolutePath()); + + UIDialog qqLoginDialog = new QQLoginDialog(DesignerContext.getDesignerFrame(), webPane); + LoginWebBridge.getHelper().setQQDialog(qqLoginDialog); + qqLoginDialog.setVisible(true); + } catch (Throwable ignored) { + } } private static void showPluginDlg(String mainJsPath) { - BasicPane managerPane = new ShopManagerPane(new PluginWebPane(mainJsPath)); - UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane); - PluginWebBridge.getHelper().setDialogHandle(dlg); - dlg.setVisible(true); + try { + Class clazz = Class.forName("com.fr.design.extra.PluginWebPane"); + Constructor constructor = clazz.getConstructor(String.class); + Component webPane = (Component) constructor.newInstance(mainJsPath); + + BasicPane managerPane = new ShopManagerPane(webPane); + UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane); + PluginWebBridge.getHelper().setDialogHandle(dlg); + dlg.setVisible(true); + } catch (Throwable ignored) { + } } private static void showLoginDlg() { - LoginWebPane webPane = new LoginWebPane(new File(installHome).getAbsolutePath()); - UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(), webPane); - LoginWebBridge.getHelper().setDialogHandle(qqdlg); - qqdlg.setVisible(true); + try { + Class clazz = Class.forName("com.fr.design.extra.LoginWebPane"); + Constructor constructor = clazz.getConstructor(String.class); + Component webPane = (Component) constructor.newInstance(new File(installHome).getAbsolutePath()); + + UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(), webPane); + LoginWebBridge.getHelper().setDialogHandle(qqdlg); + qqdlg.setVisible(true); + } catch (Throwable ignored) { + } } private static Component initTraditionalStore() { From 208db9c67da929743c54e80b8b589dbfb19af72c Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 9 Nov 2017 16:35:30 +0800 Subject: [PATCH 13/15] =?UTF-8?q?refeat:=20=E5=A2=9E=E5=8A=A0ThreadFactory?= =?UTF-8?q?Builder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/bbs/UserInfoLabel.java | 10 +- designer/src/com/fr/start/Designer.java | 6 +- .../concurrent/ThreadFactoryBuilder.java | 177 ++++++++++++++++++ 3 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index 4527ecfb81..d5c9087c69 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -14,6 +14,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; @@ -24,7 +25,6 @@ import com.fr.stable.EncodeConstants; import com.fr.stable.OperatingSystem; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import net.sf.ehcache.util.NamedThreadFactory; import javax.swing.SwingConstants; import java.awt.Cursor; @@ -40,7 +40,6 @@ import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -124,11 +123,11 @@ public class UserInfoLabel extends UILabel { } public static void showBBSDialog() { - ThreadFactory namedThread = new NamedThreadFactory("bbs-dlg"); ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor( 1, 1, 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue(1), namedThread); + new LinkedBlockingQueue(1), + new ThreadFactoryBuilder().setNameFormat("bbs-dlg-thread-%s").build()); threadPoolExecutor.execute(new Runnable() { @Override public void run() { @@ -151,7 +150,7 @@ public class UserInfoLabel extends UILabel { return; } String res = hc.getResponseText(); - if (res.indexOf(BBSConstants.UPDATE_KEY) == -1) { + if (!res.contains(BBSConstants.UPDATE_KEY)) { return; } try { @@ -163,6 +162,7 @@ public class UserInfoLabel extends UILabel { DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date())); } catch (Throwable ignored) { } + } }); } diff --git a/designer/src/com/fr/start/Designer.java b/designer/src/com/fr/start/Designer.java index 88f9dd5422..69d2ca1a1e 100644 --- a/designer/src/com/fr/start/Designer.java +++ b/designer/src/com/fr/start/Designer.java @@ -35,6 +35,7 @@ import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignerModule; +import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; @@ -42,7 +43,6 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLTools; -import net.sf.ehcache.util.NamedThreadFactory; import javax.swing.JComponent; import javax.swing.JPanel; @@ -56,7 +56,6 @@ import java.awt.event.ActionListener; import java.io.File; import java.util.ArrayList; import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -402,12 +401,11 @@ public class Designer extends BaseDesigner { int status = envManager.getActiveKeyStatus(); //没有联网验证过 if (status != 0) { - ThreadFactory namedThread = new NamedThreadFactory("net-verify"); ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor( 1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(1), - namedThread); + new ThreadFactoryBuilder().setNameFormat("net-verify-thread-%s").build()); threadPoolExecutor.execute(new Runnable() { @Override diff --git a/designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java b/designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java new file mode 100644 index 0000000000..d7d2393e84 --- /dev/null +++ b/designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2010 The Guava Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package com.fr.design.utils.concurrent; + +import java.lang.Thread.UncaughtExceptionHandler; +import java.util.Locale; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicLong; + +/** + * A ThreadFactory builder, providing any combination of these features: + *
    + *
  • whether threads should be marked as {@linkplain Thread#setDaemon daemon} threads + *
  • a {@linkplain ThreadFactoryBuilder#setNameFormat naming format} + *
  • a {@linkplain Thread#setPriority thread priority} + *
  • an {@linkplain Thread#setUncaughtExceptionHandler uncaught exception handler} + *
  • a {@linkplain ThreadFactory#newThread backing thread factory} + *
+ *

If no backing thread factory is provided, a default backing thread factory is used as if by + * calling {@code setThreadFactory(}{@link Executors#defaultThreadFactory()}{@code )}. + * + * @author Kurt Alfred Kluever + * @since 4.0 + */ +public final class ThreadFactoryBuilder { + private String nameFormat = null; + private Boolean daemon = null; + private Integer priority = null; + private UncaughtExceptionHandler uncaughtExceptionHandler = null; + private ThreadFactory backingThreadFactory = null; + + /** + * Creates a new {@link ThreadFactory} builder. + */ + public ThreadFactoryBuilder() { + } + + /** + * Sets the naming format to use when naming threads ({@link Thread#setName}) which are created + * with this ThreadFactory. + * + * @param nameFormat a {@link String#format(String, Object...)}-compatible format String, to which + * a unique integer (0, 1, etc.) will be supplied as the single parameter. This integer will + * be unique to the built instance of the ThreadFactory and will be assigned sequentially. For + * example, {@code "rpc-pool-%d"} will generate thread names like {@code "rpc-pool-0"}, + * {@code "rpc-pool-1"}, {@code "rpc-pool-2"}, etc. + * @return this for the builder pattern + */ + public ThreadFactoryBuilder setNameFormat(String nameFormat) { + String unused = format(nameFormat, 0); // fail fast if the format is bad or null + this.nameFormat = nameFormat; + return this; + } + + /** + * Sets daemon or not for new threads created with this ThreadFactory. + * + * @param daemon whether or not new Threads created with this ThreadFactory will be daemon threads + * @return this for the builder pattern + */ + public ThreadFactoryBuilder setDaemon(boolean daemon) { + this.daemon = daemon; + return this; + } + + /** + * Sets the priority for new threads created with this ThreadFactory. + * + * @param priority the priority for new Threads created with this ThreadFactory + * @return this for the builder pattern + */ + public ThreadFactoryBuilder setPriority(int priority) { + // Thread#setPriority() already checks for validity. These error messages + // are nicer though and will fail-fast. + + if (priority < Thread.MIN_PRIORITY) { + throw new IllegalArgumentException(format("Thread priority (%s) must be >= %s", priority, Thread.MIN_PRIORITY)); + } + if (priority > Thread.MAX_PRIORITY) { + throw new IllegalArgumentException(format("Thread priority (%s) must be <= %s", priority, Thread.MAX_PRIORITY)); + } + this.priority = priority; + return this; + } + + /** + * Sets the {@link UncaughtExceptionHandler} for new threads created with this ThreadFactory. + * + * @param uncaughtExceptionHandler the uncaught exception handler for new Threads created with + * this ThreadFactory + * @return this for the builder pattern + */ + public ThreadFactoryBuilder setUncaughtExceptionHandler( + UncaughtExceptionHandler uncaughtExceptionHandler) { + if (uncaughtExceptionHandler == null) { + throw new NullPointerException(); + } + this.uncaughtExceptionHandler = uncaughtExceptionHandler; + return this; + } + + /** + * Sets the backing {@link ThreadFactory} for new threads created with this ThreadFactory. Threads + * will be created by invoking #newThread(Runnable) on this backing {@link ThreadFactory}. + * + * @param backingThreadFactory the backing {@link ThreadFactory} which will be delegated to during + * thread creation. + * @return this for the builder pattern + */ + public ThreadFactoryBuilder setThreadFactory(ThreadFactory backingThreadFactory) { + if (backingThreadFactory == null) { + throw new NullPointerException(); + } + this.backingThreadFactory = backingThreadFactory; + return this; + } + + /** + * Returns a new thread factory using the options supplied during the building process. After + * building, it is still possible to change the options used to build the ThreadFactory and/or + * build again. State is not shared amongst built instances. + * + * @return the fully constructed {@link ThreadFactory} + */ + public ThreadFactory build() { + return doBuild(this); + } + + // Split out so that the anonymous ThreadFactory can't contain a reference back to the builder. + // At least, I assume that's why. TODO(cpovirk): Check, and maybe add a test for this. + private static ThreadFactory doBuild(ThreadFactoryBuilder builder) { + final String nameFormat = builder.nameFormat; + final Boolean daemon = builder.daemon; + final Integer priority = builder.priority; + final UncaughtExceptionHandler uncaughtExceptionHandler = builder.uncaughtExceptionHandler; + final ThreadFactory backingThreadFactory = + (builder.backingThreadFactory != null) + ? builder.backingThreadFactory + : Executors.defaultThreadFactory(); + final AtomicLong count = (nameFormat != null) ? new AtomicLong(0) : null; + return new ThreadFactory() { + @Override + public Thread newThread(Runnable runnable) { + Thread thread = backingThreadFactory.newThread(runnable); + if (nameFormat != null) { + thread.setName(format(nameFormat, count.getAndIncrement())); + } + if (daemon != null) { + thread.setDaemon(daemon); + } + if (priority != null) { + thread.setPriority(priority); + } + if (uncaughtExceptionHandler != null) { + thread.setUncaughtExceptionHandler(uncaughtExceptionHandler); + } + return thread; + } + }; + } + + private static String format(String format, Object... args) { + return String.format(Locale.ROOT, format, args); + } +} From 9fc711e6a3c661dad0969a52e146c219fa320130 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 10 Nov 2017 16:41:26 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20SonarQu?= =?UTF-8?q?be?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/bbs/UserInfoLabel.java | 8 ++- .../com/fr/design/extra/LoginWebBridge.java | 52 +++++++++++-------- .../com/fr/design/extra/WebViewDlgHelper.java | 4 ++ .../concurrent/ThreadFactoryBuilder.java | 1 + .../src/com/fr/start/BaseDesigner.java | 8 +-- 5 files changed, 45 insertions(+), 28 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index d5c9087c69..40d99480fc 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -49,6 +49,7 @@ import java.util.concurrent.TimeUnit; */ public class UserInfoLabel extends UILabel { + private static final int JRE_VERSION_8 = 8; //默认查询消息时间, 30s private static final long CHECK_MESSAGE_TIME = 30 * 1000L; //默认论坛检测到更新后的弹出延迟时间 @@ -85,6 +86,10 @@ public class UserInfoLabel extends UILabel { } public UserInfoLabel(UserInfoPane userInfoPane) { + init(userInfoPane); + } + + private void init(UserInfoPane userInfoPane) { this.userInfoPane = userInfoPane; String userName = DesignerEnvManager.getEnvManager().getBBSName(); @@ -95,7 +100,7 @@ public class UserInfoLabel extends UILabel { LoginWebBridge loginWebBridge = new LoginWebBridge(); loginWebBridge.setUserName(userName, UserInfoLabel.this); - if (StableUtils.getMajorJavaVersion() == 8) { + if (StableUtils.getMajorJavaVersion() == JRE_VERSION_8) { PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); } LoginWebBridge.getHelper().setUILabelInPlugin(UserInfoLabel.this); @@ -161,6 +166,7 @@ public class UserInfoLabel extends UILabel { showWindow.invoke(instance, SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date())); } catch (Throwable ignored) { + // ignored } } diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index a579cbd51e..3190e431d1 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -6,14 +6,16 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.extra.ucenter.Client; import com.fr.design.extra.ucenter.XMLHelper; import com.fr.design.gui.ilable.UILabel; +import com.fr.general.ComparatorUtils; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; import javafx.scene.web.WebEngine; -import javax.swing.*; -import java.awt.*; +import javax.swing.JDialog; +import javax.swing.SwingUtilities; +import java.awt.Desktop; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLEncoder; @@ -55,6 +57,10 @@ public class LoginWebBridge { private String userName; public LoginWebBridge() { + init(); + } + + private void init() { String username = DesignerEnvManager.getEnvManager().getBBSName(); setUserName(username, uiLabel); } @@ -216,7 +222,7 @@ public class LoginWebBridge { return NET_FAILED; } String loginResult = login(username, password); - if (loginResult.equals(LOGININ)) { + if (ComparatorUtils.equals(loginResult, LOGININ)) { updateUserInfo(username); loginSuccess(username, uiLabel); setUserName(username, uiLabel); @@ -271,24 +277,23 @@ public class LoginWebBridge { String result = uc.uc_user_login(username, password); result = new String(result.getBytes("iso-8859-1"), "gbk"); LinkedList list = XMLHelper.uc_unserialize(result); - if (list.size() > 0) { - int $uid = Integer.parseInt(list.get(0)); - if ($uid > 0) { - DesignerEnvManager.getEnvManager().setBbsUid($uid); - DesignerEnvManager.getEnvManager().setBBSName(username); - DesignerEnvManager.getEnvManager().setInShowBBsName(username); - DesignerEnvManager.getEnvManager().setBBSPassword(password); - return LOGININ;//登录成功,0 - } else if ($uid == -1) { - return USERNAME_NOT_EXSIT;//用户名不存在,-1 - } else if ($uid == -2) { - return PASSWORD_ERROR;//密码错误,-2 - } else { - return UNKNOWN_ERROR;//未知错误,-3 - } - } else { + if (list.size() == 0) { return NET_FAILED; } + int uid = Integer.parseInt(list.get(0)); + if (uid > 0) { + DesignerEnvManager.getEnvManager().setBbsUid(uid); + DesignerEnvManager.getEnvManager().setBBSName(username); + DesignerEnvManager.getEnvManager().setInShowBBsName(username); + DesignerEnvManager.getEnvManager().setBBSPassword(password); + return LOGININ;//登录成功,0 + } else if (uid == -1) { + return USERNAME_NOT_EXSIT;//用户名不存在,-1 + } else if (uid == -2) { + return PASSWORD_ERROR;//密码错误,-2 + } else { + return UNKNOWN_ERROR;//未知错误,-3 + } } catch (Exception e) { FRContext.getLogger().info(e.getMessage()); } @@ -313,21 +318,22 @@ public class LoginWebBridge { public void getLoginInfo(String userInfo) { org.json.JSONObject jo = new org.json.JSONObject(userInfo); String status = jo.get("status").toString(); - if (status.equals(LOGIN_SUCCESS)) { + if (ComparatorUtils.equals(status, LOGIN_SUCCESS)) { String username = jo.get("username").toString(); - int uid = Integer.parseInt(jo.get("uid") == null ? "" : jo.get("uid").toString()); + int uid = Integer.parseInt(jo.get("uid") == null ? StringUtils.EMPTY : jo.get("uid").toString()); closeWindow(); closeQQWindow(); pluginuiLabel.setText(username); DesignerEnvManager.getEnvManager().setBBSName(username); DesignerEnvManager.getEnvManager().setBbsUid(uid); DesignerEnvManager.getEnvManager().setInShowBBsName(username); - } else if (status.equals(LOGIN_FAILED)) { + } else if (ComparatorUtils.equals(status, LOGIN_FAILED)) { //账号没有QQ授权 closeQQWindow(); try { Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("QQ_binding"))); - } catch (Exception exp) { + } catch (Exception ignore) { + // ignored } } } diff --git a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java index 9978ac545a..c9e0089e94 100644 --- a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -109,6 +109,7 @@ public class WebViewDlgHelper { LoginWebBridge.getHelper().setQQDialog(qqLoginDialog); qqLoginDialog.setVisible(true); } catch (Throwable ignored) { + // ignored } } @@ -123,6 +124,7 @@ public class WebViewDlgHelper { PluginWebBridge.getHelper().setDialogHandle(dlg); dlg.setVisible(true); } catch (Throwable ignored) { + // ignored } } @@ -136,6 +138,7 @@ public class WebViewDlgHelper { LoginWebBridge.getHelper().setDialogHandle(qqdlg); qqdlg.setVisible(true); } catch (Throwable ignored) { + // ignored } } @@ -158,6 +161,7 @@ public class WebViewDlgHelper { PluginHelper.downloadPluginFile(scriptsId, username, password, new Process() { @Override public void process(Double integer) { + // ignored } }); } catch (PluginVerifyException e) { diff --git a/designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java b/designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java index d7d2393e84..3af213ac9e 100644 --- a/designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java +++ b/designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java @@ -45,6 +45,7 @@ public final class ThreadFactoryBuilder { * Creates a new {@link ThreadFactory} builder. */ public ThreadFactoryBuilder() { + // 这个注释毫无意义,就是为了通过SonarQube } /** diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index 1685c07112..3ee91c7607 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -56,10 +56,10 @@ public abstract class BaseDesigner extends ToolBarMenuDock { DesignUtils.setPort(getStartPort()); // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 - if (DesignUtils.isStarted()) { - DesignUtils.clientSend(args); - return; - } +// if (DesignUtils.isStarted()) { +// DesignUtils.clientSend(args); +// return; +// } BuildContext.setBuildFilePath(buildPropertiesPath()); //下面这两句的位置不能随便调换,因为会影响语言切换的问题 From 4b231ebe1ca829610826a13cae74be1ac104f8ed Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 10 Nov 2017 16:42:47 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/start/BaseDesigner.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index 3ee91c7607..1685c07112 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -56,10 +56,10 @@ public abstract class BaseDesigner extends ToolBarMenuDock { DesignUtils.setPort(getStartPort()); // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 -// if (DesignUtils.isStarted()) { -// DesignUtils.clientSend(args); -// return; -// } + if (DesignUtils.isStarted()) { + DesignUtils.clientSend(args); + return; + } BuildContext.setBuildFilePath(buildPropertiesPath()); //下面这两句的位置不能随便调换,因为会影响语言切换的问题