From 50c2b45e35c7cafab052b533075e5d499c326f00 Mon Sep 17 00:00:00 2001 From: fortyone <1151438686@qq.com> Date: Fri, 2 Dec 2016 11:10:25 +0800 Subject: [PATCH 01/53] sonar --- sonar-project.properties => sonar-dev-project.properties | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sonar-project.properties => sonar-dev-project.properties (100%) diff --git a/sonar-project.properties b/sonar-dev-project.properties similarity index 100% rename from sonar-project.properties rename to sonar-dev-project.properties From 89988a785f10b2606e4ffce9d291407903e24386 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 2 Dec 2016 14:28:41 +0800 Subject: [PATCH 02/53] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B8=80=E9=A1=B9?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E9=85=8D=E7=BD=AE?= 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_zh_CN.properties | 1 - designer_base/src/com/fr/design/locale/designer_zh_TW.properties | 1 - 4 files changed, 4 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 34e998867c..f2344274ad 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -357,7 +357,6 @@ FR-Designer_KeyPoint=KeyPoint FR-Designer_loadedTreeModel=loadedTreeModel FR-Designer-Failed_to_load_the_plugin=Failed to load the plugin\uFF0Cplease update the plugin\: FR-Designer-Plugin_Please_Update_Jar= -FR-Designer-Invalid_Page_Number=Invalid Page Number FR-Designer_XMLA_Database=Database FR-Designer_XMLA_UserName=User name FR-Designer_XMLA_Password=Password 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 91b97a86c1..a4bdd6d102 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 @@ -358,7 +358,6 @@ FR-Designer_KeyPoint=KeyPoint FR-Designer_loadedTreeModel=loadedTreeModel FR-Designer-Failed_to_load_the_plugin=Failed to load the plugin\uFF0Cplease update the plugin\: FR-Designer-Plugin_Please_Update_Jar=Please Update Jar -FR-Designer-Invalid_Page_Number=Invalid Page Number FR-Designer_XMLA_Database=DB FR-Designer_XMLA_UserName=User name FR-Designer_XMLA_Password=Password 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 a849a9b480..97593c2e62 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 @@ -358,7 +358,6 @@ FR-Designer_KeyPoint=\u5173\u952E\u8282\u70B9 FR-Designer_loadedTreeModel=\u52A0\u8F7D\u5931\u8D25,\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5 FR-Designer-Failed_to_load_the_plugin=\u65E0\u6CD5\u52A0\u8F7D\u63D2\u4EF6\uFF0C\u8BF7\u66F4\u65B0\u63D2\u4EF6\uFF1A FR-Designer-Plugin_Please_Update_Jar=\u8BF7\u66F4\u65B0Jar\u5305, \u63D2\u4EF6\u9700\u6C42\u6700\u4F4E\u7248\u672C -FR-Designer-Invalid_Page_Number=\u65E0\u6548\u9875\u7801 FR-Designer_Get-CubeGetting=\u83B7\u53D6cube FR-Designer_XMLA_Database=\u6570\u636E\u5E93 FR-Designer_XMLA_UserName=\u7528\u6237\u540D 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 2e05b1790b..c6ce111a63 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 @@ -357,7 +357,6 @@ FR-Designer_KeyPoint=\u95DC\u9375\u7BC0\u9EDE FR-Designer_loadedTreeModel=\u52A0\u8F09\u5931\u6557,\u8ACB\u6AA2\u67E5\u5F8C\u91CD\u8A66 FR-Designer-Failed_to_load_the_plugin=\u7121\u6CD5\u52A0\u8F09\u63D2\u4EF6\uFF0C\u8ACB\u66F4\u65B0\u63D2\u4EF6\uFF1A FR-Designer-Plugin_Please_Update_Jar=\u8ACB\u66F4\u65B0Jar\u5305, \u63D2\u4EF6\u9700\u6C42\u6700\u4F4E\u7248\u672C -FR-Designer-Invalid_Page_Number=\u7121\u6548\u9801\u78BC FR-Designer_Get-CubeGetting=\u7372\u53D6cube FR-Designer_XMLA_Database=\u8CC7\u6599\u5EAB FR-Designer_XMLA_UserName=\u5E33\u865F From 91d568444d5b3d1969b382dd1606d439b1499e20 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 2 Dec 2016 15:22:41 +0800 Subject: [PATCH 03/53] =?UTF-8?q?REPORT-875=20=E9=87=8D=E5=90=AF=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E4=B9=8B=E5=89=8D=EF=BC=8C=E5=85=88=E4=BF=9D?= =?UTF-8?q?=E5=AD=98xml=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/actions/file/PreferencePane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_base/src/com/fr/design/actions/file/PreferencePane.java b/designer_base/src/com/fr/design/actions/file/PreferencePane.java index 30628c3f14..3407b6ccac 100644 --- a/designer_base/src/com/fr/design/actions/file/PreferencePane.java +++ b/designer_base/src/com/fr/design/actions/file/PreferencePane.java @@ -644,6 +644,7 @@ public class PreferencePane extends BasicPane { null ); if (rv == JOptionPane.OK_OPTION) { + DesignerEnvManager.getEnvManager().saveXMLFile(); RestartHelper.restart(); } } From 8ffbc6c4f168054165ff647f7d745d703a87207e Mon Sep 17 00:00:00 2001 From: kerry Date: Sun, 4 Dec 2016 00:14:03 +0800 Subject: [PATCH 04/53] =?UTF-8?q?REPORT-849=20=E5=AD=98=E5=82=A8=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E7=AA=97=E5=8F=A3=E4=B9=9F=E8=A6=81=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=8B=96=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/ProcedureDataPane.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java index 19cb45fcad..600481428e 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java @@ -11,13 +11,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.BoxLayout; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JToolBar; -import javax.swing.SwingWorker; +import javax.swing.*; import com.fr.base.BaseUtils; import com.fr.base.FRContext; @@ -45,6 +39,7 @@ import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ToolBarDef; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.DatasourceManager; import com.fr.general.Inter; import com.fr.script.Calculator; @@ -119,8 +114,13 @@ public class ProcedureDataPane extends AbstractTableDataPane imp // 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table initconnectionTableProcedurePane(); this.setLayout(new BorderLayout(4, 4)); - this.add(connectionTableProcedurePane, BorderLayout.WEST); - this.add(sqlSplitPane, BorderLayout.CENTER); + connectionTableProcedurePane.setMinimumSize(new Dimension(155, 500)); + box.setMinimumSize(new Dimension(310, 400)); + // 使用SplitPane + JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane); + mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor())); + mainSplitPane.setOneTouchExpandable(true); + this.add(mainSplitPane, BorderLayout.CENTER); } private void initconnectionTableProcedurePane() { From c5f8285eab974a6a7994476f8652f1ad30edf3ec Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 7 Dec 2016 10:25:44 +0800 Subject: [PATCH 05/53] =?UTF-8?q?REPORT-875=20=E4=BF=AE=E5=A4=8D=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E9=87=8D=E5=90=AF=E6=97=B6=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E4=BF=9D=E5=AD=98xml=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferenceAction.java | 1 + .../design/actions/file/PreferencePane.java | 39 ++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/file/PreferenceAction.java b/designer_base/src/com/fr/design/actions/file/PreferenceAction.java index f3f5ef3250..71c25837db 100644 --- a/designer_base/src/com/fr/design/actions/file/PreferenceAction.java +++ b/designer_base/src/com/fr/design/actions/file/PreferenceAction.java @@ -38,6 +38,7 @@ public class PreferenceAction extends UpdateAction { DesignerEnvManager.getEnvManager().saveXMLFile(); JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); jt.refreshToolArea(); + preferencePane.showRestartDialog(); } }); diff --git a/designer_base/src/com/fr/design/actions/file/PreferencePane.java b/designer_base/src/com/fr/design/actions/file/PreferencePane.java index 3407b6ccac..965cf415a0 100644 --- a/designer_base/src/com/fr/design/actions/file/PreferencePane.java +++ b/designer_base/src/com/fr/design/actions/file/PreferencePane.java @@ -83,6 +83,8 @@ public class PreferencePane extends BasicPane { }; private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言 + private boolean languageChanged; // 是否修改了设计器语言设置 + //设置是否支持undo private UICheckBox supportUndoCheckBox; //设置最大撤销次数 @@ -627,26 +629,35 @@ public class PreferencePane extends BasicPane { return l; } + // 如果语言设置改变了,则显示重启对话框 + public void showRestartDialog() { + if (!languageChanged) { + return; + } + int rv = JOptionPane.showOptionDialog( + null, + Inter.getLocText("FR-Designer_Language_Change_Successful"), + Inter.getLocText("FR-Designer-Plugin_Warning"), + JOptionPane.YES_NO_OPTION, + JOptionPane.INFORMATION_MESSAGE, + null, + new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, + null + ); + if (rv == JOptionPane.OK_OPTION) { + RestartHelper.restart(); + } + } + @Override public BasicDialog showWindow(Window window) { return showWindow(window, new DialogActionAdapter() { @Override public void doOk() { if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) { - int rv = JOptionPane.showOptionDialog( - null, - Inter.getLocText("FR-Designer_Language_Change_Successful"), - Inter.getLocText("FR-Designer-Plugin_Warning"), - JOptionPane.YES_NO_OPTION, - JOptionPane.INFORMATION_MESSAGE, - null, - new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, - null - ); - if (rv == JOptionPane.OK_OPTION) { - DesignerEnvManager.getEnvManager().saveXMLFile(); - RestartHelper.restart(); - } + languageChanged = true; + } else { + languageChanged = false; } } }); From 1a9ba5337ddb7dc391b3f81db774103073e85b35 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Wed, 7 Dec 2016 17:18:32 +0800 Subject: [PATCH 06/53] =?UTF-8?q?REPORT-677=20=E5=88=A0=E9=99=A4=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E9=83=A8=E5=88=86=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原因:1.因为和之前的js那边的方法名一致,参数不同,经常会出现方法名那边找错了,导致登陆触发不完善。 2.主要是方法名和参数的问题,js那边虽然写死了带回调的,但是java这边感觉像是bug,走不到应该回调的地方。 --- .../src/com/fr/design/extra/PluginWebBridge.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginWebBridge.java b/designer_base/src/com/fr/design/extra/PluginWebBridge.java index 15bd72c09c..12c3e85c41 100644 --- a/designer_base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/PluginWebBridge.java @@ -529,17 +529,6 @@ public class PluginWebBridge { return LoginWebBridge.getHelper().pluginManageLogin(username, password, uiLabel); } - /** - * 插件管理部分的登陆的回调处理 - * @param username - * @param password - * @param callback - */ - public void defaultLogin(String username, String password, final JSObject callback) { - Task task = new PluginTask<>(webEngine, callback, new PluginLoginExecutor(username, password, uiLabel)); - new Thread(task).start(); - } - /** * 弹出QQ授权页面 */ @@ -556,4 +545,4 @@ public class PluginWebBridge { DesignerEnvManager.getEnvManager().setInShowBBsName(StringUtils.EMPTY); uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); } -} \ No newline at end of file +} From 84fb0c0013b75000a359213bb7c939808047e4ce Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 7 Dec 2016 17:46:52 +0800 Subject: [PATCH 07/53] =?UTF-8?q?REPORT-962=20=E8=8B=B1=E6=96=87=E7=89=88?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=98=AF=E6=B2=A1=E6=9C=89=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86=E7=95=8C=E9=9D=A2=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E6=96=B9=E5=BC=8F=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../freeze/RepeatAndFreezeSettingPane.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 8e70675eee..46bc378ae8 100644 --- a/designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -8,12 +8,14 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import com.fr.base.FRContext; import com.fr.design.dialog.BasicPane; import com.fr.design.extra.WebDialog; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.env.RemoteEnv; import com.fr.general.Inter; import com.fr.page.ReportPageAttrProvider; import com.fr.stable.ColumnRow; @@ -211,13 +213,13 @@ public class RepeatAndFreezeSettingPane extends BasicPane { JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); //自适应插件 - JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Attention")); - - BoxCenterAligmentPane actionLabel = getURLActionLabel(Inter.getLocText("FR-Designer_Form-Fit-Tip")); - infoPane.add(actionLabel, BorderLayout.SOUTH); - + if (shouldShowTip()) { + JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Attention")); + BoxCenterAligmentPane actionLabel = getURLActionLabel(Inter.getLocText("FR-Designer_Form-Fit-Tip")); + infoPane.add(actionLabel, BorderLayout.SOUTH); + this.add(infoPane, BorderLayout.SOUTH); + } outfreezePanel.add(freezePanel); - this.add(infoPane, BorderLayout.SOUTH); // 重复打印部分 // 重复打印标题的起始行 JPanel labelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); @@ -241,6 +243,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane { initWriteListener(); } + private boolean shouldShowTip() { + return !(FRContext.getCurrentEnv() instanceof RemoteEnv) && FRContext.isChineseEnv(); + } + protected void initWriteListener() { // 填报重复冻结行 useWriteFrozenCCheckBox.addChangeListener(useWriteFrozenCListener); From 4de95932548857b9d40d7540468bb7310356742d Mon Sep 17 00:00:00 2001 From: zhouping Date: Wed, 7 Dec 2016 20:56:09 +0800 Subject: [PATCH 08/53] =?UTF-8?q?REPORT-1092=20=E4=B8=A4=E4=B8=AA=E4=B8=80?= =?UTF-8?q?=E6=A0=B7=E7=9A=84=E8=A1=A8=E5=8D=95demo=EF=BC=8C=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E7=9A=84=E6=95=88=E6=9E=9C=E4=B8=8D=E4=B8=80=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XWAbsoluteLayout.java | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java index df28759393..98e06ebac0 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -96,7 +96,6 @@ public class XWAbsoluteLayout extends XLayoutContainer { if(screenValue != FormArea.DEFAULT_SLIDER){ this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER); } - widget.setDesigningResolution(scrnsize); } /** @@ -208,7 +207,33 @@ public class XWAbsoluteLayout extends XLayoutContainer { } } } - + + /** + * 更新子组件的Bound + * 这边主要用于绝对布局子组件在适应区域选项时 + * 涉及到的不同分辨率下缩放 + * @param minHeight 最小高度 + */ + @Override + public void updateChildBound(int minHeight) { + double prevContainerPercent = FRScreen.getByDimension(toData().getDesigningResolution()).getValue() / FormArea.DEFAULT_SLIDER; + if (toData().getCompState() == 0 && prevContainerPercent != containerPercent) { + for (int i = 0; i < this.getComponentCount(); i++) { + XCreator creator = getXCreator(i); + Rectangle rec = new Rectangle(creator.getBounds()); + rec.x = (int)(rec.x / prevContainerPercent * containerPercent); + rec.y = (int)(rec.y / prevContainerPercent * containerPercent); + rec.height = (int)(rec.height / prevContainerPercent * containerPercent); + rec.width = (int)(rec.width / prevContainerPercent * containerPercent); + BoundsWidget wgt = toData().getBoundsWidget(creator.toData()); + wgt.setBounds(rec); + creator.setBounds(rec); + creator.updateChildBound(minHeight); + } + } + toData().setDesigningResolution(Toolkit.getDefaultToolkit().getScreenSize()); + } + /** * 增加对齐线 * @param connector 对齐线 From 8e85275a38abb51e8b7c57f58698b9f92e158b53 Mon Sep 17 00:00:00 2001 From: zhouping Date: Wed, 7 Dec 2016 21:00:27 +0800 Subject: [PATCH 09/53] =?UTF-8?q?REPORT-1092=20=E4=B8=A4=E4=B8=AA=E4=B8=80?= =?UTF-8?q?=E6=A0=B7=E7=9A=84=E8=A1=A8=E5=8D=95demo=EF=BC=8C=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E7=9A=84=E6=95=88=E6=9E=9C=E4=B8=8D=E4=B8=80=E6=A0=B7?= =?UTF-8?q?=20pmd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/designer/creator/XWAbsoluteLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java index 98e06ebac0..06ae6fa785 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -443,7 +443,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { ); g2d.setColor(Color.BLACK); //画编辑文字 - g2d.drawString(Inter.getLocText("Edit"), x + w / 2 - 2, y + h / 2 + 5); + g2d.drawString(Inter.getLocText("FR-Designer_Edit"), x + w / 2 - 2, y + h / 2 + 5); } } From f2c35e950082e243fe5ae6d2457f67caffa28ddc Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Thu, 8 Dec 2016 11:20:49 +0800 Subject: [PATCH 10/53] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A0=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=98=AF=E5=90=A6=E5=8F=AF=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/icombobox/FRTreeComboBox.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java b/designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java index a609422292..ed8ffb16c7 100644 --- a/designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java +++ b/designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java @@ -91,6 +91,15 @@ public class FRTreeComboBox extends UIComboBox { return this.tree; } + /** + * 自定义那些那些node可以选中,默认情况下所有node节点都可以选中 + * @param node + * @return + */ + protected boolean customSelectable(DefaultMutableTreeNode node){ + return true; + } + public void setTree(JTree tree) { this.tree = tree; if (tree != null) { @@ -403,6 +412,12 @@ public class FRTreeComboBox extends UIComboBox { if (comboBox.onlyLeafSelectable && !node.isLeaf()) { return; } + + //自定义node是否可选择 + if (!comboBox.customSelectable(node)){ + return; + } + comboBox.setSelectedItem(treePath); togglePopup(); MenuSelectionManager.defaultManager().clearSelectedPath(); From e6b1142de70454bb6e00ab1d79604660bfedb094 Mon Sep 17 00:00:00 2001 From: zhouping Date: Thu, 8 Dec 2016 17:26:45 +0800 Subject: [PATCH 11/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=9D=E5=AF=B9=E5=B8=83=E5=B1=80=E5=B5=8C?= =?UTF-8?q?=E5=A5=97=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/FRAbsoluteLayoutAdapter.java | 71 ++++++++++--------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index 3ab61eb38b..6e68cc2d71 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -67,38 +67,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator)comp).getTopLayout(); if(topLayout != null){ if (topLayout.isEditable()){ - //判断有没有和当前控件重叠 - //先计算当前控件的位置 - int creatorX, creatorY; - if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { - - Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); - creatorX = creatorRectangle.x; - creatorY = creatorRectangle.y; - } else { - int w = creator.getWidth() / 2; - int h = creator.getHeight() / 2; - creatorX = x - w; - creatorY = y - h; - } - //再判断和布局中其他控件重叠 - Rectangle curRec = new Rectangle(creatorX, creatorY, creator.getWidth(), creator.getHeight()); - WAbsoluteLayout wAbsoluteLayout = (WAbsoluteLayout)topLayout.toData(); - for (int i = 0, count = wAbsoluteLayout.getWidgetCount(); i < count; i++) { - WAbsoluteLayout.BoundsWidget temp = (WAbsoluteLayout.BoundsWidget) wAbsoluteLayout.getWidget(i); - Rectangle rectangle = temp.getBounds(); - if (curRec.intersects(rectangle)){ - return false; - } - } - if (creatorX < 0 - || creatorX + creator.getWidth() > container.getWidth() - || creatorY < 0 - || creatorY + creator.getHeight() > container.getHeight()) { - return false; - } - return x >= 0 && y >= 0 && creator.getHeight() <= container.getHeight() - && creator.getWidth() <= container.getWidth(); + return topLayoutAccept(creator, x, y, topLayout); } //绝对布局嵌套,处于内层,不可编辑,不添加,topLayout只能获取到最外层可编辑的布局 else if (((XLayoutContainer)topLayout.getParent()).acceptType(XWAbsoluteLayout.class)) { @@ -115,6 +84,42 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { return false; } + //toplayout假如可以编辑的话就往里面添加组件 + private boolean topLayoutAccept(XCreator creator, int x, int y, XLayoutContainer topLayout) { + //判断有没有和当前控件重叠 + //先计算当前控件的位置 + int creatorX, creatorY; + if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { + + Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); + creatorX = creatorRectangle.x; + creatorY = creatorRectangle.y; + } else { + int w = creator.getWidth() / 2; + int h = creator.getHeight() / 2; + creatorX = x - w; + creatorY = y - h; + } + //再判断和布局中其他控件重叠 + Rectangle curRec = new Rectangle(creatorX, creatorY, creator.getWidth(), creator.getHeight()); + WAbsoluteLayout wAbsoluteLayout = (WAbsoluteLayout)topLayout.toData(); + for (int i = 0, count = wAbsoluteLayout.getWidgetCount(); i < count; i++) { + WAbsoluteLayout.BoundsWidget temp = (WAbsoluteLayout.BoundsWidget) wAbsoluteLayout.getWidget(i); + Rectangle rectangle = temp.getBounds(); + if (curRec.intersects(rectangle)){ + return false; + } + } + if (creatorX < 0 || creatorX + creator.getWidth() > container.getWidth()) { + return false; + } + if (creatorY < 0 || creatorY + creator.getHeight() > container.getHeight()){ + return false; + } + return x >= 0 && y >= 0 && creator.getHeight() <= container.getHeight() + && creator.getWidth() <= container.getWidth(); + } + /** * 判断是否鼠标在组件的三等分区域,如果组件在布局管理器中间,上下左右都可能会三等分 * @param parentComp 鼠标所在区域的组件 @@ -156,6 +161,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { return !ComparatorUtils.equals(trisectAreaDirect, 0); } + //当前绝对布局不可编辑,就当成一个控件,组件添加在周围 private boolean acceptWidget(XCreator creator, int x, int y){ isFindRelatedComps = false; //拖入组件判断时,先判断是否为交叉点区域,其次三等分区域,再次平分区域 @@ -235,6 +241,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { } XWAbsoluteLayout layout = (XWAbsoluteLayout) container; layout.updateBoundsWidget(creator); + updateCreatorBackBound(); LayoutUtils.layoutRootContainer(container); }else{ fixAbsolute(creator, x, y); From 7a1ba002e3942eb44c53c825beb70384d5dc1d00 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Fri, 9 Dec 2016 15:34:08 +0800 Subject: [PATCH 12/53] =?UTF-8?q?REPORT-1147=20=E8=84=9A=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 最初是为了解决,插件更新和安装下会出现plugin的数组读取两遍的问题,所以在哪个地方加个强制的判断,当时的解决方案是可为两个,还有一个是在脚本 中加入sort处理。后来vito那边找到出现问题的核心点,在于pane部分加载两次,导致脚本数组加载两次,那这边的就去掉这边的判断,因为会导致脚 本更新问题。 --- designer_base/src/com/fr/design/extra/PluginHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index ecaa34ea00..1f9cdc7c15 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -48,9 +48,11 @@ public class PluginHelper { * @param p 下载百分比处理 */ public static void downloadPluginFile(String id, String username, String password, Process p) throws Exception { + /* if (!PluginHelper.invalidUser(id, username, password)) { return; } + */ HttpClient httpClient = new HttpClient(getDownloadPath(id, username, password)); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { int totalSize = httpClient.getContentLength(); @@ -353,4 +355,4 @@ public class PluginHelper { } private static final int TIME_OUT = 5000; -} \ No newline at end of file +} From 065ba517f098c37611d14f486eff8bd4de423fcb Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Fri, 9 Dec 2016 15:52:02 +0800 Subject: [PATCH 13/53] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E7=95=8C=E9=9D=A2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/report/ReportParameterAction.java | 9 ++++++++- designer/src/com/fr/design/mainframe/JWorkBook.java | 12 ++++++++---- designer_base/src/com/fr/design/dialog/UIDialog.java | 1 + .../src/com/fr/design/mainframe/JTemplate.java | 4 ++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportParameterAction.java b/designer/src/com/fr/design/actions/report/ReportParameterAction.java index 61507ebfea..41ed08318a 100644 --- a/designer/src/com/fr/design/actions/report/ReportParameterAction.java +++ b/designer/src/com/fr/design/actions/report/ReportParameterAction.java @@ -10,6 +10,8 @@ import javax.swing.SwingUtilities; import com.fr.base.BaseUtils; import com.fr.base.Parameter; import com.fr.design.actions.JWorkBookAction; +import com.fr.design.event.UIObserverListener; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; @@ -21,7 +23,9 @@ import com.fr.main.parameter.ReportParameterAttr; /** * Report Parameter */ -public class ReportParameterAction extends JWorkBookAction { +public class ReportParameterAction extends JWorkBookAction{ + + private UIObserverListener uiObserverListener = null; public ReportParameterAction(JWorkBook jwb) { super(jwb); @@ -62,6 +66,9 @@ public class ReportParameterAction extends JWorkBookAction { jwb.fireTargetModified(); jwb.updateReportParameterAttr(); jwb.populateReportParameterAttr(); + + //点击确定会后,需要出发插件界面的更新 + HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireElementCasePane(); } }); parameterArrayDialog.setVisible(true); diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index f3722c4ac2..909581092d 100644 --- a/designer/src/com/fr/design/mainframe/JWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JWorkBook.java @@ -743,10 +743,7 @@ public class JWorkBook extends JTemplate { } EastRegionContainerPane.getInstance().replaceUpPane(QuickEditorRegion.getInstance()); } else { - ElementCasePane casePane = ((ReportComponent) delegate4ToolbarMenuAdapter()).elementCasePane; - if (casePane != null) { - casePane.fireSelectionChangeListener(); - } + fireElementCasePane(); } } if (BaseUtils.isAuthorityEditing()) { @@ -757,6 +754,13 @@ public class JWorkBook extends JTemplate { centerPane.needToShowCoverAndHidPane(); } + public void fireElementCasePane() { + ElementCasePane casePane = ((ReportComponent) delegate4ToolbarMenuAdapter()).elementCasePane; + if (casePane != null) { + casePane.fireSelectionChangeListener(); + } + } + @Override /** * diff --git a/designer_base/src/com/fr/design/dialog/UIDialog.java b/designer_base/src/com/fr/design/dialog/UIDialog.java index 7ba10164ba..b7c3bc2997 100644 --- a/designer_base/src/com/fr/design/dialog/UIDialog.java +++ b/designer_base/src/com/fr/design/dialog/UIDialog.java @@ -1,6 +1,7 @@ package com.fr.design.dialog; import com.fr.base.FRContext; +import com.fr.design.event.UIObserver; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index 58060d91a9..78ec115b37 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -325,6 +325,10 @@ public abstract class JTemplate> ex fireSuperTargetModified(); } + public void fireElementCasePane(){ + return; + } + protected boolean accept(Object o){ return true; } From 04839878cb89dfda1e6fea8984f1a4b5b7dae9d3 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Fri, 9 Dec 2016 15:53:30 +0800 Subject: [PATCH 14/53] update --- .../com/fr/design/actions/report/ReportParameterAction.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportParameterAction.java b/designer/src/com/fr/design/actions/report/ReportParameterAction.java index 41ed08318a..d05fbd5ca1 100644 --- a/designer/src/com/fr/design/actions/report/ReportParameterAction.java +++ b/designer/src/com/fr/design/actions/report/ReportParameterAction.java @@ -10,7 +10,6 @@ import javax.swing.SwingUtilities; import com.fr.base.BaseUtils; import com.fr.base.Parameter; import com.fr.design.actions.JWorkBookAction; -import com.fr.design.event.UIObserverListener; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; @@ -25,8 +24,6 @@ import com.fr.main.parameter.ReportParameterAttr; */ public class ReportParameterAction extends JWorkBookAction{ - private UIObserverListener uiObserverListener = null; - public ReportParameterAction(JWorkBook jwb) { super(jwb); this.setMenuKeySet(KeySetUtils.REPORT_PARAMETER_ATTR); From d4e041f4f66913df18466ddff8c0d48e51ddced9 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Fri, 9 Dec 2016 15:54:04 +0800 Subject: [PATCH 15/53] update --- designer_base/src/com/fr/design/dialog/UIDialog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer_base/src/com/fr/design/dialog/UIDialog.java b/designer_base/src/com/fr/design/dialog/UIDialog.java index b7c3bc2997..7ba10164ba 100644 --- a/designer_base/src/com/fr/design/dialog/UIDialog.java +++ b/designer_base/src/com/fr/design/dialog/UIDialog.java @@ -1,7 +1,6 @@ package com.fr.design.dialog; import com.fr.base.FRContext; -import com.fr.design.event.UIObserver; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; From 75eb75123acef6bdc7827556eb063a49567e065a Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 9 Dec 2016 17:39:27 +0800 Subject: [PATCH 16/53] =?UTF-8?q?REPORT-912=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9B=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/editor/ValueEditorPane.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/designer_base/src/com/fr/design/editor/ValueEditorPane.java b/designer_base/src/com/fr/design/editor/ValueEditorPane.java index 5efaf5d576..0a7600e2f4 100644 --- a/designer_base/src/com/fr/design/editor/ValueEditorPane.java +++ b/designer_base/src/com/fr/design/editor/ValueEditorPane.java @@ -106,6 +106,15 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName return currentEditor; } + public int getCurrentEditorIndex() { + for (int i = 0;i < cards.length; i++){ + if (cards[i].getClass() == currentEditor.getClass()){ + return i; + } + } + return 0; + } + public void setCurrentEditor(int i) { this.add(arrowButton, BorderLayout.WEST); currentEditor = this.cards[i]; From e6bc21d46b0e38501341f0ddd40642ea866b62b4 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Mon, 12 Dec 2016 09:27:46 +0800 Subject: [PATCH 17/53] 1 1 --- designer_base/src/com/fr/design/extra/PluginHelper.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index 1f9cdc7c15..02f3680328 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -48,11 +48,6 @@ public class PluginHelper { * @param p 下载百分比处理 */ public static void downloadPluginFile(String id, String username, String password, Process p) throws Exception { - /* - if (!PluginHelper.invalidUser(id, username, password)) { - return; - } - */ HttpClient httpClient = new HttpClient(getDownloadPath(id, username, password)); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { int totalSize = httpClient.getContentLength(); From f28682f0865bdec3aca99919455d069d09db73e2 Mon Sep 17 00:00:00 2001 From: zhouping Date: Mon, 12 Dec 2016 15:50:59 +0800 Subject: [PATCH 18/53] =?UTF-8?q?REPORT-884=20=E7=BB=9D=E5=AF=B9=E5=B8=83?= =?UTF-8?q?=E5=B1=80=EF=BC=8C=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E5=8F=AF=E4=BB=A5=E6=8B=96=E5=88=B0=E4=B8=8B=E9=9D=A2?= =?UTF-8?q?=E4=B8=8E=E7=BB=84=E4=BB=B6=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/adapters/layout/FRAbsoluteLayoutAdapter.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index 6e68cc2d71..3d53eab015 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -60,6 +60,13 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { if (comp == null){ return false; } + //参数面板内的组件不允许拖往绝对布局中 + if (creator.getParent() != null && ((XCreator)creator.getParent()).acceptType(XWParameterLayout.class)){ + Rectangle rec = creator.getBounds(); + rec.y = creator.getParent().getHeight() - rec.height; + creator.setBounds(rec); + return false; + } //判断下组件能不能拖入绝对布局 if (!creator.canEnterIntoAbsolutePane()){ return false; From 779b71ee28e23c62b3c8b2f8c6e6a7f09faf1432 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 13 Dec 2016 14:08:58 +0800 Subject: [PATCH 19/53] =?UTF-8?q?REPORT-1097=20=E8=B6=85=E9=93=BE=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=9C=A8=E5=B9=B3=E5=8F=B0=E5=86=85=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/frpane/HyperlinkGroupPane.java | 17 ++++--- .../hyperlink/AbstractHyperlinkPane.java | 49 +++++++++++++------ .../hyperlink/ReportletHyperlinkPane.java | 25 +++++++++- .../fr/design/hyperlink/WebHyperlinkPane.java | 32 ++++++++++++ 4 files changed, 100 insertions(+), 23 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java b/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java index 4d1028e784..112fa54dc2 100644 --- a/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java @@ -13,12 +13,12 @@ import com.fr.js.JavaScript; import com.fr.js.NameJavaScript; import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.PluginManager; -import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import java.util.ArrayList; -import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.TreeMap; /** * 超级链接 界面. @@ -34,23 +34,26 @@ public class HyperlinkGroupPane extends JListControlPane { * @return 返回Nameable按钮数组. */ public NameableCreator[] createNameableCreators() { + Map nameCreators = new TreeMap(); NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators(); + for (NameableCreator creator : creators) { + nameCreators.put(creator.menuName(), creator); + } PluginManager.getInstance().setExtensionPoint(HyperlinkPluginAction.XML_TAG); ArrayList templateArrayLisy = PluginManager.getInstance().getResultList(); // if (templateArrayLisy.isEmpty()) { // return creators; // } - NameableCreator[] pluginCreators = new NameableCreator[templateArrayLisy.size()]; for (int i = 0; i < templateArrayLisy.size(); i++) { - pluginCreators[i] = ((HyperlinkPluginAction) templateArrayLisy.get(i)).getHyperlinkCreator(); + NameableCreator nameableCreator = ((HyperlinkPluginAction) templateArrayLisy.get(i)).getHyperlinkCreator(); + nameCreators.put(nameableCreator.menuName(), nameableCreator); } Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); - List creatorList = new ArrayList(); for (HyperlinkProvider provider : providers) { NameableCreator nc = provider.createHyperlinkCreator(); - creatorList.add(nc); + nameCreators.put(nc.menuName(), nc); } - return ArrayUtils.addAll(creatorList.toArray(new NameableCreator[creatorList.size()]), ArrayUtils.addAll(creators, pluginCreators)); + return nameCreators.values().toArray(new NameableCreator[nameCreators.size()]); } /** diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index 36297d1656..311eaf7d94 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -1,27 +1,19 @@ package com.fr.design.hyperlink; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.DefaultListCellRenderer; - -import com.fr.design.gui.ilable.UILabel; - -import javax.swing.JList; -import javax.swing.JPanel; - import com.fr.base.Utils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import com.fr.js.Hyperlink; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + public abstract class AbstractHyperlinkPane extends BasicBeanPane { public static final int NEW_WINDOW = 0; public static final int DIALOG = 1; @@ -46,7 +38,7 @@ public abstract class AbstractHyperlinkPane extends BasicBe headerPane = this.setHeaderPanel(); this.add(headerPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); - targetFrameComboBox = new UIComboBox(new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}); + targetFrameComboBox = new UIComboBox(getTargetFrames()); targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); @@ -86,6 +78,9 @@ public abstract class AbstractHyperlinkPane extends BasicBe this.add(this.setFootPanel(), BorderLayout.SOUTH); } + protected String[] getTargetFrames(){ + return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}; + } protected abstract JPanel setHeaderPanel(); @@ -93,6 +88,30 @@ public abstract class AbstractHyperlinkPane extends BasicBe protected abstract void populateSubHyperlinkBean(T link); + public UIComboBox getTargetFrameComboBox() { + return targetFrameComboBox; + } + + public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { + this.targetFrameComboBox = targetFrameComboBox; + } + + public UINumberField getHeightTextFiled() { + return heightTextFiled; + } + + public void setHeightTextFiled(UINumberField heightTextFiled) { + this.heightTextFiled = heightTextFiled; + } + + public UINumberField getWidthTextFiled() { + return widthTextFiled; + } + + public void setWidthTextFiled(UINumberField widthTextFiled) { + this.widthTextFiled = widthTextFiled; + } + @Override public void populateBean(T link) { String name = link.getTargetFrame(); diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 1cdb3dcbb5..2664a746c9 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -104,7 +104,7 @@ public class ReportletHyperlinkPane extends BasicBeanPane { } - private class HyperlinkParametersAction extends UITableEditAction { + protected class HyperlinkParametersAction extends UITableEditAction { public HyperlinkParametersAction() { this.setName(Inter.getLocText(new String[]{"Reportlet", "Parameter"})); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif")); @@ -207,4 +207,27 @@ public class ReportletHyperlinkPane extends BasicBeanPane { } } + public ReporletHyperNorthPane getNorthPane() { + return northPane; + } + + public void setNorthPane(ReporletHyperNorthPane northPane) { + this.northPane = northPane; + } + + public ReportletParameterViewPane getParameterViewPane() { + return parameterViewPane; + } + + public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) { + this.parameterViewPane = parameterViewPane; + } + + public UICheckBox getExtendParametersCheckBox() { + return extendParametersCheckBox; + } + + public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) { + this.extendParametersCheckBox = extendParametersCheckBox; + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index 88bff48fb7..72a68baa9d 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -167,4 +167,36 @@ public class WebHyperlinkPane extends BasicBeanPane { return ParameterTableModel.CHART_METER_USE; } } + + public WebHyperNorthPane getNorthPane() { + return northPane; + } + + public void setNorthPane(WebHyperNorthPane northPane) { + this.northPane = northPane; + } + + public ReportletParameterViewPane getParameterViewPane() { + return parameterViewPane; + } + + public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) { + this.parameterViewPane = parameterViewPane; + } + + public UICheckBox getUseCJKCheckBox() { + return useCJKCheckBox; + } + + public void setUseCJKCheckBox(UICheckBox useCJKCheckBox) { + this.useCJKCheckBox = useCJKCheckBox; + } + + public UICheckBox getExtendParametersCheckBox() { + return extendParametersCheckBox; + } + + public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) { + this.extendParametersCheckBox = extendParametersCheckBox; + } } \ No newline at end of file From 3ae0adb1c0e8c54e9b3f0750acb208e204f47421 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 13 Dec 2016 14:11:20 +0800 Subject: [PATCH 20/53] REPORT-1097 pmd --- designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index 72a68baa9d..fda40217bd 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -40,7 +40,7 @@ public class WebHyperlinkPane extends BasicBeanPane { parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); this.add(parameterViewPane, BorderLayout.CENTER); - parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"), null)); + parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameters"), null)); useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter")); extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters")); From 72cb528a7736faead65cbea29be7e96d3d14b133 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 13 Dec 2016 15:11:59 +0800 Subject: [PATCH 21/53] ct --- .../design/actions/file/PreferencePane.java | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/file/PreferencePane.java b/designer_base/src/com/fr/design/actions/file/PreferencePane.java index bae1414524..965cf415a0 100644 --- a/designer_base/src/com/fr/design/actions/file/PreferencePane.java +++ b/designer_base/src/com/fr/design/actions/file/PreferencePane.java @@ -1,11 +1,13 @@ package com.fr.design.actions.file; import com.fr.base.BaseUtils; +import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.DialogActionListener; import com.fr.design.editor.editor.IntegerEditor; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIButton; @@ -29,9 +31,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.File; -import java.util.ArrayList; import java.util.Locale; -import java.util.Map; /** * 选项对话框 @@ -72,19 +72,19 @@ public class PreferencePane extends BasicPane { private static final String DISPLAY_EQUALS = "+"; private static final String MINUS = "MINUS"; private static final String DISPLAY_MINUS = "-"; - + private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG}; - private static java.util.List LANGUAGE = new ArrayList<>(); - static { - Map map = Inter.getSupportLocaleMap(); - LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default")); - for(Locale locale : map.keySet()){ - LANGUAGE.add(getLocaledLanguage(map.get(locale), locale)); - } + private static final String[] LANGUAGE = {Inter.getLocText("FR-Designer_Language_Default"), + getLocaledLanguage("Simplified_Chinese_Language", Locale.SIMPLIFIED_CHINESE), + getLocaledLanguage("English_Language", Locale.ENGLISH), + getLocaledLanguage("Japanese_Language", Locale.JAPAN), + getLocaledLanguage("Traditional_Chinese_Language", Locale.TRADITIONAL_CHINESE), + getLocaledLanguage("Korea_Language",Locale.KOREA), }; - private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言 + private boolean languageChanged; // 是否修改了设计器语言设置 + //设置是否支持undo private UICheckBox supportUndoCheckBox; //设置最大撤销次数 @@ -154,7 +154,7 @@ public class PreferencePane extends BasicPane { JPanel oraclePane = FRGUIPaneFactory.createTitledBorderPane("Oracle" + Inter.getLocText("FR-Designer_Oracle_All_Tables")); oracleSpace = new UICheckBox(Inter.getLocText(message, sign)); oraclePane.add(oracleSpace); - + JPanel improvePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Product_improve")); joinProductImprove = new UICheckBox(Inter.getLocText("FR-Designer_Join_Product_improve")); improvePane.add(joinProductImprove); @@ -164,12 +164,12 @@ public class PreferencePane extends BasicPane { spaceUpPane.add(improvePane, BorderLayout.SOUTH); advancePane.add(spaceUpPane); } - + private static String getLocaledLanguage(String key, Locale locale){ - StringBuilder sb = new StringBuilder(); - sb.append(Inter.getLocText(key)).append("("); - sb.append(Inter.getLocText(key, locale)).append(")"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append(Inter.getLocText(key)).append("("); + sb.append(Inter.getLocText(key, locale)).append(")"); + return sb.toString(); } private void createFunctionPane(JPanel generalPane) { @@ -361,7 +361,7 @@ public class PreferencePane extends BasicPane { JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language")); generalPane.add(languageAndDashBoard_pane); languageAndDashBoard_pane.add(LanguagePane); - languageComboBox = new UIComboBox(LANGUAGE.toArray()); + languageComboBox = new UIComboBox(LANGUAGE); languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文 ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language")); languageLabel.addActionListener(new ActionListener() { @@ -530,10 +530,11 @@ public class PreferencePane extends BasicPane { this.logExportDirectoryField.setText(designerEnvManager.getLogLocation()); - this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel())); + this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel())); - this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage())); + this.languageComboBox.setSelectedItem(LANGUAGE[designerEnvManager.getLanguage()]); designerEnvLanguageIndex = designerEnvManager.getLanguage(); + this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit()); this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit()); @@ -619,8 +620,8 @@ public class PreferencePane extends BasicPane { private int getLanguageInt() { int l = 0; String lang = (String) this.languageComboBox.getSelectedItem(); - for (int i = 0; i < LANGUAGE.size(); i++) { - if (ComparatorUtils.equals(lang, LANGUAGE.get(i))) { + for (int i = 0; i < LANGUAGE.length; i++) { + if (ComparatorUtils.equals(lang, LANGUAGE[i])) { l = i; break; } @@ -628,21 +629,20 @@ public class PreferencePane extends BasicPane { return l; } - // 如果语言设置改变了,则显示重启对话框 public void showRestartDialog() { if (!languageChanged) { return; } int rv = JOptionPane.showOptionDialog( - null, - Inter.getLocText("FR-Designer_Language_Change_Successful"), - Inter.getLocText("FR-Designer-Plugin_Warning"), - JOptionPane.YES_NO_OPTION, - JOptionPane.INFORMATION_MESSAGE, - null, - new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, - null + null, + Inter.getLocText("FR-Designer_Language_Change_Successful"), + Inter.getLocText("FR-Designer-Plugin_Warning"), + JOptionPane.YES_NO_OPTION, + JOptionPane.INFORMATION_MESSAGE, + null, + new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, + null ); if (rv == JOptionPane.OK_OPTION) { RestartHelper.restart(); From 717ce1109002578f33b11c4ed163001e2e882301 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 13 Dec 2016 15:50:08 +0800 Subject: [PATCH 22/53] pmd --- .../widget/ui/TextFieldEditorDefinePane.java | 6 +- .../fr/design/actions/file/LocalePane.java | 90 ++++++++----------- 2 files changed, 40 insertions(+), 56 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java index c9128627cc..1c11aad2e4 100644 --- a/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java @@ -61,7 +61,11 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane regPane.getRegComboBox().addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem(); - getRegErrorMsgTextField().setEnabled(regExp.errorMessageEditable()); + if (!StringUtils.isNotEmpty(regExp.toRegText())) { + getRegErrorMsgTextField().setEnabled(false); + } else { + getRegErrorMsgTextField().setEnabled(true); + } } }); diff --git a/designer_base/src/com/fr/design/actions/file/LocalePane.java b/designer_base/src/com/fr/design/actions/file/LocalePane.java index 4dd25c5048..c215ab6181 100644 --- a/designer_base/src/com/fr/design/actions/file/LocalePane.java +++ b/designer_base/src/com/fr/design/actions/file/LocalePane.java @@ -4,33 +4,29 @@ package com.fr.design.actions.file; -import java.awt.BorderLayout; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.*; - -import javax.swing.JTable; -import javax.swing.RowFilter; -import javax.swing.SwingWorker; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableRowSorter; - import com.fr.base.Env; import com.fr.base.FRContext; +import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.dialog.BasicPane; import com.fr.file.filetree.FileNode; import com.fr.general.*; import com.fr.stable.ArrayUtils; -import com.fr.stable.StringUtils; -import com.fr.stable.bridge.StableFactory; import com.fr.stable.project.ProjectConstants; +import javax.swing.*; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableRowSorter; +import java.awt.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.*; +import java.util.List; + /** * @author : richie * @since : 8.0 @@ -53,8 +49,8 @@ public class LocalePane extends BasicPane { add(tabbedPane, BorderLayout.CENTER); predefineTableModel = new DefaultTableModel() { - public boolean isCellEditable(int row, int column) { - return column == 0; + public boolean isCellEditable(int col, int row) { + return false; } }; @@ -111,39 +107,23 @@ public class LocalePane extends BasicPane { } private void initPredefinedProperties() { - - Map supportLocaleMap = Inter.getSupportLocaleMap(); - - String[] localeFiles = StableFactory.getLocaleFiles(); - - + Map map = Inter.getPredefinedPackageMap(); + LocalePackage chinese = map.get(Locale.SIMPLIFIED_CHINESE); List sortKeys = new ArrayList(); - for (String path : localeFiles) { - ResourceBundle chineseBundle = loadResourceBundle(path, Locale.SIMPLIFIED_CHINESE); - sortKeys.addAll(chineseBundle.keySet()); + Set bundles = chinese.getKindsOfResourceBundle(); + for (ResourceBundle bundle : bundles) { + sortKeys.addAll(bundle.keySet()); } Collections.sort(sortKeys); - Map> localeResourceBundleMap = new HashMap>(); - for (Map.Entry entry : supportLocaleMap.entrySet()) { - Locale locale = entry.getKey(); - List list = new ArrayList<>(); - for (String path : localeFiles) { - ResourceBundle chineseBundle = loadResourceBundle(path, locale); - list.add(chineseBundle); - } - localeResourceBundleMap.put(locale, list); - } - Map> data = new HashMap>(); - for (Map.Entry> entry : localeResourceBundleMap.entrySet()) { + for (Map.Entry entry : map.entrySet()) { Vector column = new Vector(); - List rbs = entry.getValue(); for (String key : sortKeys) { - column.add(readText(rbs, key)); + column.add(entry.getValue().getLocText(key)); } data.put(entry.getKey(), column); } @@ -158,19 +138,6 @@ public class LocalePane extends BasicPane { } } - private String readText(List rbs, String key) { - for (ResourceBundle rb : rbs) { - if (rb.containsKey(key)) { - return rb.getString(key); - } - } - return null; - } - - private ResourceBundle loadResourceBundle(String dir, Locale locale) { - return ResourceBundle.getBundle(dir, locale, Inter.class.getClassLoader()); - } - private void initCustomProperties() throws Exception { Env env = FRContext.getCurrentEnv(); if (env == null) { @@ -207,9 +174,22 @@ public class LocalePane extends BasicPane { } } + private Properties loadLocaleProperties(String name) { + Properties properties = new Properties(); + InputStream inputStream = IOUtils.readResource("/com/fr/general/locale/" + name); + try { + properties.load(inputStream); + } catch (IOException e) { + FRLogger.getLogger().error(e.getMessage()); + } + return properties; + } + /** * 保存当前编辑的国际化 * + * + * @date 2014-9-30-下午3:10:30 */ public void save() { Env env = FRContext.getCurrentEnv(); From e36b2fdbf903fc674d2281c3c46a223588b17c13 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 13 Dec 2016 15:51:44 +0800 Subject: [PATCH 23/53] pmd --- .../fr/design/actions/file/LocalePane.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/file/LocalePane.java b/designer_base/src/com/fr/design/actions/file/LocalePane.java index c215ab6181..3356fa70af 100644 --- a/designer_base/src/com/fr/design/actions/file/LocalePane.java +++ b/designer_base/src/com/fr/design/actions/file/LocalePane.java @@ -4,29 +4,31 @@ package com.fr.design.actions.file; +import java.awt.BorderLayout; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.*; + +import javax.swing.JTable; +import javax.swing.RowFilter; +import javax.swing.SwingWorker; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableRowSorter; + import com.fr.base.Env; import com.fr.base.FRContext; -import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.dialog.BasicPane; import com.fr.file.filetree.FileNode; import com.fr.general.*; import com.fr.stable.ArrayUtils; import com.fr.stable.project.ProjectConstants; -import javax.swing.*; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableRowSorter; -import java.awt.*; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.*; -import java.util.List; - /** * @author : richie * @since : 8.0 From 11d2469cc586a978e0a3752cc9a1dba68c80ba86 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 13 Dec 2016 17:28:23 +0800 Subject: [PATCH 24/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=20build=20failed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 90cc40e685..99858a6dc9 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -495,7 +495,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh extraChartDesignInterfaceList.add(tagName); } if (IndependentChartUIProvider.XML_TAG.equals(tagName)) { - addChartInterface(reader.getAttrAsString("class", ""), reader.getAttrAsString("priority", ChartTypeManager.DEFAULT_PRIORITY),reader.getAttrAsString("plotID", ""), simplify); + addChartInterface(reader.getAttrAsString("class", ""), reader.getAttrAsString("priority", ChartTypeManager.CHART_PRIORITY),reader.getAttrAsString("plotID", ""), simplify); } } } From 46e1e1f0452346401f3690539ffbe9eb3e89df4c Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 13 Dec 2016 17:28:47 +0800 Subject: [PATCH 25/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=20build=20failed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 99858a6dc9..2ddb5b05f2 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -38,7 +38,7 @@ import javax.swing.*; import java.util.*; /** - * Created by eason on 14/12/29. + * Created by eason on 14/12/29. */ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraChartDesignClassManagerProvider { From 3275137a96c52ed15c6af220ca7d150e5ad01b40 Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 14 Dec 2016 15:33:58 +0800 Subject: [PATCH 26/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=20master=E5=88=B0dev=E7=9A=84=E5=87=A0=E4=B8=AA=E5=86=B2?= =?UTF-8?q?=E7=AA=81.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/file/PreferencePane.java b/designer_base/src/com/fr/design/actions/file/PreferencePane.java index 965cf415a0..bae1414524 100644 --- a/designer_base/src/com/fr/design/actions/file/PreferencePane.java +++ b/designer_base/src/com/fr/design/actions/file/PreferencePane.java @@ -1,13 +1,11 @@ package com.fr.design.actions.file; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.dialog.DialogActionListener; import com.fr.design.editor.editor.IntegerEditor; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIButton; @@ -31,7 +29,9 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.File; +import java.util.ArrayList; import java.util.Locale; +import java.util.Map; /** * 选项对话框 @@ -72,19 +72,19 @@ public class PreferencePane extends BasicPane { private static final String DISPLAY_EQUALS = "+"; private static final String MINUS = "MINUS"; private static final String DISPLAY_MINUS = "-"; - + private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG}; - private static final String[] LANGUAGE = {Inter.getLocText("FR-Designer_Language_Default"), - getLocaledLanguage("Simplified_Chinese_Language", Locale.SIMPLIFIED_CHINESE), - getLocaledLanguage("English_Language", Locale.ENGLISH), - getLocaledLanguage("Japanese_Language", Locale.JAPAN), - getLocaledLanguage("Traditional_Chinese_Language", Locale.TRADITIONAL_CHINESE), - getLocaledLanguage("Korea_Language",Locale.KOREA), + private static java.util.List LANGUAGE = new ArrayList<>(); + static { + Map map = Inter.getSupportLocaleMap(); + LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default")); + for(Locale locale : map.keySet()){ + LANGUAGE.add(getLocaledLanguage(map.get(locale), locale)); + } }; - private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言 + private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言 private boolean languageChanged; // 是否修改了设计器语言设置 - //设置是否支持undo private UICheckBox supportUndoCheckBox; //设置最大撤销次数 @@ -154,7 +154,7 @@ public class PreferencePane extends BasicPane { JPanel oraclePane = FRGUIPaneFactory.createTitledBorderPane("Oracle" + Inter.getLocText("FR-Designer_Oracle_All_Tables")); oracleSpace = new UICheckBox(Inter.getLocText(message, sign)); oraclePane.add(oracleSpace); - + JPanel improvePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Product_improve")); joinProductImprove = new UICheckBox(Inter.getLocText("FR-Designer_Join_Product_improve")); improvePane.add(joinProductImprove); @@ -164,12 +164,12 @@ public class PreferencePane extends BasicPane { spaceUpPane.add(improvePane, BorderLayout.SOUTH); advancePane.add(spaceUpPane); } - + private static String getLocaledLanguage(String key, Locale locale){ - StringBuilder sb = new StringBuilder(); - sb.append(Inter.getLocText(key)).append("("); - sb.append(Inter.getLocText(key, locale)).append(")"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append(Inter.getLocText(key)).append("("); + sb.append(Inter.getLocText(key, locale)).append(")"); + return sb.toString(); } private void createFunctionPane(JPanel generalPane) { @@ -361,7 +361,7 @@ public class PreferencePane extends BasicPane { JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language")); generalPane.add(languageAndDashBoard_pane); languageAndDashBoard_pane.add(LanguagePane); - languageComboBox = new UIComboBox(LANGUAGE); + languageComboBox = new UIComboBox(LANGUAGE.toArray()); languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文 ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language")); languageLabel.addActionListener(new ActionListener() { @@ -530,11 +530,10 @@ public class PreferencePane extends BasicPane { this.logExportDirectoryField.setText(designerEnvManager.getLogLocation()); - this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel())); + this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel())); - this.languageComboBox.setSelectedItem(LANGUAGE[designerEnvManager.getLanguage()]); + this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage())); designerEnvLanguageIndex = designerEnvManager.getLanguage(); - this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit()); this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit()); @@ -620,8 +619,8 @@ public class PreferencePane extends BasicPane { private int getLanguageInt() { int l = 0; String lang = (String) this.languageComboBox.getSelectedItem(); - for (int i = 0; i < LANGUAGE.length; i++) { - if (ComparatorUtils.equals(lang, LANGUAGE[i])) { + for (int i = 0; i < LANGUAGE.size(); i++) { + if (ComparatorUtils.equals(lang, LANGUAGE.get(i))) { l = i; break; } @@ -629,20 +628,21 @@ public class PreferencePane extends BasicPane { return l; } + // 如果语言设置改变了,则显示重启对话框 public void showRestartDialog() { if (!languageChanged) { return; } int rv = JOptionPane.showOptionDialog( - null, - Inter.getLocText("FR-Designer_Language_Change_Successful"), - Inter.getLocText("FR-Designer-Plugin_Warning"), - JOptionPane.YES_NO_OPTION, - JOptionPane.INFORMATION_MESSAGE, - null, - new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, - null + null, + Inter.getLocText("FR-Designer_Language_Change_Successful"), + Inter.getLocText("FR-Designer-Plugin_Warning"), + JOptionPane.YES_NO_OPTION, + JOptionPane.INFORMATION_MESSAGE, + null, + new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, + null ); if (rv == JOptionPane.OK_OPTION) { RestartHelper.restart(); From cb55c20c56f00d41f086185adb9b12f2d9d00e85 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Thu, 15 Dec 2016 13:27:57 +0800 Subject: [PATCH 27/53] =?UTF-8?q?=E5=9C=A8=E6=9E=84=E5=BB=BA=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E6=97=B6=EF=BC=8C=E5=B0=B1=E8=80=83=E8=99=91?= =?UTF-8?q?=E5=88=B0=E6=98=AF=E5=90=A6=E5=A4=84=E4=BA=8E=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/ChartTypeButtonPane.java | 2 +- .../mainframe/chart/gui/ChartTypePane.java | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 6b6c9a4276..91b6bba3c1 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -138,7 +138,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private void checkoutChange(){ editingCollection.calculateMultiChartMode(); if (parent != null){ - parent.reactorChartTypePane(editingCollection); + parent.relayoutChartTypePane(editingCollection); } //检查是否可以配置切换 configButton.setEnabled(editingCollection.changeEnable()); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 6c747c9cc1..a3a028ef89 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -68,8 +68,13 @@ public class ChartTypePane extends AbstractChartAttrPane{ buttonPane = new ChartTypeButtonPane(this); content.add(buttonPane, BorderLayout.NORTH); - - chartTypePane = new ComboBoxPane(); + + if (editingCollection != null) { + relayoutChartTypePane(editingCollection); + }else { + chartTypePane = new ComboBoxPane(); + } + BasicScrollPane scrollPane = new BasicScrollPane() { @Override protected JPanel createContentPane() { @@ -192,7 +197,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ }); } - public void reactor(ChartCollection collection){ + public void relayout(ChartCollection collection){ //重构需要重构下拉框选项和cardNames Chart chart = collection.getSelectedChart(); String chartID = chart.getPriority(); @@ -278,9 +283,9 @@ public class ChartTypePane extends AbstractChartAttrPane{ } - public void reactorChartTypePane(ChartCollection collection){ - if (needReactor(collection)) { - chartTypePane.reactor(collection); + public void relayoutChartTypePane(ChartCollection collection){ + if (needRelayout(collection)) { + chartTypePane.relayout(collection); //设置面板切换状态 updatePaneState(collection); } @@ -292,7 +297,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ } // TODO: 2016/11/17 因为现在populate面板时会重新构造面板,所以每次都需要重构 - private boolean needReactor(ChartCollection collection) { + private boolean needRelayout(ChartCollection collection) { /*return paneState.getChartID() != collection.getRepresentChartID() || paneState.getPaneState() != collection.getState();*/ return true; } @@ -301,14 +306,14 @@ public class ChartTypePane extends AbstractChartAttrPane{ * 更新界面属性 用于展示 */ public void populate(ChartCollection collection) { + editingCollection = collection; + Chart chart = collection.getSelectedChart(); this.remove(leftContentPane); initContentPane(); buttonPane.populateBean(collection); chartTypePane.populateBean(chart); - //remove面板之后,就需要重构下拉框 - reactorChartTypePane(collection); this.initAllListeners(); } From 2ec2f5617da1ce6695cad8bdaee7b6253706dae8 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Thu, 15 Dec 2016 13:30:36 +0800 Subject: [PATCH 28/53] update --- .../design/actions/report/ReportParameterAction.java | 3 --- designer/src/com/fr/design/mainframe/JWorkBook.java | 12 ++++-------- .../src/com/fr/design/mainframe/JTemplate.java | 4 ---- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportParameterAction.java b/designer/src/com/fr/design/actions/report/ReportParameterAction.java index d05fbd5ca1..ef8454a769 100644 --- a/designer/src/com/fr/design/actions/report/ReportParameterAction.java +++ b/designer/src/com/fr/design/actions/report/ReportParameterAction.java @@ -10,7 +10,6 @@ import javax.swing.SwingUtilities; import com.fr.base.BaseUtils; import com.fr.base.Parameter; import com.fr.design.actions.JWorkBookAction; -import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; import com.fr.design.parameter.ParameterArrayPane; @@ -64,8 +63,6 @@ public class ReportParameterAction extends JWorkBookAction{ jwb.updateReportParameterAttr(); jwb.populateReportParameterAttr(); - //点击确定会后,需要出发插件界面的更新 - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireElementCasePane(); } }); parameterArrayDialog.setVisible(true); diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index 909581092d..f3722c4ac2 100644 --- a/designer/src/com/fr/design/mainframe/JWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JWorkBook.java @@ -743,7 +743,10 @@ public class JWorkBook extends JTemplate { } EastRegionContainerPane.getInstance().replaceUpPane(QuickEditorRegion.getInstance()); } else { - fireElementCasePane(); + ElementCasePane casePane = ((ReportComponent) delegate4ToolbarMenuAdapter()).elementCasePane; + if (casePane != null) { + casePane.fireSelectionChangeListener(); + } } } if (BaseUtils.isAuthorityEditing()) { @@ -754,13 +757,6 @@ public class JWorkBook extends JTemplate { centerPane.needToShowCoverAndHidPane(); } - public void fireElementCasePane() { - ElementCasePane casePane = ((ReportComponent) delegate4ToolbarMenuAdapter()).elementCasePane; - if (casePane != null) { - casePane.fireSelectionChangeListener(); - } - } - @Override /** * diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index 78ec115b37..58060d91a9 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -325,10 +325,6 @@ public abstract class JTemplate> ex fireSuperTargetModified(); } - public void fireElementCasePane(){ - return; - } - protected boolean accept(Object o){ return true; } From dcc4c63bdf5f8db27c6e17bb98560c8ff3a0d417 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Fri, 16 Dec 2016 14:35:28 +0800 Subject: [PATCH 29/53] =?UTF-8?q?=E8=8E=B7=E5=8F=96plotTypePane=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/beans/FurtherBasicBeanPane.java | 8 ++++++-- .../src/com/fr/design/ChartTypeInterfaceManager.java | 8 ++++---- .../fr/design/chart/fun/IndependentChartUIProvider.java | 5 +++++ .../fun/impl/AbstractIndependentChartUIWithAPILevel.java | 8 ++++++++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/beans/FurtherBasicBeanPane.java b/designer_base/src/com/fr/design/beans/FurtherBasicBeanPane.java index 9129c2b870..8c61c96db0 100644 --- a/designer_base/src/com/fr/design/beans/FurtherBasicBeanPane.java +++ b/designer_base/src/com/fr/design/beans/FurtherBasicBeanPane.java @@ -1,5 +1,7 @@ package com.fr.design.beans; +import com.fr.stable.StringUtils; + /** * * @author zhou @@ -17,8 +19,10 @@ public abstract class FurtherBasicBeanPane extends BasicBeanPane { * title应该是一个属性,不只是对话框的标题时用到,与其他组件结合时,也会用得到 * @return 绥化狂标题 */ - @Override - public abstract String title4PopupWindow(); + @Deprecated + public String title4PopupWindow(){ + return StringUtils.EMPTY; + } /** * 重置 diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 2ddb5b05f2..3bf990880c 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -259,7 +259,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh while (iterator.hasNext()){ Map.Entry entry = (Map.Entry) iterator.next(); IndependentChartUIProvider provider = (IndependentChartUIProvider) entry.getValue(); - names[i++] = provider.getPlotTypePane().title4PopupWindow(); + names[i++] = provider.getPlotTypeTitle4PopupWindow(); } return names; } @@ -274,7 +274,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh public String getTitle4PopupWindow(String priority, String plotID){ if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)){ IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID); - return provider.getPlotTypePane().title4PopupWindow(); + return provider.getPlotTypeTitle4PopupWindow(); } //兼容老的插件 @@ -284,7 +284,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh Map.Entry entry = (Map.Entry) iterator.next(); String defaultPriority = (String) entry.getKey(); if (chartTypeInterfaces.get(defaultPriority).containsKey(plotID)) { - return chartTypeInterfaces.get(defaultPriority).get(plotID).getPlotTypePane().title4PopupWindow(); + return chartTypeInterfaces.get(defaultPriority).get(plotID).getPlotTypeTitle4PopupWindow(); } } } @@ -332,7 +332,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh while (chartUI.hasNext()) { Map.Entry chartUIEntry = (Map.Entry) chartUI.next(); IndependentChartUIProvider provider = (IndependentChartUIProvider) chartUIEntry.getValue(); - names[index++] = provider.getPlotTypePane().title4PopupWindow(); + names[index++] = provider.getPlotTypeTitle4PopupWindow(); } return index; } diff --git a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java index a919143967..1b90382d6a 100644 --- a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java +++ b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java @@ -84,5 +84,10 @@ public interface IndependentChartUIProvider extends Level { */ String getIconPath(); + /** + * plot面板的标题 + */ + String getPlotTypeTitle4PopupWindow(); + } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java b/designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java index 2a1e6b4c4b..ff0eaa81db 100644 --- a/designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java +++ b/designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java @@ -57,4 +57,12 @@ public abstract class AbstractIndependentChartUIWithAPILevel implements Independ public ConditionAttributesPane getPlotConditionPane(Plot plot){ return new DataSeriesConditionPane(); } + + /** + * plot面板的标题 + * 插件兼容 + */ + public String getPlotTypeTitle4PopupWindow(){ + return getPlotTypePane().title4PopupWindow(); + } } From 48ce7996135896ae8965a82065b32512ac3e04cc Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 16 Dec 2016 16:02:19 +0800 Subject: [PATCH 30/53] =?UTF-8?q?REPORT-1095=20=E8=B6=85=E9=93=BE=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=86=85=E6=89=93=E5=BC=80=E6=8F=92=E4=BB=B6=E5=8D=B8?= =?UTF-8?q?=E8=BD=BD=E5=90=8E=E8=AE=BE=E8=AE=A1=E8=BF=99=E8=BE=B9=E4=BC=9A?= =?UTF-8?q?=E7=9C=8B=E5=88=B0fs=5Fself=E8=BF=99=E6=A0=B7=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=EF=BC=8C=E6=89=93=E5=BC=80=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E6=98=AF=E6=9E=9A=E4=B8=BE=E7=9A=84,=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=9C=80=E5=90=8E=E7=9A=84else=E7=9A=84=E3=80=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/hyperlink/AbstractHyperlinkPane.java | 12 +----------- .../fr/design/hyperlink/HyperlinkTargetFrame.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index 311eaf7d94..43f73b870a 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -115,17 +115,7 @@ public abstract class AbstractHyperlinkPane extends BasicBe @Override public void populateBean(T link) { String name = link.getTargetFrame(); - if ("_self".equals(name)) { - targetFrameComboBox.setSelectedIndex(SELF); - } else if ("_dialog".equals(name)) { - targetFrameComboBox.setSelectedIndex(DIALOG); - } else if ("_blank".equals(name)) { - targetFrameComboBox.setSelectedIndex(NEW_WINDOW); - } else { - DefaultComboBoxModel model = (DefaultComboBoxModel) targetFrameComboBox.getModel(); - model.addElement(name); - targetFrameComboBox.setSelectedItem(name); - } + targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(name)); heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); populateSubHyperlinkBean(link); diff --git a/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java index 80e9f21a0a..f0b0543a46 100644 --- a/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java +++ b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java @@ -1,5 +1,7 @@ package com.fr.design.hyperlink; +import com.fr.general.ComparatorUtils; + /** * Created by ibm on 2016/10/13. */ @@ -27,6 +29,18 @@ public enum HyperlinkTargetFrame { return BLANK_FRAME; } + public static int convert(String name) { + if (arrayOfValues == null) { + arrayOfValues = HyperlinkTargetFrame.values(); + } + for (HyperlinkTargetFrame hyperlinkTargetFrame : HyperlinkTargetFrame.values()) { + if (ComparatorUtils.equals(hyperlinkTargetFrame.getName(), name)) { + return hyperlinkTargetFrame.getIndex(); + } + } + return BLANK_FRAME.getIndex(); + } + public int getIndex() { return index; From ed3874dc5c0144188996d77681a99bfc424d8344 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 22 Dec 2016 15:34:02 +0800 Subject: [PATCH 31/53] =?UTF-8?q?=E7=BB=99=E8=AE=BE=E8=AE=A1=E5=99=A8->?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF->=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E5=B8=83=E5=B1=80->=E7=A7=BB=E5=8A=A8=E7=AB=AF->=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E6=89=8B=E6=9C=BA=E9=87=8D=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/creator/XCreator.java | 7 +++++++ .../designer/creator/XWAbsoluteBodyLayout.java | 15 +++++++++++++++ .../fr/design/designer/creator/XWFitLayout.java | 9 +++++++++ .../designer/properties/BodyAppRelayoutTable.java | 4 ++-- .../properties/mobile/BodyMobilePropertyUI.java | 5 +++++ 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XCreator.java b/designer_form/src/com/fr/design/designer/creator/XCreator.java index ed692cd428..e362a91678 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreator.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreator.java @@ -617,4 +617,11 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public void adjustCompHeight(double percent) { return; } + + /** + * 给子类XWFitLayout和XWAbsoluteBodyLayout提供一个获取标题的方法 + */ + public String getTitle() { + return null; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index 291a0f88d5..4681400d07 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -2,7 +2,9 @@ package com.fr.design.designer.creator; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRAbsoluteBodyLayoutAdapter; +import com.fr.design.designer.properties.mobile.BodyMobilePropertyUI; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; @@ -87,8 +89,21 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { }; } + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[]{ new BodyMobilePropertyUI(this)}; + } + @Override protected void initStyle() { initBorderStyle(); } + + /** + * 返回一个“绝对布局”字符串 + * @return + */ + public String getTitle() { + return Inter.getLocText("FR-Designer_AbsoluteLayout"); + } } diff --git a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java index 682a195907..c58fe8560d 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java @@ -25,6 +25,7 @@ import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; import com.fr.general.FRScreen; +import com.fr.general.Inter; import com.fr.stable.ArrayUtils; /** @@ -1178,5 +1179,13 @@ public class XWFitLayout extends XLayoutContainer { public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { return new WidgetPropertyUIProvider[]{ new BodyMobilePropertyUI(this)}; } + + /** + * 返回一个“自适应布局”字符串 + * @return + */ + public String getTitle() { + return Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"); + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java b/designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java index 6c10884a4c..a2c0a142ac 100644 --- a/designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java +++ b/designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java @@ -53,7 +53,7 @@ public class BodyAppRelayoutTable extends AbstractPropertyTable { FRContext.getLogger().error(e.getMessage()); } - groups.add(new PropertyGroup(new ReportAppPropertyGroupModel(Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"), xCreator, propertyTableEditor, designer))); + groups.add(new PropertyGroup(new ReportAppPropertyGroupModel(xCreator.getTitle(), xCreator, propertyTableEditor, designer))); TableModel model = new BeanTableModel(); setModel(model); @@ -65,7 +65,7 @@ public class BodyAppRelayoutTable extends AbstractPropertyTable { * 单元格tooltip * 属性名悬浮提示 * - * @param 鼠标点击事件 + * @param event 鼠标点击事件 * @return 单元格tooltip */ public String getToolTipText(MouseEvent event) { diff --git a/designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java b/designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java index a64de41584..70b80bc990 100644 --- a/designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java +++ b/designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java @@ -1,6 +1,7 @@ package com.fr.design.designer.properties.mobile; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.properties.BodyAppRelayoutTable; import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; @@ -18,6 +19,10 @@ public class BodyMobilePropertyUI extends AbstractWidgetPropertyUIProvider { this.xCreator = xwFitLayout; } + public BodyMobilePropertyUI(XWAbsoluteBodyLayout xwAbsoluteBodyLayout) { + this.xCreator = xwAbsoluteBodyLayout; + } + @Override public AbstractPropertyTable createWidgetAttrTable() { return new BodyAppRelayoutTable(xCreator); From 3139e70f361796ac96f0277d3f592bbb484c9392 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 22 Dec 2016 16:11:56 +0800 Subject: [PATCH 32/53] =?UTF-8?q?=E6=94=B9=E4=BA=86=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=80=89=E9=A1=B9=E5=8D=A1=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E6=A0=87=E9=A2=98=E2=80=9C=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E2=80=9D=E5=92=8C=E2=80=9C=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E2=80=9D=E7=BB=9F=E4=B8=80=E4=B8=BA=E2=80=9C?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=B1=9E=E6=80=A7=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/locale/designer_en_US.properties | 1 + .../src/com/fr/design/locale/designer_zh_CN.properties | 3 ++- .../src/com/fr/design/locale/designer_zh_TW.properties | 1 + .../src/com/fr/design/designer/creator/XCreator.java | 6 ------ .../fr/design/designer/creator/XWAbsoluteBodyLayout.java | 7 ------- .../src/com/fr/design/designer/creator/XWFitLayout.java | 8 -------- .../design/designer/properties/BodyAppRelayoutTable.java | 2 +- 7 files changed, 5 insertions(+), 23 deletions(-) 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 6562f726af..114eb0fda1 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 @@ -486,3 +486,4 @@ FR-Designer-DS-Database_Query=DB Query FR-Designer_Is_Share_DBTableData=Shared data set FR-Designer_Event=Event FR-Designer_Properties=Properties +FR-Designer_Properties_Mobile=MobileProperties 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 738ec6cd1b..880722d094 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 @@ -422,7 +422,7 @@ FR-Designer-Website_Url=http\://www.finereport.com/ FR-Designer-BBSLogin_Download-Unlogin-Tip=\u767B\u5F55\u540E\u624D\u80FD\u4E0B\u8F7D FR-Designer-App_ReLayout=\u624B\u673A\u91CD\u5E03\u5C40 FR-Designer_Mobile-Attr=\u79FB\u52A8\u7AEF\u5C5E\u6027 -FR-Designer_Mobile-Vertical=\u7AD6\u5C4F +FR-Designer_Mobile-Vertical=\u7AD6\u5C4FF FR-Designer_Mobile-Horizontal=\u6A2A\u5C4F FR-Designer_COMMUNITY=\u793E\u533A FR-Designer_COMMUNITY_BBS=\u5E06\u8F6F\u8BBA\u575B @@ -490,3 +490,4 @@ FR-Designer-LayerPageReport_Define_PageQuerySQL=\u5B9A\u4E49\u5206\u9875\u67E5\u FR-Designer_Is_Share_DBTableData=\u5171\u4EAB\u6570\u636E\u96C6 FR-Designer_Event=\u4E8B\u4EF6 FR-Designer_Properties=\u5C5E\u6027 +FR-Designer_Properties_Mobile=\u624B\u673A\u5C5E\u6027 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 74d7ea26d7..6d4eeb6eb5 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 @@ -478,3 +478,4 @@ FR-Designer-LayerPageReport_Define_PageQuerySQL=\u5B9A\u7FA9\u5206\u9801\u67E5\u FR-Designer_Is_Share_DBTableData=\u662F\u5426\u5171\u4EAB\u8CC7\u6599\u96C6 FR-Designer_Properties=\u5C6C\u6027 FR-Designer_Event=\u4E8B\u4EF6 +FR-Designer_Properties_Mobile=\u624B\u6A5F\u5C6C\u6027 diff --git a/designer_form/src/com/fr/design/designer/creator/XCreator.java b/designer_form/src/com/fr/design/designer/creator/XCreator.java index e362a91678..f80f20b583 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreator.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreator.java @@ -618,10 +618,4 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo return; } - /** - * 给子类XWFitLayout和XWAbsoluteBodyLayout提供一个获取标题的方法 - */ - public String getTitle() { - return null; - } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index 4681400d07..51ba4ef531 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -99,11 +99,4 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { initBorderStyle(); } - /** - * 返回一个“绝对布局”字符串 - * @return - */ - public String getTitle() { - return Inter.getLocText("FR-Designer_AbsoluteLayout"); - } } diff --git a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java index c58fe8560d..483b08fe59 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java @@ -1179,13 +1179,5 @@ public class XWFitLayout extends XLayoutContainer { public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { return new WidgetPropertyUIProvider[]{ new BodyMobilePropertyUI(this)}; } - - /** - * 返回一个“自适应布局”字符串 - * @return - */ - public String getTitle() { - return Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"); - } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java b/designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java index a2c0a142ac..36bde25d82 100644 --- a/designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java +++ b/designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java @@ -53,7 +53,7 @@ public class BodyAppRelayoutTable extends AbstractPropertyTable { FRContext.getLogger().error(e.getMessage()); } - groups.add(new PropertyGroup(new ReportAppPropertyGroupModel(xCreator.getTitle(), xCreator, propertyTableEditor, designer))); + groups.add(new PropertyGroup(new ReportAppPropertyGroupModel(Inter.getLocText("FR-Designer_Properties_Mobile"), xCreator, propertyTableEditor, designer))); TableModel model = new BeanTableModel(); setModel(model); From 56ead7d91a09592d06f37380e5bd121c946701c3 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 22 Dec 2016 17:35:01 +0800 Subject: [PATCH 33/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3tab=E5=9D=97=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99->=E7=A7=BB=E5=8A=A8=E7=AB=AF->=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=89=8B=E6=9C=BA=E9=87=8D=E5=B8=83=E5=B1=80=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/cardlayout/XWTabFitLayout.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index 230e7671dd..c95ee58696 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -14,7 +14,9 @@ import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.properties.mobile.BodyMobilePropertyUI; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; @@ -367,4 +369,13 @@ public class XWTabFitLayout extends XWFitLayout { public XLayoutContainer getTopLayout() { return this.getBackupParent().getTopLayout(); } + + /** + * 重写这个方法,解决tab块底下仍然显示手机重布局的bug + * @return + */ + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return null; + } } \ No newline at end of file From ac2e680148388de81bb5d8b80320e6a65b1e47e8 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 22 Dec 2016 17:39:45 +0800 Subject: [PATCH 34/53] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/cardlayout/XWTabFitLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index c95ee58696..71df9b059e 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -376,6 +376,6 @@ public class XWTabFitLayout extends XWFitLayout { */ @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - return null; + return new WidgetPropertyUIProvider[0]; } } \ No newline at end of file From 2b2b3b217ae3ac007c35cab4523be58d3c76e992 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Fri, 23 Dec 2016 14:48:36 +0800 Subject: [PATCH 35/53] =?UTF-8?q?REPORT-1287=20=E5=B1=9E=E6=80=A7=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=95=B0=E7=BB=84=E4=BB=A3=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rt,修复了。 --- .../src/com/fr/design/designer/creator/XElementCase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 543762ba21..a932548cc5 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -100,7 +100,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme .setI18NName(Inter.getLocText("Form-EC_toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; - resolveCompatible(propertyTableEditor); + propertyTableEditor = resolveCompatible(propertyTableEditor); FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING); if (processor == null) { return propertyTableEditor; @@ -122,7 +122,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } - private void resolveCompatible (CRPropertyDescriptor[] propertyTableEditor) { + private CRPropertyDescriptor[] resolveCompatible (CRPropertyDescriptor[] propertyTableEditor) { //这边有个插件兼容问题,之后还是要改回process才行 Set set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); for (FormElementCaseEditorProvider provider : set) { @@ -135,6 +135,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider); propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } + return propertyTableEditor; } @Override From 85a6a6076d964ba1787956fd778a7e60d910f7c7 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 22 Dec 2016 15:24:05 +0800 Subject: [PATCH 36/53] =?UTF-8?q?REPORT-1096=20=E5=AE=9E=E7=8E=B0=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=95=8C=E9=9D=A2=EF=BC=88=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=80=89=E6=8B=A9=E6=A1=86=EF=BC=89=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E5=8F=96=E8=89=B2=E5=99=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/colorSelectPane/colorPicker.png | Bin 0 -> 332 bytes .../gui/colorSelectPane/colorPickerCustom.png | Bin 0 -> 432 bytes .../fr/design/style/color/ColorPicker.java | 205 ++++++++++++++++++ .../style/color/NewColorSelectPane.java | 34 ++- 4 files changed, 236 insertions(+), 3 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker.png create mode 100644 designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPickerCustom.png create mode 100644 designer_base/src/com/fr/design/style/color/ColorPicker.java diff --git a/designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker.png b/designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker.png new file mode 100644 index 0000000000000000000000000000000000000000..fc88b3bfc192f00dd580cdbe63e11a32a45bfae2 GIT binary patch literal 332 zcmV-S0ki&zP)Px$21!IgR45f=WFP{lsHpJ$`}Z%3k&*HJ-Me>JGUC$%RLsuG$|~{m=g<8>b&5dz zpNEHsmj#z5B_*Zu|NsAo12uerYG44`bnVimOJA{S($mx9{`~oK8c?wk5dVW3{2oZh zgV;<^0Tk-VlP5wzr+pO_75xiU^Bic49ne2#Q53>BLPA2ao}QlP{{H>@|JAEk|FyKV zegK{NA81G=ObrT+tO4ks|M~g(H)LdFynveOfn3Z$!=^!8T-+SRR5XrId3pH`km(=* zvVo8W1_cF$`M{tBYcMe}c}-9Q&_+gJDBZhq<;s75fB!QQ5)x);uE5UaPx$YDq*vR5%f(lrgJuu4MY%}9<;bL1o1vba}bSf2?;@KA0cRS za1Ek0Y?2q$lweWMb0O&#J=1qVyhr{2{GW65NI?*MNs=_ZTrMhVEXLT+?RNWS1aVzg z)pflF2H5R(>SD2&%H*Ujgx*YAV#rl(tk-M!zE4gBDHEbML6&7u6a}-{4E=r|*XtE= z9AhvT6pB*N@pwe1(}87K$Q#2Uq&7{nfY7EC6h#p>n+-qi%Dg#fx7+uSpG#{*kZ!kI zh+3@{#^W*aZWq^R^QWWHXoP073CD4uX&SG|a=FBQzlW-dpWR!~BP2-@gkgx`a0tUN zULbEBJwtlE9ww6s8jXgK&SUW6h&n^5P)g+F69@r?Vjm6%oK7bWNz?RW2!RAgtJMnI z?UvVLKA)GSLxB4dK(=l3j-1bDP@SqQ0YpO2^Q!2JXJwiv&p%*s_k#^-iNR> 16; + int G = (rgb & 0xff00) >> 8; + int B = (rgb & 0xff); + return new Color(R, G, B); + } + + public void setColorPickerSize(int colorPickerSize) + { + this.colorPickerSize = colorPickerSize; + } + + public void paintComponent(Graphics g) + { + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); + double pixelCount = (double)colorPickerSize / scaleFactor; // 取色器一条边上的放大后的像素点个数(可以是小数) + // 关键处理代码 + g2d.drawImage( + screenImage, // 要画的图片 + 0, // 目标矩形的第一个角的x坐标 + 0, // 目标矩形的第一个角的y坐标 + colorPickerSize, // 目标矩形的第二个角的x坐标 + colorPickerSize, // 目标矩形的第二个角的y坐标 + locationX + (int)((colorPickerSize - pixelCount) * 0.5) + 1, // 源矩形的第一个角的x坐标 + locationY + (int)((colorPickerSize - pixelCount) * 0.5) + 1, // 源矩形的第一个角的y坐标 + locationX + (int)((colorPickerSize + pixelCount) * 0.5) + 1, // 源矩形的第二个角的x坐标 + locationY + (int)((colorPickerSize + pixelCount) * 0.5) + 1, // 源矩形的第二个角的y坐标 + this + ); + + g2d.setColor(Color.black); + g2d.drawOval(0, 0, 190, 190); + g2d.setColor(Color.white); + g2d.drawOval(1, 1, 188, 188); + g2d.drawOval(2, 2, 186, 186); + g2d.setColor(Color.black); + g2d.drawOval(3, 3, 184, 184); + + g2d.setColor(Color.white); + g2d.drawRect(86, 86, 18, 18); + g2d.setColor(Color.black); + g2d.drawRect(87, 87, 16, 16); + } + + +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java index bbecf01d3d..2b71357a82 100644 --- a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java @@ -17,6 +17,7 @@ import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.border.UIRoundedBorder; import com.fr.design.gui.ibutton.UIButton; @@ -78,10 +79,29 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { // center JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); this.add(centerPane, BorderLayout.CENTER); - + + // 第一行,1个取色按钮 + 7个最近使用的颜色 + JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout()); + row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0)); + row1Pane.setPreferredSize(new Dimension(135, 16)); // 宽度为 16 * 8 + 7 + centerPane.add(row1Pane); + + // 取色按钮 + UIButton pickColorButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/gui/colorSelectPane/colorPicker.png")); + pickColorButton.setPreferredSize(new Dimension(16, 16)); + pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); + pickColorButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + doPickColor(); + } + }); + row1Pane.add(pickColorButton, BorderLayout.WEST); + // 最近使用 - usedColorPane = new UsedColorPane(1, 8, ColorSelectConfigManager.getInstance().getColors(),this); - centerPane.add(usedColorPane.getPane()); + usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this); + usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8)); + row1Pane.add(usedColorPane.getPane()); JPanel menuColorPane1 = new JPanel(); centerPane.add(menuColorPane1); @@ -204,4 +224,12 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { usedColorPane.updateUsedColor(); } + /** + * 打开取色框,开始取色 + */ + public void doPickColor() { + ColorPicker colorPicker = new ColorPicker(this); + colorPicker.start(); + } + } \ No newline at end of file From d0cd522b795330368c8bdab441f7a69aa77fd8b9 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 22 Dec 2016 16:09:31 +0800 Subject: [PATCH 37/53] =?UTF-8?q?REPORT-1096=20=E5=B0=86=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=B0=81=E8=A3=85=E4=B8=BA=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/NewColorSelectPane.java | 18 +-------- .../design/style/color/PickColorButton.java | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 designer_base/src/com/fr/design/style/color/PickColorButton.java diff --git a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java index 2b71357a82..7e166560b4 100644 --- a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java @@ -87,15 +87,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { centerPane.add(row1Pane); // 取色按钮 - UIButton pickColorButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/gui/colorSelectPane/colorPicker.png")); - pickColorButton.setPreferredSize(new Dimension(16, 16)); - pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); - pickColorButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - doPickColor(); - } - }); + PickColorButton pickColorButton = new PickColorButton(this); row1Pane.add(pickColorButton, BorderLayout.WEST); // 最近使用 @@ -224,12 +216,4 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { usedColorPane.updateUsedColor(); } - /** - * 打开取色框,开始取色 - */ - public void doPickColor() { - ColorPicker colorPicker = new ColorPicker(this); - colorPicker.start(); - } - } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/style/color/PickColorButton.java b/designer_base/src/com/fr/design/style/color/PickColorButton.java new file mode 100644 index 0000000000..1d98bc5850 --- /dev/null +++ b/designer_base/src/com/fr/design/style/color/PickColorButton.java @@ -0,0 +1,37 @@ +package com.fr.design.style.color; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.ibutton.UIButton; + +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by plough on 2016/12/22. + */ +public class PickColorButton extends UIButton { + private ColorSelectable colorSelectable; + + public PickColorButton(ColorSelectable colorSelectable) { + super(BaseUtils.readIcon("/com/fr/design/images/gui/colorSelectPane/colorPicker.png")); + + this.colorSelectable = colorSelectable; + + this.setPreferredSize(new Dimension(16, 16)); + this.setCursor(new Cursor(Cursor.HAND_CURSOR)); + this.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + doPickColor(); + } + }); + } + /** + * 打开取色框,开始取色 + */ + public void doPickColor() { + ColorPicker colorPicker = new ColorPicker(colorSelectable); + colorPicker.start(); + } +} From 87b8d6266c8669672a94becc35884259b3f59d97 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 22 Dec 2016 16:13:40 +0800 Subject: [PATCH 38/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E7=BB=99CustomChooserPanel.java=20=E8=B0=83=E6=95=B4=E7=BC=A9?= =?UTF-8?q?=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/CustomChooserPanel.java | 1885 ++++++++--------- 1 file changed, 939 insertions(+), 946 deletions(-) diff --git a/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java b/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java index 179e90abe1..671466c3af 100644 --- a/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java @@ -42,1031 +42,1024 @@ import com.fr.general.Inter; /** * 颜色选择器自定义面板 - * @author focus * + * @author focus */ -class CustomChooserPanel extends AbstractColorChooserPanel -{ - /** The gradient image displayed. */ - private transient Image gradientImage; +class CustomChooserPanel extends AbstractColorChooserPanel { + /** + * The gradient image displayed. + */ + private transient Image gradientImage; + + /** + * The Panel that holds the gradient image. + */ + private transient JPanel gradientPanel; - /** The Panel that holds the gradient image. */ - private transient JPanel gradientPanel; + /** + * The track gradient image. + */ + private transient Image trackImage; - /** The track gradient image. */ - private transient Image trackImage; + /** + * The panel that holds the track. + */ + private transient JPanel trackPanel; - /** The panel that holds the track. */ - private transient JPanel trackPanel; + /** + * The slider for the locked HSB value. + */ + private transient UISlider slider; - /** The slider for the locked HSB value. */ - private transient UISlider slider; - - /** The RadioButton that controls the Hue. */ - private transient UIRadioButton hRadio; - - /** The RadioButton that controls the Saturation. */ - private transient UIRadioButton sRadio; - - /** The RadioButton that controls the Brightness. */ - private transient UIRadioButton bRadio; - - /** The UIBasicSpinner that controls the Hue. */ - private transient UIBasicSpinner hSpinner; - - /** The UIBasicSpinner that controls the Saturation. */ - private transient UIBasicSpinner sSpinner; - - /** The UIBasicSpinner that controls the Brightness. */ - private transient UIBasicSpinner bSpinner; - - /** The UIBasicSpinner that controls the Red. */ - private transient UIBasicSpinner rSpinner; - - /** The UIBasicSpinner that controls the Green. */ - private transient UIBasicSpinner gSpinner; - - /** The UIBasicSpinner that controls the Blue. */ - private transient UIBasicSpinner bbSpinner; - - private transient UITextField field; - - - /** The default width of the gradient image. */ - private static final int IMG_WIDTH = 200; - - /** The default height of the gradient image. */ - private static final int IMG_HEIGHT = 205; - - /** The default width of the track gradient. */ - private static final int TRACK_WIDTH = 20; - - /** The UILabel for Red. */ - private static final UILabel R = new UILabel("R"); - - /** The UILabel for Green. */ - private static final UILabel G = new UILabel("G"); - - /** The UILabel for Blue. */ - private static final UILabel B = new UILabel("B"); - - private static final int H_MAX = 365; - private static final int S_MAX = 100; - private static final int L_MAX = 100; - - private static final float HSPINNER_VALUE = 360f; - private static final float SSPINNER_VALUE = 100f; - private static final float LSPINNER_VALUE = 100f; - - private static final int BINARY_FOR_EIGHT = 255; - private static final int BINARY_FOR_FOUR = 16; - private static final int BINARY_FOR_THTEE = 8; - - private static final int TWENTY_FOUR = 24; - private static final int HEX_FF = 0xff; - - // 占位label - private static final UILabel PLACE_HOLDER_LABEL = new UILabel(); - - private ImageRGBScrollListener rgbScroll = new ImageRGBScrollListener(); - - - /** The point that is displayed in the gradient image. */ - private transient Point gradientPoint = new Point(); - - /** - * This indicates that the change to the slider or point is triggered - * internally. - */ - private transient boolean internalChange = false; - - /** This indicates that the change to the spinner is triggered internally. */ - private transient boolean spinnerTrigger = false; - - /** This int identifies which spinner is currently locked. */ - private transient int locked = -1; - - /** This value indicates that the Hue spinner is locked. */ - static final int HLOCKED = 0; - - /** This value indicates that the Saturation spinner is locked. */ - static final int SLOCKED = 1; - - /** This value indicates that the Brightness spinner is locked. */ - static final int BLOCKED = 2; - - /** - * This method indicates that the mouse event is in the process of being - * handled. - */ - private transient boolean handlingMouse; - - // 文本监听器,监听十六进制文本输入 - class TextDocumentListener implements DocumentListener{ - - // 十六进制颜色验证的正则表达式 - private static final String HEX_PATTERN = "([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"; - private Pattern pattern; - private Matcher matcher; - @Override - public void insertUpdate(DocumentEvent e) { - Document doc = e.getDocument(); - updateColorForHex(doc); - } - - @Override - public void removeUpdate(DocumentEvent e) { - Document doc = e.getDocument(); - updateColorForHex(doc); - } - - @Override - public void changedUpdate(DocumentEvent e) { - - } - - private void updateColorForHex(Document doc){ - try { - String str = doc.getText(0, doc.getLength()); - pattern = Pattern.compile(HEX_PATTERN); - matcher = pattern.matcher(str); - if(matcher.matches()){ - Color color = new Color(Integer.parseInt(str, 16)); - CustomChooserPanel.this.getColorSelectionModel().setSelectedColor(color); - } - - } catch (BadLocationException e1) { - FRLogger.getLogger().error(e1.getMessage()); - } - } - } - - /** - * This helper class handles mouse events on the gradient image. - */ - class MainGradientMouseListener extends MouseAdapter - implements MouseMotionListener - { /** - * This method is called when the mouse is pressed over the gradient - * image. The JColorChooser is then updated with new HSB values. - * - * @param e The MouseEvent. + * The RadioButton that controls the Hue. + */ + private transient UIRadioButton hRadio; + + /** + * The RadioButton that controls the Saturation. + */ + private transient UIRadioButton sRadio; + + /** + * The RadioButton that controls the Brightness. + */ + private transient UIRadioButton bRadio; + + /** + * The UIBasicSpinner that controls the Hue. + */ + private transient UIBasicSpinner hSpinner; + + /** + * The UIBasicSpinner that controls the Saturation. + */ + private transient UIBasicSpinner sSpinner; + + /** + * The UIBasicSpinner that controls the Brightness. + */ + private transient UIBasicSpinner bSpinner; + + /** + * The UIBasicSpinner that controls the Red. + */ + private transient UIBasicSpinner rSpinner; + + /** + * The UIBasicSpinner that controls the Green. + */ + private transient UIBasicSpinner gSpinner; + + /** + * The UIBasicSpinner that controls the Blue. + */ + private transient UIBasicSpinner bbSpinner; + + private transient UITextField field; + + + /** + * The default width of the gradient image. + */ + private static final int IMG_WIDTH = 200; + + /** + * The default height of the gradient image. + */ + private static final int IMG_HEIGHT = 205; + + /** + * The default width of the track gradient. + */ + private static final int TRACK_WIDTH = 20; + + /** + * The UILabel for Red. + */ + private static final UILabel R = new UILabel("R"); + + /** + * The UILabel for Green. + */ + private static final UILabel G = new UILabel("G"); + + /** + * The UILabel for Blue. + */ + private static final UILabel B = new UILabel("B"); + + private static final int H_MAX = 365; + private static final int S_MAX = 100; + private static final int L_MAX = 100; + + private static final float HSPINNER_VALUE = 360f; + private static final float SSPINNER_VALUE = 100f; + private static final float LSPINNER_VALUE = 100f; + + private static final int BINARY_FOR_EIGHT = 255; + private static final int BINARY_FOR_FOUR = 16; + private static final int BINARY_FOR_THTEE = 8; + + private static final int TWENTY_FOUR = 24; + private static final int HEX_FF = 0xff; + + // 占位label + private static final UILabel PLACE_HOLDER_LABEL = new UILabel(); + + private ImageRGBScrollListener rgbScroll = new ImageRGBScrollListener(); + + + /** + * The point that is displayed in the gradient image. + */ + private transient Point gradientPoint = new Point(); + + /** + * This indicates that the change to the slider or point is triggered + * internally. + */ + private transient boolean internalChange = false; + + /** + * This indicates that the change to the spinner is triggered internally. + */ + private transient boolean spinnerTrigger = false; + + /** + * This int identifies which spinner is currently locked. + */ + private transient int locked = -1; + + /** + * This value indicates that the Hue spinner is locked. + */ + static final int HLOCKED = 0; + + /** + * This value indicates that the Saturation spinner is locked. + */ + static final int SLOCKED = 1; + + /** + * This value indicates that the Brightness spinner is locked. */ - public void mousePressed(MouseEvent e) - { - gradientPoint = e.getPoint(); - update(e.getPoint()); + static final int BLOCKED = 2; + + /** + * This method indicates that the mouse event is in the process of being + * handled. + */ + private transient boolean handlingMouse; + + // 文本监听器,监听十六进制文本输入 + class TextDocumentListener implements DocumentListener { + + // 十六进制颜色验证的正则表达式 + private static final String HEX_PATTERN = "([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"; + private Pattern pattern; + private Matcher matcher; + + @Override + public void insertUpdate(DocumentEvent e) { + Document doc = e.getDocument(); + updateColorForHex(doc); + } + + @Override + public void removeUpdate(DocumentEvent e) { + Document doc = e.getDocument(); + updateColorForHex(doc); + } + + @Override + public void changedUpdate(DocumentEvent e) { + + } + + private void updateColorForHex(Document doc) { + try { + String str = doc.getText(0, doc.getLength()); + pattern = Pattern.compile(HEX_PATTERN); + matcher = pattern.matcher(str); + if (matcher.matches()) { + Color color = new Color(Integer.parseInt(str, 16)); + CustomChooserPanel.this.getColorSelectionModel().setSelectedColor(color); + } + + } catch (BadLocationException e1) { + FRLogger.getLogger().error(e1.getMessage()); + } + } } /** - * This method is called when the mouse is dragged over the gradient - * image. The JColorChooser is then updated with the new HSB values. - * - * @param e The MouseEvent. + * This helper class handles mouse events on the gradient image. + */ + class MainGradientMouseListener extends MouseAdapter + implements MouseMotionListener { + /** + * This method is called when the mouse is pressed over the gradient + * image. The JColorChooser is then updated with new HSB values. + * + * @param e The MouseEvent. + */ + public void mousePressed(MouseEvent e) { + gradientPoint = e.getPoint(); + update(e.getPoint()); + } + + /** + * This method is called when the mouse is dragged over the gradient + * image. The JColorChooser is then updated with the new HSB values. + * + * @param e The MouseEvent. + */ + public void mouseDragged(MouseEvent e) { + Point p = e.getPoint(); + if (isMouseOutOfImage(p)) { + return; + } + + gradientPoint = p; + update(p); + } + + private boolean isMouseOutOfImage(Point p) { + return (p.x < 0 || p.y < 0 || p.y > IMG_HEIGHT || p.x > IMG_WIDTH); + } + + /** + * This method is called when the mouse is moved over the gradient image. + * + * @param e The MouseEvent. + */ + public void mouseMoved(MouseEvent e) { + // Do nothing. + } + + /** + * This method updates the JColorChooser with the new values. + * + * @param p The Point where the MouseEvent occurred. + */ + private void update(Point p) { + handlingMouse = true; + if (hSpinner.isEnabled()) { + updateH(p); + } else if (sSpinner.isEnabled()) { + updateS(p); + } else { + updateB(p); + } + handlingMouse = false; + } + + /** + * This method updates the SB values if Hue is locked. + * + * @param p The point where the MouseEvent occurred. + */ + private void updateH(Point p) { + float s = (IMG_WIDTH - p.x * 1f) / IMG_WIDTH; + float b = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; + + // Avoid two changes to the model by changing internalChange to true. + internalChange = true; + sSpinner.setValue(new Integer((int) (s * S_MAX))); + internalChange = false; + bSpinner.setValue(new Integer((int) (b * L_MAX))); + + revalidate(); + } + + /** + * This method updates the HB values if Saturation is locked. + * + * @param p The point where the MouseEvent occurred. + */ + private void updateS(Point p) { + float h = p.x * 1f / IMG_WIDTH; + float b = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; + + internalChange = true; + hSpinner.setValue(new Integer((int) (h * H_MAX))); + internalChange = false; + bSpinner.setValue(new Integer((int) (b * L_MAX))); + + revalidate(); + } + + /** + * This method updates the HS values if Brightness is locked. + * + * @param p The point where the MouseEvent occurred. + */ + private void updateB(Point p) { + float h = p.x * 1f / IMG_WIDTH; + float s = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; + + internalChange = true; + hSpinner.setValue(new Integer((int) (h * H_MAX))); + internalChange = false; + sSpinner.setValue(new Integer((int) (s * S_MAX))); + + revalidate(); + } + } + + /** + * This method listens for slider value changes. */ - public void mouseDragged(MouseEvent e) - { - Point p = e.getPoint(); - if (isMouseOutOfImage(p)){ - return; - } - - gradientPoint = p; - update(p); + class SliderChangeListener implements ChangeListener { + /** + * This method is called when the slider value changes. It should change + * the color of the JColorChooser. + * + * @param e The ChangeEvent. + */ + public void stateChanged(ChangeEvent e) { + if (internalChange) { + return; + } + + + Integer value = new Integer(slider.getValue()); + + switch (locked) { + case HLOCKED: + hSpinner.setValue(value); + break; + case SLOCKED: + sSpinner.setValue(value); + break; + case BLOCKED: + bSpinner.setValue(value); + break; + } + updateImageAndTrack(); + } + } + + /** + * This helper class determines the active UIBasicSpinner. + */ + class RadioStateListener extends MouseAdapter + implements MouseMotionListener { + /** + * This method is called when there is a new UIRadioButton that was + * selected. As a result, it should activate the associated UIBasicSpinner. + * + * @param e The ChangeEvent. + */ + public void mousePressed(MouseEvent e) { + UIBasicSpinner change; + if (e.getSource() == hRadio) { + locked = HLOCKED; + change = hSpinner; + } else if (e.getSource() == sRadio) { + locked = SLOCKED; + change = sSpinner; + } else { + locked = BLOCKED; + change = bSpinner; + } + + hSpinner.setEnabled(false); + sSpinner.setEnabled(false); + bSpinner.setEnabled(false); + change.setEnabled(true); + updateSlider(); + updateTrack(); + updateImage(); + repaint(); + + } } - - private boolean isMouseOutOfImage(Point p){ - return (p.x < 0 || p.y < 0 || p.y > IMG_HEIGHT || p.x > IMG_WIDTH); + + /** + * hsl 监听 + */ + class ImageScrollListener implements ChangeListener { + /** + * This method is called whenever one of the UIBasicSpinner values change. The + * JColorChooser should be updated with the new HSB values. + * + * @param e The ChangeEvent. + */ + public void stateChanged(ChangeEvent e) { + if (internalChange) { + return; + } + updateImageAndTrack(); + updateSlider(); + } } /** - * This method is called when the mouse is moved over the gradient image. - * - * @param e The MouseEvent. + * rgb 监听 */ - public void mouseMoved(MouseEvent e) - { - // Do nothing. + class ImageRGBScrollListener implements ChangeListener { + /** + * This method is called whenever one of the UIBasicSpinner values change. The + * JColorChooser should be updated with the new HSB values. + * + * @param e The ChangeEvent. + */ + public void stateChanged(ChangeEvent e) { + if (internalChange) { + return; + } + + + int r = (Integer) rSpinner.getValue(); + int g = (Integer) gSpinner.getValue(); + int bb = (Integer) bbSpinner.getValue(); + + spinnerTrigger = true; + getColorSelectionModel().setSelectedColor(new Color(r, g, bb)); + spinnerTrigger = false; + + updateChooser(); + repaint(); + } } /** - * This method updates the JColorChooser with the new values. - * - * @param p The Point where the MouseEvent occurred. + * Creates a new DefaultHSBChooserPanel object. */ - private void update(Point p) - { - handlingMouse = true; - if (hSpinner.isEnabled()){ - updateH(p); - }else if (sSpinner.isEnabled()){ - updateS(p); - }else{ - updateB(p); - } - handlingMouse = false; + CustomChooserPanel() { + super(); } /** - * This method updates the SB values if Hue is locked. + * This method returns the name displayed by the JColorChooser tab that + * holds this panel. * - * @param p The point where the MouseEvent occurred. + * @return The name displayed in the JColorChooser tab. */ - private void updateH(Point p) - { - float s = (IMG_WIDTH - p.x * 1f) / IMG_WIDTH; - float b = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; - - // Avoid two changes to the model by changing internalChange to true. - internalChange = true; - sSpinner.setValue(new Integer((int) (s * S_MAX))); - internalChange = false; - bSpinner.setValue(new Integer((int) (b * L_MAX))); - - revalidate(); + public String getDisplayName() { + return Inter.getLocText("FR-Designer_Custom"); } /** - * This method updates the HB values if Saturation is locked. - * - * @param p The point where the MouseEvent occurred. + * This method updates the various components inside the HSBPanel (the + * UIBasicSpinners, the JSlider, and the gradient image point) with updated + * values when the JColorChooser color value changes. */ - private void updateS(Point p) - { - float h = p.x * 1f / IMG_WIDTH; - float b = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; + public void updateChooser() { + Color c = getColorSelectionModel().getSelectedColor(); + float[] hsbVals = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), + null); + internalChange = true; + + adjustHSLValue(hsbVals); + + internalChange = false; + + if (!handlingMouse && slider != null && !slider.getValueIsAdjusting()) { + updateImage(); + } + + if (!handlingMouse || locked != HLOCKED) { + updateTrack(); + } + updateTextFields(); + updateHexFields(); + } + + private void adjustHSLValue(float[] hsbVals) { + if (!spinnerTrigger) { + hSpinner.setValue(new Integer((int) (hsbVals[0] * HSPINNER_VALUE))); + sSpinner.setValue(new Integer((int) (hsbVals[1] * SSPINNER_VALUE))); + bSpinner.setValue(new Integer((int) (hsbVals[2] * LSPINNER_VALUE))); + } + switch (locked) { + case HLOCKED: + if (slider != null) { + slider.setValue(((Number) hSpinner.getValue()).intValue()); + } + if (!handlingMouse) { + gradientPoint.x = (int) ((1 + - ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_WIDTH); + gradientPoint.y = (int) ((1 + - ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); + } + break; + case SLOCKED: + if (slider != null) { + slider.setValue(((Number) sSpinner.getValue()).intValue()); + } + if (!handlingMouse) { + gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); + gradientPoint.y = (int) ((1 + - ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); + } + break; + case BLOCKED: + if (slider != null) { + slider.setValue(((Number) bSpinner.getValue()).intValue()); + } + if (!handlingMouse) { + gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); + gradientPoint.y = (int) ((1 + - ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_HEIGHT); + } + break; + } + } + + private void updateImageAndTrack() { + float h = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; + float s = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; + float b = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; - internalChange = true; - hSpinner.setValue(new Integer((int) (h * H_MAX))); - internalChange = false; - bSpinner.setValue(new Integer((int) (b * L_MAX))); + spinnerTrigger = true; + getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b))); + spinnerTrigger = false; - revalidate(); + if (!handlingMouse && slider != null && !slider.getValueIsAdjusting()) { + updateImage(); + updateTrack(); + } + updateTextFields(); + updateHexFields(); + repaint(); } /** - * This method updates the HS values if Brightness is locked. - * - * @param p The point where the MouseEvent occurred. + * This method builds the DefaultHSBChooserPanel. */ - private void updateB(Point p) - { - float h = p.x * 1f / IMG_WIDTH; - float s = (IMG_HEIGHT - p.y * 1f) / IMG_HEIGHT; + protected void buildChooser() { + setLayout(new BorderLayout()); + add(buildRightPanel(), BorderLayout.EAST); + JPanel container = new JPanel(); + container.setLayout(new BorderLayout()); + + gradientPanel = createGradientPanel(); + MouseAdapter ml = new MainGradientMouseListener(); + gradientPanel.addMouseListener(ml); + gradientPanel.addMouseMotionListener((MouseMotionListener) ml); + + trackPanel = createTrackPanel(); + + slider = new UISlider(); + slider.setPaintTrack(false); + slider.setPaintTicks(false); + + slider.setOrientation(SwingConstants.VERTICAL); - internalChange = true; - hSpinner.setValue(new Integer((int) (h * H_MAX))); - internalChange = false; - sSpinner.setValue(new Integer((int) (s * S_MAX))); + updateSlider(); + + container.add(gradientPanel, BorderLayout.WEST); + container.add(slider, BorderLayout.CENTER); + container.add(trackPanel, BorderLayout.EAST); + + add(container, BorderLayout.WEST); + slider.addChangeListener(new SliderChangeListener()); + + updateTextFields(); + updateHexFields(); + repaint(); + } + + private JPanel createGradientPanel() { + return new JPanel() { + public Dimension getPreferredSize() { + return new Dimension(IMG_WIDTH, IMG_HEIGHT); + } + + public void paint(Graphics g) { + if (gradientImage != null) { + g.drawImage(gradientImage, 0, 0, this); + } + + Color saved = g.getColor(); + g.setColor(Color.WHITE); + g.drawOval(gradientPoint.x - 3, gradientPoint.y - 3, 6, 6); + g.setColor(saved); + } + }; + } + + private JPanel createTrackPanel() { + return new JPanel() { + public Dimension getPreferredSize() { + return new Dimension(TRACK_WIDTH, IMG_HEIGHT); + } - revalidate(); + public void paint(Graphics g) { + if (trackImage != null) { + g.drawImage(trackImage, 0, 0, this); + } + + } + }; } - } - /** - * This method listens for slider value changes. - */ - class SliderChangeListener implements ChangeListener - { /** - * This method is called when the slider value changes. It should change - * the color of the JColorChooser. + * This method uninstalls the DefaultHSBPanel. * - * @param e The ChangeEvent. + * @param chooser The JColorChooser to remove this panel from. */ - public void stateChanged(ChangeEvent e) - { - if (internalChange){ - return; - } - - - Integer value = new Integer(slider.getValue()); - - switch (locked) - { - case HLOCKED: - hSpinner.setValue(value); - break; - case SLOCKED: - sSpinner.setValue(value); - break; - case BLOCKED: - bSpinner.setValue(value); - break; - } - updateImageAndTrack(); + public void uninstallChooserPanel(JColorChooser chooser) { + trackImage = null; + gradientImage = null; + gradientPanel = null; + slider = null; + + hSpinner = null; + sSpinner = null; + bSpinner = null; + + hRadio = null; + sRadio = null; + bRadio = null; + + removeAll(); + super.uninstallChooserPanel(chooser); } - } - - /** - * This helper class determines the active UIBasicSpinner. - */ - class RadioStateListener extends MouseAdapter - implements MouseMotionListener - { + /** - * This method is called when there is a new UIRadioButton that was - * selected. As a result, it should activate the associated UIBasicSpinner. + * This helper method creates the right side panel (the panel with the + * Spinners and TextFields). * - * @param e The ChangeEvent. + * @return The right side panel. */ - public void mousePressed(MouseEvent e) - { - UIBasicSpinner change; - if (e.getSource() == hRadio) - { - locked = HLOCKED; - change = hSpinner; - } - else if (e.getSource() == sRadio) - { - locked = SLOCKED; - change = sSpinner; - } - else - { - locked = BLOCKED; - change = bSpinner; - } - - hSpinner.setEnabled(false); + private Container buildRightPanel() { + JPanel container = new JPanel(); + container.setLayout(new FlowLayout(FlowLayout.RIGHT)); + + // 主面板 + JPanel mainPanel = new JPanel(); + mainPanel.setLayout(new BorderLayout(0, 10)); + UILabel label = new UILabel(); + label.setSize(200, 200); + container.add(label); + container.add(mainPanel); + + // hsl和rgb面板 + JPanel hslAndRgbPanel = new JPanel(); + hslAndRgbPanel.setLayout(new BorderLayout(0, 16)); + hslAndRgbPanel.add(initialHSLPanel(), BorderLayout.CENTER); + hslAndRgbPanel.add(initialRGBPanel(), BorderLayout.SOUTH); + + // 十六进制面板 + JPanel hexPanel = new JPanel(); + hexPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 0)); + hexPanel.add(new UILabel("#")); + hexPanel.add(field); + + mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER); + mainPanel.add(hexPanel, BorderLayout.SOUTH); + + return container; + } + + //初始化HSL部分 + private JPanel initialHSLPanel() { + hRadio = new UIRadioButton("H"); + sRadio = new UIRadioButton("S"); + bRadio = new UIRadioButton("L"); + ButtonGroup group = new ButtonGroup(); + group.add(hRadio); + group.add(sRadio); + group.add(bRadio); + + hSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 359, 1)); + sSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 100, 1)); + bSpinner = new UIBasicSpinner(new SpinnerNumberModel(100, 0, 100, 1)); + hSpinner.setEnabled(true); sSpinner.setEnabled(false); bSpinner.setEnabled(false); - change.setEnabled(true); - updateSlider(); - updateTrack(); - updateImage(); - repaint(); - + + MouseAdapter cl = new RadioStateListener(); + locked = HLOCKED; + hRadio.setSelected(true); + hRadio.addMouseListener(cl); + sRadio.addMouseListener(cl); + bRadio.addMouseListener(cl); + + ChangeListener scroll = new ImageScrollListener(); + hSpinner.addChangeListener(scroll); + sSpinner.addChangeListener(scroll); + bSpinner.addChangeListener(scroll); + + JPanel hslPanel = new JPanel(); + hslPanel.setLayout(new GridLayout(3, 0, 0, 5)); + + JPanel hPanel = new JPanel(); + hPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); + hPanel.add(hRadio); + hPanel.add(hSpinner); + hslPanel.add(hPanel); + + JPanel sPanel = new JPanel(); + sPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); + sPanel.add(sRadio); + sPanel.add(sSpinner); + hslPanel.add(sPanel); + + JPanel lPanel = new JPanel(); + lPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); + lPanel.add(bRadio); + lPanel.add(bSpinner); + hslPanel.add(lPanel); + return hslPanel; + } + + private JPanel initialRGBPanel() { + // 初始化RGB部分 + rSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1)); + gSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1)); + bbSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1)); + + rSpinner.setEnabled(true); + gSpinner.setEnabled(true); + bbSpinner.setEnabled(true); + + addRGBSpinnerChangeLisener(); + + TextDocumentListener listen = new TextDocumentListener(); + field = new UITextField(); + field.setPreferredSize(new Dimension(70, 18)); + field.getDocument().addDocumentListener(listen); + + JPanel rgbPanel = new JPanel(); + rgbPanel.setLayout(new GridLayout(3, 0, 0, 5)); + + JPanel rPanel = new JPanel(); + rPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); + rPanel.add(R); + rPanel.add(rSpinner); + rgbPanel.add(rPanel); + + JPanel gPanel = new JPanel(); + gPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); + gPanel.add(G); + gPanel.add(gSpinner); + rgbPanel.add(gPanel); + + JPanel bPanel = new JPanel(); + bPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); + bPanel.add(B); + bPanel.add(bbSpinner); + rgbPanel.add(bPanel); + + return rgbPanel; } - } - /** - * hsl 监听 - */ - class ImageScrollListener implements ChangeListener - { /** - * This method is called whenever one of the UIBasicSpinner values change. The - * JColorChooser should be updated with the new HSB values. + * This method returns the small display icon. * - * @param e The ChangeEvent. + * @return The small display icon. */ - public void stateChanged(ChangeEvent e) - { - if (internalChange){ - return; - } - updateImageAndTrack(); - updateSlider(); + public Icon getSmallDisplayIcon() { + return null; } - } - - /** - * rgb 监听 - */ - class ImageRGBScrollListener implements ChangeListener - { + /** - * This method is called whenever one of the UIBasicSpinner values change. The - * JColorChooser should be updated with the new HSB values. + * This method returns the large display icon. * - * @param e The ChangeEvent. + * @return The large display icon. */ - public void stateChanged(ChangeEvent e) - { - if (internalChange){ - return; - } - - - int r = (Integer) rSpinner.getValue(); - int g = (Integer) gSpinner.getValue(); - int bb = (Integer) bbSpinner.getValue(); - - spinnerTrigger = true; - getColorSelectionModel().setSelectedColor(new Color(r,g,bb)); - spinnerTrigger = false; - - updateChooser(); - repaint(); - } - } - - /** - * Creates a new DefaultHSBChooserPanel object. - */ - CustomChooserPanel() - { - super(); - } - - /** - * This method returns the name displayed by the JColorChooser tab that - * holds this panel. - * - * @return The name displayed in the JColorChooser tab. - */ - public String getDisplayName() - { - return Inter.getLocText("FR-Designer_Custom"); - } - - /** - * This method updates the various components inside the HSBPanel (the - * UIBasicSpinners, the JSlider, and the gradient image point) with updated - * values when the JColorChooser color value changes. - */ - public void updateChooser() - { - Color c = getColorSelectionModel().getSelectedColor(); - float[] hsbVals = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), - null); - internalChange = true; - - adjustHSLValue(hsbVals); - - internalChange = false; - - if (! handlingMouse && slider != null && ! slider.getValueIsAdjusting()){ - updateImage(); + public Icon getLargeDisplayIcon() { + return null; } - if (! handlingMouse || locked != HLOCKED){ - updateTrack(); - } - updateTextFields(); - updateHexFields(); - } - - private void adjustHSLValue(float[] hsbVals){ - if (! spinnerTrigger) - { - hSpinner.setValue(new Integer((int) (hsbVals[0] * HSPINNER_VALUE))); - sSpinner.setValue(new Integer((int) (hsbVals[1] * SSPINNER_VALUE))); - bSpinner.setValue(new Integer((int) (hsbVals[2] * LSPINNER_VALUE))); - } - switch (locked) - { - case HLOCKED: - if (slider != null){ - slider.setValue(((Number) hSpinner.getValue()).intValue()); - } - if (! handlingMouse) - { - gradientPoint.x = (int) ((1 - - ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_WIDTH); - gradientPoint.y = (int) ((1 - - ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); - } - break; - case SLOCKED: - if (slider != null){ - slider.setValue(((Number) sSpinner.getValue()).intValue()); - } - if (! handlingMouse) - { - gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); - gradientPoint.y = (int) ((1 - - ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); - } - break; - case BLOCKED: - if (slider != null){ - slider.setValue(((Number) bSpinner.getValue()).intValue()); - } - if (! handlingMouse) - { - gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); - gradientPoint.y = (int) ((1 - - ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_HEIGHT); - } - break; - } - } - - private void updateImageAndTrack(){ - float h = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; - float s = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; - float b = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; - - spinnerTrigger = true; - getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b))); - spinnerTrigger = false; - - if (! handlingMouse && slider != null && ! slider.getValueIsAdjusting()) - { - updateImage(); - updateTrack(); + /** + * This method updates the gradient image with a new one taking the Hue + * value as the constant. + */ + private void updateHLockImage() { + int index = 0; + int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; + float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; + + for (int j = 0; j < IMG_HEIGHT; j++) { + for (int i = 0; i < IMG_WIDTH; i++) { + pix[index++] = Color.HSBtoRGB(hValue, (IMG_WIDTH - i * 1f) / IMG_WIDTH, + (IMG_HEIGHT - j * 1f) / IMG_HEIGHT) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + } } - updateTextFields(); - updateHexFields(); - repaint(); - } - - /** - * This method builds the DefaultHSBChooserPanel. - */ - protected void buildChooser() - { - setLayout(new BorderLayout()); - add(buildRightPanel(), BorderLayout.EAST); - JPanel container = new JPanel(); - container.setLayout(new BorderLayout()); - - gradientPanel = createGradientPanel(); - MouseAdapter ml = new MainGradientMouseListener(); - gradientPanel.addMouseListener(ml); - gradientPanel.addMouseMotionListener((MouseMotionListener) ml); - - trackPanel = createTrackPanel(); - - slider = new UISlider(); - slider.setPaintTrack(false); - slider.setPaintTicks(false); - - slider.setOrientation(SwingConstants.VERTICAL); - - updateSlider(); - - container.add(gradientPanel, BorderLayout.WEST); - container.add(slider, BorderLayout.CENTER); - container.add(trackPanel, BorderLayout.EAST); - - add(container, BorderLayout.WEST); - slider.addChangeListener(new SliderChangeListener()); - - updateTextFields(); - updateHexFields(); - repaint(); - } - - private JPanel createGradientPanel(){ - return new JPanel() - { - public Dimension getPreferredSize() - { - return new Dimension(IMG_WIDTH, IMG_HEIGHT); - } - - public void paint(Graphics g) - { - if (gradientImage != null){ - g.drawImage(gradientImage, 0, 0, this); - } - - Color saved = g.getColor(); - g.setColor(Color.WHITE); - g.drawOval(gradientPoint.x - 3, gradientPoint.y - 3, 6, 6); - g.setColor(saved); - } - }; - } - - private JPanel createTrackPanel(){ - return new JPanel() - { - public Dimension getPreferredSize() - { - return new Dimension(TRACK_WIDTH, IMG_HEIGHT); - } - - public void paint(Graphics g) - { - if (trackImage != null){ - g.drawImage(trackImage, 0, 0, this); - } - - } - }; - } - - /** - * This method uninstalls the DefaultHSBPanel. - * - * @param chooser The JColorChooser to remove this panel from. - */ - public void uninstallChooserPanel(JColorChooser chooser) - { - trackImage = null; - gradientImage = null; - gradientPanel = null; - slider = null; - - hSpinner = null; - sSpinner = null; - bSpinner = null; - - hRadio = null; - sRadio = null; - bRadio = null; - - removeAll(); - super.uninstallChooserPanel(chooser); - } - - /** - * This helper method creates the right side panel (the panel with the - * Spinners and TextFields). - * - * @return The right side panel. - */ - private Container buildRightPanel() - { - JPanel container = new JPanel(); - container.setLayout(new FlowLayout(FlowLayout.RIGHT)); - - // 主面板 - JPanel mainPanel = new JPanel(); - mainPanel.setLayout(new BorderLayout(0, 10)); - UILabel label = new UILabel(); - label.setSize(200,200); - container.add(label); - container.add(mainPanel); - - // hsl和rgb面板 - JPanel hslAndRgbPanel = new JPanel(); - hslAndRgbPanel.setLayout(new BorderLayout(0,16)); - hslAndRgbPanel.add(initialHSLPanel(),BorderLayout.CENTER); - hslAndRgbPanel.add(initialRGBPanel(),BorderLayout.SOUTH); - - // 十六进制面板 - JPanel hexPanel = new JPanel(); - hexPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 0)); - hexPanel.add(new UILabel("#")); - hexPanel.add(field); - - mainPanel.add(hslAndRgbPanel,BorderLayout.CENTER); - mainPanel.add(hexPanel,BorderLayout.SOUTH); - - return container; - } - - //初始化HSL部分 - private JPanel initialHSLPanel(){ - hRadio = new UIRadioButton("H"); - sRadio = new UIRadioButton("S"); - bRadio = new UIRadioButton("L"); - ButtonGroup group = new ButtonGroup(); - group.add(hRadio); - group.add(sRadio); - group.add(bRadio); - - hSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 359, 1)); - sSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 100, 1)); - bSpinner = new UIBasicSpinner(new SpinnerNumberModel(100, 0, 100, 1)); - hSpinner.setEnabled(true); - sSpinner.setEnabled(false); - bSpinner.setEnabled(false); - - MouseAdapter cl = new RadioStateListener(); - locked = HLOCKED; - hRadio.setSelected(true); - hRadio.addMouseListener(cl); - sRadio.addMouseListener(cl); - bRadio.addMouseListener(cl); - - ChangeListener scroll = new ImageScrollListener(); - hSpinner.addChangeListener(scroll); - sSpinner.addChangeListener(scroll); - bSpinner.addChangeListener(scroll); - - JPanel hslPanel = new JPanel(); - hslPanel.setLayout(new GridLayout(3,0,0,5)); - - JPanel hPanel = new JPanel(); - hPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); - hPanel.add(hRadio); - hPanel.add(hSpinner); - hslPanel.add(hPanel); - - JPanel sPanel = new JPanel(); - sPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); - sPanel.add(sRadio); - sPanel.add(sSpinner); - hslPanel.add(sPanel); - - JPanel lPanel = new JPanel(); - lPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); - lPanel.add(bRadio); - lPanel.add(bSpinner); - hslPanel.add(lPanel); - return hslPanel; - } - - private JPanel initialRGBPanel(){ - // 初始化RGB部分 - rSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1)); - gSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1)); - bbSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, 255, 1)); - - rSpinner.setEnabled(true); - gSpinner.setEnabled(true); - bbSpinner.setEnabled(true); - - addRGBSpinnerChangeLisener(); - - TextDocumentListener listen = new TextDocumentListener(); - field = new UITextField(); - field.setPreferredSize(new Dimension(70,18)); - field.getDocument().addDocumentListener(listen); - - JPanel rgbPanel = new JPanel(); - rgbPanel.setLayout(new GridLayout(3,0,0,5)); - - JPanel rPanel = new JPanel(); - rPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); - rPanel.add(R); - rPanel.add(rSpinner); - rgbPanel.add(rPanel); - - JPanel gPanel = new JPanel(); - gPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); - gPanel.add(G); - gPanel.add(gSpinner); - rgbPanel.add(gPanel); - - JPanel bPanel = new JPanel(); - bPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); - bPanel.add(B); - bPanel.add(bbSpinner); - rgbPanel.add(bPanel); - - return rgbPanel; - } - - /** - * This method returns the small display icon. - * - * @return The small display icon. - */ - public Icon getSmallDisplayIcon() - { - return null; - } - - /** - * This method returns the large display icon. - * - * @return The large display icon. - */ - public Icon getLargeDisplayIcon() - { - return null; - } - - /** - * This method updates the gradient image with a new one taking the Hue - * value as the constant. - */ - private void updateHLockImage() - { - int index = 0; - int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; - float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; - - for (int j = 0; j < IMG_HEIGHT; j++) - { - for (int i = 0; i < IMG_WIDTH; i++){ - pix[index++] = Color.HSBtoRGB(hValue, (IMG_WIDTH - i * 1f) / IMG_WIDTH, - (IMG_HEIGHT - j * 1f) / IMG_HEIGHT) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + + gradientImage = createImage(new MemoryImageSource(IMG_WIDTH, IMG_HEIGHT, + pix, 0, IMG_WIDTH)); + } + + /** + * This method updates the gradient image with a new one taking the + * Brightness value as the constant. + */ + private void updateBLockImage() { + int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; + float bValue = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; + + int index = 0; + for (int j = 0; j < IMG_HEIGHT; j++) { + for (int i = 0; i < IMG_WIDTH; i++) { + pix[index++] = Color.HSBtoRGB(i * 1f / IMG_WIDTH, + (IMG_HEIGHT - j * 1f) / IMG_HEIGHT, bValue) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + } } + + gradientImage = createImage(new MemoryImageSource(IMG_WIDTH, IMG_HEIGHT, + pix, 0, IMG_WIDTH)); } - gradientImage = createImage(new MemoryImageSource(IMG_WIDTH, IMG_HEIGHT, - pix, 0, IMG_WIDTH)); - } - - /** - * This method updates the gradient image with a new one taking the - * Brightness value as the constant. - */ - private void updateBLockImage() - { - int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; - float bValue = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; - - int index = 0; - for (int j = 0; j < IMG_HEIGHT; j++){ - for (int i = 0; i < IMG_WIDTH; i++){ - pix[index++] = Color.HSBtoRGB(i * 1f / IMG_WIDTH, - (IMG_HEIGHT - j * 1f) / IMG_HEIGHT, bValue) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + /** + * This method updates the gradient image with a new one taking the + * Saturation value as the constant. + */ + private void updateSLockImage() { + int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; + float sValue = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; + + int index = 0; + for (int j = 0; j < IMG_HEIGHT; j++) { + for (int i = 0; i < IMG_WIDTH; i++) { + pix[index++] = Color.HSBtoRGB(i * 1f / IMG_WIDTH, sValue, + (IMG_HEIGHT - j * 1f) / IMG_HEIGHT) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + } } + + gradientImage = createImage(new MemoryImageSource(IMG_WIDTH, IMG_HEIGHT, + pix, 0, IMG_WIDTH)); } - gradientImage = createImage(new MemoryImageSource(IMG_WIDTH, IMG_HEIGHT, - pix, 0, IMG_WIDTH)); - } - - /** - * This method updates the gradient image with a new one taking the - * Saturation value as the constant. - */ - private void updateSLockImage() - { - int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; - float sValue = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; - - int index = 0; - for (int j = 0; j < IMG_HEIGHT; j++){ - for (int i = 0; i < IMG_WIDTH; i++){ - pix[index++] = Color.HSBtoRGB(i * 1f / IMG_WIDTH, sValue, - (IMG_HEIGHT - j * 1f) / IMG_HEIGHT)| (BINARY_FOR_EIGHT << TWENTY_FOUR); + /** + * This method calls the appropriate method to update the gradient image + * depending on which HSB value is constant. + */ + private void updateImage() { + switch (locked) { + case HLOCKED: + updateHLockImage(); + break; + case SLOCKED: + updateSLockImage(); + break; + case BLOCKED: + updateBLockImage(); + break; } } - - gradientImage = createImage(new MemoryImageSource(IMG_WIDTH, IMG_HEIGHT, - pix, 0, IMG_WIDTH)); - } - - /** - * This method calls the appropriate method to update the gradient image - * depending on which HSB value is constant. - */ - private void updateImage() - { - switch (locked) - { - case HLOCKED: - updateHLockImage(); - break; - case SLOCKED: - updateSLockImage(); - break; - case BLOCKED: - updateBLockImage(); - break; - } - } - - /** - * This method updates the TextFields with the correct RGB values. - */ - private void updateTextFields() - { - int c = getColorSelectionModel().getSelectedColor().getRGB(); - - removeRGBSpinnerChangeLisener(); - rSpinner.setValue(Integer.parseInt("" + (c >> BINARY_FOR_FOUR & HEX_FF))); - gSpinner.setValue(Integer.parseInt("" + (c >> BINARY_FOR_THTEE & HEX_FF))); - bbSpinner.setValue(Integer.parseInt("" + (c & HEX_FF))); - addRGBSpinnerChangeLisener(); - - repaint(); - } - - private void removeRGBSpinnerChangeLisener(){ - rSpinner.removeChangeListener(rgbScroll); - gSpinner.removeChangeListener(rgbScroll); - bbSpinner.removeChangeListener(rgbScroll); - } - - private void addRGBSpinnerChangeLisener(){ - rSpinner.addChangeListener(rgbScroll); - gSpinner.addChangeListener(rgbScroll); - bbSpinner.addChangeListener(rgbScroll); - } - - private void updateHexFields() - { - Color color = getColorSelectionModel().getSelectedColor(); - - String R = Integer.toHexString(color.getRed()); - R = R.length() < 2 ? ('0' + R) : R; - String B = Integer.toHexString(color.getBlue()); - B = B.length() < 2 ? ('0' + B) : B; - String G = Integer.toHexString(color.getGreen()); - G = G.length() < 2 ? ('0' + G) : G; - - try{ - field.setText(R + G + B); - }catch(Exception e){ - // 因为有了DocumentListener的监听,导致setText()的时候报错但不影响使用 - // 所以只捕捉,不处理 + + /** + * This method updates the TextFields with the correct RGB values. + */ + private void updateTextFields() { + int c = getColorSelectionModel().getSelectedColor().getRGB(); + + removeRGBSpinnerChangeLisener(); + rSpinner.setValue(Integer.parseInt("" + (c >> BINARY_FOR_FOUR & HEX_FF))); + gSpinner.setValue(Integer.parseInt("" + (c >> BINARY_FOR_THTEE & HEX_FF))); + bbSpinner.setValue(Integer.parseInt("" + (c & HEX_FF))); + addRGBSpinnerChangeLisener(); + + repaint(); + } + + private void removeRGBSpinnerChangeLisener() { + rSpinner.removeChangeListener(rgbScroll); + gSpinner.removeChangeListener(rgbScroll); + bbSpinner.removeChangeListener(rgbScroll); + } + + private void addRGBSpinnerChangeLisener() { + rSpinner.addChangeListener(rgbScroll); + gSpinner.addChangeListener(rgbScroll); + bbSpinner.addChangeListener(rgbScroll); + } + + private void updateHexFields() { + Color color = getColorSelectionModel().getSelectedColor(); + + String R = Integer.toHexString(color.getRed()); + R = R.length() < 2 ? ('0' + R) : R; + String B = Integer.toHexString(color.getBlue()); + B = B.length() < 2 ? ('0' + B) : B; + String G = Integer.toHexString(color.getGreen()); + G = G.length() < 2 ? ('0' + G) : G; + + try { + field.setText(R + G + B); + } catch (Exception e) { + // 因为有了DocumentListener的监听,导致setText()的时候报错但不影响使用 + // 所以只捕捉,不处理 + } + repaint(); } - repaint(); - } - - /** - * This method updates the slider in response to making a different HSB - * property the constant. - */ - private void updateSlider() - { - if (slider == null){ - return; + + /** + * This method updates the slider in response to making a different HSB + * property the constant. + */ + private void updateSlider() { + if (slider == null) { + return; + } + + slider.setMinimum(0); + if (locked == HLOCKED) { + internalChange = true; + slider.setValue(((Number) hSpinner.getValue()).intValue()); + slider.setMaximum(359); + internalChange = false; + slider.setInverted(true); + } else { + slider.setInverted(false); + if (locked == SLOCKED) { + slider.setValue(((Number) sSpinner.getValue()).intValue()); + } else { + slider.setValue(((Number) bSpinner.getValue()).intValue()); + } + slider.setMaximum(100); + slider.setInverted(false); + } + repaint(); } - - slider.setMinimum(0); - if (locked == HLOCKED) - { - internalChange = true; - slider.setValue(((Number) hSpinner.getValue()).intValue()); - slider.setMaximum(359); - internalChange = false; - slider.setInverted(true); - } - else - { - slider.setInverted(false); - if (locked == SLOCKED){ - slider.setValue(((Number) sSpinner.getValue()).intValue()); - }else{ - slider.setValue(((Number) bSpinner.getValue()).intValue()); - } - slider.setMaximum(100); - slider.setInverted(false); - } - repaint(); - } - - /** - * This method updates the track gradient image depending on which HSB - * property is constant. - */ - private void updateTrack() - { - switch (locked) - { - case HLOCKED: - updateHTrack(); - break; - case SLOCKED: - updateSTrack(); - break; - case BLOCKED: - updateBTrack(); - break; - } - } - - /** - * This method updates the track gradient image if the Hue value is allowed - * to change (according to the UIRadioButtons). - */ - private void updateHTrack() - { - int trackIndex = 0; - int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT]; - - for (int j = 0; j < IMG_HEIGHT; j++){ - for (int i = 0; i < TRACK_WIDTH; i++){ - trackPix[trackIndex++] = Color.HSBtoRGB(j * 1f / IMG_HEIGHT, 1f, 1f) - | (BINARY_FOR_EIGHT << TWENTY_FOUR); + + /** + * This method updates the track gradient image depending on which HSB + * property is constant. + */ + private void updateTrack() { + switch (locked) { + case HLOCKED: + updateHTrack(); + break; + case SLOCKED: + updateSTrack(); + break; + case BLOCKED: + updateBTrack(); + break; } } - trackImage = createImage(new MemoryImageSource(TRACK_WIDTH, IMG_HEIGHT, - trackPix, 0, TRACK_WIDTH)); - } - - /** - * This method updates the track gradient image if the Saturation value is - * allowed to change (according to the UIRadioButtons). - */ - private void updateSTrack() - { - int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT]; - - float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; - float bValue = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; - - int trackIndex = 0; - for (int j = 0; j < IMG_HEIGHT; j++){ - for (int i = 0; i < TRACK_WIDTH; i++){ - trackPix[trackIndex++] = Color.HSBtoRGB(hValue, - (IMG_HEIGHT - j * 1f) / IMG_HEIGHT, - bValue) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + /** + * This method updates the track gradient image if the Hue value is allowed + * to change (according to the UIRadioButtons). + */ + private void updateHTrack() { + int trackIndex = 0; + int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT]; + + for (int j = 0; j < IMG_HEIGHT; j++) { + for (int i = 0; i < TRACK_WIDTH; i++) { + trackPix[trackIndex++] = Color.HSBtoRGB(j * 1f / IMG_HEIGHT, 1f, 1f) + | (BINARY_FOR_EIGHT << TWENTY_FOUR); + } } + + trackImage = createImage(new MemoryImageSource(TRACK_WIDTH, IMG_HEIGHT, + trackPix, 0, TRACK_WIDTH)); } - trackImage = createImage(new MemoryImageSource(TRACK_WIDTH, IMG_HEIGHT, - trackPix, 0, TRACK_WIDTH)); - } - - /** - * This method updates the track gradient image if the Brightness value is - * allowed to change (according to the UIRadioButtons). - */ - private void updateBTrack() - { - int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT]; - - float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; - float sValue = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; - - int trackIndex = 0; - for (int j = 0; j < IMG_HEIGHT; j++){ - for (int i = 0; i < TRACK_WIDTH; i++){ - trackPix[trackIndex++] = Color.HSBtoRGB(hValue, sValue, - (IMG_HEIGHT - j * 1f) / IMG_HEIGHT) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + /** + * This method updates the track gradient image if the Saturation value is + * allowed to change (according to the UIRadioButtons). + */ + private void updateSTrack() { + int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT]; + + float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; + float bValue = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; + + int trackIndex = 0; + for (int j = 0; j < IMG_HEIGHT; j++) { + for (int i = 0; i < TRACK_WIDTH; i++) { + trackPix[trackIndex++] = Color.HSBtoRGB(hValue, + (IMG_HEIGHT - j * 1f) / IMG_HEIGHT, + bValue) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + } } + + trackImage = createImage(new MemoryImageSource(TRACK_WIDTH, IMG_HEIGHT, + trackPix, 0, TRACK_WIDTH)); } - trackImage = createImage(new MemoryImageSource(TRACK_WIDTH, IMG_HEIGHT, - trackPix, 0, TRACK_WIDTH)); - } + /** + * This method updates the track gradient image if the Brightness value is + * allowed to change (according to the UIRadioButtons). + */ + private void updateBTrack() { + int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT]; + + float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; + float sValue = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; + + int trackIndex = 0; + for (int j = 0; j < IMG_HEIGHT; j++) { + for (int i = 0; i < TRACK_WIDTH; i++) { + trackPix[trackIndex++] = Color.HSBtoRGB(hValue, sValue, + (IMG_HEIGHT - j * 1f) / IMG_HEIGHT) | (BINARY_FOR_EIGHT << TWENTY_FOUR); + } + } + + trackImage = createImage(new MemoryImageSource(TRACK_WIDTH, IMG_HEIGHT, + trackPix, 0, TRACK_WIDTH)); + } } \ No newline at end of file From cc5d8edec95f43bb757147305f2e10fd7b2237f0 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 23 Dec 2016 11:09:50 +0800 Subject: [PATCH 39/53] =?UTF-8?q?REPORT-1096=20=E5=AE=8C=E6=88=90=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{colorPicker.png => colorPicker16.png} | Bin ...olorPickerCustom.png => colorPicker18.png} | Bin .../fr/design/style/color/ColorPicker.java | 45 +++++++++++++----- .../design/style/color/ColorSelectDialog.java | 2 +- .../style/color/CustomChooserPanel.java | 36 ++++++++++++-- .../style/color/NewColorSelectPane.java | 13 ++++- .../design/style/color/PickColorButton.java | 33 +++++-------- 7 files changed, 90 insertions(+), 39 deletions(-) rename designer_base/src/com/fr/design/images/gui/colorSelectPane/{colorPicker.png => colorPicker16.png} (100%) rename designer_base/src/com/fr/design/images/gui/colorSelectPane/{colorPickerCustom.png => colorPicker18.png} (100%) diff --git a/designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker.png b/designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker16.png similarity index 100% rename from designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker.png rename to designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker16.png diff --git a/designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPickerCustom.png b/designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker18.png similarity index 100% rename from designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPickerCustom.png rename to designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker18.png diff --git a/designer_base/src/com/fr/design/style/color/ColorPicker.java b/designer_base/src/com/fr/design/style/color/ColorPicker.java index 4d23000995..f1266eae81 100644 --- a/designer_base/src/com/fr/design/style/color/ColorPicker.java +++ b/designer_base/src/com/fr/design/style/color/ColorPicker.java @@ -3,6 +3,8 @@ package com.fr.design.style.color; /** * Created by plough on 2016/12/22. */ +//import com.fr.design.dialog.UIDialog; + import java.awt.*; import java.awt.event.*; import java.awt.geom.Ellipse2D; @@ -28,10 +30,17 @@ public class ColorPicker extends JDialog implements ActionListener private Point mousePos; // 鼠标的绝对坐标 private Color colorToSet; // 暂存要设置的颜色值 + private Boolean setColorRealTime; // 实时设定颜色值 + +// private UIDialog modalDialog; // 对上层模态对话框的引用 + /** * 构造函数,创建一个取色框窗体 */ - public ColorPicker(ColorSelectable colorSelectable) + public ColorPicker(ColorSelectable colorSelectable) { + this(colorSelectable, false); + } + public ColorPicker(ColorSelectable colorSelectable, Boolean setColorRealTime) { setUndecorated(true); // 去掉窗体边缘 setResizable(false); @@ -39,17 +48,29 @@ public class ColorPicker extends JDialog implements ActionListener setShape(shape); container.add(colorPickerPanel); addMouseListener(new MouseFunctions()); - addMouseMotionListener(new MouseMotionFunctions()); updateSize(colorPickerSize); this.colorSelectable = colorSelectable; + this.setColorRealTime = setColorRealTime; this.setAlwaysOnTop(true); this.setVisible(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + System.out.println("Construced ColorPicker."); } public void start() { timer = new Timer(1000/FPS, this); timer.start(); +// if (!this.hasFocus()) { +// // 此时的焦点应该在模态对话框上 +// modalDialog = (UIDialog)KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow(); +// System.out.println("1 modalDialog is modal? " + modalDialog.isModal()); +// modalDialog.setModal(false); +// System.out.println("2 modalDialog is modal? " + modalDialog.isModal()); +// System.out.println("1 has focus? " + this.hasFocus()); +// modalDialog.transferFocus(); +// System.out.println("2 has focus? " + this.hasFocus()); +// System.out.println("current focus: " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow()); +// } } /** @@ -59,6 +80,10 @@ public class ColorPicker extends JDialog implements ActionListener public void actionPerformed(ActionEvent e) { updateLocation(); colorToSet = colorPickerPanel.getPixelColor(mousePos); + if (setColorRealTime) { + colorSelectable.setColor(colorToSet); + } +// System.out.println("hasFocus? " + this.hasFocus()); } public void updateLocation() { @@ -85,6 +110,9 @@ public class ColorPicker extends JDialog implements ActionListener public void pickComplete() { timer.stop(); colorSelectable.setColor(colorToSet); +// if (modalDialog != null) { +// modalDialog.setModal(true); +// } this.dispose(); } @@ -102,16 +130,10 @@ public class ColorPicker extends JDialog implements ActionListener { public void mousePressed(MouseEvent e) { + System.out.println("Mouse Pressed!"); pickComplete(); } } - - private class MouseMotionFunctions extends MouseMotionAdapter - { -// public void mouseMoved(MouseEvent e) { -// hideCursor(); -// } - } } class ColorPickerPanel extends JPanel @@ -187,12 +209,11 @@ class ColorPickerPanel extends JPanel this ); - g2d.setColor(Color.black); - g2d.drawOval(0, 0, 190, 190); g2d.setColor(Color.white); g2d.drawOval(1, 1, 188, 188); g2d.drawOval(2, 2, 186, 186); g2d.setColor(Color.black); + g2d.drawOval(0, 0, 190, 190); g2d.drawOval(3, 3, 184, 184); g2d.setColor(Color.white); @@ -200,6 +221,4 @@ class ColorPickerPanel extends JPanel g2d.setColor(Color.black); g2d.drawRect(87, 87, 16, 16); } - - } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java b/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java index bee4b07d2d..f7610eed62 100644 --- a/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java @@ -137,7 +137,7 @@ public class ColorSelectDialog extends MiddleChartDialog{ public static void showDialog(Frame owner,ColorSelectDetailPane pane,Color initialColor,ColorSelectable selectePane){ ColorTracker okListener = new ColorTracker(pane); ColorSelectDialog dialog = new ColorSelectDialog(owner,pane,initialColor,okListener,selectePane); - dialog.setModal(true); +// dialog.setModal(true); dialog.show(); } diff --git a/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java b/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java index 671466c3af..87b362e616 100644 --- a/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java @@ -10,10 +10,9 @@ import java.awt.Graphics; import java.awt.GridLayout; import java.awt.Image; import java.awt.Point; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionListener; +import java.awt.event.*; import java.awt.image.MemoryImageSource; +import javax.swing.Timer; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -45,7 +44,7 @@ import com.fr.general.Inter; * * @author focus */ -class CustomChooserPanel extends AbstractColorChooserPanel { +class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelectable { /** * The gradient image displayed. */ @@ -118,6 +117,8 @@ class CustomChooserPanel extends AbstractColorChooserPanel { private transient UITextField field; +// private transient PickColorButton pickColorButton; + /** * The default width of the gradient image. @@ -709,6 +710,14 @@ class CustomChooserPanel extends AbstractColorChooserPanel { hexPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 0)); hexPanel.add(new UILabel("#")); hexPanel.add(field); + PickColorButton pickColorButton = new PickColorButton(PickColorButton.IconType.ICON18); + pickColorButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + doPickColor(); + } + }); + hexPanel.add(pickColorButton); mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER); mainPanel.add(hexPanel, BorderLayout.SOUTH); @@ -1062,4 +1071,23 @@ class CustomChooserPanel extends AbstractColorChooserPanel { trackPix, 0, TRACK_WIDTH)); } + public Color getColor() { + return getColorSelectionModel().getSelectedColor(); + } + + public void setColor(Color color) { + getColorSelectionModel().setSelectedColor(color); + } + + public void colorSetted(ColorCell cc) { + } + + /** + * 打开取色框,开始取色 + */ + public void doPickColor() { + ColorPicker colorPicker = new ColorPicker(this, true); + colorPicker.start(); + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java index 7e166560b4..581599223d 100644 --- a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java @@ -87,7 +87,13 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { centerPane.add(row1Pane); // 取色按钮 - PickColorButton pickColorButton = new PickColorButton(this); + PickColorButton pickColorButton = new PickColorButton(PickColorButton.IconType.ICON18); + pickColorButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + doPickColor(); + } + }); row1Pane.add(pickColorButton, BorderLayout.WEST); // 最近使用 @@ -216,4 +222,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { usedColorPane.updateUsedColor(); } + public void doPickColor() { + ColorPicker colorPicker = new ColorPicker(this); + colorPicker.start(); + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/style/color/PickColorButton.java b/designer_base/src/com/fr/design/style/color/PickColorButton.java index 1d98bc5850..23df762838 100644 --- a/designer_base/src/com/fr/design/style/color/PickColorButton.java +++ b/designer_base/src/com/fr/design/style/color/PickColorButton.java @@ -4,34 +4,27 @@ import com.fr.base.BaseUtils; import com.fr.design.gui.ibutton.UIButton; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; /** * Created by plough on 2016/12/22. */ public class PickColorButton extends UIButton { - private ColorSelectable colorSelectable; - public PickColorButton(ColorSelectable colorSelectable) { - super(BaseUtils.readIcon("/com/fr/design/images/gui/colorSelectPane/colorPicker.png")); + public PickColorButton(IconType iconType) { + super(); - this.colorSelectable = colorSelectable; - - this.setPreferredSize(new Dimension(16, 16)); + if (iconType == IconType.ICON16) { + this.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorSelectPane/colorPicker16.png")); + this.setPreferredSize(new Dimension(16, 16)); + } else { + this.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorSelectPane/colorPicker18.png")); + this.setPreferredSize(new Dimension(18, 18)); + } this.setCursor(new Cursor(Cursor.HAND_CURSOR)); - this.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - doPickColor(); - } - }); } - /** - * 打开取色框,开始取色 - */ - public void doPickColor() { - ColorPicker colorPicker = new ColorPicker(colorSelectable); - colorPicker.start(); + + // 取色器按钮使用的图标 + public enum IconType { + ICON16, ICON18 } } From b828b89a46337ae3b366f682271090b4aafcb430 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 23 Dec 2016 16:38:14 +0800 Subject: [PATCH 40/53] =?UTF-8?q?REPORT-1096=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E9=A2=9C=E8=89=B2=E9=9A=8F=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E4=BD=8D=E7=BD=AE=E5=8A=A8=E6=80=81=E5=8F=98=E5=8C=96?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E6=94=B9=E5=8F=96=E8=89=B2=E6=A1=86=E7=9A=84?= =?UTF-8?q?UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../colorPicker16.png | Bin .../colorPicker18.png | Bin .../gui/colorPicker/colorPickerFrame.png | Bin 0 -> 12465 bytes .../fr/design/style/color/ColorPicker.java | 43 ++++-------------- .../style/color/CustomChooserPanel.java | 16 +------ .../style/color/NewColorSelectPane.java | 14 ++---- .../design/style/color/PickColorButton.java | 19 ++++++-- 7 files changed, 28 insertions(+), 64 deletions(-) rename designer_base/src/com/fr/design/images/gui/{colorSelectPane => colorPicker}/colorPicker16.png (100%) rename designer_base/src/com/fr/design/images/gui/{colorSelectPane => colorPicker}/colorPicker18.png (100%) create mode 100644 designer_base/src/com/fr/design/images/gui/colorPicker/colorPickerFrame.png diff --git a/designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker16.png b/designer_base/src/com/fr/design/images/gui/colorPicker/colorPicker16.png similarity index 100% rename from designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker16.png rename to designer_base/src/com/fr/design/images/gui/colorPicker/colorPicker16.png diff --git a/designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker18.png b/designer_base/src/com/fr/design/images/gui/colorPicker/colorPicker18.png similarity index 100% rename from designer_base/src/com/fr/design/images/gui/colorSelectPane/colorPicker18.png rename to designer_base/src/com/fr/design/images/gui/colorPicker/colorPicker18.png diff --git a/designer_base/src/com/fr/design/images/gui/colorPicker/colorPickerFrame.png b/designer_base/src/com/fr/design/images/gui/colorPicker/colorPickerFrame.png new file mode 100644 index 0000000000000000000000000000000000000000..2772b7e20ac3842ed9e1630676a192af264c32fc GIT binary patch literal 12465 zcmX|oWmH?y(l$|#J^Pt?CK1YtQfSCT$WTyFXfo2`Um?$q_s<6e$aj=$LpJ0A?ebMh6smHJEs!EXTs$HH9$Lal+bQ`cfsn+@TzJ6a2}?)*6S(YY zi>dtRu!XVYUw%N4mAa{ZFB~HUa(+Mr1pp2UUOb7dnXawVf02v3n@#>-&OuJ8ch2(N zZM2)x%i&C^>gJ;WJ|$&fKe>OKm9eq0h5cMjUS3}G`k6yz@BS5+nc;MPe*WVp8Cygx zI_t?`zMQI%QHmphlo#8xt$UW!CRI66(ZA-m75jdMdM=|}tqblyA_3>>7muIa9{z@) zVDs25%^*SX@9yt=KuuMCSw!Pqu4Db-_wvXWP0WK%;?#px%D}+Tv9n`ZWzg@ z$veN@w$<>hzk!Uf&@($Vb$@qfCyj=OXMT8WjOFp5IJegC`J#X0_2ucv$q)K&VSuY_ zki-Unjm=Z-px^3#GKWUOt4uf$;w;@2Xc!s?H7sn>_gyG}3$rV<`V?`%D?s0MCtj+E z+j@q+Ym3WvVWLaFuY%HDIvsSj*1nb_=u;2pakiE%(RW@W9D!Q%9rc0sD5O9#T1TYs z)Axm7o5g67dm4c2QoWVnf*Zm)D#9~#X=&+0KZ%QcZAwAR=b^+s7UsP4c8AWFx#bSu z*1MOxb^QEn7wyZs+S;EDzJH7+VpDFJIIKnm>*;a60&tMOR=@^+`B*4{HGV@c0?9?ex?>o!;?Pt}?Y2Xj7*W%IY&EjJ?BJM_np@|6c$ZUl58)RS7S zjHaij6aSt!c(te-+geNS%K5{W4%Li-mR(~$nn5mMFkh)ptQzza)*CiY3HH^sQf^zB zaX#WQ)XK_=l-_CSyfcIyfkr-V1k-XdUqWz>%;_eB$Dwi=7cm)i-S;kgE2G`*Xb#LS ziG^smy;dg~L&BHa@H)S!Z1D&2_B6ngCNEmN457vKAi;0NssADH7>dB}eiPB*WT|1T z#qFrJ(RPt?loYP33d#nS%?=^YVWR$Me=NHUxy1H3Xo8ZXnj)RG&LF%1Z>K={d)ki(VCVd0Lm%1rH%Za%!2{Sb&QYOW^&;#yx{|x;e z%*Hegebw`jY2(V_QfNqYg?w&p11Y;s0O&1^%sY6Ft#ed=1DlpNt&Ex)&<$R3G3pzwM06Q+sNCK9DFXaIh4#)cXzU!3iU4+`tga7 zkZ?HH=d?LFD-~Zy_AiTP;owPzLY>`@#lPe=V-4wDl~HoAF$~xx zfCSfr!qi(uB_&Ns-sta+qQMAg$liCS+0H`@#rMDp-rao)mw^=XV{Oq@b3kF&(XFSQ zei%yATssw6I?CiJHV{$g?qIsuFO%C&fV168NgYA>@gJ4L!{sjF!eNBvZHVRH<~s9H z?@VlG?I7c**+U)O3FbEU(I2p!Ew56azZIvhHl|ayQ7fB&_{Kb_sqZ$MZuzpA1P5D6 zyaUmV=jCUjB4cHF!9)9KCXWx3M)^W4Ve!`ucL6aM$`_a#XJMu`tq7&$ZIPgdVx`JATD5U-?pGr;qStkY_M169zzdxs;C$+I>KO0V zae{frebfqwW&3$aKF`flvYJMOJ^d}bZtSxSFHP5*NUO)m#1Ap!PQRD05Z}~zrZn__ zX~2OAS$jQWc%l7HCitk06JAk(lZ!u2tYLKVj81#{eu4vfnu#_Xim^%q15%%qM99#I za*mK`2V&g1GmGGyiZ1e*+cG@EphOBuh zkL$k)clr<)WlVe(75k}9|2Jx)KY*EkMHF}C>`>7bPXkccDvTUet*4)pzd4bY2W;I+ zNTZSy`JpZyRVie0SI})R42?bwguUJ_JM0&1UIqH|RrdGicqb*883SA~%m z8|-QLzC{FX<7}4+I8d8g!XRLySZz6{&u{m-+JmprM432`D(w<{e7+j5qCjIl*Jzci z(>~C zEFhXbYtl1N?IL#A2p&r_-XC%m5Kj08C)WVOewXslRDGSPtWsG{>*a>6E_0|OEOuHH@a;ZdMDUdlUTu`oVaOv_f}PCCT<&{haK#*!c>Ey zzWrCMoDBW}D8mFO?N4)eWcFh->L&&UwA~y5BNWrLU7v9`Vx<;WB$vBn@bw%;WFdFz zh@jc)2CuTsIU{42NoD)(64$P;mO>8x)kfK6r0^>@W0k+?b_woRq%D=n%j)I2gQ(iv zR}O58v8)HiRu1iQxvxY9dCMUR_(KfPnb7qbNO`Dv0E&~tvMQl4Kar+s;S!;nKpYa} zK;fE!g zDuuoj%`nzpV-F$&H4UL}7EsH0aX}~R_s4bP9aty+yH>^7cm(XGA7(4Wl?>`1 zuJ$dI=XH?osX$&6@*_d9%>D>EuOVcD-ZRCef=D76LY&vhgE05%s2|b;A_^)S*==ll zXT2>+&XdF1>zV8jstqXA15|-t-fU3jFob#hz9I7ayg12H^RaE?!f#;Vr8ki68+_qv zb2FtO|fBhcPHE9sYWD%Ev z;f9rdDkJ?uNP#x$hh+!VG!37>_OPGpkd*WY_2Z?k`su9qIvvxdNJ&1B{7{gOxb;Fj zV|JSJpD5|TKhu;D($09HWB;yt?bzyyCR!5D;$19xE;y9Vxgn^&r{II>_!@ZC>bK?T zL1y(zCA6_0{L-{HHL)rNRG`v3i;(~&cz24wUNsiuIS1@^NdbqNV({Eyfn-X8*ArqM zwQ{gEg}Y|M{B;N)XN;-|yS)8>z8uAp^51q6(!0Rpu6sAW#meU@3BPc{R`_Er`5UA4 zHQ!JEs+sr98~#(ca5b(XV=eu50hi9ba3;c7bI9j~{o+`JCBu~2yK3Om!A3B*83D?@UnlKElajso-?s`J&G{iV&YXOB2sA-5s`th3wUkP{MZ$t?-m|w9B zq$tYvnI+ei=3}{aoK)hF3mg2bl%L#$yQ&y!0KVw0dwV(a*Cc+PMd;vc&nrf8Qu>@; zSVE&A$cX<*t2))#Uo(yYkBWjzR%TjG3mK4wa={E;_@nfGYw8){ zutPwpQpSX$3m)y{^uinWNx|dXEXZ&$CecgmZjP+;akgsb?B?~R%6}J#Pk_8QHtoWnhw)w@-65K5DOb5_FXM?)R37d_u#I`WIC7XN;1QM zRo*bB>ffjb(zXH5`RSp<_VZPK-fbvobljEJr`mn54)v$Oe4fwUDN>pc^vG(#y3bjA z^6$+Qv-`FfE$JZw^hZ+RU5_eN8$p0Dt0@OME8fGd3f61M}?*2?RqJf zYit(7W~^=Je~Zx{7Yb`LK;|3$O`Z5petfuVE>;+@y+O7;_qw;2FAGIu|HL>-9uLQ8dt3>X`hvk1}`B1BrzUWU5qRKdO zT(7u{zd+Sl$o*WW+S(|y0mg$hNylb{g9FzOHL}EFI^s<(r}_U;Wk+843d0KH{oxKx zw(lL`LwWPd-;>Obs^b)XSqdHhs}ncR3i_CTDzB%)YX`2IZP04gARU`{<>UM+pBGlB zV@i6BCD)?kLdkWJ{Txj57O0LcG0Hwb_TaSuX2%KYcVVA%edY_X;WH#(QU(_ZGwUX0ctF8{*Q zw&*89AH(kvTtH3r8nwl~{>nFUAz!cfV{eI2WLZ42ENu*d^DdKTbp<_Ke4Fl?gP_DN zV;Un*k!}Cco(3tl?=>ii5rjVEtj5@n57eNuPM?KV@gq2eBdN(mk+aY2#wu8<0Xu8n zM-|pt$W2FOS^NdK{vPXT$pL8$jd#6C3jh<4!bn8>ubvLsB6RL~S7%V9j=5FfG|3^K ztJJ-}_`q#x>T1!-5kzMRY6|n7n2{Y+V94z_)_> zDF;AAaThZ^ov0EE&CGJL%P&>oaB!UjL%6Clg#Arr>{9D?!zwC?c=oco0fG%K~V zpW0Dw9JFXt_-(@7hHo(btF|9D0q)Dm$pJN2&05K;BsDaBJsI}&w>^1UGjEZhvVlrK zm(;!Dd3@=T0dFuhg|u+gg@9f=^KOhYt)hhL-)zGSxbi`&qT1dxEo>K%5^7}c6pO%0 z2Xe5|#gwig<)jp$s|y-n|A=Zj*ZZ(^{GKUuM1=LvZ%hUxt$UYV0{t|LaK2SN)JO@S z_GFm)2QcGo5=+Oy<8#d8{M8_-FQJ2QWuc4!?@CXprNGLAB8-{LmviF8urceqD83px zgx>r#oJ_OTyqy~4Kqc}g;B~rvm4o8J6~8!Trex?veeD5p&6uI#*OpWNpVUStFM0oy zQUb`p&2(Aq9IQk`86bG0>8r1dVN`A#H`Ist4kY`eTILobrB}0c36Zoaa+%&OITPLU za{;Gdx814vPcd(EMowyxs9enS&fCNH*tTrM#m!)D&6K;vQvtfbNa?OinguSJ%@dIF zr(gLfnKwO_UJhC;=QX*{s5qV3v2?_C<9fW!I2NY6nA|K*5k6TS>M(dKL7(KBI*sLJ$`XNbmwjF&HFcPjCIQGEy+7@V zrXI0}t^&G)#@VV-9vW>q5TG-aTG_bSbI*tcM@F+FRLPK9UGhH$f)b@ZMauZPOG9J= z`uq+f!viy-VplX;C}x3$_8Q_GhAOxEhRiB!4jlpR{RJPPQT&u46KYBkBmOf!1xcv8 zJrt4*R&mu4`_zy9x-*L#6P>!PJ<+GD@0OV-jV*$B??F$fg+(O9%pmoV$kkdh1KN9V zu`3BI^mn`QPnPgA`Kg;?vvhh{jjVFNPPN>m^R$lMu5#b>Sh#yj$Ud3(+H1%2Qr}XI4-S8_rA9?;U3>P!BHl;`nqd6`i@KZ{!>)-$>oRCB}g-$0-G!YkjqL>Pp`rJ%3oevLOd?6=0 z`BG(tq~$_K4_Tg;8@n5%EuZ>*Lu4b7zY>JgdJrO0@a3aKFIZ@~E(|3brS9kT%9~a~ zzy>SkyI~le|1Zfm4g_->t? zSnGegVgd?LkV3|N@F+@ssAp1{Q`RI zKj;mY4OF2&`K8MO=2Zzi7BrdGXfEb4-?l`{<-Tl0sVlH{d_`sYmL}BwjPybRCA5u) z*knCBBu^Y9%o$dhgTg!BFcT^_V%J{_2iGw|>ZWQy5sIq~WNvJ*69eAwUR5Be!l5-Dn5x8Us1}EhFHCZDHPWNGO+izZ`c;v=d(Lw(J^p~t9Pr%nMRZyR^ybj zqU(mPRkNFbbXNfD``g5u2I+oZ#-~Tfwap5q0iZB-x(6Aj4-#~`!9p(1Iv!VKQ@{Kg9xcP&} z$GF4TU>OPi>k8<~B%w83F7pfhe?Lj*va^M~aMeG~J}3eGv2WB0OCnZ+t)+ zmyRK1Nq8X3T!UQ~ou+FcUFJckd`(<5bA7xC9yog+;>c|>5F)$((w`j!NGybE|gk7{>=@1vC(fyEm zLp+lL7MO8{yBx|1Ap>vN{d_4&gM~#ZbngXsCuPz;yZw?UMQo?u5fzZjlm0(tjdMsQ z(p4CXIL0CAjGGa$1EbxUz~_ss9hTFCfK7s;PTXZ=kp9SU-`T+RP~Xm^i2G2o)ejFH z!zt&FWHd&L@CScy@W5KBi_??iV~zJb)7R!|Fvtvmogtk2TT#;g87&lrFup<2_6Xic zFgc=liTW!lr;>~euwa6No!zc+8x1MW_TC4 z(V=Lm5(bg$DG7F6nhGSGJiDOyAWntm&e4m}nW8%Y~O5p+Y0LXDT z1Aqi6qH`^|gqDR?gq$r}HmH?ts40qi8x81xUSOl$ZxX#h3is=z-X_I2HVRYoi}*m) zr~}7nR#i6)g@uMD6PSbGu<#er&OS`(z`Vt}YiRdR~ zm%8K~uXNrg2Y8zlMcB0mK`eB6c$`lj?8W?eT!LUL1Z(R4o189i>0{tE=CVQfjsE2} ze(?DBTJ~42&Y0=@csWOg#Gy~|Q6j4yiAwTOcJP6$d)N;TIeZACis%Szugv#BooeJI ze2Xt68ZZO5)%(A(^BJLm$Jh{qDgln3*VCo#7ydYk6~@H|{vM>B!&;h?VNo-HS%_B* zO~yB*uDXt}s;S6~bPKGqAIOAM@aWKlCUI>1BuiY)r)e_awnXjX0^T=nM=iIA@OsgH z+m01Jf8Fsi4YSI@?H9)(f{l3OA0s^}tz1uCCl{IBK{;F<0U+!O*R@{P?tQ ziOzdYLxaDi4}$=PL`mG9mb5#=cW#PTId7>ll;SHY&YJTu^NFa#alM~3rai6)fbBTa z3^KI$H^gFnrymh*S6c7(?eEcuI0sCe6&4@%v{u?HqpB0TSOMozX21%4kY2gXa#ys4 z#SMfnx?V33Q~JtAAdsT)-zZHY*F~37b2ggi{2m2_5Wp*fHVX^|hB?_d8lDaEiEurUiV?e?hOqzn{#{cQ7?36^xkKk3!+&GvI;1@7HshH%{qa6a-(2!PK0kV^zw3}Ed$k;4fVww@`$9pOzbnPa9M zpC<|K;6H1tW2GbV88p~{+#f&|=U=uocR^jI zhqmzdf5pi)VReQaID*sw1g*i2)ZQ(KmofL*wP6GhX^yu+n6LEMO%QS6MCT??*1r)_ zCg!FXL?i+ZspCjv2`%}klk)*`C?P~V+trrY8E-Ss$v0 zu$@9+3o$_0d?aoB!UNCD-2AXE+(1W1=XL${w&|l@-j%Bueij@^8wNDPYTjG1`(F$-FT$3{AL(c!RO9#JJ+1KY4O_89 zY5Hte@83vv!j#LKi408N2o?lIVf_zuK~U5YT!we9UXy(`VZ&5~E)UxL=ZnT=dz=1` z*=Hl9NP{5|+H@cBmw7;7n=pXS^CYhM!F zGbBBT)P`V~UT3SCPq^T0X)Itii3vinvg^;OXCK_w8xhOm3mOW1kPHlnT?K+jCFGB{ zhI8FZq{#r_<9rK8_=f?m93mJ;tcKr5m92`~k}Z9I{OKcFUS^r0P4>bSfQ;`N!#`VK z;HHZO#diDC;WIC`dDS&HLU`RlH4^)+*y+cxgra3bYyjJmfo-IU1Vztr0%mt%-$C5Q zk!_2UqD~E{*UxU7R(9hp08%k(ibb#Ct$-wr%88H}uQ@)a2h0$-Pf7I-_pz9;!Hfu1 z(}gZa^M?L*LLqCA3(jqr8Qh;vAc8*a0td;XX$Tw+_@)E}ewb!2)-^ zoXTowU;oNboRu&j7W%x)>L1@ZVD(Z5R()%*Fr zoiwdyFd+C`|BIJSRVu#0pwspcSbEpxQ)t?CPYGm?FrRzlKl5mgc8b+HZ!@Y&Xhy>N zUld*H7|9h|PCe_XjT(HVYUpWiC?LifzM60j6!yOUXOV8;wGIIxv+9dSE6sI#ljOs& zSLfmQ}`K-32$bC(1Um%P;-8M&imY3Ym z8(bu27D$>G28ZhKo{~!la{fG_i=4d_&)3^Hl2juwKV52I+7Bc5J163{{WmF^BCYtu zAC_gA;?rwzr6Y`D}C;t;0V2g){mAk!NbPPMS1u?DNql1p%%D z2pu)wp=R9_8^& zX=4AkEVPf(Up8bsLXG&yumF zINM!^GC5kv6|d!+^uL_Q5)?(4__zSA%lD#gr`q=ju2r?;2$33sh%mK(WE|!rS}hQs zABIx7-fFriAHvJL(d}`@JFL5b%HpV32gBk5@{};&D`gDfd^H~7HbV`qUy0V&(j_Z^ zp8JJgouK3EGCKRV4=6D;0c;rts1Y>4LW;f~qD=Kh>R;vY zyTWFK7ZC2{Y<|FfRFl_sp;|38XtaxkAKmGQP(8*{k0vw9R-Kwc;~6CNK9{DkCrzuY zWW1w(K#dT*s+KEVOyA=9`uw21xVT70zHph=s$9{mRHIb^K_Jz7^l~sD@u)N}+5bP6 z=?H<#8FkraYnZk36Hg*i?dWOinUI^Q94JDXwk#gs1*3umDLkGUNag-X3SM;_ z1iwMBDD(XnPR~k^33VcieKhK zh*+~Jn=zZo{1A^duYIJ~^!H+86<;rxeMoV@GTt>3q_!T83lXg+PK(jTFKZ~0b!&r( z^1bOrTEg^trP+l8k|wlm$MBC43wSzyelqA`U5-+{UJ1w3_pU^7qJu6t=>4{UNd=M^ z2`2?or{rH~s6ZQH75ZPhG&eUlbzBZHr9ZCZx5T3pu;oFs{A$LrI^pg8LmrJ2o$EvN zuQwF0vS ztdm685Y|czNuW`$zh??Ea&g_9U@HmKzza}YkIChY8%4$;RzVog*8B$;6?j7|#8-G6 z;}b&o^>`$~MEW7X{Z|PhUlxRmS{KsiN%^(3HV@#nE34nl{dTOwQ|9_JEmB>d&vrBq zJLKAUf#H7fm*C%v6rX`@a294MO^p@2UEts}mB#>Ijq$ANn_olYTx zGb4QQ6ivgC3s3WILsssK6n>_Ewswqy} zszNj*R#IIjb`w*MDkmyFpB7e2#Hw;Szq!QmN@X`3a(#ZWV%BZsyzJ^E*Msy@3HAGp zLj2IstT<$S@kLS;ct@3jdaVW;7iku*e7!Et^=k>u%Lt@C^eM3aFliglT%`tr0ZXKO zG=s&OixTv?m7iZ>Sn4nF=CU?b!OCE_U-^A;{IyVXgZ~~&6crxD7eX`}I%z!z;ytOM zQL1P)JDcTrYv=c{L~5*OMh;P$cWL(2JY`U2EkYVP1mi<1IVIj9Jo*C9a3aoKbf-8>89BhQvsjbA!>cq>#Lvaay)*Bn!H5G z$4?$w=QIB^&m{PIzpa3^bKDnAe5cWkDEM$K$Z{5pAvEv?IjUT37tnBEp8e9);^59p zlB7FXSV7p1X=UlAyzj43m576nTNE_)>Bll?@!$jtntsWiov!nV%s$ThNGiwS>t?i* zx3`A?2ia5>efeO-Q$^gubXTXfZaz;z2hWh{><4Vwg%4HbDR#V+&oBBX__0b-ZMD^Tu0_@mJ#lp}TuJ@HD=gR}vbZbo`o?k`ee-yJt&|Ya1q(YZZ zFm|vYyuQcFu7wC|3*<4Js0I-0tS5{Ma_MHl%*2t1M zRJNw(5j6Kn!>vg-hLJBv^eTG>h$BFn<r;vt0cNDcbU`sh5Iq!k1`!P(npKUueGVH zfUP)&swmt^W9ARjxvxonBf$ReUtA1(JA_bQS&!!`bbk@$+8P~~LFeSuuERdVaX#14 z<1&QnU|W;kZ!!eGy@>*BDVN&aa)o>knVd?`GgNnwrUqDrnCfCF1>#Y!kk=ypRS5lp zv27XhTfJj%64qNNJn)oouz{p=#gcg-UFG(=E z@%<>aIItPu zg`g51ILF$Qj<%(;Kyr}gqGO%Ze$na!OOd(R)ucL zU801B{Dmg3QvYwO5)mZ#{ZA{RZs6?P9sfrAxfZ8XqJAhLC(-D725Q_lCeDcxm4dA+ zsC8Hv=EdbkyJ0%m50`fn;SSq^-e-^&rq}Op+*JQs&gC&XDooatU-T&0-Fb>fi zHoV%HFTnYSKBJj{B$*ElI~5AGg@GupS!(l*9md^(mQchud?5Nd=G-C^T-R4u3T z9)irP5I924<&EDmVU2}pIHau(Fgui%_ujfOgjWKGEG*b9iErJYu1_tm$J(R-c|J21 zQ*bROvPQXtLlZ@61>aP~*0D`v=q69SV?X16XFFQa4Qpqk35bTJe}a(AwkuUI#CH>`UL;f=WYsQFk1IHz>vmS{X3{`g8ebp*VbI{$d`8N+W7r;p_DPX`B- z9UByS-UTf=tMq^Sr|T*^66Q-szYqp}&l^z*4;}sSk-6j#!Dq>X1gIXrQ|-1nL8$5g zi_*fy^2xvOm$^2W=;P?h`7^NA!g0i16%Oq?SG%=lUz)hetomHX_n2U5#M1?;k4NKKSOC~ z+8)`PhTk5`b-@k(xt69jv0V76w4_Za8YPQ7cEelcSz+N+L1 Date: Fri, 23 Dec 2016 17:29:38 +0800 Subject: [PATCH 41/53] =?UTF-8?q?REPORT-1096=20=E5=9C=A8=E2=80=9C=E7=BA=B8?= =?UTF-8?q?=E5=BC=A0=E8=83=8C=E6=99=AF=E2=80=9D=E7=AA=97=E5=8F=A3=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=96=E8=89=B2=E5=99=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/ReportBackgroundAction.java | 7 ++++-- .../fr/design/style/color/ColorPicker.java | 1 + .../design/style/color/ColorSelectPane.java | 23 +++++++++++++------ .../style/color/NewColorSelectPane.java | 2 +- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportBackgroundAction.java b/designer/src/com/fr/design/actions/report/ReportBackgroundAction.java index 6e8fd84f01..3c3940ddad 100644 --- a/designer/src/com/fr/design/actions/report/ReportBackgroundAction.java +++ b/designer/src/com/fr/design/actions/report/ReportBackgroundAction.java @@ -5,6 +5,7 @@ package com.fr.design.actions.report; import com.fr.base.BaseUtils; import com.fr.design.actions.ReportComponentAction; +import com.fr.design.dialog.BasicDialog; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ReportComponent; import com.fr.design.menu.KeySetUtils; @@ -36,14 +37,16 @@ public class ReportBackgroundAction extends ReportComponentAction Date: Fri, 23 Dec 2016 17:32:22 +0800 Subject: [PATCH 42/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=E3=80=82?= =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/style/color/ColorPicker.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/style/color/ColorPicker.java b/designer_base/src/com/fr/design/style/color/ColorPicker.java index 39fe4445fd..69665e2f51 100644 --- a/designer_base/src/com/fr/design/style/color/ColorPicker.java +++ b/designer_base/src/com/fr/design/style/color/ColorPicker.java @@ -3,7 +3,6 @@ package com.fr.design.style.color; /** * Created by plough on 2016/12/22. */ -//import com.fr.design.dialog.UIDialog; import com.fr.base.BaseUtils; @@ -58,7 +57,7 @@ public class ColorPicker extends JDialog implements ActionListener timer = new Timer(1000/FPS, this); timer.start(); hideCursor(); - System.out.println(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow()); +// System.out.println(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow()); } /** @@ -111,7 +110,6 @@ public class ColorPicker extends JDialog implements ActionListener { public void mousePressed(MouseEvent e) { - System.out.println("Mouse Pressed!"); pickComplete(); } } @@ -192,7 +190,6 @@ class ColorPickerPanel extends JPanel locationY + (int)((colorPickerSize + pixelCount) * 0.5) + 1, // 源矩形的第二个角的y坐标 this ); - g2d.drawImage(colorPickerFrame, 0, 0, this); } } \ No newline at end of file From f2d5c68c8eaf74b7a9d5acd7182c5a96e1c514cd Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 23 Dec 2016 18:22:24 +0800 Subject: [PATCH 43/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=E3=80=82?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/locale/designer.properties | 2 ++ .../design/locale/designer_en_US.properties | 2 ++ .../design/locale/designer_ja_JP.properties | 3 ++ .../design/locale/designer_ko_KR.properties | 4 ++- .../design/locale/designer_zh_CN.properties | 2 ++ .../design/locale/designer_zh_TW.properties | 2 ++ .../fr/design/style/color/ColorPicker.java | 9 ++--- .../design/style/color/ColorSelectDialog.java | 4 +-- .../design/style/color/ColorSelectPane.java | 33 ++++++++++--------- 9 files changed, 39 insertions(+), 22 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 8827ff7929..66464c8895 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -487,3 +487,5 @@ FR-Designer-LayerPageReport_PageQuery= FR-Designer-LayerPageReport_Define_PageQuerySQL= FR-Designer_Event= FR-Designer_Properties= +FR-Designer_Button_OK=OK +FR-Designer_Button_Cancel=Cancel 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 114eb0fda1..f97be09854 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 @@ -487,3 +487,5 @@ FR-Designer_Is_Share_DBTableData=Shared data set FR-Designer_Event=Event FR-Designer_Properties=Properties FR-Designer_Properties_Mobile=MobileProperties +FR-Designer_Button_OK=OK +FR-Designer_Button_Cancel=Cancel 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 4ab48d0e6b..0d7ee8fd1a 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 @@ -466,3 +466,6 @@ FR-Designer_Is_Share_DBTableData=\u5171\u6709\u30C7\u30FC\u30BF\u30BB\u30C3\u30C FR-Designer_Event=\ FR-Designer_Properties=FR-Designer_Properties=\ \ +FR-Designer_Button_OK=FR-Designer_Button_OK=\u78BA\u5B9A +FR-Designer_Button_Cancel=\u30AD\u30E3\u30F3\u30BB\u30EB +\ \ No newline at end of file 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 64bee79036..553a2503cb 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 @@ -460,4 +460,6 @@ FR-Designer_Is_Share_DBTableData=\uB370\uC774\uD130\uC138\uD2B8\uACF5\uC720 FR-Designer-LayerPageReport_PageQuery=\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30 FR-Designer-LayerPageReport_Define_PageQuerySQL=\uC815\uC758\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30sql FR-Designer_Event=\ -FR-Designer_Properties=\ \ No newline at end of file +FR-Designer_Properties=\uFFFD +FR-Designer_Button_OK=\uD655\uC778FR-Designer_Button_Cancel=\uCDE8\uC18C +\ \ No newline at end of file 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 880722d094..e0b5bef423 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 @@ -491,3 +491,5 @@ FR-Designer_Is_Share_DBTableData=\u5171\u4EAB\u6570\u636E\u96C6 FR-Designer_Event=\u4E8B\u4EF6 FR-Designer_Properties=\u5C5E\u6027 FR-Designer_Properties_Mobile=\u624B\u673A\u5C5E\u6027 +FR-Designer_Button_OK=\u786E\u5B9A +FR-Designer_Button_Cancel=\u53D6\u6D88 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 6d4eeb6eb5..3d30f49bd3 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 @@ -479,3 +479,5 @@ FR-Designer_Is_Share_DBTableData=\u662F\u5426\u5171\u4EAB\u8CC7\u6599\u96C6 FR-Designer_Properties=\u5C6C\u6027 FR-Designer_Event=\u4E8B\u4EF6 FR-Designer_Properties_Mobile=\u624B\u6A5F\u5C6C\u6027 +FR-Designer_Button_OK=\u78BA\u5B9A +FR-Designer_Button_Cancel=\u53D6\u6D88 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/style/color/ColorPicker.java b/designer_base/src/com/fr/design/style/color/ColorPicker.java index 69665e2f51..1fa7fb03fc 100644 --- a/designer_base/src/com/fr/design/style/color/ColorPicker.java +++ b/designer_base/src/com/fr/design/style/color/ColorPicker.java @@ -50,11 +50,11 @@ public class ColorPicker extends JDialog implements ActionListener this.setAlwaysOnTop(true); this.setVisible(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - System.out.println("Construced ColorPicker."); } public void start() { - timer = new Timer(1000/FPS, this); + int timeCycle = 1000 / FPS; + timer = new Timer(timeCycle, this); timer.start(); hideCursor(); // System.out.println(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow()); @@ -160,8 +160,9 @@ class ColorPickerPanel extends JPanel public Color getPixelColor(Point mousePos) { int rgb = screenImage.getRGB(mousePos.x, mousePos.y); - int R = (rgb & 0xff0000) >> 16; - int G = (rgb & 0xff00) >> 8; + int shiftStep = 8; // 右移的比特位 + int R = (rgb & 0xff0000) >> shiftStep * 2; + int G = (rgb & 0xff00) >> shiftStep; int B = (rgb & 0xff); return new Color(R, G, B); } diff --git a/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java b/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java index f7610eed62..a26bc10c26 100644 --- a/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java @@ -91,8 +91,8 @@ public class ColorSelectDialog extends MiddleChartDialog{ this.add(buttonPane, BorderLayout.SOUTH); - ok = new UIButton(Inter.getLocText("OK")); - cancel = new UIButton(Inter.getLocText("Cancel")); + ok = new UIButton(Inter.getLocText("FR-Designer_Button_OK")); + cancel = new UIButton(Inter.getLocText("FR-Designer_Button_Cancel")); buttonPane.add(ok); buttonPane.add(cancel); diff --git a/designer_base/src/com/fr/design/style/color/ColorSelectPane.java b/designer_base/src/com/fr/design/style/color/ColorSelectPane.java index 421c7c8d20..f746131d39 100644 --- a/designer_base/src/com/fr/design/style/color/ColorSelectPane.java +++ b/designer_base/src/com/fr/design/style/color/ColorSelectPane.java @@ -69,21 +69,7 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); this.add(centerPane, BorderLayout.CENTER); - // 第一行,1个取色按钮 + 7个最近使用的颜色 - JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout()); - row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0)); - row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7 - centerPane.add(row1Pane); - - // 取色按钮 - PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON16, true); - - row1Pane.add(pickColorButton, BorderLayout.WEST); - - // 最近使用 - UsedColorPane usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this); - usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8)); - row1Pane.add(usedColorPane.getPane()); + centerPane.add(getRow1Pane()); JPanel menuColorPane1 = new JPanel(); centerPane.add(menuColorPane1); @@ -113,6 +99,23 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable centerPane.add(centerPane1); } + // 第一行,1个取色按钮 + 7个最近使用的颜色 + private JPanel getRow1Pane() { + JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout()); + row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0)); + row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7 + + // 取色按钮 + PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON16, true); + row1Pane.add(pickColorButton, BorderLayout.WEST); + + // 最近使用 + UsedColorPane usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this); + usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8)); + row1Pane.add(usedColorPane.getPane()); + return row1Pane; + } + protected Color[] getColorArray(){ return ColorFactory.MenuColors; } From 35198fa0d9462713e7561abc663ca2221d67a529 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 26 Dec 2016 10:49:15 +0800 Subject: [PATCH 44/53] =?UTF-8?q?REPORT-1096=20=E4=B8=8D=E7=BB=A7=E6=89=BF?= =?UTF-8?q?UIButton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/style/color/ColorSelectPane.java | 2 +- .../style/color/CustomChooserPanel.java | 5 +- .../style/color/NewColorSelectPane.java | 4 +- .../design/style/color/PickColorButton.java | 43 ----------------- .../style/color/PickColorButtonFactory.java | 46 +++++++++++++++++++ 5 files changed, 50 insertions(+), 50 deletions(-) delete mode 100644 designer_base/src/com/fr/design/style/color/PickColorButton.java create mode 100644 designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java diff --git a/designer_base/src/com/fr/design/style/color/ColorSelectPane.java b/designer_base/src/com/fr/design/style/color/ColorSelectPane.java index f746131d39..743a71ce42 100644 --- a/designer_base/src/com/fr/design/style/color/ColorSelectPane.java +++ b/designer_base/src/com/fr/design/style/color/ColorSelectPane.java @@ -106,7 +106,7 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7 // 取色按钮 - PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON16, true); + UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON16, true); row1Pane.add(pickColorButton, BorderLayout.WEST); // 最近使用 diff --git a/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java b/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java index 6df00919dc..85363b0e65 100644 --- a/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java @@ -12,7 +12,6 @@ import java.awt.Image; import java.awt.Point; import java.awt.event.*; import java.awt.image.MemoryImageSource; -import javax.swing.Timer; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -20,7 +19,6 @@ import javax.swing.ButtonGroup; import javax.swing.Icon; import javax.swing.JColorChooser; import javax.swing.JPanel; -import javax.swing.JSlider; import javax.swing.SpinnerNumberModel; import javax.swing.SwingConstants; import javax.swing.colorchooser.AbstractColorChooserPanel; @@ -31,6 +29,7 @@ import javax.swing.event.DocumentListener; import javax.swing.text.BadLocationException; import javax.swing.text.Document; +import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.islider.UISlider; @@ -710,7 +709,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec hexPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 0)); hexPanel.add(new UILabel("#")); hexPanel.add(field); - PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON18, true); + UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true); hexPanel.add(pickColorButton); mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER); diff --git a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java index 0a41ce5391..ba28b42016 100644 --- a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java @@ -17,7 +17,6 @@ import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.border.UIRoundedBorder; import com.fr.design.gui.ibutton.UIButton; @@ -87,8 +86,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { centerPane.add(row1Pane); // 取色按钮 - PickColorButton pickColorButton = new PickColorButton(this, PickColorButton.IconType.ICON16); - + UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON16); row1Pane.add(pickColorButton, BorderLayout.WEST); // 最近使用 diff --git a/designer_base/src/com/fr/design/style/color/PickColorButton.java b/designer_base/src/com/fr/design/style/color/PickColorButton.java deleted file mode 100644 index a529c0b76e..0000000000 --- a/designer_base/src/com/fr/design/style/color/PickColorButton.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.fr.design.style.color; - -import com.fr.base.BaseUtils; -import com.fr.design.gui.ibutton.UIButton; - -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * Created by plough on 2016/12/22. - */ -public class PickColorButton extends UIButton { - public PickColorButton(final ColorSelectable colorSelectable, IconType iconType){ - this(colorSelectable, iconType, false); - } - - public PickColorButton(final ColorSelectable colorSelectable, IconType iconType, final Boolean setColorRealTime) { - super(); - - if (iconType == IconType.ICON16) { - this.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorPicker/colorPicker16.png")); - this.setPreferredSize(new Dimension(16, 16)); - } else { - this.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorPicker/colorPicker18.png")); - this.setPreferredSize(new Dimension(18, 18)); - } - this.setCursor(new Cursor(Cursor.HAND_CURSOR)); - - this.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - ColorPicker colorPicker = new ColorPicker(colorSelectable, setColorRealTime); - colorPicker.start(); - } - }); - } - - // 取色器按钮使用的图标 - public enum IconType { - ICON16, ICON18 - } -} diff --git a/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java b/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java new file mode 100644 index 0000000000..0ffd293c84 --- /dev/null +++ b/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java @@ -0,0 +1,46 @@ +package com.fr.design.style.color; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.ibutton.UIButton; + +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by plough on 2016/12/22. + */ +public class PickColorButtonFactory { + + public static UIButton getPickColorButton(ColorSelectable colorSelectable, IconType iconType) { + return getPickColorButton(colorSelectable, iconType, false); + } + + public static UIButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final Boolean setColorRealTime) { + UIButton pickColorButton = new UIButton(); + + if (iconType == IconType.ICON16) { + pickColorButton.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorPicker/colorPicker16.png")); + pickColorButton.setPreferredSize(new Dimension(16, 16)); + } else { + pickColorButton.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorPicker/colorPicker18.png")); + pickColorButton.setPreferredSize(new Dimension(18, 18)); + } + pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); + + pickColorButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ColorPicker colorPicker = new ColorPicker(colorSelectable, setColorRealTime); + colorPicker.start(); + } + }); + + return pickColorButton; + } + + // 取色器按钮使用的图标 + public enum IconType { + ICON16, ICON18 + } +} From af009c3c7866e6b4ecbf8027cd63d167630d996c Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 26 Dec 2016 11:25:16 +0800 Subject: [PATCH 45/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=E3=80=82?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/style/color/ColorPicker.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/designer_base/src/com/fr/design/style/color/ColorPicker.java b/designer_base/src/com/fr/design/style/color/ColorPicker.java index 1fa7fb03fc..cb30c186dd 100644 --- a/designer_base/src/com/fr/design/style/color/ColorPicker.java +++ b/designer_base/src/com/fr/design/style/color/ColorPicker.java @@ -26,6 +26,7 @@ public class ColorPicker extends JDialog implements ActionListener private Timer timer; // 用于定时重绘 private int FPS = 45; // 重绘取色器的频率 + private int timeCycle = 1000 / FPS; // 时钟周期 private ColorSelectable colorSelectable; private Point mousePos; // 鼠标的绝对坐标 @@ -33,6 +34,7 @@ public class ColorPicker extends JDialog implements ActionListener private Boolean setColorRealTime; // 实时设定颜色值 + /** * 构造函数,创建一个取色框窗体 */ @@ -53,7 +55,6 @@ public class ColorPicker extends JDialog implements ActionListener } public void start() { - int timeCycle = 1000 / FPS; timer = new Timer(timeCycle, this); timer.start(); hideCursor(); @@ -125,6 +126,12 @@ class ColorPickerPanel extends JPanel private int scaleFactor; // 放大倍数 private Robot robot; + // getPixelColor 常数 + private static int SHIFT_STEP = 8; // 比特位右移步长 + private static int AND_R = 0xff0000; + private static int AND_G = 0xff00; + private static int AND_B = 0xff; + /** * 带参数的构造函数 * @param scaleFactor 放大倍数 @@ -160,10 +167,9 @@ class ColorPickerPanel extends JPanel public Color getPixelColor(Point mousePos) { int rgb = screenImage.getRGB(mousePos.x, mousePos.y); - int shiftStep = 8; // 右移的比特位 - int R = (rgb & 0xff0000) >> shiftStep * 2; - int G = (rgb & 0xff00) >> shiftStep; - int B = (rgb & 0xff); + int R = (rgb & AND_R) >> SHIFT_STEP * 2; + int G = (rgb & AND_G) >> SHIFT_STEP; + int B = (rgb & AND_B); return new Color(R, G, B); } From d16badad3b09ef058abd6efbdde067ec7a7bd55c Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Fri, 30 Dec 2016 11:52:10 +0800 Subject: [PATCH 46/53] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E6=97=B6=EF=BC=8C=E4=B8=8D=E8=83=BD=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8A=A8=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/chart/gui/ChartTypePane.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java index a3a028ef89..172d040f3f 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -206,6 +206,8 @@ public class ChartTypePane extends AbstractChartAttrPane{ } //第一步就是重构cardNames cardNames = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(chartID); + //下拉框重构开始。为了防止重构是触发update + ((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.REACTOR); //重构下拉框选项 reactorComboBox(); //重新选择选中的下拉项 @@ -213,6 +215,8 @@ public class ChartTypePane extends AbstractChartAttrPane{ String plotID = chart.getPlot().getPlotID(); Object item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(chartID, plotID); jcb.setSelectedItem(item); + //下拉框重构结束 + ((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.DEFAULT); //重新选中 checkPlotPane(); } @@ -223,13 +227,10 @@ public class ChartTypePane extends AbstractChartAttrPane{ } private void reactorComboBox() { - FlexibleComboBox fcb = (FlexibleComboBox)jcb; - fcb.setItemEvenType(ItemEventType.REACTOR); - fcb.removeAllItems(); + jcb.removeAllItems(); for (int i = 0; i < this.cardNames.length; i++) { - fcb.addItem(cardNames[i]); + jcb.addItem(cardNames[i]); } - fcb.setItemEvenType(ItemEventType.DEFAULT); } @Override From a6cc41ac3084b2de6273380dabfd489815a69791 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 30 Dec 2016 16:37:16 +0800 Subject: [PATCH 47/53] =?UTF-8?q?REPORT-1096=20=E5=8F=96=E8=89=B2=E6=9D=BF?= =?UTF-8?q?=3D=E3=80=8B=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/ReportBackgroundAction.java | 6 +-- .../fr/design/style/color/ColorPicker.java | 41 ++++++++++++++++--- .../design/style/color/ColorSelectDialog.java | 2 +- .../style/color/PickColorButtonFactory.java | 10 ++--- 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/designer/src/com/fr/design/actions/report/ReportBackgroundAction.java b/designer/src/com/fr/design/actions/report/ReportBackgroundAction.java index 3c3940ddad..4a381d4d08 100644 --- a/designer/src/com/fr/design/actions/report/ReportBackgroundAction.java +++ b/designer/src/com/fr/design/actions/report/ReportBackgroundAction.java @@ -37,16 +37,14 @@ public class ReportBackgroundAction extends ReportComponentAction Date: Tue, 3 Jan 2017 14:50:16 +0800 Subject: [PATCH 48/53] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=97=B6=EF=BC=8C=E4=B9=9F=E8=A6=81=E8=80=83?= =?UTF-8?q?=E8=99=91=E9=87=8D=E6=96=B0=E6=9B=B4=E6=96=B0=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/mainframe/ElementCasePane.java | 2 +- .../src/com/fr/design/style/color/ColorSelectDialog.java | 2 +- .../fr/design/mainframe/chart/gui/ChartTypeButtonPane.java | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePane.java b/designer/src/com/fr/design/mainframe/ElementCasePane.java index dcc68ab81a..edeb8fb76f 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePane.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePane.java @@ -851,7 +851,7 @@ public abstract class ElementCasePane extends Tar */ protected void initInputActionMap() { InputMap inputMapAncestor = this.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - ActionMap actionMap = this.getActionMap(); + ActionMap actionMap = this.getActionMap() ; // clearReportPage old values. inputMapAncestor.clear(); actionMap.clear(); diff --git a/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java b/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java index a26bc10c26..11a243b6cd 100644 --- a/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer_base/src/com/fr/design/style/color/ColorSelectDialog.java @@ -137,7 +137,7 @@ public class ColorSelectDialog extends MiddleChartDialog{ public static void showDialog(Frame owner,ColorSelectDetailPane pane,Color initialColor,ColorSelectable selectePane){ ColorTracker okListener = new ColorTracker(pane); ColorSelectDialog dialog = new ColorSelectDialog(owner,pane,initialColor,okListener,selectePane); -// dialog.setModal(true); + dialog.setModal(true); dialog.show(); } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 91b6bba3c1..4a18611fa4 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -425,6 +425,8 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private void deleteAButton() { //先重构属性,在重构面板,否则面板在重构过程中,会重新将属性中的切换图表加到indexList中,导致面板无法删除 + //记录改变前的plotID + String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart().getPlot().getPlotID(); if (editingCollection != null) { int count = editingCollection.getChartCount(); for (int i = 0; i < count; i++) { @@ -447,6 +449,11 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen checkoutChange(); relayoutPane(); + + //重构面板 + if (parent != null ){ + parent.reLayoutEditPane(lastPlotID, editingCollection); + } } private void relayoutPane() { From f8a6f64b3912a1e5c17fefbe86e2b8ec5e052708 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Tue, 3 Jan 2017 14:53:04 +0800 Subject: [PATCH 49/53] update --- designer/src/com/fr/design/mainframe/ElementCasePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePane.java b/designer/src/com/fr/design/mainframe/ElementCasePane.java index edeb8fb76f..dcc68ab81a 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePane.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePane.java @@ -851,7 +851,7 @@ public abstract class ElementCasePane extends Tar */ protected void initInputActionMap() { InputMap inputMapAncestor = this.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - ActionMap actionMap = this.getActionMap() ; + ActionMap actionMap = this.getActionMap(); // clearReportPage old values. inputMapAncestor.clear(); actionMap.clear(); From 50f28fc95e35f3f61c61a7e03d7b205654b985ad Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Tue, 3 Jan 2017 16:37:06 +0800 Subject: [PATCH 50/53] =?UTF-8?q?populate=E4=B9=8B=E5=89=8D=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=8E=A7=E4=BB=B6=E6=9C=AC=E8=BA=AB=E7=9A=84?= =?UTF-8?q?listener?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/icombobox/UIComboBox.java | 4 ++++ .../design/mainframe/chart/gui/style/ChartTextAttrPane.java | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java b/designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java index d6d1496746..4840121b8b 100644 --- a/designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java +++ b/designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java @@ -160,6 +160,10 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser uiObserverListener = listener; } + public void removeChangeListener(){ + uiObserverListener = null; + } + /** * @return */ diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index a52fe010d8..1e383dede6 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -71,6 +71,7 @@ public class ChartTextAttrPane extends BasicPane { } public void populate(FRFont frFont) { + removeAllComboBoxListener(); if (frFont == null) { return; } @@ -85,6 +86,11 @@ public class ChartTextAttrPane extends BasicPane { } } + private void removeAllComboBoxListener() { + fontNameComboBox.removeChangeListener(); + fontSizeComboBox.removeChangeListener(); + } + /** * 更新字 * @return 更新字 From 54bf5da257119cf2f2be2b2712f580c82d6d08f4 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 3 Jan 2017 18:42:05 +0800 Subject: [PATCH 51/53] =?UTF-8?q?REPORT-1096=20=E5=8F=96=E8=89=B2=E6=9D=BF?= =?UTF-8?q?=3D=E3=80=8B=E4=BF=AE=E5=A4=8D=E5=9C=A8=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C=E6=97=A0=E6=B3=95=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E9=A2=9C=E8=89=B2=E6=8B=BE=E5=8F=96=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/style/color/ColorPicker.java | 4 ++++ .../src/com/fr/design/style/color/ColorSelectBox.java | 1 + 2 files changed, 5 insertions(+) diff --git a/designer_base/src/com/fr/design/style/color/ColorPicker.java b/designer_base/src/com/fr/design/style/color/ColorPicker.java index 6fc5706037..c103e84371 100644 --- a/designer_base/src/com/fr/design/style/color/ColorPicker.java +++ b/designer_base/src/com/fr/design/style/color/ColorPicker.java @@ -32,6 +32,7 @@ public class ColorPicker extends JDialog implements ActionListener private ColorSelectable colorSelectable; private Point mousePos; // 鼠标的绝对坐标 private Color colorToSet; // 暂存要设置的颜色值 + private Color initColor; // 保存初始颜色。实时模式下,如果取消取色操作,则重设为初始颜色 private Boolean setColorRealTime; // 实时设定颜色值 @@ -66,6 +67,7 @@ public class ColorPicker extends JDialog implements ActionListener // 如果要求实时变化,确保先关闭弹窗,再截屏 // 主要针对"图案"选项卡中的"前景"、"背景" if (this.setColorRealTime) { + initColor = colorSelectable.getColor(); colorSelectable.setColor(Color.WHITE); // setColor 可以关闭弹窗 try { Thread.sleep(100); // 等待弹窗关闭 @@ -114,6 +116,8 @@ public class ColorPicker extends JDialog implements ActionListener timer.stop(); if (setColor) { colorSelectable.setColor(colorToSet); + } else if (setColorRealTime) { + colorSelectable.setColor(initColor); } this.dispose(); } diff --git a/designer_base/src/com/fr/design/style/color/ColorSelectBox.java b/designer_base/src/com/fr/design/style/color/ColorSelectBox.java index f926775ee1..2dd5d51c39 100644 --- a/designer_base/src/com/fr/design/style/color/ColorSelectBox.java +++ b/designer_base/src/com/fr/design/style/color/ColorSelectBox.java @@ -63,6 +63,7 @@ public class ColorSelectBox extends AbstractSelectBox implements UIObserv fireDisplayComponent(ColorBackground.getInstance(color)); } }); + colorPane.setColor(color); return colorPane; } From e596f2aca760cd2f7c700c00d603c7861aaa8571 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 3 Jan 2017 19:43:51 +0800 Subject: [PATCH 52/53] =?UTF-8?q?REPORT-1096=20=E5=8F=96=E8=89=B2=E6=9D=BF?= =?UTF-8?q?=3D=E3=80=8B=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/style/color/ColorPicker.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/designer_base/src/com/fr/design/style/color/ColorPicker.java b/designer_base/src/com/fr/design/style/color/ColorPicker.java index c103e84371..e616e08af7 100644 --- a/designer_base/src/com/fr/design/style/color/ColorPicker.java +++ b/designer_base/src/com/fr/design/style/color/ColorPicker.java @@ -112,12 +112,10 @@ public class ColorPicker extends JDialog implements ActionListener validate(); // 更新所有子控件 } - public void pickComplete(Boolean setColor) { + public void pickComplete(Color color) { timer.stop(); - if (setColor) { - colorSelectable.setColor(colorToSet); - } else if (setColorRealTime) { - colorSelectable.setColor(initColor); + if (color != null) { + colorSelectable.setColor(color); } this.dispose(); } @@ -134,9 +132,9 @@ public class ColorPicker extends JDialog implements ActionListener public void mousePressed(MouseEvent e) { if (e.getButton() == e.BUTTON1) { // 左键确定 - pickComplete(true); + pickComplete(colorToSet); } else { - pickComplete(false); + pickComplete(setColorRealTime ? initColor : null); } } } From 96519eca895b24cc8a0b945c5aec98ec61197345 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2017 11:20:06 +0800 Subject: [PATCH 53/53] ct --- .../widget/ui/TextFieldEditorDefinePane.java | 6 +- .../fr/design/actions/file/LocalePane.java | 62 ++++++++++++------- .../com/fr/design/locale/designer.properties | 7 ++- .../design/locale/designer_en_US.properties | 9 ++- .../design/locale/designer_ja_JP.properties | 16 ++--- .../design/locale/designer_ko_KR.properties | 10 +-- .../design/locale/designer_zh_CN.properties | 10 +-- .../design/locale/designer_zh_TW.properties | 8 ++- 8 files changed, 77 insertions(+), 51 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java index 1c11aad2e4..c9128627cc 100644 --- a/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java @@ -61,11 +61,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane regPane.getRegComboBox().addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem(); - if (!StringUtils.isNotEmpty(regExp.toRegText())) { - getRegErrorMsgTextField().setEnabled(false); - } else { - getRegErrorMsgTextField().setEnabled(true); - } + getRegErrorMsgTextField().setEnabled(regExp.errorMessageEditable()); } }); diff --git a/designer_base/src/com/fr/design/actions/file/LocalePane.java b/designer_base/src/com/fr/design/actions/file/LocalePane.java index 3356fa70af..4dd25c5048 100644 --- a/designer_base/src/com/fr/design/actions/file/LocalePane.java +++ b/designer_base/src/com/fr/design/actions/file/LocalePane.java @@ -27,6 +27,8 @@ import com.fr.design.dialog.BasicPane; import com.fr.file.filetree.FileNode; import com.fr.general.*; import com.fr.stable.ArrayUtils; +import com.fr.stable.StringUtils; +import com.fr.stable.bridge.StableFactory; import com.fr.stable.project.ProjectConstants; /** @@ -51,8 +53,8 @@ public class LocalePane extends BasicPane { add(tabbedPane, BorderLayout.CENTER); predefineTableModel = new DefaultTableModel() { - public boolean isCellEditable(int col, int row) { - return false; + public boolean isCellEditable(int row, int column) { + return column == 0; } }; @@ -109,23 +111,39 @@ public class LocalePane extends BasicPane { } private void initPredefinedProperties() { - Map map = Inter.getPredefinedPackageMap(); - LocalePackage chinese = map.get(Locale.SIMPLIFIED_CHINESE); + + Map supportLocaleMap = Inter.getSupportLocaleMap(); + + String[] localeFiles = StableFactory.getLocaleFiles(); + + List sortKeys = new ArrayList(); - Set bundles = chinese.getKindsOfResourceBundle(); - for (ResourceBundle bundle : bundles) { - sortKeys.addAll(bundle.keySet()); + for (String path : localeFiles) { + ResourceBundle chineseBundle = loadResourceBundle(path, Locale.SIMPLIFIED_CHINESE); + sortKeys.addAll(chineseBundle.keySet()); } Collections.sort(sortKeys); + Map> localeResourceBundleMap = new HashMap>(); + for (Map.Entry entry : supportLocaleMap.entrySet()) { + Locale locale = entry.getKey(); + List list = new ArrayList<>(); + for (String path : localeFiles) { + ResourceBundle chineseBundle = loadResourceBundle(path, locale); + list.add(chineseBundle); + } + localeResourceBundleMap.put(locale, list); + } + Map> data = new HashMap>(); - for (Map.Entry entry : map.entrySet()) { + for (Map.Entry> entry : localeResourceBundleMap.entrySet()) { Vector column = new Vector(); + List rbs = entry.getValue(); for (String key : sortKeys) { - column.add(entry.getValue().getLocText(key)); + column.add(readText(rbs, key)); } data.put(entry.getKey(), column); } @@ -140,6 +158,19 @@ public class LocalePane extends BasicPane { } } + private String readText(List rbs, String key) { + for (ResourceBundle rb : rbs) { + if (rb.containsKey(key)) { + return rb.getString(key); + } + } + return null; + } + + private ResourceBundle loadResourceBundle(String dir, Locale locale) { + return ResourceBundle.getBundle(dir, locale, Inter.class.getClassLoader()); + } + private void initCustomProperties() throws Exception { Env env = FRContext.getCurrentEnv(); if (env == null) { @@ -176,22 +207,9 @@ public class LocalePane extends BasicPane { } } - private Properties loadLocaleProperties(String name) { - Properties properties = new Properties(); - InputStream inputStream = IOUtils.readResource("/com/fr/general/locale/" + name); - try { - properties.load(inputStream); - } catch (IOException e) { - FRLogger.getLogger().error(e.getMessage()); - } - return properties; - } - /** * 保存当前编辑的国际化 * - * - * @date 2014-9-30-下午3:10:30 */ public void save() { Env env = FRContext.getCurrentEnv(); diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 66464c8895..1b9e5506d2 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -357,6 +357,7 @@ FR-Designer_KeyPoint=KeyPoint FR-Designer_loadedTreeModel=loadedTreeModel FR-Designer-Failed_to_load_the_plugin=Failed to load the plugin\uFF0Cplease update the plugin\: FR-Designer-Plugin_Please_Update_Jar= +FR-Designer-Invalid_Page_Number=Invalid Page Number FR-Designer_XMLA_Database=Database FR-Designer_XMLA_UserName=User name FR-Designer_XMLA_Password=Password @@ -487,5 +488,7 @@ FR-Designer-LayerPageReport_PageQuery= FR-Designer-LayerPageReport_Define_PageQuerySQL= FR-Designer_Event= FR-Designer_Properties= -FR-Designer_Button_OK=OK -FR-Designer_Button_Cancel=Cancel +FR-Designer_Permissions_Edition=Permissions Edition +FR-Designer_Export_Excel_Page=Page +FR-Designer_Export_Excel_Simple=Simple +FR-Designer_Export_Excel_PageToSheet=Page To Sheet 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 f97be09854..9628555144 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 @@ -358,6 +358,7 @@ FR-Designer_KeyPoint=KeyPoint FR-Designer_loadedTreeModel=loadedTreeModel FR-Designer-Failed_to_load_the_plugin=Failed to load the plugin\uFF0Cplease update the plugin\: FR-Designer-Plugin_Please_Update_Jar=Please Update Jar +FR-Designer-Invalid_Page_Number=Invalid Page Number FR-Designer_XMLA_Database=DB FR-Designer_XMLA_UserName=User name FR-Designer_XMLA_Password=Password @@ -486,6 +487,8 @@ FR-Designer-DS-Database_Query=DB Query FR-Designer_Is_Share_DBTableData=Shared data set FR-Designer_Event=Event FR-Designer_Properties=Properties -FR-Designer_Properties_Mobile=MobileProperties -FR-Designer_Button_OK=OK -FR-Designer_Button_Cancel=Cancel +FR-Designer_Permissions_Edition=Permissions Edition +FR-Designer_Permission_Edition=Permissions Edition +FR-Designer_Export_Excel_Page=Page Break +FR-Designer_Export_Excel_Simple=Original +FR-Designer_Export_Excel_PageToSheet=One Page Per Sheet 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 0d7ee8fd1a..ec280ecaf6 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 @@ -320,7 +320,7 @@ FR-Designer_Show_Text=\u30DC\u30BF\u30F3\u540D\u524D\u3092\u8868\u793A FR-Designer_User_Defined_Event=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u4E8B\u4EF6 FR-Designer_Output_PDF=PDF\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8 FR-Designer_Output_Word=Word\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8 -FR-Designer_Image=\u30A4\u30E1\u30FC\u30B8 +FR-Designer_Image=\u753B\u50CF\uFF08PNG\uFF09 FR-Designer_Flash_Print=Flash\u30D7\u30EA\u30F3\u30C8 FR-Designer_PDF_Print=PDF\u30D7\u30EA\u30F3\u30C8 FR-Designer_Applet_Print=\u30A2\u30D7\u30EC\u30C3\u30C8\u5370\u5237 @@ -432,7 +432,7 @@ FR-Designer_Attention=\u6CE8\u610F\u3057\u307E\u3059 FR-Designer_Forbid_Widgets_Intersects=\u7981\u6B62\u90E8\u54C1\u3092\u91CD\u306D\u3066 FR-Designer_Widget_Scaling_Mode_Fit=\u9069\u5FDC\u533A\u57DF FR-Designer_Widget_Scaling_Mode_Fixed=\u56FA\u5B9A\u30B5\u30A4\u30BA -FR-Designer-Widget_Area_Scaling=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30A8\u30EA\u30A2\ +FR-Designer-Widget_Area_Scaling=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30A8\u30EA\u30A2 FR-Designer-QQLogin-Determine=\u6C7A\u5B9A\u3057\u307E\u3059 FR-Designer-QQLogin-Cancel=\u30AD\u30E3\u30F3\u30BB\u30EB FR-Designer-Reuse_Manager= @@ -463,9 +463,9 @@ FR-Designer-DS-Database_Query=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30AF\u30A8\u FR-Designer-LayerPageReport_PageQuery=\u30DA\u30FC\u30B8\u5225\u30AF\u30A8\u30EA FR-Designer-LayerPageReport_Define_PageQuerySQL=\u5B9A\u7FA9\u30DA\u30FC\u30B8\u5225\u30AF\u30A8\u30EAsql FR-Designer_Is_Share_DBTableData=\u5171\u6709\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 -FR-Designer_Event=\ -FR-Designer_Properties=FR-Designer_Properties=\ -\ -FR-Designer_Button_OK=FR-Designer_Button_OK=\u78BA\u5B9A -FR-Designer_Button_Cancel=\u30AD\u30E3\u30F3\u30BB\u30EB -\ \ No newline at end of file +FR-Designer_Event= +FR-Designer_Properties= +FR-Designer_Permissions_Edition=\u6A29\u9650\u7DE8\u96C6 +FR-Designer_Export_Excel_Page=\u6539\u30DA\u30FC\u30B8\u51FA\u529B +FR-Designer_Export_Excel_Simple=\u305D\u306E\u307E\u307E\u51FA\u529B +FR-Designer_Export_Excel_PageToSheet=\u6539\u30DA\u30FC\u30B8\uFF06\u30B7\u30FC\u30C8\u5206\u3051 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 553a2503cb..99ed34dc57 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 @@ -459,7 +459,9 @@ FR-Designer-DS-Database_Query=\uB370\uC774\uD130\uBCA0\uC774\uC2A4\uCC3E\uC544\u FR-Designer_Is_Share_DBTableData=\uB370\uC774\uD130\uC138\uD2B8\uACF5\uC720 FR-Designer-LayerPageReport_PageQuery=\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30 FR-Designer-LayerPageReport_Define_PageQuerySQL=\uC815\uC758\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30sql -FR-Designer_Event=\ -FR-Designer_Properties=\uFFFD -FR-Designer_Button_OK=\uD655\uC778FR-Designer_Button_Cancel=\uCDE8\uC18C -\ \ No newline at end of file +FR-Designer_Event= +FR-Designer_Properties= +FR-Designer_Permissions_Edition=\uAD8C\uD55C\uD3B8\uC9D1 +FR-Designer_Export_Excel_Page=\uD398\uC774\uC9C0\uB098\uB204\uAE30\uC5B4\uB0B4\uBCF4\uB0B4\uAE30 +FR-Designer_Export_Excel_Simple=\uC6D0\uB798\uBAA8\uC2B5\uB0B4\uBCF4\uB0B4\uAE30 +FR-Designer_Export_Excel_PageToSheet=\uD398\uC774\uC9C0\uC640 Sheet\uB098\uB204\uC5B4\uB0B4\uBCF4\uB0B4\uAE30 \ No newline at end of file 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 e0b5bef423..584ea5a776 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 @@ -358,6 +358,7 @@ FR-Designer_KeyPoint=\u5173\u952E\u8282\u70B9 FR-Designer_loadedTreeModel=\u52A0\u8F7D\u5931\u8D25,\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5 FR-Designer-Failed_to_load_the_plugin=\u65E0\u6CD5\u52A0\u8F7D\u63D2\u4EF6\uFF0C\u8BF7\u66F4\u65B0\u63D2\u4EF6\uFF1A FR-Designer-Plugin_Please_Update_Jar=\u8BF7\u66F4\u65B0Jar\u5305, \u63D2\u4EF6\u9700\u6C42\u6700\u4F4E\u7248\u672C +FR-Designer-Invalid_Page_Number=\u65E0\u6548\u9875\u7801 FR-Designer_Get-CubeGetting=\u83B7\u53D6cube FR-Designer_XMLA_Database=\u6570\u636E\u5E93 FR-Designer_XMLA_UserName=\u7528\u6237\u540D @@ -422,7 +423,7 @@ FR-Designer-Website_Url=http\://www.finereport.com/ FR-Designer-BBSLogin_Download-Unlogin-Tip=\u767B\u5F55\u540E\u624D\u80FD\u4E0B\u8F7D FR-Designer-App_ReLayout=\u624B\u673A\u91CD\u5E03\u5C40 FR-Designer_Mobile-Attr=\u79FB\u52A8\u7AEF\u5C5E\u6027 -FR-Designer_Mobile-Vertical=\u7AD6\u5C4FF +FR-Designer_Mobile-Vertical=\u7AD6\u5C4F FR-Designer_Mobile-Horizontal=\u6A2A\u5C4F FR-Designer_COMMUNITY=\u793E\u533A FR-Designer_COMMUNITY_BBS=\u5E06\u8F6F\u8BBA\u575B @@ -490,6 +491,7 @@ FR-Designer-LayerPageReport_Define_PageQuerySQL=\u5B9A\u4E49\u5206\u9875\u67E5\u FR-Designer_Is_Share_DBTableData=\u5171\u4EAB\u6570\u636E\u96C6 FR-Designer_Event=\u4E8B\u4EF6 FR-Designer_Properties=\u5C5E\u6027 -FR-Designer_Properties_Mobile=\u624B\u673A\u5C5E\u6027 -FR-Designer_Button_OK=\u786E\u5B9A -FR-Designer_Button_Cancel=\u53D6\u6D88 +FR-Designer_Permissions_Edition=\u6743\u9650\u7F16\u8F91 +FR-Designer_Export_Excel_Page=\u5206\u9875\u5BFC\u51FA +FR-Designer_Export_Excel_Simple=\u539F\u6837\u5BFC\u51FA +FR-Designer_Export_Excel_PageToSheet=\u5206\u9875\u5206Sheet\u5BFC\u51FA 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 3d30f49bd3..c46b4f83d5 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 @@ -357,6 +357,7 @@ FR-Designer_KeyPoint=\u95DC\u9375\u7BC0\u9EDE FR-Designer_loadedTreeModel=\u52A0\u8F09\u5931\u6557,\u8ACB\u6AA2\u67E5\u5F8C\u91CD\u8A66 FR-Designer-Failed_to_load_the_plugin=\u7121\u6CD5\u52A0\u8F09\u63D2\u4EF6\uFF0C\u8ACB\u66F4\u65B0\u63D2\u4EF6\uFF1A FR-Designer-Plugin_Please_Update_Jar=\u8ACB\u66F4\u65B0Jar\u5305, \u63D2\u4EF6\u9700\u6C42\u6700\u4F4E\u7248\u672C +FR-Designer-Invalid_Page_Number=\u7121\u6548\u9801\u78BC FR-Designer_Get-CubeGetting=\u7372\u53D6cube FR-Designer_XMLA_Database=\u8CC7\u6599\u5EAB FR-Designer_XMLA_UserName=\u5E33\u865F @@ -478,6 +479,7 @@ FR-Designer-LayerPageReport_Define_PageQuerySQL=\u5B9A\u7FA9\u5206\u9801\u67E5\u FR-Designer_Is_Share_DBTableData=\u662F\u5426\u5171\u4EAB\u8CC7\u6599\u96C6 FR-Designer_Properties=\u5C6C\u6027 FR-Designer_Event=\u4E8B\u4EF6 -FR-Designer_Properties_Mobile=\u624B\u6A5F\u5C6C\u6027 -FR-Designer_Button_OK=\u78BA\u5B9A -FR-Designer_Button_Cancel=\u53D6\u6D88 \ No newline at end of file +FR-Designer_Permissions_Edition=\u6B0A\u9650\u7DE8\u8F2F +FR-Designer_Export_Excel_Page=\u5206\u9801\u532F\u51FA +FR-Designer_Export_Excel_Simple=\u539F\u6A23\u532F\u51FA +FR-Designer_Export_Excel_PageToSheet=\u5206\u9801\u5206Sheet\u532F\u51FA