From e60e6e46b3eb1113cd671f7a09cc51b9e24b8176 Mon Sep 17 00:00:00 2001 From: mengao Date: Mon, 27 Mar 2017 16:33:25 +0800 Subject: [PATCH 01/60] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 18 +++++++----------- .../chart/gui/style/axis/ChartValuePane.java | 5 ++--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 73235dc31f..4a9be221de 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p, f }; - double[] rowSize = { p, p, p, p, p, p, p, p}; + double[] rowSize = { p, p, p, p}; Component[][] components = getPanelComponents(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); - for(int i = 0; i < components.length; i+=2) { + for(int i = 0; i < components.length; i++) { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() { @Override @@ -57,19 +57,15 @@ public class MinMaxValuePane extends JPanel { checkBoxUse(); } }); - ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]); + ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); } } protected Component[][] getPanelComponents() { return new Component[][]{ - new Component[]{minCheckBox}, - new Component[]{minValueField}, - new Component[]{maxCheckBox}, - new Component[]{maxValueField}, - new Component[]{isCustomMainUnitBox}, - new Component[]{mainUnitField}, - new Component[]{isCustomSecUnitBox}, - new Component[]{secUnitField}, + new Component[]{minCheckBox, minValueField}, + new Component[]{maxCheckBox, maxValueField}, + new Component[]{isCustomMainUnitBox, mainUnitField}, + new Component[]{isCustomSecUnitBox, secUnitField}, }; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index f798a0a07d..d25ed29972 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -151,11 +151,10 @@ public class ChartValuePane extends ChartAxisUsePane{ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f}; - double[] rowSize = { p, p, p}; + double[] rowSize = {p, p}; Component[][] component = new Component[][]{ new Component[]{null,initMinMaxValue(),null}, - new Component[]{null, addLogarithmicPane2ValuePane(), null}, - new Component[]{null, null, addLogText()}, + new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, }; return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); } From b7fea495cff85298182c710dc5c2dd98ffbbdbde Mon Sep 17 00:00:00 2001 From: mengao Date: Mon, 27 Mar 2017 16:43:33 +0800 Subject: [PATCH 02/60] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 18 +++++++++++------- .../chart/gui/style/axis/ChartValuePane.java | 5 +++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 4a9be221de..73235dc31f 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p, f }; - double[] rowSize = { p, p, p, p}; + double[] rowSize = { p, p, p, p, p, p, p, p}; Component[][] components = getPanelComponents(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); - for(int i = 0; i < components.length; i++) { + for(int i = 0; i < components.length; i+=2) { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() { @Override @@ -57,15 +57,19 @@ public class MinMaxValuePane extends JPanel { checkBoxUse(); } }); - ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); + ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]); } } protected Component[][] getPanelComponents() { return new Component[][]{ - new Component[]{minCheckBox, minValueField}, - new Component[]{maxCheckBox, maxValueField}, - new Component[]{isCustomMainUnitBox, mainUnitField}, - new Component[]{isCustomSecUnitBox, secUnitField}, + new Component[]{minCheckBox}, + new Component[]{minValueField}, + new Component[]{maxCheckBox}, + new Component[]{maxValueField}, + new Component[]{isCustomMainUnitBox}, + new Component[]{mainUnitField}, + new Component[]{isCustomSecUnitBox}, + new Component[]{secUnitField}, }; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index d25ed29972..f798a0a07d 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -151,10 +151,11 @@ public class ChartValuePane extends ChartAxisUsePane{ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f}; - double[] rowSize = {p, p}; + double[] rowSize = { p, p, p}; Component[][] component = new Component[][]{ new Component[]{null,initMinMaxValue(),null}, - new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, + new Component[]{null, addLogarithmicPane2ValuePane(), null}, + new Component[]{null, null, addLogText()}, }; return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); } From 2e01132b6ac761728d302236dfdef2c0d041e81c Mon Sep 17 00:00:00 2001 From: fr_shine Date: Fri, 31 Mar 2017 15:28:05 +0800 Subject: [PATCH 03/60] =?UTF-8?q?=E5=BD=93=E5=89=8D=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=20=E5=88=A0=E9=99=A4=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/series/SeriesCondition/impl/FormHyperlinkPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java index 52607e72ea..01754ce2a9 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java @@ -95,6 +95,8 @@ public class FormHyperlinkPane extends BasicBeanPane { parameterList.toArray(parameters); formHyperlink.setParameters(parameters); + } else { + formHyperlink.setParameters(null); } } From 9014f648299a8d25be5ae9a9c7ab65848f73f843 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 31 Mar 2017 16:06:02 +0800 Subject: [PATCH 04/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E8=A7=A3=E5=86=B3=E5=B8=A6=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=A1=A8=E5=8D=95=E6=97=A0=E6=B3=95=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/templateinfo/JFormProcessInfo.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java b/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java index 4fa5169290..00b4d3f776 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.templateinfo; import com.fr.form.main.Form; -import com.fr.form.ui.container.WFitLayout; +import com.fr.form.ui.container.WLayout; /** * Created by plough on 2017/3/17. @@ -32,8 +32,8 @@ public class JFormProcessInfo extends TemplateProcessInfo
{ public int getWidgetCount() { int widgetCount = 0; for (int i = 0; i < template.getContainer().getWidgetCount(); i++) { - WFitLayout wf = (WFitLayout) template.getContainer().getWidget(i); - widgetCount += wf.getWidgetCount(); + WLayout wl = (WLayout) template.getContainer().getWidget(i); + widgetCount += wl.getWidgetCount(); } int a = 1; int b = 2; From 51f1caa26abe0513ec0eb38d3ab83d18ad7a261d Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 5 Apr 2017 14:52:55 +0800 Subject: [PATCH 05/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E8=AE=A9designer=5Fbase=E4=B8=8D=E4=BE=9D=E8=B5=96eng?= =?UTF-8?q?ine=E5=92=8Cdesigner=5Fform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java | 1 - .../com/fr/design/mainframe/templateinfo/JFormProcessInfo.java | 0 2 files changed, 1 deletion(-) rename {designer_base => designer}/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java (98%) rename {designer_base => designer_form}/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java (100%) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java b/designer/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java similarity index 98% rename from designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java rename to designer/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java index 44522b8566..bf5d835d2a 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java +++ b/designer/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.templateinfo; -import com.fr.base.io.IOFile; import com.fr.base.parameter.ParameterUI; import com.fr.main.impl.WorkBook; import com.fr.report.cellcase.CellCase; diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java b/designer_form/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java similarity index 100% rename from designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java rename to designer_form/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java From ec76806d476de5ea50ceb6fed066ace0ae910e7a Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 5 Apr 2017 15:42:49 +0800 Subject: [PATCH 06/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E8=A7=A3=E5=86=B3=E5=8F=A6=E5=AD=98?= =?UTF-8?q?=E4=B8=BA=E4=B8=8D=E4=BA=A7=E7=94=9F=E6=96=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84bug=EF=BC=9B=E5=BD=93id=E4=B8=BAnull=E6=97=B6=EF=BC=88?= =?UTF-8?q?=E6=97=A7=E6=A8=A1=E6=9D=BF=EF=BC=89=EF=BC=8C=E4=B8=8D=E6=90=9C?= =?UTF-8?q?=E9=9B=86=E6=95=B0=E6=8D=AE=EF=BC=9B=E8=B0=83=E6=95=B4=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=89=93=E5=8D=B0=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/mainframe/JTemplate.java | 9 +++++---- .../mainframe/templateinfo/TemplateInfoCollector.java | 9 ++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index b0b9f7b5a9..d6dc2f0b16 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -111,14 +111,15 @@ public abstract class JTemplate> ex // 为收集模版信息作准备 private void initForCollect() { - if (template.getTemplateID() == null) { - template.initTemplateID(); // 为新模板设置 templateID 属性 - } + template.initTemplateID(); // 为新模板设置 templateID 属性 if (openTime == 0) { openTime = System.currentTimeMillis(); } } private void collectInfo() { // 执行收集操作 + if (template.getTemplateID() == null) { // 旧模板 + return; + } long saveTime = System.currentTimeMillis(); // 保存模板的时间点 tic.collectInfo(template, this, openTime, saveTime); openTime = saveTime; // 更新 openTime,准备下一次计算 @@ -533,7 +534,7 @@ public abstract class JTemplate> ex boolean result = this.saveFile(); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); - initForCollect(); // 如果是旧模板另存为新模板,则添加 templateID + initForCollect(); // 如果另存为新模板,则添加 templateID collectInfo(); } //更换最近打开 diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 4f7069205c..39a7e22abd 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -113,7 +113,14 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - FRLogger.getLogger().info("writing: " + instance.templateInfoList); + String log = ""; + int count = 1; + for (String key : templateInfoList.keySet()) { + String createTime = ((HashMap)templateInfoList.get(key).get("consumingMap")).get("create_time").toString(); + log += (count + ". id: " + key + " " + createTime + "\n" + templateInfoList.get(key).toString() + "\n"); + count ++; + } + FRLogger.getLogger().info("writing tplInfo: \n" + log); os.writeObject(instance); os.close(); } catch (Exception ex) { From c6c5eb3f4ab49d27e2300d1f4c450f5172e39075 Mon Sep 17 00:00:00 2001 From: unknown <李晓丽> Date: Wed, 5 Apr 2017 16:50:23 +0800 Subject: [PATCH 07/60] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/locale/designer_zh_TW.properties | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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 10edd2d169..46500f10c1 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 @@ -563,17 +563,17 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u67 FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002 -FR-Designer_Background_Null= -FR-Designer_Background_Color= -FR-Designer_Background_Texture= -FR-Designer_Background_Pattern= -FR-Designer_Background_Gradient_Color= -FR-Designer_Background_Image= -FR-Designer_Background_Clear= -FR-Designer_Background_Image_Select= -FR-Designer_Initial_Background_Tips= -FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= +FR-Designer_Background_Null=\u6C92\u6709\u80CC\u666F +FR-Designer_Background_Color=\u984F\u8272 +FR-Designer_Background_Texture=\u7D0B\u7406 +FR-Designer_Background_Pattern=\u5716\u6848 +FR-Designer_Background_Gradient_Color=\u6F38\u8B8A\u8272 +FR-Designer_Background_Image=\u5716\u7247 +FR-Designer_Background_Clear=\u6E05\u9664 +FR-Designer_Background_Image_Select=\u9078\u64C7\u5716\u7247 +FR-Designer_Initial_Background_Tips=\u6309\u9215\u7684\u521D\u59CB\u80CC\u666F +FR-Designer_Mouse_Move_Tips=\u6ED1\u9F20\u79FB\u52D5\u5230\u6309\u9215\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u7121\u5247\u4E0D\u6539\u8B8A\u80CC\u666F +FR-Designer_Mouse_Click_Tips=\u6ED1\u9F20\u9EDE\u64CA\u6309\u9215\u6642\u80CC\u666F\uFF0C\u82E5\u7121\u5247\u4E0D\u6539\u8B8A\u80CC\u666F FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5 From 756670a9c0d4b17c71faae4ccf682f54359edddf Mon Sep 17 00:00:00 2001 From: wanling wang Date: Wed, 5 Apr 2017 16:56:21 +0800 Subject: [PATCH 08/60] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .../design/locale/designer_ja_JP.properties | 30 +++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index a9c6c2320c..5cc51f5ed5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,6 @@ designer_base/bin designer_chart/bin designer_form/bin *.iml +designer_base/src/com/fr/design/locale/.idea 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 4d68093c75..ffb1757f09 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 @@ -541,18 +541,18 @@ FR-Designer_No=\u3044\u3044\u3048 FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0 FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9 FR-Designer_Parameter-Formula=\u6570\u5F0F -FR-Designer_Background_Null= -FR-Designer_Background_Color= -FR-Designer_Background_Texture= -FR-Designer_Background_Pattern= -FR-Designer_Background_Gradient_Color= -FR-Designer_Background_Image= -FR-Designer_Background_Clear= -FR-Designer_Background_Image_Select= -FR-Designer_Initial_Background_Tips= -FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= -FR-Designer-Move_Tab_First= -FR-Designer-Move_Tab_End= -FR-Designer-Move_Tab_Next= -FR-Designer-Move_Tab_Prev= +FR-Designer_Background_Null=\u80CC\u666F\u306A\u3057 +FR-Designer_Background_Color=\u8272 +FR-Designer_Background_Texture=\u67C4 +FR-Designer_Background_Pattern=\u6A21\u69D8 +FR-Designer_Background_Gradient_Color=\u30B0\u30E9\u30C7\u30FC\u30B7\u30E7\u30F3\u8272 +FR-Designer_Background_Image=\u5199\u771F +FR-Designer_Background_Clear=\u30AF\u30EA\u30A2 +FR-Designer_Background_Image_Select=\u5199\u771F\u3092\u9078\u629E +FR-Designer_Initial_Background_Tips=\u30DC\u30BF\u30F3\u306E\u521D\u671F\u80CC\u666F +FR-Designer_Mouse_Move_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u306E\u80CC\u666F +FR-Designer_Mouse_Click_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u306E\u80CC\u666F +FR-Designer-Move_Tab_First=\u30C8\u30C3\u30D7\u306B\u79FB\u3059 +FR-Designer-Move_Tab_End=\u6700\u5F8C\u306B\u79FB\u3059 +FR-Designer-Move_Tab_Next=\u5F8C\u308D\u306B\u79FB\u3059 +FR-Designer-Move_Tab_Prev=\u524D\u306B\u79FB\u3059 From a1a277ff65546753d8beae9434004376cb395f0d Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Wed, 5 Apr 2017 16:59:49 +0800 Subject: [PATCH 09/60] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 18 +++++++----------- .../chart/gui/style/axis/ChartValuePane.java | 5 ++--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 73235dc31f..4a9be221de 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p, f }; - double[] rowSize = { p, p, p, p, p, p, p, p}; + double[] rowSize = { p, p, p, p}; Component[][] components = getPanelComponents(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); - for(int i = 0; i < components.length; i+=2) { + for(int i = 0; i < components.length; i++) { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() { @Override @@ -57,19 +57,15 @@ public class MinMaxValuePane extends JPanel { checkBoxUse(); } }); - ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]); + ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); } } protected Component[][] getPanelComponents() { return new Component[][]{ - new Component[]{minCheckBox}, - new Component[]{minValueField}, - new Component[]{maxCheckBox}, - new Component[]{maxValueField}, - new Component[]{isCustomMainUnitBox}, - new Component[]{mainUnitField}, - new Component[]{isCustomSecUnitBox}, - new Component[]{secUnitField}, + new Component[]{minCheckBox, minValueField}, + new Component[]{maxCheckBox, maxValueField}, + new Component[]{isCustomMainUnitBox, mainUnitField}, + new Component[]{isCustomSecUnitBox, secUnitField}, }; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index f798a0a07d..e497bcb80f 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -151,11 +151,10 @@ public class ChartValuePane extends ChartAxisUsePane{ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f}; - double[] rowSize = { p, p, p}; + double[] rowSize = { p, p}; Component[][] component = new Component[][]{ new Component[]{null,initMinMaxValue(),null}, - new Component[]{null, addLogarithmicPane2ValuePane(), null}, - new Component[]{null, null, addLogText()}, + new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, }; return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); } From 28443f0c163bc298d006015392f62a2f810764ab Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 5 Apr 2017 17:42:38 +0800 Subject: [PATCH 10/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 3 -- .../templateinfo/TemplateInfoCollector.java | 29 ++++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index d6dc2f0b16..37769cdbe8 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -117,9 +117,6 @@ public abstract class JTemplate> ex } } private void collectInfo() { // 执行收集操作 - if (template.getTemplateID() == null) { // 旧模板 - return; - } long saveTime = System.currentTimeMillis(); // 保存模板的时间点 tic.collectInfo(template, this, openTime, saveTime); openTime = saveTime; // 更新 openTime,准备下一次计算 diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 39a7e22abd..3cbc557f81 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -15,9 +15,7 @@ import org.json.JSONObject; import java.io.*; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.HashMap; +import java.util.*; /** * 做模板的过程和耗时收集,辅助类 @@ -27,6 +25,7 @@ public class TemplateInfoCollector implements Serializable { private static final String FILE_NAME = "tplInfo.ser"; private static TemplateInfoCollector instance; private HashMap> templateInfoList; + private Set removedTemplates; // 已经从 templateInfoList 中删除过的 id 列表,防止重复收集数据 private String designerOpenDate; //设计器最近一次打开日期 private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数 private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 @@ -36,6 +35,7 @@ public class TemplateInfoCollector implements Serializable { @SuppressWarnings("unchecked") private TemplateInfoCollector() { templateInfoList = new HashMap<>(); + removedTemplates = new ListSet<>(); setDesignerOpenDate(); } @@ -77,12 +77,15 @@ public class TemplateInfoCollector implements Serializable { return instance; } - private static boolean shouldCollectInfo() { + private boolean shouldCollectInfo(T t) { + if (t.getTemplateID() == null || instance.removedTemplates.contains(t.getTemplateID())) { // 旧模板 + return false; + } return DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); } - public static void appendProcess(String log) { - if (!shouldCollectInfo()) { + public void appendProcess(T t, String log) { + if (!shouldCollectInfo(t)) { return; } // 获取当前编辑的模板 @@ -148,7 +151,7 @@ public class TemplateInfoCollector implements Serializable { */ @SuppressWarnings("unchecked") public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { - if (!shouldCollectInfo()) { + if (!shouldCollectInfo(t)) { return; } @@ -232,7 +235,7 @@ public class TemplateInfoCollector implements Serializable { if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); - templateInfoList.remove(templateInfo.get("templateID")); + removeFromTemplateInfoList(templateInfo.get("templateID")); } } saveInfo(); @@ -284,12 +287,18 @@ public class TemplateInfoCollector implements Serializable { } // 删除测试模板 for (String key : testTemplateKeys) { - templateInfoList.remove(key); -// System.out.println(key + " is removed..."); + removeFromTemplateInfoList(key); } return completeTemplatesInfo; } + private void removeFromTemplateInfoList(String key) { + templateInfoList.remove(key); + removedTemplates.add(key); + FRLogger.getLogger().info(key + " is removed..."); + FRLogger.getLogger().info("removedTemplates: " + removedTemplates); + } + @SuppressWarnings("unchecked") private boolean isTestTemplate(HashMap templateInfo) { HashMap processMap = (HashMap) templateInfo.get("processMap"); From f7d68b85c4450327597b3c56d8a7f2376b700fca Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Wed, 5 Apr 2017 19:58:39 +0800 Subject: [PATCH 11/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/style/axis/ChartValuePane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index e497bcb80f..8916efe254 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -72,7 +72,7 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane = new ChartAxisLineStylePane(); zeroPane = aliagnZero4Second(); - axisReversed = new UICheckBox(Inter.getLocText("AxisReversed")); + axisReversed = new UICheckBox(Inter.getLocText("FR-Designer_AxisReversed")); unitCombox = new UIComboBox(ChartConstants.UNIT_I18N_VALUES); formatPane = new FormatPane(); axisLabelPane = new ChartAxisLabelPane(); @@ -171,8 +171,8 @@ public class ChartValuePane extends ChartAxisUsePane{ // 返回对数相关界面. 百分比 没有此界面. protected JPanel addLogarithmicPane2ValuePane() { JPanel labelLogPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); - labelLogPane.add(logBox = new UICheckBox(Inter.getLocText("Logarithmic")+":")); - labelLogPane.add(new UILabel(Inter.getLocText("Chart_Log_Base"))); + labelLogPane.add(logBox = new UICheckBox(Inter.getLocText("FR-Designer_Logarithmic")+":")); + labelLogPane.add(new UILabel(Inter.getLocText("FR-Designer_Chart_Log_Base"))); logBaseField = new UITextField(4); logBaseField.setText("10"); @@ -221,7 +221,7 @@ public class ChartValuePane extends ChartAxisUsePane{ * @return 返回标题. */ public String title4PopupWindow() { - return Inter.getLocText("Chart_F_Radar_Axis"); + return Inter.getLocText("FR-Designer_Chart_F_Radar_Axis"); } @Override From ab1d6e5cc7ea54fb0696e0cf285e34d935e5f64f Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 6 Apr 2017 10:04:10 +0800 Subject: [PATCH 12/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E6=94=B6=E9=9B=86=E6=A8=A1=E6=9D=BF=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/templateinfo/TemplateInfoCollector.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 3cbc557f81..f302d9f5ea 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -5,6 +5,7 @@ import com.fr.base.io.IOFile; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; +import com.fr.env.RemoteEnv; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.GeneralUtils; @@ -78,7 +79,9 @@ public class TemplateInfoCollector implements Serializable { } private boolean shouldCollectInfo(T t) { - if (t.getTemplateID() == null || instance.removedTemplates.contains(t.getTemplateID())) { // 旧模板 + if (FRContext.getCurrentEnv() instanceof RemoteEnv // 远程设计不收集数据 + || t.getTemplateID() == null + || instance.removedTemplates.contains(t.getTemplateID())) { // 旧模板 return false; } return DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); From 4cd9b17bfca1021f81e616f035daef7fc7941851 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 6 Apr 2017 10:36:56 +0800 Subject: [PATCH 13/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E5=A6=82=E6=9E=9C=20TemplateInfoCollecor?= =?UTF-8?q?=20=E7=B1=BB=E7=BB=93=E6=9E=84=E6=9C=89=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=EF=BC=8C=E5=88=99=E6=94=BE=E5=BC=83=E4=B9=8B=E5=89=8D=E6=94=B6?= =?UTF-8?q?=E9=9B=86=E7=9A=84=E6=95=B0=E6=8D=AE=EF=BC=8C=E4=BF=9D=E8=AF=81?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E5=90=AF=E5=8A=A8=E8=AE=BE=E8=AE=A1=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/templateinfo/TemplateInfoCollector.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index f302d9f5ea..76d942e9a3 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -71,7 +71,14 @@ public class TemplateInfoCollector implements Serializable { } catch (FileNotFoundException ex) { // 如果之前没有存储过,则创建新对象 instance = new TemplateInfoCollector(); - } catch (Exception ex) { + } catch (InvalidClassException ex) { + // 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖) + // 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现 + FRLogger.getLogger().error(ex.getMessage()); + FRLogger.getLogger().info("use a new instance"); + instance = new TemplateInfoCollector(); + } + catch (Exception ex) { FRLogger.getLogger().error(ex.getMessage(), ex); } } From cebfc9ef10d1c3411e4bc6a33e3b05d38b158e53 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 6 Apr 2017 12:47:09 +0800 Subject: [PATCH 14/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E4=BF=AE=E6=94=B9=E7=AE=97=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E5=B0=86=E4=B8=8A=E4=BC=A0=E5=90=8E=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E8=A7=86=E4=B8=BA=E6=97=A7=E6=A8=A1=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E6=94=B6=E9=9B=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/JTemplate.java | 3 +++ .../templateinfo/TemplateInfoCollector.java | 16 +++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index 37769cdbe8..7c98fecd1f 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -117,6 +117,9 @@ public abstract class JTemplate> ex } } private void collectInfo() { // 执行收集操作 + if (openTime == 0) { // 旧模板,不收集数据 + return; + } long saveTime = System.currentTimeMillis(); // 保存模板的时间点 tic.collectInfo(template, this, openTime, saveTime); openTime = saveTime; // 更新 openTime,准备下一次计算 diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 76d942e9a3..db1fe312ae 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -26,7 +26,6 @@ public class TemplateInfoCollector implements Serializable { private static final String FILE_NAME = "tplInfo.ser"; private static TemplateInfoCollector instance; private HashMap> templateInfoList; - private Set removedTemplates; // 已经从 templateInfoList 中删除过的 id 列表,防止重复收集数据 private String designerOpenDate; //设计器最近一次打开日期 private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数 private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 @@ -36,7 +35,6 @@ public class TemplateInfoCollector implements Serializable { @SuppressWarnings("unchecked") private TemplateInfoCollector() { templateInfoList = new HashMap<>(); - removedTemplates = new ListSet<>(); setDesignerOpenDate(); } @@ -85,17 +83,15 @@ public class TemplateInfoCollector implements Serializable { return instance; } - private boolean shouldCollectInfo(T t) { - if (FRContext.getCurrentEnv() instanceof RemoteEnv // 远程设计不收集数据 - || t.getTemplateID() == null - || instance.removedTemplates.contains(t.getTemplateID())) { // 旧模板 + private boolean shouldCollectInfo() { + if (FRContext.getCurrentEnv() instanceof RemoteEnv) { // 远程设计不收集数据 return false; } return DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); } - public void appendProcess(T t, String log) { - if (!shouldCollectInfo(t)) { + public void appendProcess(String log) { + if (!shouldCollectInfo()) { return; } // 获取当前编辑的模板 @@ -161,7 +157,7 @@ public class TemplateInfoCollector implements Serializable { */ @SuppressWarnings("unchecked") public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { - if (!shouldCollectInfo(t)) { + if (!shouldCollectInfo()) { return; } @@ -304,9 +300,7 @@ public class TemplateInfoCollector implements Serializable { private void removeFromTemplateInfoList(String key) { templateInfoList.remove(key); - removedTemplates.add(key); FRLogger.getLogger().info(key + " is removed..."); - FRLogger.getLogger().info("removedTemplates: " + removedTemplates); } @SuppressWarnings("unchecked") From 88201d9d5c175775f43cb017f3d8b5159ee3bf4f Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 6 Apr 2017 14:42:21 +0800 Subject: [PATCH 15/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=9B=E5=8F=91=E9=80=81=E6=95=B0=E6=8D=AE=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=BE=93=E5=87=BA=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/mainframe/JTemplate.java | 4 ++-- .../design/mainframe/templateinfo/TemplateInfoCollector.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index 7c98fecd1f..92dd63e112 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -85,7 +85,7 @@ public abstract class JTemplate> ex public JTemplate(T t, String defaultFileName) { this(t, new MemFILE(newTemplateNameByIndex(defaultFileName)), true); - initForCollect(); + openTime = System.currentTimeMillis(); } public JTemplate(T t, FILE file) { @@ -534,7 +534,7 @@ public abstract class JTemplate> ex boolean result = this.saveFile(); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); - initForCollect(); // 如果另存为新模板,则添加 templateID + initForCollect(); // 如果保存新模板(新建模板直接保存,或者另存为),则添加 templateID collectInfo(); } //更换最近打开 diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index db1fe312ae..1b57c21fa9 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -242,6 +242,8 @@ public class TemplateInfoCollector implements Serializable { // 清空记录 FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); removeFromTemplateInfoList(templateInfo.get("templateID")); + } else { + FRLogger.getLogger().info("模板数据发送服务器失败,下次启动设计器时再尝试:" + templateInfo.get("templateID")); } } saveInfo(); From 139b3b89e24e57e2bcdf663e1b1940bfbafbe6d8 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 6 Apr 2017 14:45:08 +0800 Subject: [PATCH 16/60] =?UTF-8?q?=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 --- .../fr/design/mainframe/templateinfo/TemplateInfoCollector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 1b57c21fa9..37446b3d34 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -243,7 +243,7 @@ public class TemplateInfoCollector implements Serializable { FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); removeFromTemplateInfoList(templateInfo.get("templateID")); } else { - FRLogger.getLogger().info("模板数据发送服务器失败,下次启动设计器时再尝试:" + templateInfo.get("templateID")); + FRLogger.getLogger().info("send template info failed, will try next time, " + templateInfo.get("templateID")); } } saveInfo(); From 7d9891e3574997ead204235878cab8bc26f8fc98 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 6 Apr 2017 17:10:45 +0800 Subject: [PATCH 17/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/locale/designer.properties | 4 ++++ .../src/com/fr/design/locale/designer_en_US.properties | 4 ++++ .../src/com/fr/design/locale/designer_ja_JP.properties | 4 ++++ .../src/com/fr/design/locale/designer_ko_KR.properties | 4 ++++ .../src/com/fr/design/locale/designer_zh_CN.properties | 4 ++++ .../src/com/fr/design/locale/designer_zh_TW.properties | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 7c4847f3ca..8293091877 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -585,3 +585,7 @@ FR-Designer-Move_Tab_First=move to first FR-Designer-Move_Tab_End=move to end FR-Designer-Move_Tab_Next=move to next FR-Designer-Move_Tab_Prev=move to previous +FR-Designer_AxisReversed=AxisValue +FR-Designer_Logarithmic=Logarithmic +FR-Designer_Chart_Log_Base=Log Base +FR-Designer_Chart_F_Radar_Axis=Chart_F_Radar_Axis \ No newline at end of file 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 fab277ad6f..6f602ec4e0 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 @@ -586,3 +586,7 @@ FR-Designer-Move_Tab_First=move to first FR-Designer-Move_Tab_End=move to end FR-Designer-Move_Tab_Next=move to next FR-Designer-Move_Tab_Prev=move to previous +FR-Designer_AxisReversed=Axis in reverse order +FR-Designer_Logarithmic=Log scale +FR-Designer_Chart_Log_Base=Log Base +FR-Designer_Chart_F_Radar_Axis=Value Axis \ No newline at end of file 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 4d68093c75..23285ba1db 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 @@ -556,3 +556,7 @@ FR-Designer-Move_Tab_First= FR-Designer-Move_Tab_End= FR-Designer-Move_Tab_Next= FR-Designer-Move_Tab_Prev= +FR-Designer_AxisReversed=\u8EF8\u9006\u914D\u5217 +FR-Designer_Logarithmic=\u5BFE\u6570\u76EE\u76DB\u308A +FR-Designer_Chart_Log_Base=\u5E95\u6570 +FR-Designer_Chart_F_Radar_Axis=\u5782\u76F4\u8EF8 \ 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 14086e8814..0c798b87aa 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 @@ -553,3 +553,7 @@ FR-Designer-Move_Tab_First= FR-Designer-Move_Tab_End= FR-Designer-Move_Tab_Next= FR-Designer-Move_Tab_Prev= +FR-Designer_AxisReversed=\uCD95\uC5ED\uC21C +FR-Designer_Logarithmic=\uB85C\uADF8\uB208\uAE08 +FR-Designer_Chart_Log_Base=\uAE30\uC218 +FR-Designer_Chart_F_Radar_Axis=\uAC12\uCD95 \ 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 5139b301f7..7c3917275a 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 @@ -590,3 +590,7 @@ FR-Designer-Move_Tab_First=\u79FB\u52A8\u5230\u9996\u4F4D FR-Designer-Move_Tab_End=\u79FB\u52A8\u5230\u672B\u5C3E FR-Designer-Move_Tab_Next=\u5F80\u540E\u79FB\u52A8 FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52A8 +FR-Designer_AxisReversed=\u8F74\u9006\u5E8F +FR-Designer_Logarithmic=\u5BF9\u6570\u523B\u5EA6 +FR-Designer_Chart_Log_Base=\u5E95\u6570 +FR-Designer_Chart_F_Radar_Axis=\u503C\u8F74 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 10edd2d169..aeb9411149 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 @@ -578,3 +578,7 @@ FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5 FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52D5 +FR-Designer_AxisReversed=\u8EF8\u9006\u5E8F +FR-Designer_Logarithmic=\u5C0D\u6578\u523B\u5EA6 +FR-Designer_Chart_Log_Base=\u5E95\u6578 +FR-Designer_Chart_F_Radar_Axis=\u503C\u8EF8 \ No newline at end of file From eb465d65f5fefd70787773ced1a97eecada6476d Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 7 Apr 2017 11:43:29 +0800 Subject: [PATCH 18/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E7=BB=99TemplateInfoCollector=E5=8A=A0?= =?UTF-8?q?=E4=B8=8AserialVersionUID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/templateinfo/TemplateInfoCollector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 37446b3d34..b9b7aa194e 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -31,6 +31,7 @@ public class TemplateInfoCollector implements Serializable { private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 private static final int COMPLETE_DAY_COUNT = 15; // 判断模板是否完成的天数 private static final int ONE_THOUSAND = 1000; + static final long serialVersionUID = 2007L; @SuppressWarnings("unchecked") private TemplateInfoCollector() { @@ -72,7 +73,7 @@ public class TemplateInfoCollector implements Serializable { } catch (InvalidClassException ex) { // 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖) // 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现 - FRLogger.getLogger().error(ex.getMessage()); + FRLogger.getLogger().info(ex.getMessage()); FRLogger.getLogger().info("use a new instance"); instance = new TemplateInfoCollector(); } From 58fbac4e191af1d56f843ac75f020eba3f405c1c Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Fri, 7 Apr 2017 13:58:25 +0800 Subject: [PATCH 19/60] =?UTF-8?q?report-1945=E7=BB=84=E4=BB=B6=E5=A4=8D?= =?UTF-8?q?=E7=94=A8bug?= 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_zh_CN.properties | 3 +- .../design/locale/designer_zh_TW.properties | 3 +- .../layout/FRAbsoluteLayoutAdapter.java | 11 +- .../adapters/layout/FRBodyLayoutAdapter.java | 26 +- .../adapters/layout/FRFitLayoutAdapter.java | 2 +- .../layout/FRTabFitLayoutAdapter.java | 15 +- .../designer/beans/models/AddingModel.java | 180 ++--- .../designer/beans/models/SelectionModel.java | 46 +- .../designer/beans/models/StateModel.java | 688 +++++++++--------- .../beans/painters/AbstractPainter.java | 45 +- .../designer/creator/XLayoutContainer.java | 435 +++++------ .../creator/cardlayout/XWCardTagLayout.java | 338 +++++---- .../mainframe/FormCreatorDropTarget.java | 17 +- .../com/fr/design/mainframe/FormDesigner.java | 6 + .../fr/design/mainframe/FormSelection.java | 12 +- .../design/mainframe/FormSelectionUtils.java | 73 +- 18 files changed, 985 insertions(+), 919 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 7c4847f3ca..0eda01dee6 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -585,3 +585,5 @@ FR-Designer-Move_Tab_First=move to first FR-Designer-Move_Tab_End=move to end FR-Designer-Move_Tab_Next=move to next FR-Designer-Move_Tab_Prev=move to previous +FR-Designer_Too_Large_To_Paste=too large to paste +FR-Designer_Too_Small_To_Paste=Too small to paste 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 fab277ad6f..0dc0c050f9 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 @@ -586,3 +586,5 @@ FR-Designer-Move_Tab_First=move to first FR-Designer-Move_Tab_End=move to end FR-Designer-Move_Tab_Next=move to next FR-Designer-Move_Tab_Prev=move to previous +FR-Designer_Too_Large_To_Paste=Too large to paste! +FR-Designer_Too_Small_To_Paste=Too small to paste! 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 56e695b2cf..5631325835 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 @@ -585,9 +585,10 @@ FR-Designer_Background_Clear=\u6E05\u9664 FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247 FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F - FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F FR-Designer-Move_Tab_First=\u79FB\u52A8\u5230\u9996\u4F4D FR-Designer-Move_Tab_End=\u79FB\u52A8\u5230\u672B\u5C3E FR-Designer-Move_Tab_Next=\u5F80\u540E\u79FB\u52A8 FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52A8 +FR-Designer_Too_Large_To_Paste=\u7EC4\u4EF6\u5927\u5C0F\u8D85\u51FA\u8FB9\u754C\uFF0C\u65E0\u6CD5\u7C98\u8D34\uFF01 +FR-Designer_Too_Small_To_Paste=\u6B64\u5904\u65E0\u6CD5\u7C98\u8D34\uFF0C\u5C0F\u4E8E\u7EC4\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 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 df75494c6b..dc9916ab18 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 @@ -579,4 +579,5 @@ FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5 FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52D5 - +FR-Designer_Too_Large_To_Paste=\u7D44\u4EF6\u5927\u5C0F\u8D85\u51FA\u908A\u754C\uFF0C\u7121\u6CD5\u7C98\u8CBC\uFF01 +FR-Designer_Too_Small_To_Paste=\u6B64\u8655\u7121\u6CD5\u7C98\u8CBC\uFF0C\u5C0F\u65BC\u7D44\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 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 b8a8e8ad19..603626e13d 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 @@ -283,7 +283,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { } else if (isCrossPointArea(parentComp, x, y)) { //交叉区域插入组件时,根据具体位置进行上下或者左右或者相邻三个组件的位置大小插入 fixCrossPointArea(parentComp, child, x, y); - //TODO 尽量不要出现这种写法吧?if else条件要么互斥,要么多个if判断return,不要在一条if else语句里面return吧? return; } else if (isTrisectionArea(parentComp, x, y)) { // 在边界三等分区域,就不再和组件二等分了 @@ -320,17 +319,15 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { int height = creator.getHeight(); int width = creator.getWidth(); if (x < 0) { - width += x; - x = 0; + x = container.getX(); } else if (x + creator.getWidth() > container.getWidth()) { - width = container.getWidth() - x; + x = container.getWidth() - width; } if (y < 0) { - height += y; - y = 0; + y = container.getY(); } else if (y + creator.getHeight() > container.getHeight()) { - height = container.getHeight() - y; + y = container.getHeight() - height; } creator.setBounds(x, y, width, height); diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java index b3072667b2..75190ba3bf 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java @@ -640,11 +640,7 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter { * 又通过ComponentUtils.getRelativeBounds()方法获取到了绝对坐标, * 再次计算相对坐标,所以将y值重新变成绝对坐标。 * */ - if (currentCreator.getBackupParent().getLocation().y == WBorderLayout.DEFAULT_SIZE) { - y = y + WCardMainBorderLayout.TAB_HEIGHT + WBorderLayout.DEFAULT_SIZE; - } else { - y = y + WCardMainBorderLayout.TAB_HEIGHT; - } + y = y + WCardMainBorderLayout.TAB_HEIGHT + this.getParaEditorYOffset(); int tempX = x - rect.x; int tempY = y - rect.y; int containerX = container.getX(); @@ -675,6 +671,26 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter { return position; } + /** + * 获取因为参数面板导致的Y坐标偏移 + * + * @return 参数面板导致的Y坐标偏移 + */ + protected int getParaEditorYOffset() { + int offset = 0; + if (container.getParent() != null) { + Component components[] = container.getParent().getComponents(); + for (Component component : components) { + if (component instanceof XWParameterLayout) { + offset = component.getY() + component.getHeight(); + break; + } + } + } + return offset; + } + + /** * 组件交叉区域进行插入时,调整受到变动的其他组件,之前是交叉区域插入也按照三等分逻辑,后面测试中发现有bug,改为和bi一样的鼠标所在侧平分 * 默认左上角、右下角区域是垂直方向插入组件 diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index e31ee6a5d3..eca82e5022 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -133,7 +133,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { isFindRelatedComps = false; //拖入组件判断时,先判断是否为交叉点区域,其次三等分区域,再次平分区域 Component comp = container.getComponentAt(x, y); - if (checkInterval(comp)) { + if (comp == null || checkInterval(comp)) { return false; } //如果当前处于边缘地带, 那么就把他贴到父容器上 diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java index 352a3ba7a6..b1ca803c6b 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java @@ -7,11 +7,13 @@ package com.fr.design.designer.beans.adapters.layout; import com.fr.design.beans.GroupModel; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWidgetCreator; import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FRTabFitLayoutPropertiesGroupModel; +import com.fr.design.mainframe.widget.editors.ParameterEditor; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.container.WBorderLayout; @@ -82,16 +84,14 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter { return true; } - // tab布局的纵坐标受到tab高度的影响,判断的上边界取得是里面XWTabFitLayout的上边界, - // 实际计算的时候的纵坐标用了外层的CardMainBorerLayout,需要将tab高度减掉 - //将y值变为相对坐标以实现获取到鼠标drop位置的控件 - //TODO 可以直接在这边将x,y都变成相对坐标,这样在后面判断拖进来的新控件放置方式的时候就不用再判断了 + // tab布局的纵坐标受到tab高度以及参数面板高度的影响,判断的上边界取得是里面XWTabFitLayout的上边界, + // 实际计算的时候的纵坐标用了外层的CardMainBorerLayout,需要将tab高度和参数面板高度减掉 + // 将y值变为相对坐标以实现获取到鼠标drop位置的控件 + // TODO 可以直接在这边将x,y都变成相对坐标,这样在后面判断拖进来的新控件放置方式的时候就不用再判断了 private int adjustY(int y, XWTabFitLayout tabLayout) { XWCardLayout cardLayout = (XWCardLayout) tabLayout.getBackupParent(); LayoutBorderStyle style = cardLayout.toData().getBorderStyle(); - if (container.getLocation().y == WBorderLayout.DEFAULT_SIZE) { - y = y - WBorderLayout.DEFAULT_SIZE; - } + y = y - this.getParaEditorYOffset(); if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { y = y - WCardMainBorderLayout.TAB_HEIGHT; } @@ -101,4 +101,5 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter { protected Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout) { return ComponentUtils.getRelativeBounds(mainLayout); } + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java b/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java index 46798f4d9a..54033694d9 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java @@ -18,116 +18,124 @@ import com.fr.general.ComparatorUtils; */ public class AddingModel { - // 当前要添加的组件 - private XCreator creator; - // 记录当前鼠标的位置信息 - private int current_x; - private int current_y; - private boolean added; - - public AddingModel(FormDesigner designer, XCreator xCreator) { - String creatorName = getXCreatorName(designer, xCreator); - this.creator = xCreator; - instantiateCreator(designer, creatorName); - // 初始的时候隐藏该组件的图标 - current_x = -this.creator.getWidth(); - current_y = -this.creator.getHeight(); - } + // 当前要添加的组件 + private XCreator creator; + // 记录当前鼠标的位置信息 + private int currentX; + private int currentY; + private boolean added; + + public AddingModel(FormDesigner designer, XCreator xCreator) { + String creatorName = getXCreatorName(designer, xCreator); + this.creator = xCreator; + instantiateCreator(designer, creatorName); + // 初始的时候隐藏该组件的图标 + currentY = -this.creator.getWidth(); + currentX = -this.creator.getHeight(); + } /** * 待说明 - * @param designer 设计器 - * @param creatorName 组件名 + * + * @param designer 设计器 + * @param creatorName 组件名 */ - public void instantiateCreator(FormDesigner designer, String creatorName) { - creator.toData().setWidgetName(creatorName); - ComponentAdapter adapter = new CompositeComponentAdapter(designer, creator); - adapter.initialize(); - creator.addNotify(); - creator.putClientProperty(AdapterBus.CLIENT_PROPERTIES, adapter); - } - - public AddingModel(XCreator xCreator, int x, int y) { - this.creator = xCreator; - this.creator.backupCurrentSize(); - this.creator.backupParent(); - this.creator.setSize(xCreator.initEditorSize()); - current_x = x - (xCreator.getWidth() / 2); - current_y = y - (xCreator.getHeight() / 2); - } + public void instantiateCreator(FormDesigner designer, String creatorName) { + creator.toData().setWidgetName(creatorName); + ComponentAdapter adapter = new CompositeComponentAdapter(designer, creator); + adapter.initialize(); + creator.addNotify(); + creator.putClientProperty(AdapterBus.CLIENT_PROPERTIES, adapter); + } + + public AddingModel(XCreator xCreator, int x, int y) { + this.creator = xCreator; + this.creator.backupCurrentSize(); + this.creator.backupParent(); + this.creator.setSize(xCreator.initEditorSize()); + currentX = x - (xCreator.getWidth() / 2); + currentY = y - (xCreator.getHeight() / 2); + } /** * 隐藏当前组件的图标 */ - public void reset() { - current_x = -this.creator.getWidth(); - current_y = -this.creator.getHeight(); - } + public void reset() { + currentX = -this.creator.getWidth(); + currentY = -this.creator.getHeight(); + } - public String getXCreatorName(FormDesigner designer,XCreator x){ - String def= x.createDefaultName(); + public String getXCreatorName(FormDesigner designer, XCreator x) { + String def = x.createDefaultName(); if (x.acceptType(XWParameterLayout.class)) { return def; } - int i = 0; - while (designer.getTarget().isNameExist(def + i)) { - i++; - } - return def+i; - } - - public int getCurrentX() { - return current_x; - } - - public int getCurrentY() { - return current_y; - } + int i = 0; + while (designer.getTarget().isNameExist(def + i)) { + i++; + } + return def + i; + } + + public int getCurrentX() { + return currentX; + } + + public int getCurrentY() { + return currentY; + } /** * 移动组件图标到鼠标事件发生的位置 - * @param x 坐标 - * @param y 坐标 + * + * @param x 坐标 + * @param y 坐标 */ - public void moveTo(int x, int y) { - current_x = x - (this.creator.getWidth() / 2); - current_y = y - (this.creator.getHeight() / 2); - } + public void moveTo(int x, int y) { + currentX = x - (this.creator.getWidth() / 2); + currentY = y - (this.creator.getHeight() / 2); + } - public XCreator getXCreator() { - return this.creator; - } + public XCreator getXCreator() { + return this.creator; + } /** * 当前组件是否已经添加到某个容器中 - * @return 是返回true + * + * @return 是返回true */ - public boolean isCreatorAdded() { - return added; - } + public boolean isCreatorAdded() { + return added; + } /** * 加入容器 - * @param designer 设计器 - * @param container 容器 - * @param x 坐标 - * @param y 坐标 - * @return 成功返回true + * + * @param designer 设计器 + * @param container 容器 + * @param x 坐标 + * @param y 坐标 + * @return 成功返回true */ - public boolean add2Container(FormDesigner designer, XLayoutContainer container, int x, int y) { - //考虑不同布局嵌套的情况,获取顶层容器 - XLayoutContainer xLayoutContainer = container.getTopLayout(); - if(xLayoutContainer != null && xLayoutContainer.acceptType(XWAbsoluteLayout.class)){ - container = xLayoutContainer; - } - - Rectangle rect = ComponentUtils.getRelativeBounds(container); - if(!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())){ - return added = container.getLayoutAdapter().addBean(creator, x + designer.getArea().getHorizontalValue(), y + designer.getArea().getVerticalValue()); - } - return added = container.getLayoutAdapter().addBean(creator, - x + designer.getArea().getHorizontalValue() - rect.x, - y + designer.getArea().getVerticalValue() - rect.y); - } + public boolean add2Container(FormDesigner designer, XLayoutContainer container, int x, int y) { + //考虑不同布局嵌套的情况,获取顶层容器 + XLayoutContainer xLayoutContainer = container.getTopLayout(); + if (xLayoutContainer != null && xLayoutContainer.acceptType(XWAbsoluteLayout.class)) { + container = xLayoutContainer; + } + + Rectangle rect = ComponentUtils.getRelativeBounds(container); + if (!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())) { + added = container.getLayoutAdapter().addBean(creator, + x + designer.getArea().getHorizontalValue(), + y + designer.getArea().getVerticalValue()); + return added; + } + added = container.getLayoutAdapter().addBean(creator, + x + designer.getArea().getHorizontalValue() - rect.x, + y + designer.getArea().getVerticalValue() - rect.y); + return added; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index c364317f1a..a70d9b1566 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java @@ -13,6 +13,7 @@ import com.fr.design.form.util.XCreatorConstants; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelectionUtils; +import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.stable.ArrayUtils; @@ -26,7 +27,7 @@ import java.util.ArrayList; public class SelectionModel { //被粘贴组件在所选组件位置处往下、往右各错开20像素。执行多次粘贴时,在上一次粘贴的位置处错开20像素。 private static final int DELTA_X_Y = 20; //粘贴时候的偏移距离 - private static final int BORDER_PROPORTION = 20; + private static final double OFFSET_RELATIVE = 0.80; private static FormSelection clipboard = new FormSelection(); private FormDesigner designer; private FormSelection selection; @@ -111,7 +112,7 @@ public class SelectionModel { */ public boolean pasteFromClipBoard() { if (!clipboard.isEmpty()) { - if (!hasSelectionComponent()) { + if (!hasSelectedPasteSource()) { //未选 unselectedPaste(); } else { @@ -140,14 +141,14 @@ public class SelectionModel { FormSelectionUtils.paste2Container(designer, (XLayoutContainer) selection.getSelectedCreator(), clipboard, rec.x + rec.width / 2, - rec.y + BORDER_PROPORTION); + rec.y + DELTA_X_Y); } else { Rectangle rec = selection.getRelativeBounds(); //自适应布局 FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), clipboard, rec.x + rec.width / 2, - rec.y + BORDER_PROPORTION); + rec.y + DELTA_X_Y); } } else { //绝对布局 @@ -172,18 +173,22 @@ public class SelectionModel { * 粘贴时选择组件 */ private void selectedPaste() { - XLayoutContainer parent = null; + XLayoutContainer container = null; //获取到编辑器的表层容器(已选的组件的父容器就是表层容器) - parent = XCreatorUtils.getParentXLayoutContainer(selection.getSelectedCreator()); - if (parent != null && selection.getSelectedCreator().getParent() instanceof XWFitLayout) { + container = XCreatorUtils.getParentXLayoutContainer(selection.getSelectedCreator()); + if (container != null && selection.getSelectedCreator().getParent() instanceof XWFitLayout) { //自适应布局 - Rectangle rec = selection.getRelativeBounds(); - FormSelectionUtils.paste2Container(designer, parent, clipboard, rec.x + rec.width / 2, rec.y + - rec.height - BORDER_PROPORTION); - } else if (parent != null && selection.getSelectedCreator().getParent() instanceof XWAbsoluteLayout) { + Rectangle selectionRec = selection.getRelativeBounds(); + Rectangle containerRec = ComponentUtils.getRelativeBounds(container); + //计算自适应布局位置 + int positionX = selectionRec.x - containerRec.x + selectionRec.width / 2; + int positionY = (int) (selectionRec.y - containerRec.y + selectionRec.height * OFFSET_RELATIVE); + + FormSelectionUtils.paste2Container(designer, container, clipboard, positionX, positionY); + } else if (container != null && selection.getSelectedCreator().getParent() instanceof XWAbsoluteLayout) { //绝对布局 Rectangle rec = selection.getSelctionBounds(); - FormSelectionUtils.paste2Container(designer, parent, clipboard, rec.x + DELTA_X_Y, rec.y + DELTA_X_Y); + FormSelectionUtils.paste2Container(designer, container, clipboard, rec.x + DELTA_X_Y, rec.y + DELTA_X_Y); } } @@ -198,13 +203,13 @@ public class SelectionModel { if (creator.acceptType(XWParameterLayout.class)) { designer.removeParaComponent(); } - removeCreatorFromContainer(creator, creator.getWidth(), creator.getHeight()); creator.removeAll(); // 清除被选中的组件 selection.reset(); } setSelectedCreator(designer.getRootComponent()); + FormSelectionUtils.rebuildSelection(designer); // 触发事件 designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); designer.repaint(); @@ -275,7 +280,7 @@ public class SelectionModel { * 但是编辑窗口的最外层其实是表层@see {@link com.fr.design.designer.creator.XWAbsoluteBodyLayout}, * 其他两层不是靠添加组件就可以编辑的。 */ - public boolean hasSelectionComponent() { + public boolean hasSelectedPasteSource() { XCreator selectionXCreator = selection.getSelectedCreator(); if (designer.getClass().equals(FormDesigner.class)) { //frm本地组件复用 @@ -286,10 +291,12 @@ public class SelectionModel { || selectionXCreator.getClass().equals(XWTabFitLayout.class); //选中的是否是frm绝对布局编辑器本身 boolean absoluteEditor = selectionXCreator.getClass().equals(XWAbsoluteBodyLayout.class); + //选中是否是frm绝对画布块编辑器本身 + boolean absoluteCanvas = selectionXCreator.getClass().equals(XWAbsoluteLayout.class); //选中的是否是相对布局编辑器本身 boolean relativeEditor = selectionXCreator.getClass().equals(XWFitLayout.class); - return !(tabEditor || absoluteEditor || relativeEditor); + return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor); } else { return false; } @@ -299,6 +306,15 @@ public class SelectionModel { } } + /** + * 是否有组件被选择。如果所选组件是最底层容器,也视为无选择 + * + * @return 是则返回true + */ + public boolean hasSelectionComponent() { + return !selection.isEmpty() && selection.getSelectedCreator().getParent() != null; + } + /** * 移动组件至指定位置 * diff --git a/designer_form/src/com/fr/design/designer/beans/models/StateModel.java b/designer_form/src/com/fr/design/designer/beans/models/StateModel.java index a623caddcf..f3aeb8f901 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/StateModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/StateModel.java @@ -1,446 +1,476 @@ package com.fr.design.designer.beans.models; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Graphics; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.awt.event.MouseEvent; -import java.util.ArrayList; - import com.fr.design.beans.location.Absorptionline; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.HoverPainter; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Location; -import com.fr.design.designer.creator.XConnector; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWAbsoluteLayout; +import com.fr.design.designer.creator.*; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.utils.ComponentUtils; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.util.ArrayList; + /** * 普通模式下的状态model */ public class StateModel { - // 对应的selection model - - private SelectionModel selectionModel; - // 当前鼠标进入拖拽区域的位置类型 - private Direction driection; - - // 当前拖拽的起始位置 - private int current_x; - private int current_y; - - private Point startPoint = new Point(); - private Point currentPoint = new Point(); - - private Absorptionline lineInX; - private Absorptionline lineInY; - //等距线 - private Absorptionline lineEquidistant; - - // 当前是否处于拖拽选择状态 - private boolean selecting; - private boolean dragging; - - private boolean addable; - - private FormDesigner designer; - - public StateModel(FormDesigner designer) { - this.designer = designer; - selectionModel = designer.getSelectionModel(); - } - - /** - * 返回direction - * @return direction方向 - */ - public Direction getDirection() { - return driection; - } - - /** - * 是否有组件正被选中 - * - * @return true 如果至少一个组件被选中 - */ - public boolean isSelecting() { - return selecting; - } + // 对应的selection model + + private SelectionModel selectionModel; + // 当前鼠标进入拖拽区域的位置类型 + private Direction driection; + + // 当前拖拽的起始位置 + private int currentX; + private int currentY; + + //拖拽组件原始位置大小备份 + private Rectangle selectedPositionBackup; + + private Point startPoint = new Point(); + private Point currentPoint = new Point(); + + private Absorptionline lineInX; + private Absorptionline lineInY; + //等距线 + private Absorptionline lineEquidistant; + + // 当前是否处于拖拽选择状态 + private boolean selecting; + private boolean dragging; + + private boolean addable; + + private FormDesigner designer; + + public StateModel(FormDesigner designer) { + this.designer = designer; + selectionModel = designer.getSelectionModel(); + } /** - *是否能拖拽 + * 返回direction + * + * @return direction方向 + */ + public Direction getDirection() { + return driection; + } + + /** + * 是否有组件正被选中 + * + * @return true 如果至少一个组件被选中 + */ + public boolean isSelecting() { + return selecting; + } + + /** + * 是否能拖拽 + * * @return 非outer且选中为空 */ - public boolean dragable() { - return ((driection != Location.outer) && !selecting); - } - - /** - * 拖拽中是否可以转换为添加模式: - * 如果拖拽组件只有一个,鼠标当前所在位置的最底层表单容器与这个组件的容器不同; - * 如果拖拽组件为多个,鼠标当前所在位置的最底层表单容器除了要求要跟这些组件的容器不同外,还必须是绝对定位布局 - */ - private void checkAddable(MouseEvent e) { - addable = false; - designer.setPainter(null); - - if (driection != Location.inner) { - return; - } - - XCreator comp = designer.getComponentAt(e.getX(), e.getY(), selectionModel.getSelection().getSelectedCreators()); - XLayoutContainer container = XCreatorUtils.getHotspotContainer(comp); - XCreator creator = selectionModel.getSelection().getSelectedCreator(); - Component creatorContainer = XCreatorUtils.getParentXLayoutContainer(creator); - if (creatorContainer != null && creatorContainer != container - && (selectionModel.getSelection().size() == 1 || container instanceof XWAbsoluteLayout)) { - HoverPainter painter = AdapterBus.getContainerPainter(designer, container); - designer.setPainter(painter); - if (painter != null) { - Rectangle rect = ComponentUtils.getRelativeBounds(container); - rect.x -= designer.getArea().getHorizontalValue(); - rect.y -= designer.getArea().getVerticalValue(); - painter.setRenderingBounds(rect); - painter.setHotspot(new Point(e.getX(), e.getY())); - painter.setCreator(creator); - } - addable = true; - } - } - - private boolean addBean(XLayoutContainer container, int x, int y) { - LayoutAdapter adapter = container.getLayoutAdapter(); - Rectangle r = ComponentUtils.getRelativeBounds(container); - if (selectionModel.getSelection().size() == 1) { - return adapter.addBean(selectionModel.getSelection().getSelectedCreator(), x - + designer.getArea().getHorizontalValue() - r.x, y + designer.getArea().getVerticalValue() - r.y); - } - for (XCreator creator : selectionModel.getSelection().getSelectedCreators()) { - adapter.addBean(creator, x + designer.getArea().getHorizontalValue() - r.x, y + designer.getArea().getVerticalValue()- r.y); - } - return true; - } - - private void adding(int x, int y) { + public boolean dragable() { + return ((driection != Location.outer) && !selecting); + } + + /** + * 拖拽中是否可以转换为添加模式: + * 如果拖拽组件只有一个,鼠标当前所在位置的最底层表单容器与这个组件的容器不同; + * 如果拖拽组件为多个,鼠标当前所在位置的最底层表单容器除了要求要跟这些组件的容器不同外,还必须是绝对定位布局 + */ + private void checkAddable(MouseEvent e) { + addable = false; + designer.setPainter(null); + + if (driection != Location.inner) { + return; + } + + XCreator comp = designer.getComponentAt(e.getX(), e.getY(), selectionModel.getSelection().getSelectedCreators()); + XLayoutContainer container = XCreatorUtils.getHotspotContainer(comp); + XCreator creator = selectionModel.getSelection().getSelectedCreator(); + Component creatorContainer = XCreatorUtils.getParentXLayoutContainer(creator); + if (creatorContainer != null && creatorContainer != container + && (selectionModel.getSelection().size() == 1 || container instanceof XWAbsoluteLayout)) { + HoverPainter painter = AdapterBus.getContainerPainter(designer, container); + designer.setPainter(painter); + if (painter != null) { + Rectangle rect = ComponentUtils.getRelativeBounds(container); + rect.x -= designer.getArea().getHorizontalValue(); + rect.y -= designer.getArea().getVerticalValue(); + painter.setRenderingBounds(rect); + painter.setHotspot(new Point(e.getX(), e.getY())); + painter.setCreator(creator); + } + addable = true; + } + } + + /** + * @param container 容器 + * @param mouseX 鼠标释放位置X + * @param mouseY 鼠标释放位置Y + * @return 是否成功 + */ + private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) { + LayoutAdapter adapter = container.getLayoutAdapter(); + Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container); + if (selectionModel.getSelection().size() == 1) { + return adapter.addBean(selectionModel.getSelection().getSelectedCreator(), + mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, + mouseY + designer.getArea().getVerticalValue() - rectangleContainer.y); + } + for (XCreator creator : selectionModel.getSelection().getSelectedCreators()) { + adapter.addBean(creator, + mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, + mouseY + designer.getArea().getVerticalValue() - rectangleContainer.y); + } + return true; + } + + /** + * @param mouseReleasedX 鼠标释放位置X + * @param mouseReleasedY 鼠标释放位置Y + */ + private void adding(int mouseReleasedX, int mouseReleasedY) { // 当前鼠标所在的组件 - XCreator hoveredComponent = designer.getComponentAt(x, y, selectionModel.getSelection().getSelectedCreators()); + XCreator hoveredComponent = designer.getComponentAt(mouseReleasedX, mouseReleasedY, selectionModel.getSelection().getSelectedCreators()); // 获取该组件所在的焦点容器 XLayoutContainer container = XCreatorUtils.getHotspotContainer(hoveredComponent); boolean success = false; - if (container != null) { - // 如果是容器,则调用其acceptComponent接受组件 - success = addBean(container, x, y); - } - - if (success) { - FormSelectionUtils.rebuildSelection(designer); - designer.getEditListenerTable().fireCreatorModified( - selectionModel.getSelection().getSelectedCreator(), DesignerEvent.CREATOR_ADDED); - } else { - Toolkit.getDefaultToolkit().beep(); - } - + if (container != null) { + // 如果是容器,则调用其acceptComponent接受组件 + success = addBean(container, mouseReleasedX, mouseReleasedY); + } + + if (success) { + FormSelectionUtils.rebuildSelection(designer); + designer.getEditListenerTable().fireCreatorModified( + selectionModel.getSelection().getSelectedCreator(), DesignerEvent.CREATOR_ADDED); + } else { + selectionModel.getSelection().setSelectionBounds(selectedPositionBackup, designer); + Toolkit.getDefaultToolkit().beep(); + } // 取消提示 designer.setPainter(null); } /** - *是否拖拽 + * 是否拖拽 + * * @return dragging状态 */ - public boolean isDragging() { - return dragging; - } + public boolean isDragging() { + return dragging; + } /** - *是否可以开始画线 + * 是否可以开始画线 + * * @return startPoint不为空返回true */ - public boolean prepareForDrawLining() { - return startPoint != null; - } + public boolean prepareForDrawLining() { + return startPoint != null; + } /** - *设置开始位置 + * 设置开始位置 + * * @param p point位置 */ - public void setStartPoint(Point p) { - this.startPoint = p; - } + public void setStartPoint(Point p) { + this.startPoint = p; + } /** - *返回开始位置 + * 返回开始位置 + * * @return 点位置 */ - public Point getStartPoint() { - return startPoint; - } + public Point getStartPoint() { + return startPoint; + } /** - *返回当前点位置 + * 返回当前点位置 + * * @return 点位置 */ public Point getEndPoint() { - return currentPoint; - } + return currentPoint; + } /** - *当前选中组件 + * 当前选中组件 + * * @param e 鼠标事件 */ - public void startSelecting(MouseEvent e) { - selecting = true; - selectionModel.setHotspotBounds(new Rectangle()); - current_x = getMouseXY(e).x; - current_y = getMouseXY(e).y; - } + public void startSelecting(MouseEvent e) { + selecting = true; + selectionModel.setHotspotBounds(new Rectangle()); + currentX = getMouseXY(e).x; + currentY = getMouseXY(e).y; + } /** - *当前鼠标的xy + * 当前鼠标的xy + * * @param e 鼠标事件 */ - public void startResizing(MouseEvent e) { - if (!selectionModel.getSelection().isEmpty()) { - driection.backupBounds(designer); - } - current_x = getMouseXY(e).x; - current_y = getMouseXY(e).y; - } + public void startResizing(MouseEvent e) { + if (!selectionModel.getSelection().isEmpty()) { + driection.backupBounds(designer); + } + currentX = getMouseXY(e).x; + currentY = getMouseXY(e).y; + } /** - *起始点开始DrawLine + * 起始点开始DrawLine + * * @param p 点位置 */ - public void startDrawLine(Point p) { - this.startPoint = p; - if(p != null) { - try { - designer.setCursor(XConnector.connectorCursor); - } catch (Exception e) { - } - } else { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - } + public void startDrawLine(Point p) { + this.startPoint = p; + if (p != null) { + try { + designer.setCursor(XConnector.connectorCursor); + } catch (Exception e) { + } + } else { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + } /** - *鼠标释放时所在的区域及圈中的组件 + * 鼠标释放时所在的区域及圈中的组件 + * * @param e 鼠标事件 */ - public void selectCreators(MouseEvent e) { - int x = getMouseXY(e).x; - int y = getMouseXY(e).y; + public void selectCreators(MouseEvent e) { + int x = getMouseXY(e).x; + int y = getMouseXY(e).y; - Rectangle bounds = createCurrentBounds(x, y); + Rectangle bounds = createCurrentBounds(x, y); - if ((x != current_x) || (y != current_y)) { - selectionModel.setSelectedCreators(getHotspotCreators(bounds, designer.getRootComponent())); - } - selectionModel.setHotspotBounds(null); - } + if ((x != currentX) || (y != currentY)) { + selectionModel.setSelectedCreators(getHotspotCreators(bounds, designer.getRootComponent())); + } + selectionModel.setHotspotBounds(null); + } /** - *画所在区域线 + * 画所在区域线 + * * @param e 鼠标事件 */ - public void drawLine(MouseEvent e) { - designer.getDrawLineHelper().setDrawLine(true); - Point p = designer.getDrawLineHelper().getNearWidgetPoint(e); - if (p != null) { - currentPoint = p; - } else { - currentPoint.x = e.getX() + designer.getArea().getHorizontalValue(); - currentPoint.y = e.getY() + designer.getArea().getVerticalValue(); - } - } - - private Rectangle createCurrentBounds(int x, int y) { - Rectangle bounds = new Rectangle(); - - bounds.x = Math.min(x, current_x); - bounds.y = Math.min(y, current_y); - bounds.width = Math.max(x, current_x) - bounds.x; - bounds.height = Math.max(y, current_y) - bounds.y; - - return bounds; - } - - private ArrayList getHotspotCreators(Rectangle selection, XCreator root) { - ArrayList creators = new ArrayList(); - - if (!root.isVisible() && !designer.isRoot(root)) { - return creators; - } - - if (root instanceof XLayoutContainer) { - XLayoutContainer container = (XLayoutContainer) root; - int count = container.getXCreatorCount(); - Rectangle clipped = new Rectangle(selection); - - for (int i = count - 1; i >= 0; i--) { - XCreator child = container.getXCreator(i); - - if (selection.contains(child.getBounds())) { - creators.add(child); - } else { - clipped.x = selection.x - child.getX(); - clipped.y = selection.y - child.getY(); - creators.addAll(getHotspotCreators(clipped, child)); - } - } - } - - return creators; - } + public void drawLine(MouseEvent e) { + designer.getDrawLineHelper().setDrawLine(true); + Point p = designer.getDrawLineHelper().getNearWidgetPoint(e); + if (p != null) { + currentPoint = p; + } else { + currentPoint.x = e.getX() + designer.getArea().getHorizontalValue(); + currentPoint.y = e.getY() + designer.getArea().getVerticalValue(); + } + } + + private Rectangle createCurrentBounds(int x, int y) { + Rectangle bounds = new Rectangle(); + + bounds.x = Math.min(x, currentX); + bounds.y = Math.min(y, currentY); + bounds.width = Math.max(x, currentX) - bounds.x; + bounds.height = Math.max(y, currentY) - bounds.y; + + return bounds; + } + + private ArrayList getHotspotCreators(Rectangle selection, XCreator root) { + ArrayList creators = new ArrayList<>(); + + if (!root.isVisible() && !designer.isRoot(root)) { + return creators; + } + + if (root instanceof XLayoutContainer) { + XLayoutContainer container = (XLayoutContainer) root; + int count = container.getXCreatorCount(); + Rectangle clipped = new Rectangle(selection); + + for (int i = count - 1; i >= 0; i--) { + XCreator child = container.getXCreator(i); + + if (selection.contains(child.getBounds())) { + creators.add(child); + } else { + clipped.x = selection.x - child.getX(); + clipped.y = selection.y - child.getY(); + creators.addAll(getHotspotCreators(clipped, child)); + } + } + } + + return creators; + } /** - *重置model + * 重置model */ - public void resetModel() { - dragging = false; - selecting = false; - } + public void resetModel() { + dragging = false; + selecting = false; + } /** - *重置 + * 重置 */ - public void reset() { - driection = Location.outer; - dragging = false; - selecting = false; - } + public void reset() { + driection = Location.outer; + dragging = false; + selecting = false; + } /** - *取消拖拽 + * 取消拖拽 */ - public void draggingCancel() { - designer.repaint(); - reset(); - } + public void draggingCancel() { + designer.repaint(); + reset(); + } /** - *设置可拉伸方向 + * 设置可拉伸方向 + * * @param dir 拉伸方向 */ - public void setDirection(Direction dir) { - if(driection != dir) { - this.driection = dir; - driection.updateCursor(designer); - } - } + public void setDirection(Direction dir) { + if (driection != dir) { + this.driection = dir; + driection.updateCursor(designer); + } + } /** - *x吸附线赋值 + * x吸附线赋值 + * * @param line 线 */ - public void setXAbsorptionline(Absorptionline line) { - this.lineInX = line; - } + public void setXAbsorptionline(Absorptionline line) { + this.lineInX = line; + } /** - *y吸附线赋值 + * y吸附线赋值 + * + * @param line 线 + */ + public void setYAbsorptionline(Absorptionline line) { + this.lineInY = line; + } + + /** + * 等距线赋值 + * * @param line 线 */ - public void setYAbsorptionline(Absorptionline line) { - this.lineInY = line; - } - - /** - * 等距线赋值 - * @param line 线 - */ - public void setEquidistantLine(Absorptionline line){ - this.lineEquidistant = line; - } + public void setEquidistantLine(Absorptionline line) { + this.lineEquidistant = line; + } /** - *画吸附线 + * 画吸附线 + * * @param g Graphics类 */ - public void paintAbsorptionline(Graphics g) { - if(lineInX != null) { - lineInX.paint(g,designer.getArea()); - } - if(lineInY != null) { - lineInY.paint(g,designer.getArea()); - } - if(lineEquidistant != null){ - lineEquidistant.paint(g,designer.getArea()); - } - } + public void paintAbsorptionline(Graphics g) { + if (lineInX != null) { + lineInX.paint(g, designer.getArea()); + } + if (lineInY != null) { + lineInY.paint(g, designer.getArea()); + } + if (lineEquidistant != null) { + lineEquidistant.paint(g, designer.getArea()); + } + } /** - *拖拽 + * 拖拽 + * * @param e 鼠标事件 */ - public void dragging(MouseEvent e) { - checkAddable(e); - setDependLinePainter(e); - driection.drag(getMouseXY(e).x-current_x, getMouseXY(e).y-current_y, designer); - this.dragging = true; - } - - // 拖拽时画依附线用到的painter - private void setDependLinePainter(MouseEvent e){ - XCreator comp = designer.getComponentAt(e.getX(), e.getY(), selectionModel.getSelection().getSelectedCreators()); - XLayoutContainer container = XCreatorUtils.getHotspotContainer(comp); - XCreator creator = selectionModel.getSelection().getSelectedCreator(); - HoverPainter painter = AdapterBus.getContainerPainter(designer, container); - designer.setPainter(painter); - if (painter != null) { - painter.setHotspot(new Point(e.getX(), e.getY())); - painter.setCreator(creator); - } - } + public void dragging(MouseEvent e) { + //进入dragging状态时备份组件大小和位置 + if (!dragging) { + selectedPositionBackup = selectionModel.getSelection().getRelativeBounds(); + } + checkAddable(e); + setDependLinePainter(e); + driection.drag(getMouseXY(e).x - currentX, getMouseXY(e).y - currentY, designer); + this.dragging = true; + } + + // 拖拽时画依附线用到的painter + private void setDependLinePainter(MouseEvent e) { + XCreator comp = designer.getComponentAt(e.getX(), e.getY(), selectionModel.getSelection().getSelectedCreators()); + XLayoutContainer container = XCreatorUtils.getHotspotContainer(comp); + XCreator creator = selectionModel.getSelection().getSelectedCreator(); + HoverPainter painter = AdapterBus.getContainerPainter(designer, container); + designer.setPainter(painter); + if (painter != null) { + painter.setHotspot(new Point(e.getX(), e.getY())); + painter.setCreator(creator); + } + } /** - *释放捕获 + * 释放捕获 + * * @param e 鼠标事件 */ - public void releaseDragging(MouseEvent e) { - this.dragging = false; - if (addable) { - adding(e.getX(), e.getY()); - } else if (!selectionModel.getSelection().isEmpty()) { - selectionModel.releaseDragging(); - } - designer.repaint(); - } + public void releaseDragging(MouseEvent e) { + this.dragging = false; + if (addable) { + adding(e.getX(), e.getY()); + } else if (!selectionModel.getSelection().isEmpty()) { + selectionModel.releaseDragging(); + } + designer.repaint(); + } /** - *改变选择区域 + * 改变选择区域 * - * @param e 鼠标事件 + * @param e 鼠标事件 */ - public void changeSelection(MouseEvent e) { - Rectangle bounds = createCurrentBounds(getMouseXY(e).x, getMouseXY(e).y); - selectionModel.setHotspotBounds(bounds); - } + public void changeSelection(MouseEvent e) { + Rectangle bounds = createCurrentBounds(getMouseXY(e).x, getMouseXY(e).y); + selectionModel.setHotspotBounds(bounds); + } /** - *返回鼠标所在的x、y 考虑滚动条的值 + * 返回鼠标所在的x、y 考虑滚动条的值 * * @param e 鼠标事件 * @return xy值 */ - public Point getMouseXY(MouseEvent e) { - Point p1 = new Point(e.getX() + designer.getArea().getHorizontalValue(), e.getY() - + designer.getArea().getVerticalValue()); - return p1; - } - + public Point getMouseXY(MouseEvent e) { + Point p1 = new Point(e.getX() + designer.getArea().getHorizontalValue(), e.getY() + + designer.getArea().getVerticalValue()); + return p1; + } + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/beans/painters/AbstractPainter.java b/designer_form/src/com/fr/design/designer/beans/painters/AbstractPainter.java index 06565fe4f3..cb5c6a4a0a 100644 --- a/designer_form/src/com/fr/design/designer/beans/painters/AbstractPainter.java +++ b/designer_form/src/com/fr/design/designer/beans/painters/AbstractPainter.java @@ -22,6 +22,7 @@ public abstract class AbstractPainter implements HoverPainter { /** * 构造函数 + * * @param container 容器 */ public AbstractPainter(XLayoutContainer container) { @@ -32,23 +33,25 @@ public abstract class AbstractPainter implements HoverPainter { public void setHotspot(Point p) { hotspot = p; } - + /** - * 画初始区域 - * @param g 画图类 - * @param startX 起始x位置 - * @param startY 起始y位置 + * 画初始区域 + * + * @param g 画图类 + * @param startX 起始x位置 + * @param startY 起始y位置 + */ + public void paint(Graphics g, int startX, int startY) { + if (hotspot_bounds != null) { + drawHotspot(g, hotspot_bounds.x, hotspot_bounds.y, hotspot_bounds.width, hotspot_bounds.height, Color.lightGray, true, false); + } + } + + /** + * 设置边界 + * + * @param rect 位置 */ - public void paint(Graphics g, int startX, int startY) { - if(hotspot_bounds != null){ - drawHotspot(g, hotspot_bounds.x, hotspot_bounds.y, hotspot_bounds.width, hotspot_bounds.height, Color.lightGray, true, false); - } - } - - /** - * 设置边界 - * @param rect 位置 - */ @Override public void setRenderingBounds(Rectangle rect) { hotspot_bounds = rect; @@ -63,12 +66,12 @@ public abstract class AbstractPainter implements HoverPainter { Color bColor = accept ? XCreatorConstants.LAYOUT_HOTSPOT_COLOR : XCreatorConstants.LAYOUT_FORBIDDEN_COLOR; drawHotspot(g, x, y, width, height, bColor, accept, false); } - + /** * 自适应布局那边渲染提示,要画整个背景,不是画边框 */ protected void drawRegionBackground(Graphics g, int x, int y, int width, int height, Color bColor, boolean accept) { - drawHotspot(g, x, y, width, height, bColor, accept, true); + drawHotspot(g, x, y, width, height, bColor, accept, true); } protected void drawHotspot(Graphics g, int x, int y, int width, int height, Color bColor, boolean accept, boolean drawBackground) { @@ -81,13 +84,13 @@ public abstract class AbstractPainter implements HoverPainter { if (!accept) { g2d.drawString(Inter.getLocText("Cannot-Add_To_This_Area") + "!", x + width / 3, y + height / 2); } else if (drawBackground) { - g2d.fillRect(x, y, width, height); + g2d.fillRect(x, y, width, height); } else { - g2d.drawRect(x, y, width, height); + g2d.drawRect(x, y, width, height); } g2d.setStroke(backup); g2d.setColor(color); } - - + + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java b/designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java index 254e9a9184..edd1c69f0f 100644 --- a/designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java +++ b/designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java @@ -30,12 +30,12 @@ import java.util.List; * @since 6.5.3 */ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator implements ContainerListener, ParameterBridge { - - // 布局内部组件默认最小宽度36,最小高度21 - public static int MIN_WIDTH = 36; - public static int MIN_HEIGHT = 21; - - protected static final Dimension LARGEPREFERREDSIZE = new Dimension(200, 200); + + // 布局内部组件默认最小宽度36,最小高度21 + public static int MIN_WIDTH = 36; + public static int MIN_HEIGHT = 21; + + protected static final Dimension LARGEPREFERREDSIZE = new Dimension(200, 200); protected boolean isRefreshing; protected int default_Length = 5; // 取指定点坐在的组件,默认为5保证取四侧相邻的组件时x、y在组件内非边框上 @@ -45,6 +45,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme protected boolean editable = false; //鼠标移动到布局画出编辑层 protected boolean isMouseEnter = false; + public void setMouseEnter(boolean mouseEnter) { isMouseEnter = mouseEnter; } @@ -55,12 +56,13 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme } /** - * 得到属性名 + * 得到属性名 + * * @return 属性名 * @throws IntrospectionException */ - public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { - return new CRPropertyDescriptor[] { + public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { + return new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter .getLocText("FR-Designer_Form-Widget_Name")), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( @@ -68,19 +70,20 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") .setPropertyChangeListener(new PropertyChangeAdapter() { - @Override - public void propertyChange() { - initStyle(); - } - }), + @Override + public void propertyChange() { + initStyle(); + } + }), new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) .setI18NName(Inter.getLocText("FR-Designer_Layout-Padding")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - }; - } + }; + } /** * 控件名属性 + * * @return * @throws IntrospectionException */ @@ -91,6 +94,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme /** * 边距属性 + * * @return * @throws IntrospectionException */ @@ -101,47 +105,50 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme } /** - * 返回对应的wlayout + * 返回对应的wlayout + * * @return wlayout控件 */ public WLayout toData() { return (WLayout) data; } - @Override - protected void initXCreatorProperties() { - super.initXCreatorProperties(); - initBorderStyle(); - this.initLayoutManager(); - this.convert(); - } + @Override + protected void initXCreatorProperties() { + super.initXCreatorProperties(); + initBorderStyle(); + this.initLayoutManager(); + this.convert(); + } @Override - protected JComponent initEditor() { - return this; - } - - /** - * 当前组件zorder位置替换新的控件 - * @param widget 控件 - * @param oldcreator 旧组件 - * @return 组件 - */ - public XCreator replace(Widget widget, XCreator oldcreator) { - int i = this.getComponentZOrder(oldcreator); - if (i != -1) { - this.toData().replace(widget, oldcreator.toData()); - this.convert(); - XCreator creator = (XCreator) this.getComponent(i); - creator.setSize(oldcreator.getSize()); - return creator; - } - return null; - } - - /** - * 初始化时默认的组件大小 - * @return 默认Dimension + protected JComponent initEditor() { + return this; + } + + /** + * 当前组件zorder位置替换新的控件 + * + * @param widget 控件 + * @param oldcreator 旧组件 + * @return 组件 + */ + public XCreator replace(Widget widget, XCreator oldcreator) { + int i = this.getComponentZOrder(oldcreator); + if (i != -1) { + this.toData().replace(widget, oldcreator.toData()); + this.convert(); + XCreator creator = (XCreator) this.getComponent(i); + creator.setSize(oldcreator.getSize()); + return creator; + } + return null; + } + + /** + * 初始化时默认的组件大小 + * + * @return 默认Dimension */ public Dimension initEditorSize() { return LARGEPREFERREDSIZE; @@ -172,7 +179,8 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme /** * 设计界面中有组件添加时,要通知WLayout容器重新paint - * @param e 待说明 + * + * @param e 待说明 */ @Override public void componentAdded(ContainerEvent e) { @@ -188,7 +196,8 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme /** * 设计界面中有组件添加时,要通知WLayout容器重新paint - * @param e 待说明 + * + * @param e 待说明 */ @Override public void componentRemoved(ContainerEvent e) { @@ -203,6 +212,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme /** * 根据widget的属性值来获取 + * * @param wgt * @return */ @@ -226,30 +236,32 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme public int getXCreatorCount() { return getComponentCount(); } - + public XCreator getXCreator(int i) { return (XCreator) getComponent(i); } /** * 该组件是否可以拖入参数面板 + * * @return 是则返回true */ - public boolean canEnterIntoParaPane(){ + public boolean canEnterIntoParaPane() { return false; } - + /** - * 是否作为控件树的叶子节点 - * @return 是则返回true - */ - public boolean isComponentTreeLeaf() { - return false; - } + * 是否作为控件树的叶子节点 + * + * @return 是则返回true + */ + public boolean isComponentTreeLeaf() { + return false; + } - public List getAllXCreatorNameList(XCreator xCreator, List namelist){ - for (int i = 0; i < ((XLayoutContainer)xCreator).getXCreatorCount(); i++) { - XCreator creatorSon = ((XLayoutContainer)xCreator).getXCreator(i); + public List getAllXCreatorNameList(XCreator xCreator, List namelist) { + for (int i = 0; i < ((XLayoutContainer) xCreator).getXCreatorCount(); i++) { + XCreator creatorSon = ((XLayoutContainer) xCreator).getXCreator(i); creatorSon.getAllXCreatorNameList(creatorSon, namelist); } return namelist; @@ -257,19 +269,20 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme /** * 是否有查询按钮 - * @param xCreator 控件或容器 - * @return 有无查询按钮 + * + * @param xCreator 控件或容器 + * @return 有无查询按钮 */ public boolean SearchQueryCreators(XCreator xCreator) { - for (int i = 0; i < ((XLayoutContainer)xCreator).getXCreatorCount(); i++) { - XCreator creatorSon = ((XLayoutContainer)xCreator).getXCreator(i); - if(creatorSon.SearchQueryCreators(creatorSon)){ + for (int i = 0; i < ((XLayoutContainer) xCreator).getXCreatorCount(); i++) { + XCreator creatorSon = ((XLayoutContainer) xCreator).getXCreator(i); + if (creatorSon.SearchQueryCreators(creatorSon)) { return true; } } return false; } - + public FRLayoutManager getFRLayout() { LayoutManager layout = getLayout(); if (layout instanceof FRLayoutManager) { @@ -279,111 +292,120 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme return null; } - public abstract LayoutAdapter getLayoutAdapter(); - - public int getIndexOfChild(Object child) { - int count = getComponentCount(); - for (int i = 0; i < count; i++) { - Component comp = getComponent(i); - if (comp == child) { - return i; - } - } - return -1; - } - - /** - * 主要为自适应用 - * 返回指定point的上方组件 - * @param x x位置 - * @param y y位置 - * @return 指定位置的组件 - */ - public Component getTopComp(int x, int y) { - return this.getComponentAt(x, y-default_Length); - } - - /** - * 主要为自适应用 - * 返回指定point的左方组件 - * @param x x位置 - * @param y y位置 - * @return 指定位置的组件 - */ - public Component getLeftComp(int x, int y) { - return this.getComponentAt(x-default_Length, y); - } - - /** - * 返回指定point的右方组件 - * @param x x位置 - * @param y y位置 - * @param w 宽度 - * @return 指定位置的组件 - */ - public Component getRightComp(int x, int y, int w) { - return this.getComponentAt(x+w+default_Length, y); - } - - /** - * 返回指定point的下方组件 - * @param x x位置 - * @param y y位置 - * @param h 高度 - * @return 指定位置的组件 - */ - public Component getBottomComp(int x, int y, int h) { - return this.getComponentAt(x, y+h+default_Length); - } - - /** - * 返回指定point的上方且是右侧的组件 - * @param x x位置 - * @param y y位置 - * @param w 宽度 - * @return 指定位置的组件 - */ - public Component getRightTopComp(int x, int y, int w) { - return this.getComponentAt(x+w-default_Length, y-default_Length); - } - - /** - * 返回指定point的左方且是下侧的组件 - * @param x x位置 - * @param y y位置 - * @param h 高度 - * @return 指定位置的组件 - */ - public Component getBottomLeftComp(int x, int y, int h) { - return this.getComponentAt(x-default_Length, y+h-default_Length); - } - - /** - * 返回指定point的右方且是下侧的组件 - * @param x x位置 - * @param y y位置 - * @param h 高度 - * @param w 宽度 - * @return 指定位置的组件 - */ - public Component getBottomRightComp(int x, int y, int h, int w) { - return this.getComponentAt(x+w+default_Length, y+h-default_Length); - } - - /** - * 返回指定point的下方且是右侧的组件 - * @param x x位置 - * @param y y位置 - * @param h 高度 - * @param w 宽度 - * @return 指定位置的组件 - */ - public Component getRightBottomComp(int x, int y, int h, int w) { - return this.getComponentAt(x+w-default_Length, y+h+default_Length); - } + public abstract LayoutAdapter getLayoutAdapter(); + + public int getIndexOfChild(Object child) { + int count = getComponentCount(); + for (int i = 0; i < count; i++) { + Component comp = getComponent(i); + if (comp == child) { + return i; + } + } + return -1; + } + + /** + * 主要为自适应用 + * 返回指定point的上方组件 + * + * @param x x位置 + * @param y y位置 + * @return 指定位置的组件 + */ + public Component getTopComp(int x, int y) { + return this.getComponentAt(x, y - default_Length); + } + + /** + * 主要为自适应用 + * 返回指定point的左方组件 + * + * @param x x位置 + * @param y y位置 + * @return 指定位置的组件 + */ + public Component getLeftComp(int x, int y) { + return this.getComponentAt(x - default_Length, y); + } + + /** + * 返回指定point的右方组件 + * + * @param x x位置 + * @param y y位置 + * @param w 宽度 + * @return 指定位置的组件 + */ + public Component getRightComp(int x, int y, int w) { + return this.getComponentAt(x + w + default_Length, y); + } + + /** + * 返回指定point的下方组件 + * + * @param x x位置 + * @param y y位置 + * @param h 高度 + * @return 指定位置的组件 + */ + public Component getBottomComp(int x, int y, int h) { + return this.getComponentAt(x, y + h + default_Length); + } + + /** + * 返回指定point的上方且是右侧的组件 + * + * @param x x位置 + * @param y y位置 + * @param w 宽度 + * @return 指定位置的组件 + */ + public Component getRightTopComp(int x, int y, int w) { + return this.getComponentAt(x + w - default_Length, y - default_Length); + } + + /** + * 返回指定point的左方且是下侧的组件 + * + * @param x x位置 + * @param y y位置 + * @param h 高度 + * @return 指定位置的组件 + */ + public Component getBottomLeftComp(int x, int y, int h) { + return this.getComponentAt(x - default_Length, y + h - default_Length); + } + + /** + * 返回指定point的右方且是下侧的组件 + * + * @param x x位置 + * @param y y位置 + * @param h 高度 + * @param w 宽度 + * @return 指定位置的组件 + */ + public Component getBottomRightComp(int x, int y, int h, int w) { + return this.getComponentAt(x + w + default_Length, y + h - default_Length); + } + + /** + * 返回指定point的下方且是右侧的组件 + * + * @param x x位置 + * @param y y位置 + * @param h 高度 + * @param w 宽度 + * @return 指定位置的组件 + */ + public Component getRightBottomComp(int x, int y, int h, int w) { + return this.getComponentAt(x + w - default_Length, y + h + default_Length); + } /** * 是否延迟展示报表内容,也就是说是否要等点击了查询之后才执行报表 + * * @return 如果是true,则表示点击之后才开始计算,false则表示会根据参数默认值直接计算报表并展现 */ public boolean isDelayDisplayContent() { @@ -392,18 +414,20 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme /** * 是否显示参数界面 + * * @return 显示参数界面则返回true,否则返回false */ public boolean isDisplay() { return false; } - public Background getDataBackground(){ + public Background getDataBackground() { return toData().getBackground(); } /** * 获取参数界面的宽度 + * * @return 宽度 */ public int getDesignWidth() { @@ -412,83 +436,82 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme /** * 获取参数面板的对齐方式 + * * @return 左中右三种对齐方式 */ public int getPosition() { return 0; } - + /** * 切换到非添加状态 - * + * * @param designer 表单设计器 */ - public void stopAddingState(FormDesigner designer){ - return; - } - - /** - * 寻找最近的为自适应布局的父容器 - * - * @return 布局容器 - * - * - * @date 2014-12-30-下午3:15:28 - * - */ - public XLayoutContainer findNearestFit(){ - //一层一层网上找, 找到最近的fit那一层就return - XLayoutContainer parent = this.getBackupParent(); - return parent == null ? null : parent.findNearestFit(); - } - + public void stopAddingState(FormDesigner designer) { + } + + /** + * 寻找最近的为自适应布局的父容器 + * + * @return 布局容器 + * @date 2014-12-30-下午3:15:28 + */ + public XLayoutContainer findNearestFit() { + //一层一层网上找, 找到最近的fit那一层就return + XLayoutContainer parent = this.getBackupParent(); + return parent == null ? null : parent.findNearestFit(); + } + /** * 获取容器所有内部组件横坐标值 - * + * * @return 横坐标数组 */ - public int[] getHors(){ - return ArrayUtils.EMPTY_INT_ARRAY; + public int[] getHors() { + return ArrayUtils.EMPTY_INT_ARRAY; } - + /** * 获取容器所有内部组件纵坐标值 - * + * * @return 纵坐标数组 */ - public int[] getVeris(){ - return ArrayUtils.EMPTY_INT_ARRAY; + public int[] getVeris() { + return ArrayUtils.EMPTY_INT_ARRAY; } - public void setDelayDisplayContent(boolean delayPlaying){ + public void setDelayDisplayContent(boolean delayPlaying) { } - public void setPosition(int align){ + public void setPosition(int align) { } - public void setDisplay(boolean showWindow){ + public void setDisplay(boolean showWindow) { } - public void setBackground(Background background){ + public void setBackground(Background background) { } /** * 布局是否可编辑,不可则显示编辑蒙层 + * * @return 可否编辑 */ - public boolean isEditable(){ + public boolean isEditable() { return this.editable; } /** * 设置布局是否可编辑,不可则显示编辑蒙层 + * * @param isEditable 可否编辑 */ - public void setEditable(boolean isEditable){ + public void setEditable(boolean isEditable) { this.editable = isEditable; } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java index 947ec5eaba..114ce3240c 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java @@ -1,5 +1,5 @@ /** - * + * */ package com.fr.design.designer.creator.cardlayout; @@ -25,114 +25,109 @@ import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout; /** - * - * * @date: 2014-11-25-下午3:11:14 */ public class XWCardTagLayout extends XWHorizontalBoxLayout { - - private static final int MIN_SIZE = 1; - - private String tagName = "Tab"; - - private boolean switchingTab = false; - - //增加一个tabNameIndex防止tabFitLayout重名 - private int tabFitIndex = 0; - private CardSwitchButton currentCard; - - public CardSwitchButton getCurrentCard() { - return currentCard; - } - - public void setCurrentCard(CardSwitchButton currentCard) { - this.currentCard = currentCard; - } - - public int getTabFitIndex() { - return tabFitIndex; - } - - public void setTabFitIndex(int tabFitIndex) { - this.tabFitIndex = tabFitIndex; - } - - public String getTagName() { - return tagName; - } - - public void setTagName(String tagName) { - this.tagName = tagName; - } - - public boolean isSwitchingTab() { - return switchingTab; - } - - public void setSwitchingTab(boolean switchingTab) { - this.switchingTab = switchingTab; - } - - private XWCardLayout cardLayout; - - public XWCardTagLayout(WCardTagLayout widget, Dimension initSize){ - super(widget, initSize); - } - - /** - * 构造函数 - */ - public XWCardTagLayout(WCardTagLayout widget, Dimension initSize, XWCardLayout cardLayout) { - super(widget, initSize); - - this.cardLayout = cardLayout; - } - - /** - * 添加组件的监听事件 - * - * @param e 事件 - * - * - * @date 2014-11-25-下午6:20:10 - * - */ - public void componentAdded(ContainerEvent e) { - super.componentAdded(e); - - if (isSwitchingTab()){ - return; - } - - if(this.cardLayout == null){ - initCardLayout(); - } - - int index = this.cardLayout.toData().getWidgetCount(); - //新加一个card - String widgetName = tagName+getTabNameIndex(); - WTabFitLayout fitLayout = new WTabFitLayout(widgetName,tabFitIndex,currentCard); - fitLayout.setTabNameIndex(getTabNameIndex()); - XWTabFitLayout tabFitLayout = new XWTabFitLayout(fitLayout, new Dimension()); - tabFitLayout.setBackupParent(cardLayout); - cardLayout.add(tabFitLayout, widgetName); - this.cardLayout.toData().setShowIndex(index); - cardLayout.showCard(); - } - - private void initCardLayout(){ - XWCardTitleLayout titleLayout = (XWCardTitleLayout)this.getBackupParent(); - XWCardMainBorderLayout borderLayout = (XWCardMainBorderLayout)titleLayout.getBackupParent(); - - this.cardLayout = borderLayout.getCardPart(); - } - + + private static final int MIN_SIZE = 1; + + private String tagName = "Tab"; + + private boolean switchingTab = false; + + //增加一个tabNameIndex防止tabFitLayout重名 + private int tabFitIndex = 0; + private CardSwitchButton currentCard; + + public CardSwitchButton getCurrentCard() { + return currentCard; + } + + public void setCurrentCard(CardSwitchButton currentCard) { + this.currentCard = currentCard; + } + + public int getTabFitIndex() { + return tabFitIndex; + } + + public void setTabFitIndex(int tabFitIndex) { + this.tabFitIndex = tabFitIndex; + } + + public String getTagName() { + return tagName; + } + + public void setTagName(String tagName) { + this.tagName = tagName; + } + + public boolean isSwitchingTab() { + return switchingTab; + } + + public void setSwitchingTab(boolean switchingTab) { + this.switchingTab = switchingTab; + } + + private XWCardLayout cardLayout; + + public XWCardTagLayout(WCardTagLayout widget, Dimension initSize) { + super(widget, initSize); + } + + /** + * 构造函数 + */ + public XWCardTagLayout(WCardTagLayout widget, Dimension initSize, XWCardLayout cardLayout) { + super(widget, initSize); + + this.cardLayout = cardLayout; + } + + /** + * 添加组件的监听事件 + * + * @param e 事件 + * @date 2014-11-25-下午6:20:10 + */ + public void componentAdded(ContainerEvent e) { + super.componentAdded(e); + + if (isSwitchingTab()) { + return; + } + + if (this.cardLayout == null) { + initCardLayout(); + } + + int index = this.cardLayout.toData().getWidgetCount(); + //新加一个card + String widgetName = tagName + getTabNameIndex(); + WTabFitLayout fitLayout = new WTabFitLayout(widgetName, tabFitIndex, currentCard); + fitLayout.setTabNameIndex(getTabNameIndex()); + XWTabFitLayout tabFitLayout = new XWTabFitLayout(fitLayout, new Dimension()); + tabFitLayout.setBackupParent(cardLayout); + cardLayout.add(tabFitLayout, widgetName); + this.cardLayout.toData().setShowIndex(index); + cardLayout.showCard(); + } + + private void initCardLayout() { + XWCardTitleLayout titleLayout = (XWCardTitleLayout) this.getBackupParent(); + XWCardMainBorderLayout borderLayout = (XWCardMainBorderLayout) titleLayout.getBackupParent(); + + this.cardLayout = borderLayout.getCardPart(); + } + /** * 将WLayout转换为XLayoutContainer */ public void convert() { isRefreshing = true; - WCardTagLayout layout = (WCardTagLayout)this.toData(); + WCardTagLayout layout = (WCardTagLayout) this.toData(); this.removeAll(); for (int i = 0; i < layout.getWidgetCount(); i++) { Widget wgt = layout.getWidget(i); @@ -144,82 +139,81 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { } isRefreshing = false; } - + /** * 切换到非添加状态 - * + * * @return designer 表单设计器 */ - public void stopAddingState(FormDesigner designer){ - designer.stopAddingState(); - return; + public void stopAddingState(FormDesigner designer) { + designer.stopAddingState(); } - + //新增时去tabFitLayout名字中最大的Index+1,防止重名 - private int getTabNameIndex(){ - int tabNameIndex = 0; - WCardLayout layout = this.cardLayout.toData(); - int size = layout.getWidgetCount(); - if(size < MIN_SIZE){ - return tabNameIndex; - } - for(int i=0;i + * void + */ + public void adjustComponentWidth() { + } + + + /** + * 该布局需要隐藏,无需对边框进行操作 + * + * @param + */ public void setBorder(Border border) { - return; - } - - @Override - /** - * 该布局隐藏,点击该布局时选中相应的tab布局主体 - * @param editingMouseListener 监听 - * @param e 鼠标点击事件 - * - */ - public void respondClick(EditingMouseListener editingMouseListener, - MouseEvent e) { - FormDesigner designer = editingMouseListener.getDesigner(); - SelectionModel selectionModel = editingMouseListener.getSelectionModel(); - - XWCardTitleLayout titleLayout = (XWCardTitleLayout) this.getBackupParent(); - if(titleLayout != null){ - XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout)titleLayout.getBackupParent(); - if(mainLayout != null){ - XWCardLayout cardLayout = mainLayout.getCardPart(); - selectionModel.setSelectedCreator(cardLayout); - } - } - - if (editingMouseListener.stopEditing()) { - if (this != designer.getRootComponent()) { - ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); - editingMouseListener.startEditing(this, adapter.getDesignerEditor(), adapter); - } - } - } - - @Override - public XLayoutContainer getTopLayout() { - return this.getBackupParent().getTopLayout(); - } + + } + + @Override + /** + * 该布局隐藏,点击该布局时选中相应的tab布局主体 + * @param editingMouseListener 监听 + * @param e 鼠标点击事件 + * + */ + public void respondClick(EditingMouseListener editingMouseListener, + MouseEvent e) { + FormDesigner designer = editingMouseListener.getDesigner(); + SelectionModel selectionModel = editingMouseListener.getSelectionModel(); + + XWCardTitleLayout titleLayout = (XWCardTitleLayout) this.getBackupParent(); + if (titleLayout != null) { + XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) titleLayout.getBackupParent(); + if (mainLayout != null) { + XWCardLayout cardLayout = mainLayout.getCardPart(); + selectionModel.setSelectedCreator(cardLayout); + } + } + + if (editingMouseListener.stopEditing()) { + if (this != designer.getRootComponent()) { + ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); + editingMouseListener.startEditing(this, adapter.getDesignerEditor(), adapter); + } + } + } + + @Override + public XLayoutContainer getTopLayout() { + return this.getBackupParent().getTopLayout(); + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java index 6390b64f89..486ad26949 100644 --- a/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer_form/src/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -43,7 +43,7 @@ public class FormCreatorDropTarget extends DropTarget { * 当前添加模式对应的model */ private AddingModel addingModel; - private final static int GAP = 30; + private static final int GAP = 30; private JWindow promptWindow = new JWindow(); private UIButton promptButton = new UIButton("", BaseUtils.readIcon(IconPathConstants.FORBID_ICON_PATH)); @@ -59,10 +59,11 @@ public class FormCreatorDropTarget extends DropTarget { XCreator hoveredComponent = designer.getComponentAt(x, y); // 获取该组件所在的焦点容器 XLayoutContainer container = XCreatorUtils.getHotspotContainer(hoveredComponent); - //cardTagLayout里用到 - container.stopAddingState(designer); boolean success = false; if (container != null) { + //XWCardTagLayout 切换添加状态到普通状态 + container.stopAddingState(designer); + // 如果是容器,则调用其acceptComponent接受组件 AddingModel model = designer.getAddingModel(); @@ -129,9 +130,7 @@ public class FormCreatorDropTarget extends DropTarget { //提示组件是否可以拖入 promptUser(x, y, container); if (container != null) { - dealWithContainer(x, y, container); - } else { // 如果鼠标不在任何组件上,则取消提示器 designer.setPainter(null); @@ -197,11 +196,9 @@ public class FormCreatorDropTarget extends DropTarget { private void promptWidgetForbidEnter(int x, int y, XLayoutContainer container) { container.setBorder(BorderFactory.createLineBorder(Color.RED, Constants.LINE_MEDIUM)); - int screen_X = (int) designer.getArea().getLocationOnScreen().getX(); - int screen_Y = (int) designer.getArea().getLocationOnScreen().getY(); - this.promptWindow.setSize(promptWindow.getPreferredSize()); - this.promptWindow.setPreferredSize(promptWindow.getPreferredSize()); - promptWindow.setLocation(screen_X + x + GAP, screen_Y + y + GAP); + int screenX = designer.getArea().getLocationOnScreen().x; + int screenY = designer.getArea().getLocationOnScreen().y; + promptWindow.setLocation(screenX + x + GAP, screenY + y + GAP); promptWindow.setVisible(true); } diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 1dd61c5597..0c77059935 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -612,6 +612,12 @@ public class FormDesigner extends TargetComponent implements TreeSelection return true; } + public void showMessageDialog(String message) { + JOptionPane.showMessageDialog(this, message, Inter.getLocText("FR-Designer_Alert"), JOptionPane.WARNING_MESSAGE); + FormSelectionUtils.rebuildSelection(this); + repaint(); + } + /** * 保存参数界面的宽度 * diff --git a/designer_form/src/com/fr/design/mainframe/FormSelection.java b/designer_form/src/com/fr/design/mainframe/FormSelection.java index f30cf2e84f..ff809371c5 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSelection.java +++ b/designer_form/src/com/fr/design/mainframe/FormSelection.java @@ -8,12 +8,7 @@ import com.fr.base.FRContext; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.location.Direction; -import com.fr.design.designer.creator.XComponent; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWAbsoluteLayout; -import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.designer.creator.*; import com.fr.form.ui.Widget; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; @@ -273,6 +268,11 @@ public class FormSelection { if (parent == null) { return; } + boolean changeCreator = creator.shouldScaleCreator() || creator.hasTitleStyle(); + if (parent.acceptType(XWFitLayout.class) && changeCreator) { + creator = (XCreator) creator.getParent(); + } + parent.getLayoutAdapter().removeBean(creator, creator.getWidth(), creator.getHeight()); // 删除其根组件,同时就删除了同时被选择的叶子组件 parent.remove(creator); LayoutManager layout = parent.getLayout(); diff --git a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java index ff976ef771..79f52519ec 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java @@ -8,6 +8,7 @@ import com.fr.design.designer.creator.*; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; import java.awt.*; import java.util.ArrayList; @@ -17,11 +18,7 @@ import java.util.List; public class FormSelectionUtils { //组件复制时坐标偏移 - private static final int DELAY_X = 20; - private static final int DELAY_Y = 20; - - //组件复制时是否已经向左上偏移 - private static boolean backoffset = false; + private static final int DELAY_X_Y = 20; //组件重命名后缀 private static final String POSTFIX = "_c"; @@ -31,11 +28,7 @@ public class FormSelectionUtils { } /** - * @param designer 编辑器 - * @param parent 粘贴依据的组件 - * @param clipboard 剪贴板内容 - * @param x x - * @param y y + * 粘贴到容器 */ public static void paste2Container(FormDesigner designer, XLayoutContainer parent, FormSelection clipboard, int x, int y) { @@ -54,12 +47,6 @@ public class FormSelectionUtils { /** * 绝对布局粘贴 - * - * @param designer - * @param clipboard - * @param adapter - * @param x - * @param y */ private static void absolutePaste(FormDesigner designer, FormSelection clipboard, LayoutAdapter adapter, int x, int y) { @@ -74,6 +61,10 @@ public class FormSelectionUtils { copiedCreator, x + creator.getX() - rec.x + copiedCreator.getWidth() / 2, y + creator.getY() - rec.y + copiedCreator.getHeight() / 2); + if (!adapter.accept(copiedCreator, point.x, point.y)) { + designer.showMessageDialog(Inter.getLocText("FR-Designer_Too_Large_To_Paste")); + return; + } boolean addSuccess = adapter.addBean(copiedCreator, point.x, point.y); if (addSuccess) { designer.getSelectionModel().getSelection().addSelectedCreator(copiedCreator); @@ -90,12 +81,6 @@ public class FormSelectionUtils { /** * 相对布局粘贴 - * - * @param designer - * @param clipboard - * @param adapter - * @param x - * @param y */ private static void relativePaste(FormDesigner designer, FormSelection clipboard, LayoutAdapter adapter, int x, int y) { designer.getSelectionModel().getSelection().reset(); @@ -103,6 +88,10 @@ public class FormSelectionUtils { try { Widget copied = copyWidget(designer, creator); XCreator copiedCreator = XCreatorUtils.createXCreator(copied, creator.getSize()); + if (!adapter.accept(copiedCreator, x, y)) { + designer.showMessageDialog(Inter.getLocText("FR-Designer_Too_Small_To_Paste")); + return; + } boolean addSuccess = adapter.addBean(copiedCreator, x, y); if (addSuccess) { designer.getSelectionModel().getSelection().addSelectedCreator(copiedCreator); @@ -118,14 +107,6 @@ public class FormSelectionUtils { /** * 组件复用绝对布局获取粘贴组件位置 - * - * @param layoutAdapter 绝对布局容器AbstractLayoutAdapter - * @param copiedCreator 复制的组件 - * @param x x=组件x + clonedCreator.getWidth() / 2 - * @param y y=组件y + clonedCreator.getHeight() / 2 - * 除2的步骤会导致当宽度或者高度为奇数是,中心点向左上各偏移一个像素 - * 由于中心点向左上各偏移一个像素,依赖中心点计算的右下点就会相应的想做上偏移一个像素,导致结果不准确 - * @return 新位置坐标 */ private static Point getPasteLocation(AbstractLayoutAdapter layoutAdapter, XCreator copiedCreator, int x, int y) { //当宽度为奇数时 设置偏移 @@ -144,12 +125,10 @@ public class FormSelectionUtils { * x,y同时越界 */ if (xOut && yOut) { - x = backoffset ? container.getWidth() - copiedCreator.getWidth() / 2 - xoffset - : container.getWidth() - copiedCreator.getWidth() / 2 - DELAY_X - xoffset; - y = backoffset ? - container.getHeight() - copiedCreator.getHeight() / 2 - yoffset - : container.getHeight() - copiedCreator.getHeight() / 2 - DELAY_Y - yoffset; - backoffset = !backoffset; + //向左偏移 + x = container.getWidth() - copiedCreator.getWidth() / 2 - DELAY_X_Y - xoffset; + //紧贴下边界 + y = container.getHeight() - copiedCreator.getHeight() / 2 - yoffset; return new Point(x, y); } /* @@ -158,7 +137,7 @@ public class FormSelectionUtils { * 距离大于20像素的一侧正常错开。 * x,y中只有一个越界 */ - else if ((xOut || yOut)) { + if ((xOut || yOut)) { x = xOut ? container.getWidth() - copiedCreator.getWidth() / 2 - xoffset : x; y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; return new Point(x, y); @@ -170,15 +149,10 @@ public class FormSelectionUtils { /** * 拷贝组件 - * - * @param formDesigner - * @param xCreator - * @return - * @throws CloneNotSupportedException */ private static Widget copyWidget(FormDesigner formDesigner, XCreator xCreator) throws CloneNotSupportedException { - ArrayList nameSpace = new ArrayList(); + ArrayList nameSpace = new ArrayList<>(); Widget copied = (Widget) xCreator.toData().clone(); //重命名拷贝的组件 String name = getCopiedName(formDesigner, copied, nameSpace); @@ -193,14 +167,9 @@ public class FormSelectionUtils { /** * 组件拷贝命名规则 - * - * @param formDesigner - * @param copied - * @param nameSpace - * @return name */ private static String getCopiedName(FormDesigner formDesigner, Widget copied, ArrayList nameSpace) { - StringBuffer name = new StringBuffer(copied.getWidgetName()); + StringBuilder name = new StringBuilder(copied.getWidgetName()); do { name.append(POSTFIX); } while (formDesigner.getTarget().isNameExist(name.toString()) || nameSpace.contains(name.toString())); @@ -209,8 +178,8 @@ public class FormSelectionUtils { } public static void rebuildSelection(FormDesigner designer) { - ArrayList newSelection = new ArrayList(); - List widgetList = new ArrayList(); + ArrayList newSelection = new ArrayList<>(); + List widgetList = new ArrayList<>(); for (XCreator comp : designer.getSelectionModel().getSelection().getSelectedCreators()) { widgetList.add(comp.toData()); } @@ -219,7 +188,7 @@ public class FormSelectionUtils { } public static ArrayList rebuildSelection(XCreator rootComponent, Widget[] selectWidgets) { - List selectionWidget = new ArrayList(); + List selectionWidget = new ArrayList<>(); if (selectWidgets != null) { selectionWidget.addAll(Arrays.asList(selectWidgets)); } From 19df32d4b03f0e8fb935f9f2116364e1c6f8a7cb Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 7 Apr 2017 17:26:29 +0800 Subject: [PATCH 20/60] =?UTF-8?q?REPORT-1916=20=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=3D=E3=80=8B=E4=BF=AE=E5=A4=8D=E5=88=9D=E6=AC=A1?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=A8=A1=E6=9D=BF=E6=97=B6=EF=BC=8C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BF=9D=E5=AD=98ID=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/mainframe/JTemplate.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index 92dd63e112..e28090299e 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -529,12 +529,13 @@ public abstract class JTemplate> ex } protected boolean saveNewFile(FILE editingFILE, String oldName){ - this.editingFILE = editingFILE; + // 在保存之前,初始化 templateID + initForCollect(); // 如果保存新模板(新建模板直接保存,或者另存为),则添加 templateID + this.editingFILE = editingFILE; boolean result = this.saveFile(); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); - initForCollect(); // 如果保存新模板(新建模板直接保存,或者另存为),则添加 templateID collectInfo(); } //更换最近打开 From 5eeeaa37e7e2c2a6b4b2e7d4eed3a94386364aed Mon Sep 17 00:00:00 2001 From: zhouping Date: Mon, 10 Apr 2017 14:43:17 +0800 Subject: [PATCH 21/60] =?UTF-8?q?REPORT-2334=20=E8=A1=A8=E5=8D=95tab?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E4=B8=AD=E5=9B=BE=E8=A1=A8=E6=94=BE=E5=A4=A7?= =?UTF-8?q?=E7=BC=A9=E5=B0=8F=E4=BC=9A=E6=98=8E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/adapters/layout/FRFitLayoutAdapter.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index e31ee6a5d3..f5aa87a2b7 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -274,12 +274,8 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { } private Rectangle adjustBackupBound(Rectangle backupBound, XWCardMainBorderLayout mainLayout) { - // 参数界面高度对纵坐标产生的影响 - JForm jform = (JForm) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); - if (jform.getFormDesign().getParaComponent() != null) { - backupBound.y -= jform.getFormDesign().getParaHeight(); - } - + // zhouping: REPORT-2334 表单tab布局中图表放大缩小会明显 + // 这边不需要单独处理参数面板高度了,下面的方法中获取的是XWCardMainBorderLayout相对坐标 Rectangle rec = getLayoutBound(mainLayout); // XWTabLayout里面的横纵坐标收到外层XWCardMainBorderLayout的横纵坐标影响 // 减掉之后可以按照它原来的逻辑执行 From 9d5bdf6f595604b4ad0e39772736b1e733b1f313 Mon Sep 17 00:00:00 2001 From: syoki Date: Tue, 11 Apr 2017 00:18:09 +0900 Subject: [PATCH 22/60] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20design=E9=83=A8=E5=88=86=20=E5=BA=84=E5=A5=87=20201?= =?UTF-8?q?704110018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/locale/designer_ja_JP.properties | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) 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 d74f09b9d0..37d913e735 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 @@ -366,24 +366,30 @@ FR-Designer_XMLA_Get_Catalog=\u30AB\u30BF\u30ED\u30B0\u3092\u691C\u7D22\u3059\u3 FR-Designer_XMLA_Not_NULL=\u3053\u3053\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 FR-Designer_Column-Axis=\u5217\u8EF8 FR-Designer_LiteCondition_Common=\u4E00\u822C -FR-Designer_LiteCondition_Formula=\u516C\u5F0F +FR-Designer_LiteCondition_Formula=\u6570\u5F0F FR-Designer_LiteCondition_ConditionB-AND=\u30A2\u30F3\u30C9(AND) FR-Designer_LiteCondition_ConditionB-OR=\u30AA\u30A2(OR) FR-Designer_LiteCondition_Common_Condition=\u666E\u901A\u6761\u4EF6 -FR-Designer_LiteCondition_Formula_Condition=\u516C\u5F0F\u6761\u4EF6 +FR-Designer_LiteCondition_Formula_Condition=\u6570\u5F0F\u6761\u4EF6 FR-Designer_LiteCondition_Define=\u5B9A\u7FA9 +FR-Designer_Normal=\u6B63\u5E38 +FR-Designer_Alert=\u30A2\u30E9\u30FC\u30C8 FR-Designer_Select_All=\u5168\u9078\u629E -FR-Designer-Plugin_Expire_Dialog_Title=\u671F\u9650\u5207\u308C\u306E\u30D7\u30E9\u30B0\u30A4\u30F3 -FR-Designer-Plugin_Expire_Dialog_Text=\u30D7\u30E9\u30B0\u30A4\u30F3\u306F\u3001\u8CFC\u5165\u3092\u3059\u308B\u305F\u3081\u306B\u5E06\u30BD\u30D5\u30C8\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30BB\u30F3\u30BF\u30FC\u3092\u884C\u304F\u3001\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002 -FR-Designer-Plugin_Finerest_Addon=\u5E06\u8EDF\u5FDC\u7528\u30BB\u30F3\u30BF\u30FC +FR-Designer_Clear_All=\u5168\u3066\u3092\u30AF\u30EA\u30A2 +FR-Designer_Copy=\u30B3\u30D4\u30FC +FR-Designer_Log=\u30ED\u30B0 +FR-Designer-Plugin_Expire_Dialog_Title=\u30D7\u30E9\u30B0\u30A4\u30F3\u306F\u671F\u9650\u5207\u308C +FR-Designer-Plugin_Expire_Dialog_Text=\u30D7\u30E9\u30B0\u30A4\u30F3\u306F\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3001\u30D5\u30A1\u30F3\u30E9\u30F3\u30A2\u30D7\u30EA\u30BB\u30F3\u30BF\u30FC\u3078\u8CFC\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +FR-Designer-Plugin_Finerest_Addon=\u30D5\u30A1\u30F3\u30E9\u30F3\u30A2\u30D7\u30EA\u30BB\u30F3\u30BF\u30FC FR-Designer_Performance_First=\u6027\u80FD\u512A\u5148 FR-Designer_Total_N_Grade=\u5168\u90E8\u3067\:${N}\u5C64 FR-Designer_time(s)=\u56DE -FR-Designer_General=\u5E38\u7528 -FR-Designer_Advanced=\u9AD8\u7D1A +FR-Designer_General=\u901A\u5E38 +FR-Designer_Advanced=\u8A73\u7D30 +FR-Designer_Validate=\u691C\u8A3C FR-Designer_Oracle=\u3059\u3079\u3066\u306E\u30C6\u30FC\u30D6\u30EB FR-Designer_Product_improve=\u88FD\u54C1\u6539\u5584 -FR-Designer_Join_Product_improve=\u88FD\u54C1\u6539\u5584\u30D7\u30E9\u30F3\u306B\u52A0\u3048\u308B +FR-Designer_Join_Product_improve=\u88FD\u54C1\u6539\u5584\u30D7\u30E9\u30F3\u306B\u5165\u308B FR-Designer_Preference-Function=\u30D5\u30A1\u30F3\u30AF\u30B7\u30E7\u30F3\u8A2D\u5B9A FR-Designer_max_undo_limit=\u6700\u5927\u53D6\u308A\u6D88\u3057\u56DE\u6570 FR-Designer_Surport_String_To_Formula=\u30AD\u30E3\u30E9\u30AF\u30BF\u30FC\u6587\u5B57\u5217\u7DE8\u96C6\u3092\u516C\u5F0F\u3068\u3059\u308B\u3053\u3068\u306B\u30B5\u30DD\u30FC\u30C8 @@ -539,24 +545,26 @@ FR-Designer_Show_As_Download=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30EA\u30F3\u3 FR-Designer_File_Name_For_Download=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u540D FR-Designer_No=\u3044\u3044\u3048 FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0 -FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9 +FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 FR-Designer_Parameter-Formula=\u6570\u5F0F FR-Designer_Background_Null=\u80CC\u666F\u306A\u3057 FR-Designer_Background_Color=\u8272 -FR-Designer_Background_Texture=\u67C4 -FR-Designer_Background_Pattern=\u6A21\u69D8 -FR-Designer_Background_Gradient_Color=\u30B0\u30E9\u30C7\u30FC\u30B7\u30E7\u30F3\u8272 -FR-Designer_Background_Image=\u5199\u771F +FR-Designer_Background_Texture=\u30C6\u30AF\u30B9\u30C1\u30E3 +FR-Designer_Background_Pattern=\u30D1\u30BF\u30FC\u30F3 +FR-Designer_Background_Gradient_Color=\u30B0\u30E9\u30C7\u30FC\u30B7\u30E7\u30F3 +FR-Designer_Background_Image=\u753B\u50CF FR-Designer_Background_Clear=\u30AF\u30EA\u30A2 -FR-Designer_Background_Image_Select=\u5199\u771F\u3092\u9078\u629E +FR-Designer_Background_Image_Select=\u753B\u50CF\u9078\u629E FR-Designer_Initial_Background_Tips=\u30DC\u30BF\u30F3\u306E\u521D\u671F\u80CC\u666F -FR-Designer_Mouse_Move_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u306E\u80CC\u666F -FR-Designer_Mouse_Click_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u306E\u80CC\u666F +FR-Designer_Mouse_Move_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u5909\u5316\u3059\u308B\u80CC\u666F +FR-Designer_Mouse_Click_Tips=\u30DC\u30BF\u30F3\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u6642\u5909\u5316\u3059\u308B\u80CC\u666F FR-Designer-Move_Tab_First=\u30C8\u30C3\u30D7\u306B\u79FB\u3059 FR-Designer-Move_Tab_End=\u6700\u5F8C\u306B\u79FB\u3059 FR-Designer-Move_Tab_Next=\u5F8C\u308D\u306B\u79FB\u3059 FR-Designer-Move_Tab_Prev=\u524D\u306B\u79FB\u3059 -FR-Designer_AxisReversed=\u8EF8\u9006\u914D\u5217 +FR-Designer_AxisReversed=\u8EF8\u9006\u9806 FR-Designer_Logarithmic=\u5BFE\u6570\u76EE\u76DB\u308A FR-Designer_Chart_Log_Base=\u5E95\u6570 -FR-Designer_Chart_F_Radar_Axis=\u5782\u76F4\u8EF8 \ No newline at end of file +FR-Designer_Chart_F_Radar_Axis=\u5782\u76F4\u8EF8 +FR-Designer_Too_Large_To_Paste=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u30DC\u30FC\u30C0\u30FC\u306B\u8D85\u3048\u305F\u306E\u3067\u3001\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\uFF01 +FR-Designer_Too_Small_To_Paste=\u8A72\u5F53\u51E6\u306B\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u9AD8\u3059\u304E\uFF01 \ No newline at end of file From 6a9cec9bb37f797bb79e6c3bd61e141109a22ca1 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 11 Apr 2017 10:57:22 +0800 Subject: [PATCH 23/60] =?UTF-8?q?report-1945frm=E6=9C=AC=E5=9C=B0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=A4=8D=E7=94=A8=EF=BC=9A1=E3=80=81=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E6=88=96=E8=80=85tab=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B8=8D=E9=80=89=E4=B8=AD=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=BA=E4=B8=8A=E4=B8=8B=E5=B9=B3=E5=88=86?= =?UTF-8?q?=E5=B7=A6=E4=B8=8A=E8=A7=92=E7=9A=84=E7=BB=84=E4=BB=B6=EF=BC=9B?= =?UTF-8?q?2=E3=80=81tab=E5=B8=83=E5=B1=80=EF=BC=88=E6=9C=89=E6=97=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=EF=BC=89=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/SelectionModel.java | 44 ++++++++++++------- .../design/mainframe/FormSelectionUtils.java | 20 +++++++-- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index a70d9b1566..dc4ea6a49b 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java @@ -136,19 +136,20 @@ public class SelectionModel { if (designer.getClass().equals(FormDesigner.class)) { if (selection.getSelectedCreator() instanceof XWFitLayout) { if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) { - Rectangle rec = selection.getRelativeBounds(); - //Tab布局 - FormSelectionUtils.paste2Container(designer, (XLayoutContainer) selection.getSelectedCreator(), - clipboard, - rec.x + rec.width / 2, - rec.y + DELTA_X_Y); + XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator(); + //tab布局编辑器内部左上角第一个坐标点 + int leftUpX = container.toData().getMargin().getLeft() + 1; + int leftUpY = container.toData().getMargin().getTop() + 1; + //选中第一个坐标点坐在的组件 + selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); + pasteFromClipBoard(); } else { - Rectangle rec = selection.getRelativeBounds(); - //自适应布局 - FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), - clipboard, - rec.x + rec.width / 2, - rec.y + DELTA_X_Y); + //自适应布局编辑器内部左上角第一个坐标点 + int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; + int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; + //选中第一个坐标点坐在的组件 + selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); + pasteFromClipBoard(); } } else { //绝对布局 @@ -178,12 +179,23 @@ public class SelectionModel { container = XCreatorUtils.getParentXLayoutContainer(selection.getSelectedCreator()); if (container != null && selection.getSelectedCreator().getParent() instanceof XWFitLayout) { //自适应布局 + Rectangle selectionRec = selection.getRelativeBounds(); + //获取父容器位置,补充因参数面板高度导致的位置坐标计算偏移 Rectangle containerRec = ComponentUtils.getRelativeBounds(container); - //计算自适应布局位置 - int positionX = selectionRec.x - containerRec.x + selectionRec.width / 2; - int positionY = (int) (selectionRec.y - containerRec.y + selectionRec.height * OFFSET_RELATIVE); - + int positionX, positionY; + + if (container.getClass().equals(XWTabFitLayout.class)) { + //tab内部粘贴不补充高度偏移 + //且不计算参数面板造成的影响,因为在 + //@see com.fr.design.designer.beans.adapters.layout.FRTabFitLayoutAdapter#addBean中做了 + positionX = selectionRec.x + selectionRec.width / 2; + positionY = (int) (selectionRec.y + selectionRec.height * OFFSET_RELATIVE); + } else { + //计算自适应布局位置 + positionX = selectionRec.x - containerRec.x + selectionRec.width / 2; + positionY = (int) (selectionRec.y - containerRec.y + selectionRec.height * OFFSET_RELATIVE); + } FormSelectionUtils.paste2Container(designer, container, clipboard, positionX, positionY); } else if (container != null && selection.getSelectedCreator().getParent() instanceof XWAbsoluteLayout) { //绝对布局 diff --git a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java index 79f52519ec..1978e8432b 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java @@ -3,8 +3,10 @@ package com.fr.design.mainframe; import com.fr.base.FRContext; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.AbstractLayoutAdapter; +import com.fr.design.designer.beans.adapters.layout.FRTabFitLayoutAdapter; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.*; +import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.general.ComparatorUtils; @@ -83,14 +85,26 @@ public class FormSelectionUtils { * 相对布局粘贴 */ private static void relativePaste(FormDesigner designer, FormSelection clipboard, LayoutAdapter adapter, int x, int y) { + + //@see FRTabFitLayoutAdapter + Rectangle tabContainerRect = ComponentUtils.getRelativeBounds(designer.getSelectionModel().getSelection() + .getSelectedCreator().getParent()); + designer.getSelectionModel().getSelection().reset(); for (XCreator creator : clipboard.getSelectedCreators()) { try { Widget copied = copyWidget(designer, creator); XCreator copiedCreator = XCreatorUtils.createXCreator(copied, creator.getSize()); - if (!adapter.accept(copiedCreator, x, y)) { - designer.showMessageDialog(Inter.getLocText("FR-Designer_Too_Small_To_Paste")); - return; + if (adapter.getClass().equals(FRTabFitLayoutAdapter.class)) { + if (!adapter.accept(copiedCreator, x - tabContainerRect.x, y - tabContainerRect.y)) { + designer.showMessageDialog(Inter.getLocText("FR-Designer_Too_Small_To_Paste")); + return; + } + } else { + if (!adapter.accept(copiedCreator, x, y)) { + designer.showMessageDialog(Inter.getLocText("FR-Designer_Too_Small_To_Paste")); + return; + } } boolean addSuccess = adapter.addBean(copiedCreator, x, y); if (addSuccess) { From cc99e7d54fa965cfe3e25506ee44c75c7e64d3e2 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 11 Apr 2017 15:07:00 +0800 Subject: [PATCH 24/60] =?UTF-8?q?=E6=97=A0=E4=BB=BB=E5=8A=A1=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XWAbsoluteLayout.java | 887 +++++++++--------- 1 file changed, 451 insertions(+), 436 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 4ed1b6549b..1854b91f46 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -34,322 +34,335 @@ import com.fr.general.Inter; */ public class XWAbsoluteLayout extends XLayoutContainer { - private static final int EDIT_BTN_WIDTH = 60; - private static final int EDIT_BTN_HEIGHT = 24; - private int minWidth = WLayout.MIN_WIDTH; - private int minHeight = WLayout.MIN_HEIGHT; - - //由于屏幕分辨率不同,界面上的容器大小可能不是默认的100%,此时拖入组件时,保存的大小按照100%时的计算 - protected double containerPercent = 1.0; - - private HashMap xConnectorMap; - - public XWAbsoluteLayout() { - this(new WAbsoluteLayout(),new Dimension()); - } - - public XWAbsoluteLayout(WAbsoluteLayout widget) { - this(widget,new Dimension()); - } - - public XWAbsoluteLayout(WAbsoluteLayout widget, Dimension initSize) { - super(widget, initSize); - this.xConnectorMap = new HashMap(); - Connector connector; - for (int i = 0; i < widget.connectorCount(); i++) { - connector = widget.getConnectorIndex(i); - xConnectorMap.put(connector, new XConnector(connector, this)); - } - - initPercent(widget); - } - - /** - * 初始化时默认的组件大小 - * - * @return 默认Dimension - */ - @Override - public Dimension initEditorSize() { - return new Dimension(500, 300); - } - - //根据屏幕大小来确定显示的百分比, 1440*900默认100%, 1366*768缩放90% - private void initPercent(WAbsoluteLayout widget){ - Toolkit toolkit = Toolkit.getDefaultToolkit(); - Dimension scrnsize = toolkit.getScreenSize(); - double screenValue = FRScreen.getByDimension(scrnsize).getValue(); - if(screenValue != FormArea.DEFAULT_SLIDER){ - this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER); - } - } - - /** - * 返回容器大小的百分比 - * @return the containerPercent - */ - public double getContainerPercent() { - return containerPercent; - } - - /** - * 设置容器大小的百分比 - * @param containerPercent the containerPercent to set - */ - public void setContainerPercent(double containerPercent) { - this.containerPercent = containerPercent; - minWidth = (int) (XWAbsoluteLayout.MIN_WIDTH*containerPercent); - minHeight = (int) (XWAbsoluteLayout.MIN_HEIGHT*containerPercent); - } - - /** - * 返回界面处根据百分比调整后的最小宽度 - * @return 最小宽度 - */ - public int getActualMinWidth() { - return this.minWidth; - } - - /** - * 返回界面处根据百分比调整后的最小高度 - * @return 最小高度 - */ - public int getActualMinHeight() { - return this.minHeight; - } - - /** - * 返回界面处根据百分比调整后的间隔大小(且为偶数) - * @return 间隔 - */ - public int getAcualInterval() { - // adapter那边交叉三等分、删除都要判断是否对齐,所以间隔转为偶数 - int interval = (int) (toData().getCompInterval()*containerPercent); - int val = interval/2; - return val*2; - } - - /** - * 界面容器大小不是默认的时,处理控件的BoundsWidget,且避免出现空隙 - */ - private Rectangle dealWidgetBound(Rectangle rec) { - if (containerPercent == 1.0) { - return rec; - } - rec.x = (int) (rec.x/containerPercent); - rec.y = (int) (rec.y/containerPercent); - rec.width = (int) (rec.width/containerPercent); - rec.height = (int) (rec.height/containerPercent); - return rec; - } - - /** - * 新增删除拉伸后单个组件的BoundsWidget - */ - public void updateBoundsWidget(XCreator xCreator) { - WAbsoluteLayout layout = this.toData(); - if (xCreator.hasTitleStyle()) { - xCreator = (XLayoutContainer)xCreator.getParent(); - } - if (xCreator.acceptType(XWAbsoluteLayout.class)){ - ((XWAbsoluteLayout) xCreator).updateBoundsWidget(); - } - BoundsWidget boundsWidget = layout.getBoundsWidget(xCreator.toData()); - Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); - } - - private Rectangle calculateBound(Rectangle rec, double pw, double ph){ - Rectangle calRec = new Rectangle(0,0,0,0); - calRec.x = (int)(rec.x / pw); - calRec.y = (int)(rec.y / ph); - calRec.width = (int)(rec.width / pw); - calRec.height = (int)(rec.height / ph); - return calRec; - } - - /** - * 新增删除拉伸后每个组件的BoundsWidget - */ - public void updateBoundsWidget() { - WAbsoluteLayout layout = this.toData(); - Rectangle backupBound = this.getBackupBound(); - Rectangle currentBound = this.getBounds(); - if (backupBound != null && layout.getCompState() == WAbsoluteLayout.STATE_FIT) { - double percentW = ((double) backupBound.width / (double) currentBound.width); - double percentH = ((double) backupBound.height / (double) currentBound.height); - for (int index = 0, n = this.getComponentCount(); index < n; index++){ - XCreator creator = (XCreator) this.getComponent(index); - BoundsWidget wgt = layout.getBoundsWidget(creator.toData()); - // 用当前的显示大小计算后调正具体位置 - Rectangle wgtBound = creator.getBounds(); - Rectangle rec = calculateBound(wgtBound, percentW, percentH); - wgt.setBounds(rec); - creator.setBounds(rec); - //绝对布局嵌套,要更新内部的绝对布局 - if (creator.acceptType(XWAbsoluteLayout.class)){ - creator.setBackupBound(wgtBound); - ((XWAbsoluteLayout) creator).updateBoundsWidget(); - } - } - } - } - - /** - * 更新子组件的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 对齐线 - */ - public void addConnector(Connector connector) { - xConnectorMap.put(connector, new XConnector(connector, this)); - ((WAbsoluteLayout) data).addConnector(connector); - } - - public XConnector getXConnector(Connector connector) { - return xConnectorMap.get(connector); - } - - /** - * 去除对齐线 - * @param connector 对齐线 - */ - public void removeConnector(Connector connector) { - ((WAbsoluteLayout) data).removeConnector(connector); - xConnectorMap.remove(connector); - } - - /** - * 返回对应的widget容器 - * @return 返回WAbsoluteLayout - */ - @Override - public WAbsoluteLayout toData() { - return (WAbsoluteLayout) data; - } - - @Override - protected String getIconName() { - return "layout_absolute_new.png"; - } - - /** - * 返回默认的容器name - * @return 返回绝对布局容器名 - */ - @Override - public String createDefaultName() { - return "absolute"; - } - - @Override - protected void initLayoutManager() { - this.setLayout(new FRAbsoluteLayout()); - } - - /** - * 是否支持标题样式 - * - * @return 默认false - */ - @Override - public boolean hasTitleStyle() { - return false; - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - WAbsoluteLayout layout = (WAbsoluteLayout) data; - Connector[] connector = layout.getConnector(); - for (int i = 0, size = connector.length; i < size; i++) { - connector[i].draw(g); - } - } - - /** - * 转换保存组件信息的wlayout为对应的container - */ - @Override - public void convert() { - isRefreshing = true; - WAbsoluteLayout abs = toData(); - this.removeAll(); - for (int i = 0, count = abs.getWidgetCount(); i < count; i++) { - BoundsWidget bw = (BoundsWidget)abs.getWidget(i); - if (bw != null) { - Rectangle bounds = bw.getBounds(); - XWidgetCreator comp = (XWidgetCreator)XCreatorUtils.createXCreator(bw.getWidget()); - if (!comp.acceptType(XWParameterLayout.class)) { - comp.setDirections(Direction.ALL); - } - add(comp); - comp.setBounds(bounds); - } - } - isRefreshing = false; - } - - /** - * 当前组件zorder位置替换新的控件 - * @param widget 控件 - * @param oldcreator 旧组件 - * @return 组件 - */ - @Override - public XCreator replace(Widget widget, XCreator oldcreator) { - int i = this.getComponentZOrder(oldcreator); - if (i != -1) { - this.toData().replace(new BoundsWidget(widget, oldcreator.getBounds()), - new BoundsWidget(oldcreator.toData(), oldcreator.getBounds())); - this.convert(); - return (XCreator) this.getComponent(i); - } - return null; - } - - /** + private static final int EDIT_BTN_WIDTH = 60; + private static final int EDIT_BTN_HEIGHT = 24; + private int minWidth = WLayout.MIN_WIDTH; + private int minHeight = WLayout.MIN_HEIGHT; + + //由于屏幕分辨率不同,界面上的容器大小可能不是默认的100%,此时拖入组件时,保存的大小按照100%时的计算 + protected double containerPercent = 1.0; + + private HashMap xConnectorMap; + + public XWAbsoluteLayout() { + this(new WAbsoluteLayout(), new Dimension()); + } + + public XWAbsoluteLayout(WAbsoluteLayout widget) { + this(widget, new Dimension()); + } + + public XWAbsoluteLayout(WAbsoluteLayout widget, Dimension initSize) { + super(widget, initSize); + this.xConnectorMap = new HashMap(); + Connector connector; + for (int i = 0; i < widget.connectorCount(); i++) { + connector = widget.getConnectorIndex(i); + xConnectorMap.put(connector, new XConnector(connector, this)); + } + + initPercent(widget); + } + + /** + * 初始化时默认的组件大小 + * + * @return 默认Dimension + */ + @Override + public Dimension initEditorSize() { + return new Dimension(500, 300); + } + + //根据屏幕大小来确定显示的百分比, 1440*900默认100%, 1366*768缩放90% + private void initPercent(WAbsoluteLayout widget) { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Dimension scrnsize = toolkit.getScreenSize(); + double screenValue = FRScreen.getByDimension(scrnsize).getValue(); + if (screenValue != FormArea.DEFAULT_SLIDER) { + this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER); + } + } + + /** + * 返回容器大小的百分比 + * + * @return the containerPercent + */ + public double getContainerPercent() { + return containerPercent; + } + + /** + * 设置容器大小的百分比 + * + * @param containerPercent the containerPercent to set + */ + public void setContainerPercent(double containerPercent) { + this.containerPercent = containerPercent; + minWidth = (int) (XWAbsoluteLayout.MIN_WIDTH * containerPercent); + minHeight = (int) (XWAbsoluteLayout.MIN_HEIGHT * containerPercent); + } + + /** + * 返回界面处根据百分比调整后的最小宽度 + * + * @return 最小宽度 + */ + public int getActualMinWidth() { + return this.minWidth; + } + + /** + * 返回界面处根据百分比调整后的最小高度 + * + * @return 最小高度 + */ + public int getActualMinHeight() { + return this.minHeight; + } + + /** + * 返回界面处根据百分比调整后的间隔大小(且为偶数) + * + * @return 间隔 + */ + public int getAcualInterval() { + // adapter那边交叉三等分、删除都要判断是否对齐,所以间隔转为偶数 + int interval = (int) (toData().getCompInterval() * containerPercent); + int val = interval / 2; + return val * 2; + } + + /** + * 界面容器大小不是默认的时,处理控件的BoundsWidget,且避免出现空隙 + */ + private Rectangle dealWidgetBound(Rectangle rec) { + if (containerPercent == 1.0) { + return rec; + } + rec.x = (int) (rec.x / containerPercent); + rec.y = (int) (rec.y / containerPercent); + rec.width = (int) (rec.width / containerPercent); + rec.height = (int) (rec.height / containerPercent); + return rec; + } + + /** + * 新增删除拉伸后单个组件的BoundsWidget + */ + public void updateBoundsWidget(XCreator xCreator) { + WAbsoluteLayout layout = this.toData(); + if (xCreator.hasTitleStyle()) { + xCreator = (XLayoutContainer) xCreator.getParent(); + } + if (xCreator.acceptType(XWAbsoluteLayout.class)) { + ((XWAbsoluteLayout) xCreator).updateBoundsWidget(); + } + BoundsWidget boundsWidget = layout.getBoundsWidget(xCreator.toData()); + Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); + } + + private Rectangle calculateBound(Rectangle rec, double pw, double ph) { + Rectangle calRec = new Rectangle(0, 0, 0, 0); + calRec.x = (int) (rec.x / pw); + calRec.y = (int) (rec.y / ph); + calRec.width = (int) (rec.width / pw); + calRec.height = (int) (rec.height / ph); + return calRec; + } + + /** + * 新增删除拉伸后每个组件的BoundsWidget + */ + public void updateBoundsWidget() { + WAbsoluteLayout layout = this.toData(); + Rectangle backupBound = this.getBackupBound(); + Rectangle currentBound = this.getBounds(); + if (backupBound != null && layout.getCompState() == WAbsoluteLayout.STATE_FIT) { + double percentW = ((double) backupBound.width / (double) currentBound.width); + double percentH = ((double) backupBound.height / (double) currentBound.height); + for (int index = 0, n = this.getComponentCount(); index < n; index++) { + XCreator creator = (XCreator) this.getComponent(index); + BoundsWidget wgt = layout.getBoundsWidget(creator.toData()); + // 用当前的显示大小计算后调正具体位置 + Rectangle wgtBound = creator.getBounds(); + Rectangle rec = calculateBound(wgtBound, percentW, percentH); + wgt.setBounds(rec); + creator.setBounds(rec); + //绝对布局嵌套,要更新内部的绝对布局 + if (creator.acceptType(XWAbsoluteLayout.class)) { + creator.setBackupBound(wgtBound); + ((XWAbsoluteLayout) creator).updateBoundsWidget(); + } + } + } + } + + /** + * 更新子组件的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 对齐线 + */ + public void addConnector(Connector connector) { + xConnectorMap.put(connector, new XConnector(connector, this)); + ((WAbsoluteLayout) data).addConnector(connector); + } + + public XConnector getXConnector(Connector connector) { + return xConnectorMap.get(connector); + } + + /** + * 去除对齐线 + * + * @param connector 对齐线 + */ + public void removeConnector(Connector connector) { + ((WAbsoluteLayout) data).removeConnector(connector); + xConnectorMap.remove(connector); + } + + /** + * 返回对应的widget容器 + * + * @return 返回WAbsoluteLayout + */ + @Override + public WAbsoluteLayout toData() { + return (WAbsoluteLayout) data; + } + + @Override + protected String getIconName() { + return "layout_absolute_new.png"; + } + + /** + * 返回默认的容器name + * + * @return 返回绝对布局容器名 + */ + @Override + public String createDefaultName() { + return "absolute"; + } + + @Override + protected void initLayoutManager() { + this.setLayout(new FRAbsoluteLayout()); + } + + /** + * 是否支持标题样式 + * + * @return 默认false + */ + @Override + public boolean hasTitleStyle() { + return false; + } + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + WAbsoluteLayout layout = (WAbsoluteLayout) data; + Connector[] connector = layout.getConnector(); + for (int i = 0, size = connector.length; i < size; i++) { + connector[i].draw(g); + } + } + + /** + * 转换保存组件信息的wlayout为对应的container + */ + @Override + public void convert() { + isRefreshing = true; + WAbsoluteLayout abs = toData(); + this.removeAll(); + for (int i = 0, count = abs.getWidgetCount(); i < count; i++) { + BoundsWidget bw = (BoundsWidget) abs.getWidget(i); + if (bw != null) { + Rectangle bounds = bw.getBounds(); + XWidgetCreator comp = (XWidgetCreator) XCreatorUtils.createXCreator(bw.getWidget()); + if (!comp.acceptType(XWParameterLayout.class)) { + comp.setDirections(Direction.ALL); + } + add(comp); + comp.setBounds(bounds); + } + } + isRefreshing = false; + } + + /** + * 当前组件zorder位置替换新的控件 + * + * @param widget 控件 + * @param oldcreator 旧组件 + * @return 组件 + */ + @Override + public XCreator replace(Widget widget, XCreator oldcreator) { + int i = this.getComponentZOrder(oldcreator); + if (i != -1) { + this.toData().replace(new BoundsWidget(widget, oldcreator.getBounds()), + new BoundsWidget(oldcreator.toData(), oldcreator.getBounds())); + this.convert(); + return (XCreator) this.getComponent(i); + } + return null; + } + + /** * 组件增加 + * * @param e 容器事件 */ - @Override - public void componentAdded(ContainerEvent e) { - if (isRefreshing) { - return; - } - XWidgetCreator creator = (XWidgetCreator) e.getChild(); - WAbsoluteLayout wabs = this.toData(); - if (!creator.acceptType(XWFitLayout.class)) { - creator.setDirections(Direction.ALL); - } - wabs.addWidget(new BoundsWidget(creator.toData(), creator.getBounds())); - } - - /** + @Override + public void componentAdded(ContainerEvent e) { + if (isRefreshing) { + return; + } + XWidgetCreator creator = (XWidgetCreator) e.getChild(); + WAbsoluteLayout wabs = this.toData(); + if (!creator.acceptType(XWFitLayout.class)) { + creator.setDirections(Direction.ALL); + } + wabs.addWidget(new BoundsWidget(creator.toData(), creator.getBounds())); + } + + /** * 在设计界面中有组件移除的时候,需要通知WLayout容器重新paint + * * @param e 容器事件 */ @Override @@ -363,128 +376,130 @@ public class XWAbsoluteLayout extends XLayoutContainer { BoundsWidget bw = new BoundsWidget(wgt, xwc.getBounds()); wlayout.removeWidget(bw); } - - @Override - public Dimension getMinimumSize() { - return toData().getMinDesignSize(); - } - - @Override - public LayoutAdapter getLayoutAdapter() { - return new FRAbsoluteLayoutAdapter(this); - } - - @Override - public XLayoutContainer getTopLayout() { - XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout(); - if (xTopLayout != null && !xTopLayout.isEditable()){ - return xTopLayout; - } - else{ - return this; - } - } - - /** - * 得到属性名 - * @return 属性名 - * @throws java.beans.IntrospectionException - */ - public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { - return new CRPropertyDescriptor[] { - new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName( - Inter.getLocText("FR-Designer_Form-Widget_Name")) - }; - } - - public void paint(Graphics g) { - super.paint(g); - //如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层 - if (isMouseEnter && !this.editable) { - int x = 0; - int y = 0; - int w = getWidth(); - int h = getHeight(); - - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - //画白色的编辑层 - g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 60 / 100.0F)); - g2d.setColor(Color.WHITE); - g2d.fillRect(x, y, w, h); - //画编辑按钮所在框 - g2d.setComposite(oldComposite); - g2d.setColor(new Color(176, 196, 222)); - g2d.fillRect((x + w / 2 - EDIT_BTN_WIDTH / 2), (y + h / 2 - EDIT_BTN_HEIGHT / 2), EDIT_BTN_WIDTH, EDIT_BTN_HEIGHT); - //画编辑按钮图标 - BufferedImage image = IOUtils.readImage(IconPathConstants.TD_EDIT_ICON_PATH); - g2d.drawImage( - image, - (x + w / 2 - 23), - (y + h / 2 - image.getHeight() / 2), - image.getWidth(), - image.getHeight(), - null, - this - ); - g2d.setColor(Color.BLACK); - //画编辑文字 - g2d.drawString(Inter.getLocText("FR-Designer_Edit"), x + w / 2 - 2, y + h / 2 + 5); - } - } - - /** - * 响应点击事件 - * - * @param editingMouseListener 鼠标点击,位置处理器 - * @param e 鼠标点击事件 - */ - public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ - FormDesigner designer = editingMouseListener.getDesigner(); - SelectionModel selectionModel = editingMouseListener.getSelectionModel(); - boolean isEditing = isEditable() || designer.getCursor().getType() == Cursor.HAND_CURSOR || e.getClickCount() == 2; - setEditable(isEditing); - - selectionModel.selectACreatorAtMouseEvent(e); - designer.repaint(); - - if (editingMouseListener.stopEditing()) { - if (this != designer.getRootComponent()) { - ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); - editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); - } - } - } - - /** - * body大小手动调整的时候 - * 按照比例调整组件的宽度 - * @param percent 比例 - */ - @Override - public void adjustCompWidth(double percent) { - for (int i = 0; i < getComponentCount(); i++) { - XCreator xCreator = (XCreator) getComponent(i); - Rectangle rectangle = xCreator.getBounds(); - xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height); - BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); - widget.setBounds(xCreator.getBounds()); - } - } - - /** - * body大小手动调整的时候 - * 按照比例调整组件的高度 - * @param percent 比例 - */ - @Override - public void adjustCompHeight(double percent) { - for (int i = 0; i < getComponentCount(); i++) { - XCreator xCreator = (XCreator) getComponent(i); - Rectangle rectangle = xCreator.getBounds(); - xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent)); - BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); - widget.setBounds(xCreator.getBounds()); - } - } + + @Override + public Dimension getMinimumSize() { + return toData().getMinDesignSize(); + } + + @Override + public LayoutAdapter getLayoutAdapter() { + return new FRAbsoluteLayoutAdapter(this); + } + + @Override + public XLayoutContainer getTopLayout() { + XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout(); + if (xTopLayout != null && !xTopLayout.isEditable()) { + return xTopLayout; + } else { + return this; + } + } + + /** + * 得到属性名 + * + * @return 属性名 + * @throws java.beans.IntrospectionException + */ + public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { + return new CRPropertyDescriptor[]{ + new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName( + Inter.getLocText("FR-Designer_Form-Widget_Name")) + }; + } + + public void paint(Graphics g) { + super.paint(g); + //如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层 + if (isMouseEnter && !this.editable) { + int x = 0; + int y = 0; + int w = getWidth(); + int h = getHeight(); + + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + //画白色的编辑层 + g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 60 / 100.0F)); + g2d.setColor(Color.WHITE); + g2d.fillRect(x, y, w, h); + //画编辑按钮所在框 + g2d.setComposite(oldComposite); + g2d.setColor(new Color(176, 196, 222)); + g2d.fillRect((x + w / 2 - EDIT_BTN_WIDTH / 2), (y + h / 2 - EDIT_BTN_HEIGHT / 2), EDIT_BTN_WIDTH, EDIT_BTN_HEIGHT); + //画编辑按钮图标 + BufferedImage image = IOUtils.readImage(IconPathConstants.TD_EDIT_ICON_PATH); + g2d.drawImage( + image, + (x + w / 2 - 23), + (y + h / 2 - image.getHeight() / 2), + image.getWidth(), + image.getHeight(), + null, + this + ); + g2d.setColor(Color.BLACK); + //画编辑文字 + g2d.drawString(Inter.getLocText("FR-Designer_Edit"), x + w / 2 - 2, y + h / 2 + 5); + } + } + + /** + * 响应点击事件 + * + * @param editingMouseListener 鼠标点击,位置处理器 + * @param e 鼠标点击事件 + */ + public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { + FormDesigner designer = editingMouseListener.getDesigner(); + SelectionModel selectionModel = editingMouseListener.getSelectionModel(); + boolean isEditing = isEditable() || designer.getCursor().getType() == Cursor.HAND_CURSOR || e.getClickCount() == 2; + setEditable(isEditing); + + selectionModel.selectACreatorAtMouseEvent(e); + designer.repaint(); + + if (editingMouseListener.stopEditing()) { + if (this != designer.getRootComponent()) { + ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); + editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); + } + } + } + + /** + * body大小手动调整的时候 + * 按照比例调整组件的宽度 + * + * @param percent 比例 + */ + @Override + public void adjustCompWidth(double percent) { + for (int i = 0; i < getComponentCount(); i++) { + XCreator xCreator = (XCreator) getComponent(i); + Rectangle rectangle = xCreator.getBounds(); + xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height); + BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); + widget.setBounds(xCreator.getBounds()); + } + } + + /** + * body大小手动调整的时候 + * 按照比例调整组件的高度 + * + * @param percent 比例 + */ + @Override + public void adjustCompHeight(double percent) { + for (int i = 0; i < getComponentCount(); i++) { + XCreator xCreator = (XCreator) getComponent(i); + Rectangle rectangle = xCreator.getBounds(); + xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent)); + BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); + widget.setBounds(xCreator.getBounds()); + } + } } \ No newline at end of file From 228d8bb8e8865d78257a6aa825529ce26bdb4fc3 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 11 Apr 2017 15:07:37 +0800 Subject: [PATCH 25/60] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E5=B1=82=E5=8F=A0=E9=A1=BA=E5=BA=8F=E6=96=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6=E5=9C=A8=E4=B8=8A=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/adapters/layout/FRAbsoluteLayoutAdapter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 603626e13d..0384de675d 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 @@ -235,7 +235,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { if (creator.hasTitleStyle()) { addParentCreator(creator); } else { - container.add(creator, creator.toData().getWidgetName()); + container.add(creator, creator.toData().getWidgetName(),0); } XWAbsoluteLayout layout = (XWAbsoluteLayout) container; layout.updateBoundsWidget(creator); @@ -246,7 +246,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { if (creator.shouldScaleCreator() || creator.hasTitleStyle()) { addParentCreator(creator); } else { - container.add(creator, creator.toData().getWidgetName()); + container.add(creator, creator.toData().getWidgetName(),0); } XWFitLayout layout = (XWFitLayout) container; // 更新对应的BoundsWidget @@ -265,7 +265,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { private void addParentCreator(XCreator child) { XLayoutContainer parentPanel = child.initCreatorWrapper(child.getHeight()); - container.add(parentPanel, child.toData().getWidgetName()); + container.add(parentPanel, child.toData().getWidgetName(),0); } /** From 03ae87935a5ce59af7fc70aee38b21d88821ed91 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Wed, 12 Apr 2017 09:06:25 +0800 Subject: [PATCH 26/60] =?UTF-8?q?report-1945=20=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E6=97=A0=E7=BB=84=E4=BB=B6=E6=98=AF=E7=B2=98=E8=B4=B4=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/beans/models/SelectionModel.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index dc4ea6a49b..4b7b97e7da 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java @@ -149,7 +149,15 @@ public class SelectionModel { int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; //选中第一个坐标点坐在的组件 selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); - pasteFromClipBoard(); + if (hasSelectedPasteSource()) { + selectedPaste(); + } else { + FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), + clipboard, + DELTA_X_Y, + DELTA_X_Y); + } + } } else { //绝对布局 From 25116d6466188442d0d384252bb81b01047681ad Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Wed, 12 Apr 2017 09:30:27 +0800 Subject: [PATCH 27/60] =?UTF-8?q?report-1945,tab|=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94,=E6=97=A0=E7=BB=84=E4=BB=B6=E6=97=B6=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/SelectionModel.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index 4b7b97e7da..13eaa18ac3 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java @@ -142,22 +142,29 @@ public class SelectionModel { int leftUpY = container.toData().getMargin().getTop() + 1; //选中第一个坐标点坐在的组件 selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); - pasteFromClipBoard(); + Rectangle rectangle = selection.getRelativeBounds(); + if (hasSelectedPasteSource()) { + selectedPaste(); + } else { + FormSelectionUtils.paste2Container(designer, container, clipboard, + rectangle.x + rectangle.width / 2, + rectangle.y + DELTA_X_Y); + } } else { //自适应布局编辑器内部左上角第一个坐标点 int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; //选中第一个坐标点坐在的组件 selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); + Rectangle rectangle = selection.getRelativeBounds(); if (hasSelectedPasteSource()) { selectedPaste(); } else { FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), clipboard, - DELTA_X_Y, - DELTA_X_Y); + rectangle.x + rectangle.width / 2, + rectangle.y + DELTA_X_Y); } - } } else { //绝对布局 From 50dd30c362cd0804b5af586cd8e0362e50980c3a Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 12 Apr 2017 11:46:58 +0800 Subject: [PATCH 28/60] =?UTF-8?q?REPORT-2344=20=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E2=80=94=E2=80=94=E7=B9=81=E4=BD=93=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=B0=91=E4=BA=86key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/locale/designer.properties | 8 +++- .../design/locale/designer_en_US.properties | 7 +++- .../design/locale/designer_ja_JP.properties | 28 ++++++++++++- .../design/locale/designer_ko_KR.properties | 40 ++++++++++++++++++- .../design/locale/designer_zh_CN.properties | 2 + .../design/locale/designer_zh_TW.properties | 15 ++++++- 6 files changed, 95 insertions(+), 5 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 6aa27aba37..62d19e7378 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -590,4 +590,10 @@ FR-Designer_Logarithmic=Logarithmic FR-Designer_Chart_Log_Base=Log Base FR-Designer_Chart_F_Radar_Axis=Chart_F_Radar_Axis FR-Designer_Too_Large_To_Paste=too large to paste -FR-Designer_Too_Small_To_Paste=Too small to paste \ No newline at end of file +FR-Designer_Too_Small_To_Paste=Too small to paste +FR-Designer_Validate= +FR-Designer_Get-CubeGetting cube= +FR-Designer_Get-CubeGetting= +FR-Designer_Fit= +FR-Designer_Properties_Mobile= +FR-Designer_Oracle= 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 79f9c41390..bfab2989f3 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 @@ -591,4 +591,9 @@ FR-Designer_Logarithmic=Log scale FR-Designer_Chart_Log_Base=Log Base FR-Designer_Chart_F_Radar_Axis=Value Axis FR-Designer_Too_Large_To_Paste=Too large to paste! -FR-Designer_Too_Small_To_Paste=Too small to paste! \ No newline at end of file +FR-Designer_Too_Small_To_Paste=Too small to paste! +FR-Designer_SimpleCross_Report= +FR-Designer_Get-Cube= +FR-Designer_DoubleLayer_Report= +FR-Designer_Get-CubeGetting= +FR-Designer_SimpleDetail_Report= 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 37d913e735..ae7510e78e 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 @@ -567,4 +567,30 @@ FR-Designer_Logarithmic=\u5BFE\u6570\u76EE\u76DB\u308A FR-Designer_Chart_Log_Base=\u5E95\u6570 FR-Designer_Chart_F_Radar_Axis=\u5782\u76F4\u8EF8 FR-Designer_Too_Large_To_Paste=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u30DC\u30FC\u30C0\u30FC\u306B\u8D85\u3048\u305F\u306E\u3067\u3001\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\uFF01 -FR-Designer_Too_Small_To_Paste=\u8A72\u5F53\u51E6\u306B\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u9AD8\u3059\u304E\uFF01 \ No newline at end of file +FR-Designer_Too_Small_To_Paste=\u8A72\u5F53\u51E6\u306B\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u9AD8\u3059\u304E\uFF01 +FR-Designer_DoubleLayer_Report= +FR-Designer_Printer_Native_Button= +FR-Designer_Mobile-Warning= +FR-Designer_Form-Fit-Tip= +FR-Designer_Form-Forzen-Speed= +FR-Designer_Mobile_Form_Analysis_Annotation= +FR-Designer_TableData-Default-Para= +FR-Designer-Selected_Widget= +FR-Designer_Plugin_Should_Update_Please_Contact_Developer= +FR-Designer_SimpleCross_Report= +FR-Designer_Button-Cancel= +FR-Designer_Delete_Template= +FR-Designer_Install_Template= +FR-Designer_SimpleDetail_Report= +FR-Designer_LocalWidget= +FR-Designer_WidgetOrder= +FR-Designer_Form-Frozen-Tip= +FR-Designer-Invalid_Page_Number= +FR-Designer_Reset= +FR-Designer-Plugin_Please_Update_Jar= +FR-Designer_Get-CubeGetting cube= +FR-Designer_Mobile_Report_Analysis_Annotation= +FR-Designer_Properties_Mobile= +FR-Designer_Button-OK= +FR-Designer_Allow-Blank= +FR-Designer_AllCategories= 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 0c798b87aa..f6c1591ef0 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 @@ -556,4 +556,42 @@ FR-Designer-Move_Tab_Prev= FR-Designer_AxisReversed=\uCD95\uC5ED\uC21C FR-Designer_Logarithmic=\uB85C\uADF8\uB208\uAE08 FR-Designer_Chart_Log_Base=\uAE30\uC218 -FR-Designer_Chart_F_Radar_Axis=\uAC12\uCD95 \ No newline at end of file +FR-Designer_Chart_F_Radar_Axis=\uAC12\uCD95 +FR-Designer_COMMUNITY_VIDEO= +FR-Designer_DoubleLayer_Report= +FR-Designer_Too_Small_To_Paste= +FR-Designer_formDesignerModule= +FR-Designer_Mobile-Warning= +FR-Designer_Mobile-Open= +FR-Designer_Form-Fit-Tip= +FR-Designer_Form-Forzen-Speed= +FR-Designer_Mobile_Form_Analysis_Annotation= +FR-Designer_Too_Large_To_Paste= +FR-Designer_COMMUNITY_HELP= +FR-Designer_Validate= +FR-Designer_Button-Cancel= +FR-Designer_Plugin_Should_Update_Please_Contact_Developer= +FR-Designer_COMMUNITY_QUESTIONS= +FR-Designer_SimpleCross_Report= +FR-Designer_COMMUNITY_NEED= +FR-Designer_Delete_Template= +FR-Designer_TableData-Default-Para= +FR-Designer_Allow-Blank= +FR-Designer_LocalWidget= +FR-Designer_WidgetOrder= +FR-Designer_Form-Frozen-Tip= +FR-Designer_Mobile-Horizontal= +FR-Designer-Invalid_Page_Number= +FR-Designer_COMMUNITY_BBS= +FR-Designer_COMMUNITY_SIGN= +FR-Designer_COMMUNITY_UPDATE= +FR-Designer_Mobile-Vertical= +FR-Designer_Get-CubeGetting cube= +FR-Designer_COMMUNITY= +FR-Designer_Mobile_Report_Analysis_Annotation= +FR-Designer_Properties_Mobile= +FR-Designer_Button-OK= +FR-Designer_COMMUNITY_BUG= +FR-Designer_AllCategories= +FR-Designer_Mobile-Attr= +FR-Designer_Mobile-Zoom= 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 060eddbd74..b711458203 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 @@ -596,3 +596,5 @@ FR-Designer_Chart_Log_Base=\u5E95\u6570 FR-Designer_Chart_F_Radar_Axis=\u503C\u8F74 FR-Designer_Too_Large_To_Paste=\u7EC4\u4EF6\u5927\u5C0F\u8D85\u51FA\u8FB9\u754C\uFF0C\u65E0\u6CD5\u7C98\u8D34\uFF01 FR-Designer_Too_Small_To_Paste=\u6B64\u5904\u65E0\u6CD5\u7C98\u8D34\uFF0C\u5C0F\u4E8E\u7EC4\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 + +FR-Designer_Get-CubeGetting cube= 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 1329b3ba62..c16164185b 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 @@ -584,4 +584,17 @@ FR-Designer_Logarithmic=\u5C0D\u6578\u523B\u5EA6 FR-Designer_Chart_Log_Base=\u5E95\u6578 FR-Designer_Chart_F_Radar_Axis=\u503C\u8EF8 FR-Designer_Too_Large_To_Paste=\u7D44\u4EF6\u5927\u5C0F\u8D85\u51FA\u908A\u754C\uFF0C\u7121\u6CD5\u7C98\u8CBC\uFF01 -FR-Designer_Too_Small_To_Paste=\u6B64\u8655\u7121\u6CD5\u7C98\u8CBC\uFF0C\u5C0F\u65BC\u7D44\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 \ No newline at end of file +FR-Designer_Too_Small_To_Paste=\u6B64\u8655\u7121\u6CD5\u7C98\u8CBC\uFF0C\u5C0F\u65BC\u7D44\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 +FR-Designer_Download_Template= +FR-Designer-Selected_Widget= +FR-Designer_LocalWidget= +FR-Designer_Get-CubeGetting cube= +FR-Designer_Install_Template= +FR-Designer_Reset= +FR-Designer_SimpleCross_Report= +FR-Designer_Allow-Blank= +FR-Designer_AllCategories= +FR-Designer_SimpleDetail_Report= +FR-Designer_DoubleLayer_Report= +FR-Designer_Delete_Template= +FR-Designer_Validate= From 55ddfd87dcf16703d8326d4ade2a15509f075889 Mon Sep 17 00:00:00 2001 From: syoki Date: Thu, 13 Apr 2017 02:21:08 +0900 Subject: [PATCH 29/60] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E9=83=A8=E5=88=86=E6=9C=AA=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=BF=BB=E8=AF=91=20=E5=BA=84=E5=A5=87=20201?= =?UTF-8?q?704130221?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/locale/designer_ja_JP.properties | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) 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 ae7510e78e..87d0801981 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 @@ -568,29 +568,29 @@ FR-Designer_Chart_Log_Base=\u5E95\u6570 FR-Designer_Chart_F_Radar_Axis=\u5782\u76F4\u8EF8 FR-Designer_Too_Large_To_Paste=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u30DC\u30FC\u30C0\u30FC\u306B\u8D85\u3048\u305F\u306E\u3067\u3001\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\uFF01 FR-Designer_Too_Small_To_Paste=\u8A72\u5F53\u51E6\u306B\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u9AD8\u3059\u304E\uFF01 -FR-Designer_DoubleLayer_Report= -FR-Designer_Printer_Native_Button= -FR-Designer_Mobile-Warning= -FR-Designer_Form-Fit-Tip= -FR-Designer_Form-Forzen-Speed= -FR-Designer_Mobile_Form_Analysis_Annotation= -FR-Designer_TableData-Default-Para= -FR-Designer-Selected_Widget= -FR-Designer_Plugin_Should_Update_Please_Contact_Developer= -FR-Designer_SimpleCross_Report= -FR-Designer_Button-Cancel= -FR-Designer_Delete_Template= -FR-Designer_Install_Template= -FR-Designer_SimpleDetail_Report= -FR-Designer_LocalWidget= -FR-Designer_WidgetOrder= -FR-Designer_Form-Frozen-Tip= -FR-Designer-Invalid_Page_Number= -FR-Designer_Reset= -FR-Designer-Plugin_Please_Update_Jar= +FR-Designer_DoubleLayer_Report=\u4E8C\u968E\u30BF\u30A4\u30C8\u30EB +FR-Designer_Printer_Native_Button=\u30ED\u30FC\u30AB\u30EB\u5370\u5237 +FR-Designer_Mobile-Warning=\u6700\u5927\u306E\u9AD8\u3055\u306F\u8868\u793A\u30A8\u30EA\u30A2\u306E80\uFF05\u4EE5\u4E0A\u306B\u306A\u308A\u307E\u305B\u3093 +FR-Designer_Form-Fit-Tip=\u81EA\u5DF1\u9069\u5FDC\u30D7\u30E9\u30B0\u30A4\u30F3 +FR-Designer_Form-Forzen-Speed=\u3001\u305D\u3057\u3066\u6A2A\u65B9\u5411\u81EA\u5DF1\u9069\u5FDC\u307E\u305F\u306F2\u65B9\u5411\u81EA\u52D5\u9069\u5FDC\u3092\u5229\u7528\u3057\u3001\u5E33\u7968\u8868\u793A\u306E\u30B9\u30D4\u30FC\u30C9\u3092\u4E0A\u3052\u3067\u304D\u307E\u3059\u3002 +FR-Designer_Mobile_Form_Analysis_Annotation=\u8AAC\u660E\:\u8A72\u5F53\u8A2D\u5B9A\u3088\u308A\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u306E\u30A2\u30D7\u30EA\u3067\u306E\u89E3\u6790\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u3059\u3002 +FR-Designer_TableData-Default-Para=\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30D1\u30E9\u30E1\u30FC\u30BF +FR-Designer-Selected_Widget=\u5F53\u306E\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8 +FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u4F4E\u3044\u3067\u3059\u304C\u3001\u4E0D\u5177\u5408\u304C\u3067\u3063\u305F\u3001\u958B\u767A\u8005\u3068\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +FR-Designer_SimpleCross_Report=\u7C21\u5358\u30AF\u30ED\u30FC\u30B9\u8868 +FR-Designer_Button-Cancel=\u53D6\u308A\u6D88\u3057 +FR-Designer_Delete_Template=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u524A\u9664 +FR-Designer_Install_Template=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB +FR-Designer_SimpleDetail_Report=\u7C21\u5358\u660E\u7D30\u8868 +FR-Designer_LocalWidget=\u30ED\u30FC\u30AB\u30EB\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA +FR-Designer_WidgetOrder=\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u306E\u9806\u756A +FR-Designer_Form-Frozen-Tip=\u30D5\u30EA\u30FC\u30BA\u3092\u4F7F\u3046\u6642\u3001\u5F8C\u8A18\u306E\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\uFF1A +FR-Designer-Invalid_Page_Number=\u7121\u52B9\u306A\u30DA\u30FC\u30B8\u756A\u53F7 +FR-Designer_Reset=\u30EA\u30BB\u30C3\u30C8 +FR-Designer-Plugin_Please_Update_Jar=jar\u30D1\u30C3\u30AF\u3092\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3057\u3066\u304F\u3060\u3055\u3044 FR-Designer_Get-CubeGetting cube= -FR-Designer_Mobile_Report_Analysis_Annotation= -FR-Designer_Properties_Mobile= -FR-Designer_Button-OK= -FR-Designer_Allow-Blank= -FR-Designer_AllCategories= +FR-Designer_Mobile_Report_Analysis_Annotation=\u8AAC\u660E\:\u8A72\u5F53\u5C5E\u6027\u3088\u308A\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u306E\u30A2\u30D7\u30EA\u3067\u306E\u89E3\u6790\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u3059\u3001\u9801\u5206\u3051\u30D7\u30EC\u30D3\u30E5\u30FC\u3060\u3051\u3092\u652F\u6301\u3001\u66F8\u304D\u8FBC\u307F\u306B\u8A2D\u5B9A\u3059\u308B\u6642\u7121\u52B9\u306B\u306A\u308A\u307E\u3059\u3002 +FR-Designer_Properties_Mobile=\u30B9\u30DE\u30FC\u30C8\u30D5\u30A9\u30F3\u5C5E\u6027 +FR-Designer_Button-OK=\u5206\u304B\u308A\u307E\u3057\u305F +FR-Designer_Allow-Blank=\u7A7A\u306B\u8A31\u3059 +FR-Designer_AllCategories=\u5168\u3066\u306E\u7A2E\u985E From cc43c5314357111fdc2c58d1b7791c2d0b5c9fd2 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 13 Apr 2017 10:10:06 +0800 Subject: [PATCH 30/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=80=BC=E5=80=BC=E5=AE=9A=E4=B9=89=EF=BC=8C?= =?UTF-8?q?=E5=85=BC=E5=AE=B9vancharts=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 4a9be221de..96c51516d8 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -42,24 +42,30 @@ public class MinMaxValuePane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p, f }; - double[] rowSize = { p, p, p, p}; - Component[][] components = getPanelComponents(); - JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); + Component[][] components = getPanelComponents(); + JPanel panel = TableLayoutHelper.createTableLayoutPane(components, getRowSize(p), columnSize); this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); + this.add(panel, BorderLayout.CENTER); + addComponentListener(components); + } - for(int i = 0; i < components.length; i++) { - ((UICheckBox)components[i][0]).addActionListener(new ActionListener() { + protected double[] getRowSize(double p) { + return new double[]{p, p, p, p}; + } + public void addComponentListener(Component[][] components) { + for (int i = 0; i < components.length; i++) { + ((UICheckBox) components[i][0]).addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkBoxUse(); } }); - ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); + ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); } } + protected Component[][] getPanelComponents() { return new Component[][]{ new Component[]{minCheckBox, minValueField}, @@ -69,7 +75,7 @@ public class MinMaxValuePane extends JPanel { }; } - private void checkBoxUse() { + protected void checkBoxUse() { minValueField.setEnabled(minCheckBox.isSelected()); maxValueField.setEnabled(maxCheckBox.isSelected()); @@ -100,7 +106,7 @@ public class MinMaxValuePane extends JPanel { if(axis.getMinValue() != null) { minValueField.setText(axis.getMinValue().toString()); } - } + } // 最大值 if (axis.isCustomMaxValue()) { @@ -108,7 +114,7 @@ public class MinMaxValuePane extends JPanel { if(axis.getMaxValue() != null) { maxValueField.setText(axis.getMaxValue().toString()); } - } + } // 主次刻度单位 if (axis.isCustomMainUnit()) { @@ -116,7 +122,7 @@ public class MinMaxValuePane extends JPanel { if(axis.getMainUnit() != null) { mainUnitField.setText(axis.getMainUnit().toString()); } - } + } if(axis.isCustomSecUnit()) { isCustomSecUnitBox.setSelected(true); From 469bcc513df64ea674dc1a8ed7a4b733c10531f8 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 13 Apr 2017 10:34:11 +0800 Subject: [PATCH 31/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 96c51516d8..2ae89b60c0 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -53,18 +53,22 @@ public class MinMaxValuePane extends JPanel { protected double[] getRowSize(double p) { return new double[]{p, p, p, p}; } - public void addComponentListener(Component[][] components) { - for (int i = 0; i < components.length; i++) { - ((UICheckBox) components[i][0]).addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - checkBoxUse(); - } - }); - ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); - } - } + public void addComponentListener(Component[][] components) { + for (int i = 0; i < components.length; i++) { + addListener((UICheckBox) components[i][0]); + ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); + } + } + + protected void addListener(UICheckBox checkBox) { + checkBox.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + checkBoxUse(); + } + }); + } protected Component[][] getPanelComponents() { return new Component[][]{ @@ -75,7 +79,7 @@ public class MinMaxValuePane extends JPanel { }; } - protected void checkBoxUse() { + private void checkBoxUse() { minValueField.setEnabled(minCheckBox.isSelected()); maxValueField.setEnabled(maxCheckBox.isSelected()); From 814bea2e11f20cb32f895aa3d9792684fcaf8045 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 13 Apr 2017 10:48:19 +0800 Subject: [PATCH 32/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/chart/axis/MinMaxValuePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 2ae89b60c0..88a6b528ec 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -53,7 +53,7 @@ public class MinMaxValuePane extends JPanel { protected double[] getRowSize(double p) { return new double[]{p, p, p, p}; } - public void addComponentListener(Component[][] components) { + protected void addComponentListener(Component[][] components) { for (int i = 0; i < components.length; i++) { addListener((UICheckBox) components[i][0]); ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); From be48bf4b295d2cda530003874b5b0edde571074b Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 13 Apr 2017 16:08:15 +0800 Subject: [PATCH 33/60] =?UTF-8?q?REPORT-2220=20=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E7=94=A8=E6=88=B7=E5=90=8D=E5=92=8C=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/formula/VariableResolverAdapter.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/formula/VariableResolverAdapter.java b/designer_base/src/com/fr/design/formula/VariableResolverAdapter.java index eb80600acc..623b1cbf4f 100644 --- a/designer_base/src/com/fr/design/formula/VariableResolverAdapter.java +++ b/designer_base/src/com/fr/design/formula/VariableResolverAdapter.java @@ -4,12 +4,16 @@ import com.fr.base.ConfigManager; import com.fr.base.Parameter; import com.fr.design.DesignModelAdapter; import com.fr.base.ConfigManagerProvider; +import com.fr.plugin.ExtraClassManager; import com.fr.script.ScriptConstants; +import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; +import com.fr.stable.fun.BuiltInParametersProvider; import com.fr.stable.script.CalculatorProvider; import java.util.ArrayList; import java.util.List; +import java.util.Set; public abstract class VariableResolverAdapter implements VariableResolver { private static final int TABLE_DATA_PARA = 0; @@ -21,7 +25,7 @@ public abstract class VariableResolverAdapter implements VariableResolver { * @return 内置参数 */ public String[] resolveCurReportVariables() { - return new String[] { ScriptConstants.SUMMARY_TAG + "page_number", + String [] variables = new String[] { ScriptConstants.SUMMARY_TAG + "page_number", ScriptConstants.SUMMARY_TAG + "totalPage_number", // 下面是权限相关的参数 ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_USERNAME, ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_AUTHORITY, @@ -32,6 +36,13 @@ public abstract class VariableResolverAdapter implements VariableResolver { CalculatorProvider.REPORT_NAME, CalculatorProvider.FORMLET_NAME, CalculatorProvider.SERVLET_URL, CalculatorProvider.SERVER_SCHEMA, CalculatorProvider.SERVER_NAME, CalculatorProvider.SERVER_PORT, CalculatorProvider.SERVER_URL, CalculatorProvider.CONTEXT_PATH, CalculatorProvider.SESSION_ID }; + Set set = ExtraClassManager.getInstance().getArray(BuiltInParametersProvider.XML_TAG); + for (BuiltInParametersProvider provider : set) { + return (String[]) ArrayUtils.addAll(variables, new String []{ + ScriptConstants.DETAIL_TAG + provider.getParametersName() + }); + } + return variables; } private Parameter[] getCurrentModeParameters(int type) { From c247eeac6a60cd0468fb78e451fe307a2feaef50 Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 14 Apr 2017 14:54:45 +0800 Subject: [PATCH 34/60] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=20?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E6=96=B0=E7=BF=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XElementCase.java | 160 +++++++++--------- 1 file changed, 77 insertions(+), 83 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 c7cd3b4934..3a077e57a8 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -10,9 +10,11 @@ import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.*; -import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor; +import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; +import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; +import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; @@ -34,8 +36,8 @@ import java.beans.PropertyDescriptor; import java.util.Set; public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ - private UILabel imageLable; - private CoverReportPane coverPanel; + private UILabel imageLable; + private CoverReportPane coverPanel; private FormDesigner designer; //缩略图 private BufferedImage thumbnailImage; @@ -64,30 +66,23 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } /** - * 是否支持设置标题 - * @return 是返回true - */ - public boolean hasTitleStyle() { + * 是否支持设置标题 + * @return 是返回true + */ + public boolean hasTitleStyle() { return true; } - /** - * 返回组件属性值 - * @return 返回组件属性值 - * @throws IntrospectionException 异常 - */ + /** + * 返回组件属性值 + * @return 返回组件属性值 + * @throws IntrospectionException 异常 + */ public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetName", this.data.getClass()) .setI18NName(Inter.getLocText("Form-Widget_Name")), - new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( - Inter.getLocText("FR-Designer_Widget-Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - makeVisible(toData().isVisible());} - }), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( WLayoutBorderStyleEditor.class).setI18NName( Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") @@ -97,12 +92,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void propertyChange() { initStyle(); } - }), new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) .setI18NName(Inter.getLocText("FR-Layout_Padding")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) + new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class) .setI18NName(Inter.getLocText("Form-EC_toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; @@ -149,30 +143,30 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme return "text_field_16.png"; } - /** - * 返回组件默认名 - * @return 组件类名(小写) - */ - public String createDefaultName() { - return "report"; - } + /** + * 返回组件默认名 + * @return 组件类名(小写) + */ + public String createDefaultName() { + return "report"; + } @Override protected JComponent initEditor() { if (editor == null) { setBorder(DEFALUTBORDER); - editor = new JPanel(); - editor.setBackground(null); - editor.setLayout(null); - imageLable = initImageBackground(); - - coverPanel = new CoverReportPane(); - coverPanel.setPreferredSize(imageLable.getPreferredSize()); - coverPanel.setBounds(imageLable.getBounds()); - - editor.add(coverPanel); - coverPanel.setVisible(false); - editor.add(imageLable); + editor = new JPanel(); + editor.setBackground(null); + editor.setLayout(null); + imageLable = initImageBackground(); + + coverPanel = new CoverReportPane(); + coverPanel.setPreferredSize(imageLable.getPreferredSize()); + coverPanel.setBounds(imageLable.getBounds()); + + editor.add(coverPanel); + coverPanel.setVisible(false); + editor.add(imageLable); } return editor; } @@ -185,7 +179,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme BufferedImage image = getThumbnailImage(); setLabelBackground(image, imageLable); - return imageLable; + return imageLable; } /** @@ -194,16 +188,16 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme private void setLabelBackground(Image image, UILabel imageLable){ ImageIcon icon = new ImageIcon(image); imageLable.setIcon(icon); - imageLable.setOpaque(true); - imageLable.setLayout(null); - imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); + imageLable.setOpaque(true); + imageLable.setLayout(null); + imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); } - /** - * 是否展现覆盖的pane - * @param display 是否 - */ - public void displayCoverPane(boolean display){ + /** + * 是否展现覆盖的pane + * @param display 是否 + */ + public void displayCoverPane(boolean display){ coverPanel.setVisible(display); coverPanel.setBounds(1, 1, (int) editor.getBounds().getWidth(), (int) editor.getBounds().getHeight()); editor.repaint(); @@ -216,41 +210,41 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme coverPanel.destroyHelpDialog(); } - public JComponent getCoverPane(){ - return coverPanel; - } + public JComponent getCoverPane(){ + return coverPanel; + } - /** - * 初始化大小 - * @return 尺寸 - */ + /** + * 初始化大小 + * @return 尺寸 + */ public Dimension initEditorSize() { return BORDER_PREFERRED_SIZE; } - /** - * 是否是报表块 - * @return 是 - */ + /** + * 是否是报表块 + * @return 是 + */ public boolean isReport() { return true; } - /** - * 该组件是否可以拖入参数面板 - * @return 是则返回true - */ - public boolean canEnterIntoParaPane(){ - return false; - } - - /** - * 返回报表块对应的widget - * @return 返回ElementCaseEditor - */ - public ElementCaseEditor toData() { - return ((ElementCaseEditor) data); - } + /** + * 该组件是否可以拖入参数面板 + * @return 是则返回true + */ + public boolean canEnterIntoParaPane(){ + return false; + } + + /** + * 返回报表块对应的widget + * @return 返回ElementCaseEditor + */ + public ElementCaseEditor toData() { + return ((ElementCaseEditor) data); + } public FormElementCaseProvider getElementCase() { return toData().getElementCase(); @@ -301,14 +295,14 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } - private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){ - FormDesigner designer = editingMouseListener.getDesigner(); - if (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR){ - FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e); - //切换设计器 - designer.switchTab(component); - } - } + private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){ + FormDesigner designer = editingMouseListener.getDesigner(); + if (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR){ + FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e); + //切换设计器 + designer.switchTab(component); + } + } @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { From 08069fbfe0b9d75a73bc51eb4557246368826851 Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 17 Apr 2017 14:25:03 +0800 Subject: [PATCH 35/60] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=20=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BB=A3=E7=A0=81=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/FRAbsoluteLayoutAdapter.java | 162 +++++++++--------- 1 file changed, 81 insertions(+), 81 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 e96d392255..8ca2012525 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 @@ -1,31 +1,31 @@ -package com.fr.design.designer.beans.adapters.layout; - -import com.fr.design.beans.GroupModel; -import com.fr.design.designer.beans.ConstraintsGroupModel; -import com.fr.design.designer.beans.HoverPainter; -import com.fr.design.designer.beans.painters.FRAbsoluteLayoutPainter; -import com.fr.design.designer.creator.*; -import com.fr.design.designer.properties.BoundsGroupModel; -import com.fr.design.designer.properties.FRAbsoluteLayoutPropertiesGroupModel; -import com.fr.design.utils.ComponentUtils; -import com.fr.design.utils.gui.LayoutUtils; -import com.fr.general.ComparatorUtils; -import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; -import com.fr.general.FRLogger; - +package com.fr.design.designer.beans.adapters.layout; + +import com.fr.design.beans.GroupModel; +import com.fr.design.designer.beans.ConstraintsGroupModel; +import com.fr.design.designer.beans.HoverPainter; +import com.fr.design.designer.beans.painters.FRAbsoluteLayoutPainter; +import com.fr.design.designer.creator.*; +import com.fr.design.designer.properties.BoundsGroupModel; +import com.fr.design.designer.properties.FRAbsoluteLayoutPropertiesGroupModel; +import com.fr.design.utils.ComponentUtils; +import com.fr.design.utils.gui.LayoutUtils; +import com.fr.form.ui.container.WAbsoluteLayout; +import com.fr.general.ComparatorUtils; +import com.fr.general.FRLogger; + import java.awt.*; -public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { +public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { //是不是添加到父容器上 private boolean isAdd2ParentLayout = false; private HoverPainter painter; - - public FRAbsoluteLayoutAdapter(XLayoutContainer container) { - super(container); + + public FRAbsoluteLayoutAdapter(XLayoutContainer container) { + super(container); painter = new FRAbsoluteLayoutPainter(container); initMinSize(); - } - + } + private void initMinSize() { XWAbsoluteLayout layout = (XWAbsoluteLayout) container; minWidth = layout.getActualMinWidth(); @@ -33,25 +33,25 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { actualVal = layout.getAcualInterval(); margin = layout.toData().getMargin(); } - + @Override public HoverPainter getPainter() { return painter; } - /** - * 是否能在指定位置添加组件 + /** + * 是否能在指定位置添加组件 * - * @param creator 组件 + * @param creator 组件 * @param x 坐标x * @param y 坐标y - * @return 能则返回true - */ + * @return 能则返回true + */ //这个地方的逻辑非常复杂, // 1.当前绝对布局是不可编辑且是最外层,那么其他控件添加在它周围, // 2.当前绝对布局是不可编辑且不是最外层,那么控件不可添加,(嵌套) // 3.当前绝对布局可编辑,那么控件添加 - @Override + @Override public boolean accept(XCreator creator, int x, int y) { Component comp = container.getComponentAt(x, y); //布局控件要先判断是不是可编辑 @@ -85,39 +85,39 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { } else { FRLogger.getLogger().error("top layout is null!"); } - + return false; } - + //topLayout假如可以编辑的话就往里面添加组件 private boolean topLayoutAccept(XCreator creator, int x, int y) { //允许组件重叠,可以不判断有没有和当前控件重叠 //先计算当前控件的位置 int creatorX, creatorY; if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { - Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); - creatorX = creatorRectangle.x; - creatorY = creatorRectangle.y; - } else { + Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); + creatorX = creatorRectangle.x; + creatorY = creatorRectangle.y; + } else { //这边计算得到的组件其实位置是正确的, //因为传入的x和y已经加上了宽度或者高度的一半,再减去相同的宽度和高度的一半是没区别的, // 例如高度为21,那么就是+10-10; // 高度为20,那么就是+10-10; 没区别 - int w = creator.getWidth() / 2; - int h = creator.getHeight() / 2; - creatorX = x - w; - creatorY = y - h; - } + int w = creator.getWidth() / 2; + int h = creator.getHeight() / 2; + creatorX = x - w; + creatorY = y - h; + } if (creatorX < 0 || creatorX + creator.getWidth() > container.getWidth()) { - return false; - } + return false; + } if (creatorY < 0 || creatorY + creator.getHeight() > container.getHeight()) { - return false; - } + return false; + } return x >= 0 && y >= 0 && creator.getHeight() <= container.getHeight() - && creator.getWidth() <= container.getWidth(); + && creator.getWidth() <= container.getWidth(); } - + /** * 判断是否鼠标在组件的三等分区域,如果组件在布局管理器中间,上下左右都可能会三等分 * @@ -156,10 +156,10 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { if (!creator.getTargetChildrenList().isEmpty()) { return false; } - + return !ComparatorUtils.equals(trisectAreaDirect, 0); } - + //当前绝对布局不可编辑,就当成一个控件,组件添加在周围 private boolean acceptWidget(int x, int y) { isFindRelatedComps = false; @@ -169,27 +169,27 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { XLayoutContainer parent = container.findNearestFit(); container = parent != null ? parent : container; isAdd2ParentLayout = true; - + int componentHeight = comp.getHeight(); int componentWidth = comp.getWidth(); //上半部分高度 int upHeight = (int) (componentHeight * TOP_HALF) + comp.getY(); //下半部分高度 int downHeight = (int) (componentHeight * BOTTOM_HALF) + comp.getY(); - + if (isCrossPointArea(comp, x, y)) { return canAcceptWhileCrossPoint(comp, x, y); } - + if (isTrisectionArea(comp, x, y)) { return canAcceptWhileTrisection(comp, x, y); } - + boolean horizonValid = componentWidth >= minWidth * 2 + actualVal; boolean verticalValid = componentHeight >= minHeight * 2 + actualVal; return y > upHeight && y < downHeight ? horizonValid : verticalValid; } - + /** * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 @@ -202,7 +202,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { @Override public boolean addBean(XCreator creator, int x, int y) { Rectangle rect = ComponentUtils.getRelativeBounds(container); - + int posX = x + rect.x; int posY = y + rect.y; if (!accept(creator, x, y)) { @@ -212,7 +212,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { ((XWidgetCreator) creator).recalculateChildrenSize(); return true; } - + @Override protected void addComp(XCreator creator, int x, int y) { if (!isAdd2ParentLayout) { @@ -220,7 +220,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { x = x - r.x; y = y - r.y; if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { - + Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); x = creatorRectangle.x - r.x; y = creatorRectangle.y - r.y; @@ -231,11 +231,11 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { y = y - h; } fix(creator, x, y); - + if (creator.hasTitleStyle()) { addParentCreator(creator); } else { - container.add(creator, creator.toData().getWidgetName(),0); + container.add(creator, creator.toData().getWidgetName(), 0); } XWAbsoluteLayout layout = (XWAbsoluteLayout) container; layout.updateBoundsWidget(creator); @@ -246,7 +246,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { if (creator.shouldScaleCreator() || creator.hasTitleStyle()) { addParentCreator(creator); } else { - container.add(creator, creator.toData().getWidgetName(),0); + container.add(creator, creator.toData().getWidgetName(), 0); } XWFitLayout layout = (XWFitLayout) container; // 更新对应的BoundsWidget @@ -254,7 +254,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { updateCreatorBackBound(); } } - + private void updateCreatorBackBound() { for (int i = 0, size = container.getComponentCount(); i < size; i++) { XCreator creator = (XCreator) container.getComponent(i); @@ -262,12 +262,12 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { creator.setBackupBound(creator.getBounds()); } } - + private void addParentCreator(XCreator child) { XLayoutContainer parentPanel = child.initCreatorWrapper(child.getHeight()); - container.add(parentPanel, child.toData().getWidgetName(),0); + container.add(parentPanel, child.toData().getWidgetName(), 0); } - + /** * 新拖入组件时,计算调整其他关联组件位置大小 * @@ -292,29 +292,29 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { fixHalve(parentComp, child, x, y); } } - + /** - * 组件拖拽后调整大小 + * 组件拖拽后调整大小 * - * @param creator 组件 - */ - @Override + * @param creator 组件 + */ + @Override public void fix(XCreator creator) { WAbsoluteLayout wabs = (WAbsoluteLayout) container.toData(); fix(creator, creator.getX(), creator.getY()); wabs.setBounds(creator.toData(), creator.getBounds()); - + XWAbsoluteLayout layout = (XWAbsoluteLayout) container; layout.updateBoundsWidget(creator); - } + } - /** - * 调整组件大小到合适尺寸位置 + /** + * 调整组件大小到合适尺寸位置 * - * @param creator 组件 + * @param creator 组件 * @param x 坐标x * @param y 坐标y - */ + */ public void fix(XCreator creator, int x, int y) { int height = creator.getHeight(); int width = creator.getWidth(); @@ -323,21 +323,21 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { } else if (x + creator.getWidth() > container.getWidth()) { x = container.getWidth() - width; } - + if (y < 0) { y = container.getY(); } else if (y + creator.getHeight() > container.getHeight()) { y = container.getHeight() - height; } - + creator.setBounds(x, y, width, height); - } - - @Override - public ConstraintsGroupModel getLayoutConstraints(XCreator creator) { + } + + @Override + public ConstraintsGroupModel getLayoutConstraints(XCreator creator) { return new BoundsGroupModel((XWAbsoluteLayout) container, creator); - } - + } + @Override public GroupModel getLayoutProperties() { XWAbsoluteLayout xwAbsoluteLayout = (XWAbsoluteLayout) container; From 935b4fcca69eb3f0e5d792fccc596e45b1f23f03 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 17 Apr 2017 15:33:00 +0800 Subject: [PATCH 36/60] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=9B?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templateinfo/TemplateInfoCollector.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index b9b7aa194e..e5c6688ec9 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -73,8 +73,6 @@ public class TemplateInfoCollector implements Serializable { } catch (InvalidClassException ex) { // 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖) // 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现 - FRLogger.getLogger().info(ex.getMessage()); - FRLogger.getLogger().info("use a new instance"); instance = new TemplateInfoCollector(); } catch (Exception ex) { @@ -123,14 +121,6 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - String log = ""; - int count = 1; - for (String key : templateInfoList.keySet()) { - String createTime = ((HashMap)templateInfoList.get(key).get("consumingMap")).get("create_time").toString(); - log += (count + ". id: " + key + " " + createTime + "\n" + templateInfoList.get(key).toString() + "\n"); - count ++; - } - FRLogger.getLogger().info("writing tplInfo: \n" + log); os.writeObject(instance); os.close(); } catch (Exception ex) { @@ -241,10 +231,7 @@ public class TemplateInfoCollector implements Serializable { String jsonProcessMap = templateInfo.get("jsonProcessMap"); if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 - FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); removeFromTemplateInfoList(templateInfo.get("templateID")); - } else { - FRLogger.getLogger().info("send template info failed, will try next time, " + templateInfo.get("templateID")); } } saveInfo(); @@ -303,7 +290,6 @@ public class TemplateInfoCollector implements Serializable { private void removeFromTemplateInfoList(String key) { templateInfoList.remove(key); - FRLogger.getLogger().info(key + " is removed..."); } @SuppressWarnings("unchecked") From 0593924ef3d8c3289bee1b779997312a9908c387 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 18 Apr 2017 14:03:13 +0800 Subject: [PATCH 37/60] =?UTF-8?q?REPORT-2430=20master=E6=94=B6=E9=9B=86?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=9D=BF=E4=BF=A1=E6=81=AF=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=88=A0=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templateinfo/TemplateInfoCollector.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index b9b7aa194e..e5c6688ec9 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -73,8 +73,6 @@ public class TemplateInfoCollector implements Serializable { } catch (InvalidClassException ex) { // 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖) // 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现 - FRLogger.getLogger().info(ex.getMessage()); - FRLogger.getLogger().info("use a new instance"); instance = new TemplateInfoCollector(); } catch (Exception ex) { @@ -123,14 +121,6 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - String log = ""; - int count = 1; - for (String key : templateInfoList.keySet()) { - String createTime = ((HashMap)templateInfoList.get(key).get("consumingMap")).get("create_time").toString(); - log += (count + ". id: " + key + " " + createTime + "\n" + templateInfoList.get(key).toString() + "\n"); - count ++; - } - FRLogger.getLogger().info("writing tplInfo: \n" + log); os.writeObject(instance); os.close(); } catch (Exception ex) { @@ -241,10 +231,7 @@ public class TemplateInfoCollector implements Serializable { String jsonProcessMap = templateInfo.get("jsonProcessMap"); if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 - FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); removeFromTemplateInfoList(templateInfo.get("templateID")); - } else { - FRLogger.getLogger().info("send template info failed, will try next time, " + templateInfo.get("templateID")); } } saveInfo(); @@ -303,7 +290,6 @@ public class TemplateInfoCollector implements Serializable { private void removeFromTemplateInfoList(String key) { templateInfoList.remove(key); - FRLogger.getLogger().info(key + " is removed..."); } @SuppressWarnings("unchecked") From fed1ceaeea3185789c5a78b17671d7f29afe7850 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 18 Apr 2017 23:34:48 +0800 Subject: [PATCH 38/60] =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=BA=9B=E6=8E=A5=E5=8F=A3=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=88Vancharts=E6=96=B0=E6=8F=92=E4=BB=B6=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=9C=80=E8=A6=81=EF=BC=8Ceason=E4=B8=8EFR=E5=95=86=E8=AE=A8?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=EF=BC=8C=E5=8F=AF=E4=BB=A5=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9master=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/TableDataPane.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index a6bea6b0ca..721e7432ac 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -25,6 +25,10 @@ public class TableDataPane extends FurtherBasicBeanPane{ private ChartDataPane parent; + protected AbstractTableDataContentPane getDataContentPane() { + return dataContentPane; + } + public TableDataPane(ChartDataPane parent) { this.parent = parent; initDataPane(); @@ -103,34 +107,41 @@ public class TableDataPane extends FurtherBasicBeanPane{ * @param collection 图表属性的集合 */ public void refreshContentPane(ChartCollection collection) { + refreshContentPane(getContentPane(collection.getSelectedChart().getPlot())); + } + + protected void refreshContentPane(AbstractTableDataContentPane contentPane) { if(dataContentPane != null) { remove(dataContentPane); } - dataContentPane = getContentPane(collection.getSelectedChart().getPlot()); + dataContentPane = contentPane; if(dataContentPane != null) { add(dataContentPane, BorderLayout.CENTER); } } - /** - * 更新界面属性 + * 更新界面属性 */ public void populateBean(ChartCollection collection) { if(collection == null) { return; } TableDataDefinition data = (TableDataDefinition)collection.getSelectedChart().getFilterDefinition(); + populateDSName(data); + if(dataContentPane != null) { + dataContentPane.populateBean(collection); + } + } + protected void populateDSName(TableDataDefinition dataDefinition){ + TableData tableData = null; - if(data != null) { - tableData = data.getTableData(); + if(dataDefinition != null) { + tableData = dataDefinition.getTableData(); } onSelectTableData(); checkBoxUse(); tableDataPane.populateBean(tableData); - if(dataContentPane != null) { - dataContentPane.populateBean(collection); - } } /** @@ -141,6 +152,10 @@ public class TableDataPane extends FurtherBasicBeanPane{ dataContentPane.updateBean(collection); } TopDefinition dataDefinition = (TopDefinition)collection.getSelectedChart().getFilterDefinition(); + updateDSName(dataDefinition); + } + + protected void updateDSName(TopDefinition dataDefinition) { if(dataDefinition instanceof TableDataDefinition) { TableDataWrapper tableDataWrapper = tableDataPane.getTableDataWrapper(); if (dataDefinition != null && tableDataWrapper != null){ From 23566ed6ba492fa846b83bd88241474317186e6c Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 19 Apr 2017 16:39:06 +0800 Subject: [PATCH 39/60] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E6=88=AA=E8=8E=B7=E6=A8=A1=E6=9D=BF=E4=BF=A1=E6=81=AF=E6=94=B6?= =?UTF-8?q?=E9=9B=86=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=AF=BC=E8=87=B4=E6=A8=A1=E6=9D=BF=E6=89=93=E4=B8=8D?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/templateinfo/TemplateInfoCollector.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index e5c6688ec9..f8e985f667 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -67,16 +67,8 @@ public class TemplateInfoCollector implements Serializable { try{ ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile())); instance = (TemplateInfoCollector) is.readObject(); - } catch (FileNotFoundException ex) { - // 如果之前没有存储过,则创建新对象 + } catch (Exception ex) { instance = new TemplateInfoCollector(); - } catch (InvalidClassException ex) { - // 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖) - // 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现 - instance = new TemplateInfoCollector(); - } - catch (Exception ex) { - FRLogger.getLogger().error(ex.getMessage(), ex); } } return instance; From ffc2a088efe9c3cf3903615eea584cb1b245d0bf Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 19 Apr 2017 18:46:25 +0800 Subject: [PATCH 40/60] =?UTF-8?q?REPORT-1344=20=E8=A1=A8=E5=8D=95=E7=BF=BB?= =?UTF-8?q?=E9=A1=B5=E6=94=B9=E8=89=AF=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/XElementCase.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 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 3a077e57a8..af268e9843 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -10,11 +10,9 @@ import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.*; -import com.fr.design.mainframe.widget.editors.BooleanEditor; +import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; -import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; -import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; @@ -83,6 +81,13 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetName", this.data.getClass()) .setI18NName(Inter.getLocText("Form-Widget_Name")), + new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( + Inter.getLocText("FR-Designer_Widget-Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + makeVisible(toData().isVisible());} + }), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( WLayoutBorderStyleEditor.class).setI18NName( Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") @@ -92,11 +97,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void propertyChange() { initStyle(); } + }), new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) .setI18NName(Inter.getLocText("FR-Layout_Padding")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class) + new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) .setI18NName(Inter.getLocText("Form-EC_toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; From e35d5ee8f7a04fd4a449af136bcbeaca286a2aac Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Wed, 19 Apr 2017 22:05:52 +0800 Subject: [PATCH 41/60] =?UTF-8?q?report-1945=20frm=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/FormSelectionUtils.java | 34 +++++++------------ 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java index 1978e8432b..b288ec2029 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java @@ -25,6 +25,7 @@ public class FormSelectionUtils { //组件重命名后缀 private static final String POSTFIX = "_c"; + private FormSelectionUtils() { } @@ -132,29 +133,18 @@ public class FormSelectionUtils { XLayoutContainer container = layoutAdapter.getContainer(); boolean xOut = x < 0 || x + copiedCreator.getWidth() / 2 + xoffset > container.getWidth(); boolean yOut = y < 0 || y + copiedCreator.getHeight() / 2 + yoffset > container.getHeight(); - /* - * 组件原始位置位于布局的右下角, - * 和布局右下边界线紧挨, - * 粘贴时组件在原始位置向左错开20像素。 - * x,y同时越界 - */ - if (xOut && yOut) { - //向左偏移 - x = container.getWidth() - copiedCreator.getWidth() / 2 - DELAY_X_Y - xoffset; + + y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; + boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset); + if (xOut) { + if (isEdge) { + //向左偏移 + x = container.getWidth() - copiedCreator.getWidth() / 2 - DELAY_X_Y - xoffset; + } //紧贴下边界 - y = container.getHeight() - copiedCreator.getHeight() / 2 - yoffset; - return new Point(x, y); - } - /* - * 组件原始位置与布局边界距离小于20像素(下边界&右边界同时小于或者任意一个边界小于), - * 则粘贴时距离小于20像素一侧直接贴近布局边界, - * 距离大于20像素的一侧正常错开。 - * x,y中只有一个越界 - */ - if ((xOut || yOut)) { - x = xOut ? container.getWidth() - copiedCreator.getWidth() / 2 - xoffset : x; - y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; - return new Point(x, y); + else { + x = container.getWidth() - copiedCreator.getWidth() / 2 - xoffset; + } } } return new Point(x, y); From ffab31c3d9771ec7ba92104936fcdc298c17792e Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 20 Apr 2017 10:01:33 +0800 Subject: [PATCH 42/60] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A2=AB=E8=AF=AF=E6=9D=80=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/designer/creator/XElementCase.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 3a077e57a8..7eb967a9f7 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -83,6 +83,14 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetName", this.data.getClass()) .setI18NName(Inter.getLocText("Form-Widget_Name")), + new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( + Inter.getLocText("FR-Designer_Widget-Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + makeVisible(toData().isVisible()); + } + }), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( WLayoutBorderStyleEditor.class).setI18NName( Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") From 46b6f5c880e62de970c46ba14de3b0a90b7f098f Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 21 Apr 2017 13:52:21 +0800 Subject: [PATCH 43/60] =?UTF-8?q?REPORT-1344=20=E5=91=BD=E5=90=8D=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/designer/creator/XElementCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 af268e9843..56aca1c43a 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -102,7 +102,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) .setI18NName(Inter.getLocText("FR-Layout_Padding")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) + new CRPropertyDescriptor("toolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) .setI18NName(Inter.getLocText("Form-EC_toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; From 92d1f8209cce7d6e95de62b02a2d75d95d34392f Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 21 Apr 2017 15:43:47 +0800 Subject: [PATCH 44/60] =?UTF-8?q?REPORT-2368=20=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E4=BA=86=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E8=A7=81=EF=BC=8C=E5=9C=A8=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B8=8A=E8=BF=98=E6=98=AF=E5=8F=AF=E8=A7=81=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/widget/CellWidgetCardPane.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/designer/src/com/fr/design/widget/CellWidgetCardPane.java b/designer/src/com/fr/design/widget/CellWidgetCardPane.java index 8ba9d32350..12f3137b40 100644 --- a/designer/src/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer/src/com/fr/design/widget/CellWidgetCardPane.java @@ -88,15 +88,6 @@ public class CellWidgetCardPane extends BasicPane { this.tabbedPane.setEnabled(true); } - attriTabPane.remove(widgetPropertyPane); - widgetPropertyPane = new BasicWidgetPropertySettingPane(); - JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8)); - JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties")); - northPane.add(basic); - basic.add(widgetPropertyPane); - attriTabPane.add(northPane, BorderLayout.NORTH); - WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { @Override public void did(DataCreatorUI ui, String cardName) { From b5024a0547fc23b908a7a645a6eee15cd4bb6f28 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 21 Apr 2017 16:27:51 +0800 Subject: [PATCH 45/60] =?UTF-8?q?REPORT-2368=20=E4=BF=AE=E6=94=B9=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E8=AE=BE=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=AF=B9=E2=80=9C?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E5=B1=9E=E6=80=A7=E2=80=9D=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/widget/CellWidgetCardPane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/widget/CellWidgetCardPane.java b/designer/src/com/fr/design/widget/CellWidgetCardPane.java index 12f3137b40..d286cc1900 100644 --- a/designer/src/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer/src/com/fr/design/widget/CellWidgetCardPane.java @@ -67,7 +67,12 @@ public class CellWidgetCardPane extends BasicPane { treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); widgetPropertyPane = new BasicWidgetPropertySettingPane(); - attriTabPane.add(widgetPropertyPane, BorderLayout.NORTH); + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8)); + JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties")); + northPane.add(basic); + basic.add(widgetPropertyPane); + attriTabPane.add(northPane, BorderLayout.NORTH); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriTabPane.add(attriCardPane, BorderLayout.CENTER); attriCardLayout = (CardLayout) attriCardPane.getLayout(); From c93986c3973154ff6861d7d75863f019fc4ef353 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 24 Apr 2017 09:20:52 +0800 Subject: [PATCH 46/60] =?UTF-8?q?REPORT-2273=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E=E6=8E=A5=E6=88=90?= =?UTF-8?q?=E5=8A=9F=EF=BC=8C=E9=A2=84=E8=A7=88=E6=8A=A5=E9=94=99=EF=BC=8C?= =?UTF-8?q?datasourcexml=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/server/ConnectionListAction.java | 345 +++++++++--------- .../connect/ConnectionComboBoxPanel.java | 266 +++++++------- .../datapane/connect/ConnectionListPane.java | 324 ++++++++-------- .../connect/ConnectionManagerPane.java | 155 ++++---- .../datapane/connect/ConnectionShowPane.java | 15 + 5 files changed, 569 insertions(+), 536 deletions(-) create mode 100644 designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java diff --git a/designer_base/src/com/fr/design/actions/server/ConnectionListAction.java b/designer_base/src/com/fr/design/actions/server/ConnectionListAction.java index e24826b50b..68e6057575 100644 --- a/designer_base/src/com/fr/design/actions/server/ConnectionListAction.java +++ b/designer_base/src/com/fr/design/actions/server/ConnectionListAction.java @@ -1,171 +1,176 @@ -package com.fr.design.actions.server; - -import com.fr.base.BaseUtils; -import com.fr.base.Env; -import com.fr.base.FRContext; -import com.fr.base.ModifiedTable; -import com.fr.data.impl.Connection; -import com.fr.dav.LocalEnv; -import com.fr.design.actions.UpdateAction; -import com.fr.design.data.datapane.connect.ConnectionManagerPane; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.DesignerFrame; -import com.fr.design.menu.MenuKeySet; -import com.fr.file.DatasourceManager; -import com.fr.file.DatasourceManagerProvider; -import com.fr.general.Inter; - -import javax.swing.*; -import java.awt.event.ActionEvent; -import java.util.HashMap; - -/** - * DatasourceList Action - */ -public class ConnectionListAction extends UpdateAction { - private static final int BYTENUM = 1444; - - public ConnectionListAction() { - this.setMenuKeySet(DEFINE_DATA_CONNECTION); - this.setName(getMenuKeySet().getMenuKeySetName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/connection.png")); - } - - public static final MenuKeySet DEFINE_DATA_CONNECTION = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'D'; - } - - @Override - public String getMenuName() { - return Inter.getLocText("Server-Define_Data_Connection"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; - - /** - * 执行动作 - * - * @param evt 事件 - */ - public void actionPerformed(ActionEvent evt) { - DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); - final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); - final DatasourceManager backupManager = datasourceManager.getBackUpManager(); - final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() { - public void complete() { - populate(datasourceManager); - } - - protected void renameConnection(String oldName, String newName) { - datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName); - } - }; - final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null); - databaseListDialog.addDialogActionListener(new DialogActionAdapter() { - public void doOk() { - if (!databaseManagerPane.isNamePermitted()) { - databaseListDialog.setDoOKSucceed(false); - return; - } - if (!doWithDatasourceManager(datasourceManager, backupManager, databaseManagerPane, databaseListDialog)) { - //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面 - return; - } - // marks:保存数据 - writeFile(datasourceManager); - } - - public void doCancel() { - datasourceManager.synchronizedWithServer(); - } - }); - databaseListDialog.setVisible(true); - } - - - private void writeFile(DatasourceManagerProvider datasourceManager) { - Env currentEnv = FRContext.getCurrentEnv(); - try { - boolean isSuccess = currentEnv.writeResource(datasourceManager); - if (!isSuccess) { - throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist")); - } - } catch (Exception e) { - throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist")); - } - DesignerContext.getDesignerBean("databasename").refreshBeanElement(); - } - - /** - * 是否正常更新完datasourceManager - * - * @param datasourceManager - * @param databaseManagerPane - * @return - */ - private boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager backupManager, - ConnectionManagerPane databaseManagerPane, BasicDialog databaseListDialog) { - databaseManagerPane.update(datasourceManager); - HashMap modifyDetails = datasourceManager.getConnectionModifyDetails(); - modifyDetails.clear(); - Env currentEnv = FRContext.getCurrentEnv(); - ModifiedTable localModifiedTable = datasourceManager.checkConnectionModifyTable(backupManager, currentEnv.getUserID()); - boolean isFailed = false; - if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) { - //如果是本地,并且有远程用户时则更新自己的修改表 - datasourceManager.updateSelfConnectionTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER); - } else { - if (!currentEnv.isSupportLocalFileOperate()) { - //如果是远程,则去取服务器的最新的修改表,检查有没有冲突 - ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.CONNECTION); - if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) { - //有冲突,进行提示 - String title = Inter.getLocText(new String[]{"Select", "Single", "Setting"}); - int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), localModifiedTable.getWaringMessage(), title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); - if (returnVal == JOptionPane.YES_OPTION) { - //点击是,进行相应刷新去冲突 - datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.CONNECTION); - //要是有重命名冲突的,则对详细的修改表先进行修改 - datasourceManager.doWithConnectionConflict(localModifiedTable); - localModifiedTable.removeConfilct(); - modifyDetails.clear(); - //更新面板 - databaseManagerPane.populate(datasourceManager); - } else { - //更新失败,继续停留页面 - isFailed = true; - } - - } - } - } - //存在请重命名则不能更新 - int index = datasourceManager.isConnectionMapContainsRename(); - if (index != -1) { - isFailed = true; - databaseManagerPane.setSelectedIndex(index); - } - databaseListDialog.setDoOKSucceed(!isFailed); - //如果修改成功,则去远程端增量修改修改表 - if (!isFailed && !currentEnv.isSupportLocalFileOperate()) { - currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.CONNECTION); - localModifiedTable.clear(); - modifyDetails.clear(); - } - return !isFailed; - } - - - public void update() { - this.setEnabled(true); - } +package com.fr.design.actions.server; + +import com.fr.base.BaseUtils; +import com.fr.base.Env; +import com.fr.base.FRContext; +import com.fr.base.ModifiedTable; +import com.fr.data.impl.Connection; +import com.fr.dav.LocalEnv; +import com.fr.design.actions.UpdateAction; +import com.fr.design.data.datapane.connect.ConnectionManagerPane; +import com.fr.design.data.datapane.connect.ConnectionShowPane; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.menu.MenuKeySet; +import com.fr.file.DatasourceManager; +import com.fr.file.DatasourceManagerProvider; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.util.HashMap; + +/** + * DatasourceList Action + */ +public class ConnectionListAction extends UpdateAction { + + public ConnectionListAction() { + this.setMenuKeySet(DEFINE_DATA_CONNECTION); + this.setName(getMenuKeySet().getMenuKeySetName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/connection.png")); + } + + public static final MenuKeySet DEFINE_DATA_CONNECTION = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'D'; + } + + @Override + public String getMenuName() { + return Inter.getLocText("Server-Define_Data_Connection"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; + + /** + * 执行动作 + * + * @param evt 事件 + */ + public void actionPerformed(ActionEvent evt) { + DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); + final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); + final DatasourceManager backupManager = datasourceManager.getBackUpManager(); + final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() { + public void complete() { + populate(datasourceManager); + } + + protected void renameConnection(String oldName, String newName) { + datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName); + } + }; + final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null); + databaseListDialog.addDialogActionListener(new DialogActionAdapter() { + public void doOk() { + if (!databaseManagerPane.isNamePermitted()) { + databaseListDialog.setDoOKSucceed(false); + return; + } + if (!doWithDatasourceManager(datasourceManager, backupManager, databaseManagerPane, databaseListDialog)) { + //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面 + return; + } + // marks:保存数据 + writeFile(datasourceManager); + } + + public void doCancel() { + datasourceManager.synchronizedWithServer(); + } + }); + databaseListDialog.setVisible(true); + } + + + /** + * @param datasourceManager + */ + public static void writeFile(DatasourceManagerProvider datasourceManager) { + Env currentEnv = FRContext.getCurrentEnv(); + try { + boolean isSuccess = currentEnv.writeResource(datasourceManager); + if (!isSuccess) { + throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist")); + } + } catch (Exception e) { + throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist")); + } + DesignerContext.getDesignerBean("databasename").refreshBeanElement(); + } + + /** + * 更新datasourceManager + * + * @param datasourceManager datasource管理对象 + * @param backupManager datasource管理对象备份 + * @param connectionShowPane datasource面板 + * @param databaseListDialog datasource管理对话框 + * @return boolean 是否更新成功 + */ + public static boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager + backupManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) { + connectionShowPane.update(datasourceManager); + HashMap modifyDetails = datasourceManager.getConnectionModifyDetails(); + modifyDetails.clear(); + Env currentEnv = FRContext.getCurrentEnv(); + ModifiedTable localModifiedTable = datasourceManager.checkConnectionModifyTable(backupManager, currentEnv.getUserID()); + boolean isFailed = false; + if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) { + //如果是本地,并且有远程用户时则更新自己的修改表 + datasourceManager.updateSelfConnectionTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER); + } else { + if (!currentEnv.isSupportLocalFileOperate()) { + //如果是远程,则去取服务器的最新的修改表,检查有没有冲突 + ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.CONNECTION); + if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) { + //有冲突,进行提示 + String title = Inter.getLocText(new String[]{"Select", "Single", "Setting"}); + int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), localModifiedTable.getWaringMessage(), title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); + if (returnVal == JOptionPane.YES_OPTION) { + //点击是,进行相应刷新去冲突 + datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.CONNECTION); + //要是有重命名冲突的,则对详细的修改表先进行修改 + datasourceManager.doWithConnectionConflict(localModifiedTable); + localModifiedTable.removeConfilct(); + modifyDetails.clear(); + //更新面板 + connectionShowPane.populate(datasourceManager); + } else { + //更新失败,继续停留页面 + isFailed = true; + } + + } + } + } + //存在请重命名则不能更新 + int index = datasourceManager.isConnectionMapContainsRename(); + if (index != -1) { + isFailed = true; + connectionShowPane.setSelectedIndex(index); + } + databaseListDialog.setDoOKSucceed(!isFailed); + //如果修改成功,则去远程端增量修改修改表 + if (!isFailed && !currentEnv.isSupportLocalFileOperate()) { + currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.CONNECTION); + localModifiedTable.clear(); + modifyDetails.clear(); + } + return !isFailed; + } + + + public void update() { + this.setEnabled(true); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index cc75b7ca22..c80970bd9c 100644 --- a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -1,128 +1,140 @@ -package com.fr.design.data.datapane.connect; - -import com.fr.base.Env; -import com.fr.base.FRContext; -import com.fr.data.impl.AbstractDatabaseConnection; -import com.fr.data.impl.Connection; -import com.fr.data.impl.NameDatabaseConnection; -import com.fr.design.DesignerEnvManager; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.file.DatasourceManager; -import com.fr.file.DatasourceManagerProvider; -import com.fr.general.ComparatorUtils; -import com.fr.stable.StringUtils; - -import javax.swing.*; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.List; - -/** - * 选择数据连接的下拉框 - * - * @editor zhou - * @since 2012-3-28下午3:02:30 - */ -public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { - /** - * - */ - private static final long serialVersionUID = 1L; - private Class cls; // 所取的Connection都是cls及其子类 - private java.util.List nameList = new ArrayList(); - - public ConnectionComboBoxPanel(Class cls) { - super(); - - this.cls = cls; - - // alex:添加item change监听,当改变时改变DesignerEnvManager中的最近选中的数据连接 - this.itemComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - String selected = ConnectionComboBoxPanel.this.getSelectedItem(); - if (StringUtils.isNotBlank(selected)) { - DesignerEnvManager.getEnvManager().setRecentSelectedConnection(selected); - } - } - }); - refreshItems(); - } - - /* - * 刷新ComboBox.items - */ - protected java.util.Iterator items() { - nameList = new ArrayList(); - - DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance(); - java.util.Iterator nameIt = mgr.getConnectionNameIterator(); - while (nameIt.hasNext()) { - String conName = nameIt.next(); - Connection connection = mgr.getConnection(conName); - filterConnection(connection, conName, nameList); - } - - return nameList.iterator(); - } - - protected void filterConnection(Connection connection, String conName, List nameList) { - connection.addConnection(nameList, conName, new Class[]{AbstractDatabaseConnection.class}); - } - - - public int getConnectionSize() { - return nameList.size(); - } - - public String getConnection(int i) { - return nameList.get(i); - } - - /* - * 弹出对话框编辑Items - */ - protected void editItems() { - final ConnectionListPane connectionListPane = new ConnectionListPane(); - final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); - connectionListPane.populate(datasourceManager); - BasicDialog connectionListDialog = connectionListPane.showLargeWindow( - SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), new DialogActionAdapter() { - public void doOk() { - connectionListPane.update(datasourceManager); - // marks:保存数据 - Env currentEnv = FRContext.getCurrentEnv(); - try { - currentEnv.writeResource(datasourceManager); - } catch (Exception ex) { - FRContext.getLogger().error(ex.getMessage(), ex); - } - } - }); - connectionListDialog.setVisible(true); - refreshItems(); - } - - public void populate(com.fr.data.impl.Connection connection) { - editButton.setEnabled(FRContext.getCurrentEnv().isRoot()); - if (connection instanceof NameDatabaseConnection) { - this.setSelectedItem(((NameDatabaseConnection) connection).getName()); - } else { - String s = DesignerEnvManager.getEnvManager().getRecentSelectedConnection(); - if (StringUtils.isNotBlank(s)) { - for (int i = 0; i < this.getConnectionSize(); i++) { - String t = this.getConnection(i); - if (ComparatorUtils.equals(s, t)) { - this.setSelectedItem(s); - break; - } - } - } - // alex:如果这个ComboBox还是没有选中,那么选中第一个 - if (StringUtils.isBlank(this.getSelectedItem()) && this.getConnectionSize() > 0) { - this.setSelectedItem(this.getConnection(0)); - } - } - } +package com.fr.design.data.datapane.connect; + +import com.fr.base.FRContext; +import com.fr.data.impl.AbstractDatabaseConnection; +import com.fr.data.impl.Connection; +import com.fr.data.impl.NameDatabaseConnection; +import com.fr.design.DesignerEnvManager; +import com.fr.design.actions.server.ConnectionListAction; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.file.DatasourceManager; +import com.fr.file.DatasourceManagerProvider; +import com.fr.general.ComparatorUtils; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * 选择数据连接的下拉框 + * + * @editor zhou + * @since 2012-3-28下午3:02:30 + */ +public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { + /** + * + */ + private static final long serialVersionUID = 1L; + private Class cls; // 所取的Connection都是cls及其子类 + private List nameList = new ArrayList(); + + public ConnectionComboBoxPanel(Class cls) { + super(); + + this.cls = cls; + + // alex:添加item change监听,当改变时改变DesignerEnvManager中的最近选中的数据连接 + this.itemComboBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + String selected = ConnectionComboBoxPanel.this.getSelectedItem(); + if (StringUtils.isNotBlank(selected)) { + DesignerEnvManager.getEnvManager().setRecentSelectedConnection(selected); + } + } + }); + refreshItems(); + } + + /* + * 刷新ComboBox.items + */ + protected Iterator items() { + nameList = new ArrayList(); + + DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance(); + Iterator nameIt = mgr.getConnectionNameIterator(); + while (nameIt.hasNext()) { + String conName = nameIt.next(); + Connection connection = mgr.getConnection(conName); + filterConnection(connection, conName, nameList); + } + + return nameList.iterator(); + } + + protected void filterConnection(Connection connection, String conName, List nameList) { + connection.addConnection(nameList, conName, new Class[]{AbstractDatabaseConnection.class}); + } + + public int getConnectionSize() { + return nameList.size(); + } + + public String getConnection(int i) { + return nameList.get(i); + } + + /* + * 弹出对话框编辑Items + */ + protected void editItems() { + final ConnectionListPane connectionListPane = new ConnectionListPane(); + final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance(); + final DatasourceManager backupManager = datasourceManager.getBackUpManager(); + connectionListPane.populate(datasourceManager); + final BasicDialog connectionListDialog = connectionListPane.showLargeWindow( + SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), null); + connectionListDialog.addDialogActionListener(new DialogActionAdapter() { + public void doOk() { + if (!connectionListPane.isNamePermitted()) { + connectionListDialog.setDoOKSucceed(false); + return; + } + if (!ConnectionListAction.doWithDatasourceManager(datasourceManager, backupManager, connectionListPane, + connectionListDialog)) { + //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面 + return; + } + // marks:保存数据 + ConnectionListAction.writeFile(datasourceManager); + } + + public void doCancel() { + datasourceManager.synchronizedWithServer(); + } + }); + connectionListDialog.setVisible(true); + refreshItems(); + } + + /** + * @param connection 数据库链接 + */ + public void populate(Connection connection) { + editButton.setEnabled(FRContext.getCurrentEnv().isRoot()); + if (connection instanceof NameDatabaseConnection) { + this.setSelectedItem(((NameDatabaseConnection) connection).getName()); + } else { + String s = DesignerEnvManager.getEnvManager().getRecentSelectedConnection(); + if (StringUtils.isNotBlank(s)) { + for (int i = 0; i < this.getConnectionSize(); i++) { + String t = this.getConnection(i); + if (ComparatorUtils.equals(s, t)) { + this.setSelectedItem(s); + break; + } + } + } + // alex:如果这个ComboBox还是没有选中,那么选中第一个 + if (StringUtils.isBlank(this.getSelectedItem()) && this.getConnectionSize() > 0) { + this.setSelectedItem(this.getConnection(0)); + } + } + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java index 8d0f2aa392..1cdf1cb1a9 100644 --- a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -1,163 +1,163 @@ -package com.fr.design.data.datapane.connect; - -import com.fr.data.impl.Connection; -import com.fr.data.impl.JDBCDatabaseConnection; -import com.fr.data.impl.JNDIDatabaseConnection; -import com.fr.design.ExtraDesignClassManager; -import com.fr.design.fun.ConnectionProvider; -import com.fr.design.gui.controlpane.JListControlPane; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.file.DatasourceManagerProvider; -import com.fr.general.ComparatorUtils; -import com.fr.general.Inter; -import com.fr.general.NameObject; -import com.fr.stable.ArrayUtils; -import com.fr.stable.Nameable; -import com.fr.stable.StringUtils; -import com.fr.stable.core.PropertyChangeAdapter; - -import javax.swing.*; -import java.util.*; - -/** - * Connection List Pane. - */ -public class ConnectionListPane extends JListControlPane { - public static final String TITLE_NAME = Inter.getLocText("Server-Define_Data_Connection"); - private boolean isNamePermitted = true; - private HashMap renameMap = new HashMap(); - - public ConnectionListPane() { - renameMap.clear(); - this.addEditingListner(new PropertyChangeAdapter() { - public void propertyChange() { - isNamePermitted = true; - String[] allListNames = nameableList.getAllNames(); - allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; - String tempName = getEditingName(); - if (StringUtils.isEmpty(tempName)) { - String[] warning = new String[]{"NOT_NULL_Des", "Please_Rename"}; - String[] sign = new String[]{",", "!"}; - nameableList.stopEditing(); - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), Inter.getLocText(warning, sign)); - setWarnigText(editingIndex); - isNamePermitted = false; - return; - } - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeted(new List[]{Arrays.asList(allListNames)}, tempName)) { - isNamePermitted = false; - nameableList.stopEditing(); - String message = Inter.getLocText(new String[]{"Utils-has_been_existed", "DashBoard-ConnectionList", "Please_Rename"}, new String[]{"", tempName + ",", "!"}); - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message); - setWarnigText(editingIndex); - } - if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) { - rename(selectedName, tempName); - } - - } - }); - } - - - protected void rename(String oldName, String newName) { - if (renameMap.containsKey(selectedName)) { - renameMap.remove(selectedName); - } - renameMap.put(selectedName, newName); - } - - /** - * 名字是否允许 - * - * @return 是/否 - */ - public boolean isNamePermitted() { - return isNamePermitted; - } - - /** - * 检查按钮可用状态 Check button enabled. - */ - public void checkButtonEnabled() { - super.checkButtonEnabled(); - isNamePermitted = !isContainsRename(); - } - - - public HashMap getRenameMap() { - return renameMap; - } - - /** - * 创建菜单项 - * - * @return 菜单项 - */ - public NameableCreator[] createNameableCreators() { - NameableCreator[] creators = new NameableCreator[]{new NameObjectCreator( - "JDBC", - "/com/fr/design/images/data/source/jdbcTableData.png", - JDBCDatabaseConnection.class, - DatabaseConnectionPane.JDBC.class - ), new NameObjectCreator( - "JNDI", - "/com/fr/design/images/data/source/jdbcTableData.png", - JNDIDatabaseConnection.class, - DatabaseConnectionPane.JNDI.class - )}; - Set pluginCreators = ExtraDesignClassManager.getInstance().getArray(ConnectionProvider.XML_TAG); - for (ConnectionProvider provider : pluginCreators) { - NameObjectCreator creator = new NameObjectCreator( - provider.nameForConnection(), - provider.iconPathForConnection(), - provider.classForConnection(), - provider.appearanceForConnection() - ); - creators = ArrayUtils.add(creators, creator); - } - - return creators; - } - - @Override - protected String title4PopupWindow() { - return TITLE_NAME; - } - - /** - * Populate. - * - * @param datasourceManager the new datasourceManager. - */ - public void populate(DatasourceManagerProvider datasourceManager) { - Iterator nameIt = datasourceManager.getConnectionNameIterator(); - - List nameObjectList = new ArrayList(); - while (nameIt.hasNext()) { - String name = nameIt.next(); - nameObjectList.add(new NameObject(name, datasourceManager.getConnection(name))); - } - this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); - - } - - /** - * Update. - */ - public void update(DatasourceManagerProvider datasourceManager) { - // Nameable[]居然不能强转成NameObject[],一定要这么写... - Nameable[] res = this.update(); - NameObject[] res_array = new NameObject[res.length]; - java.util.Arrays.asList(res).toArray(res_array); - - datasourceManager.clearAllConnection(); - - for (int i = 0; i < res_array.length; i++) { - NameObject nameObject = res_array[i]; - datasourceManager.putConnection(nameObject.getName(), (Connection) nameObject.getObject()); - } - } +package com.fr.design.data.datapane.connect; + +import com.fr.data.impl.Connection; +import com.fr.data.impl.JDBCDatabaseConnection; +import com.fr.data.impl.JNDIDatabaseConnection; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.ConnectionProvider; +import com.fr.design.gui.controlpane.JListControlPane; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.file.DatasourceManagerProvider; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.stable.ArrayUtils; +import com.fr.stable.Nameable; +import com.fr.stable.StringUtils; +import com.fr.stable.core.PropertyChangeAdapter; + +import javax.swing.*; +import java.util.*; + +/** + * Connection List Pane. + */ +public class ConnectionListPane extends JListControlPane implements ConnectionShowPane { + public static final String TITLE_NAME = Inter.getLocText("Server-Define_Data_Connection"); + private boolean isNamePermitted = true; + private HashMap renameMap = new HashMap(); + + public ConnectionListPane() { + renameMap.clear(); + this.addEditingListner(new PropertyChangeAdapter() { + public void propertyChange() { + isNamePermitted = true; + String[] allListNames = nameableList.getAllNames(); + allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; + String tempName = getEditingName(); + if (StringUtils.isEmpty(tempName)) { + String[] warning = new String[]{"NOT_NULL_Des", "Please_Rename"}; + String[] sign = new String[]{",", "!"}; + nameableList.stopEditing(); + JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), Inter.getLocText(warning, sign)); + setWarnigText(editingIndex); + isNamePermitted = false; + return; + } + if (!ComparatorUtils.equals(tempName, selectedName) + && isNameRepeted(new List[]{Arrays.asList(allListNames)}, tempName)) { + isNamePermitted = false; + nameableList.stopEditing(); + String message = Inter.getLocText(new String[]{"Utils-has_been_existed", "DashBoard-ConnectionList", "Please_Rename"}, new String[]{"", tempName + ",", "!"}); + JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message); + setWarnigText(editingIndex); + } + if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) { + rename(selectedName, tempName); + } + + } + }); + } + + + protected void rename(String oldName, String newName) { + if (renameMap.containsKey(selectedName)) { + renameMap.remove(selectedName); + } + renameMap.put(selectedName, newName); + } + + /** + * 名字是否允许 + * + * @return 是/否 + */ + public boolean isNamePermitted() { + return isNamePermitted; + } + + /** + * 检查按钮可用状态 Check button enabled. + */ + public void checkButtonEnabled() { + super.checkButtonEnabled(); + isNamePermitted = !isContainsRename(); + } + + + public HashMap getRenameMap() { + return renameMap; + } + + /** + * 创建菜单项 + * + * @return 菜单项 + */ + public NameableCreator[] createNameableCreators() { + NameableCreator[] creators = new NameableCreator[]{new NameObjectCreator( + "JDBC", + "/com/fr/design/images/data/source/jdbcTableData.png", + JDBCDatabaseConnection.class, + DatabaseConnectionPane.JDBC.class + ), new NameObjectCreator( + "JNDI", + "/com/fr/design/images/data/source/jdbcTableData.png", + JNDIDatabaseConnection.class, + DatabaseConnectionPane.JNDI.class + )}; + Set pluginCreators = ExtraDesignClassManager.getInstance().getArray(ConnectionProvider.XML_TAG); + for (ConnectionProvider provider : pluginCreators) { + NameObjectCreator creator = new NameObjectCreator( + provider.nameForConnection(), + provider.iconPathForConnection(), + provider.classForConnection(), + provider.appearanceForConnection() + ); + creators = ArrayUtils.add(creators, creator); + } + + return creators; + } + + @Override + protected String title4PopupWindow() { + return TITLE_NAME; + } + + /** + * Populate. + * + * @param datasourceManager the new datasourceManager. + */ + public void populate(DatasourceManagerProvider datasourceManager) { + Iterator nameIt = datasourceManager.getConnectionNameIterator(); + + List nameObjectList = new ArrayList(); + while (nameIt.hasNext()) { + String name = nameIt.next(); + nameObjectList.add(new NameObject(name, datasourceManager.getConnection(name))); + } + this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); + + } + + /** + * Update. + */ + public void update(DatasourceManagerProvider datasourceManager) { + // Nameable[]居然不能强转成NameObject[],一定要这么写... + Nameable[] res = this.update(); + NameObject[] res_array = new NameObject[res.length]; + java.util.Arrays.asList(res).toArray(res_array); + + datasourceManager.clearAllConnection(); + + for (int i = 0; i < res_array.length; i++) { + NameObject nameObject = res_array[i]; + datasourceManager.putConnection(nameObject.getName(), (Connection) nameObject.getObject()); + } + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java index ace69ff692..70d4933faf 100644 --- a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java +++ b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java @@ -1,78 +1,79 @@ -package com.fr.design.data.datapane.connect; - -import com.fr.base.FRContext; -import com.fr.design.gui.frpane.LoadingBasicPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.file.DatasourceManagerProvider; -import com.fr.general.Inter; -import com.fr.stable.project.ProjectConstants; - -import javax.swing.*; -import java.awt.*; -import java.io.File; -import java.util.HashMap; - -public class ConnectionManagerPane extends LoadingBasicPane { - private UITextField connectionTextField; - private ConnectionListPane connectionListPane; - - protected void initComponents(JPanel container) { - container.setLayout(FRGUIPaneFactory.createBorderLayout()); - - JPanel connectionPathPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - container.add(connectionPathPane, BorderLayout.NORTH); - - connectionPathPane.setBorder(BorderFactory.createEmptyBorder(6, 2, 2, 2)); - - connectionPathPane.add(new UILabel(Inter.getLocText("FR-Designer_Save_Path") + ":"), BorderLayout.WEST); - this.connectionTextField = new UITextField(); - connectionPathPane.add(connectionTextField, BorderLayout.CENTER); - this.connectionTextField.setEditable(false); - connectionListPane = new ConnectionListPane(){ - protected void rename(String oldName,String newName) { - super.rename(oldName,newName); - renameConnection(oldName,newName); - } - }; - container.add(connectionListPane, BorderLayout.CENTER); - } - - @Override - protected String title4PopupWindow() { - return Inter.getLocText("Server-Define_Data_Connection"); - } - - public HashMap getRenameMap() { - return connectionListPane.getRenameMap(); - } - - public void populate(DatasourceManagerProvider datasourceManager) { - this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME - + File.separator + datasourceManager.fileName()); - this.connectionListPane.populate(datasourceManager); - } - - public void update(DatasourceManagerProvider datasourceManager) { - this.connectionListPane.update(datasourceManager); - } - - /** - * 设置选中项 - * - * @param index 选中项的序列号 - */ - public void setSelectedIndex(int index) { - this.connectionListPane.setSelectedIndex(index); - } - - /** - * 名字是否允许 - * @return 允许返回true - */ - public boolean isNamePermitted() { - return connectionListPane.isNamePermitted(); - } - +package com.fr.design.data.datapane.connect; + +import com.fr.base.FRContext; +import com.fr.design.gui.frpane.LoadingBasicPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.file.DatasourceManagerProvider; +import com.fr.general.Inter; +import com.fr.stable.project.ProjectConstants; + +import javax.swing.*; +import java.awt.*; +import java.io.File; +import java.util.HashMap; + +public class ConnectionManagerPane extends LoadingBasicPane implements ConnectionShowPane { + private UITextField connectionTextField; + private ConnectionListPane connectionListPane; + + protected void initComponents(JPanel container) { + container.setLayout(FRGUIPaneFactory.createBorderLayout()); + + JPanel connectionPathPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + container.add(connectionPathPane, BorderLayout.NORTH); + + connectionPathPane.setBorder(BorderFactory.createEmptyBorder(6, 2, 2, 2)); + + connectionPathPane.add(new UILabel(Inter.getLocText("FR-Designer_Save_Path") + ":"), BorderLayout.WEST); + this.connectionTextField = new UITextField(); + connectionPathPane.add(connectionTextField, BorderLayout.CENTER); + this.connectionTextField.setEditable(false); + connectionListPane = new ConnectionListPane() { + protected void rename(String oldName, String newName) { + super.rename(oldName, newName); + renameConnection(oldName, newName); + } + }; + container.add(connectionListPane, BorderLayout.CENTER); + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("Server-Define_Data_Connection"); + } + + public HashMap getRenameMap() { + return connectionListPane.getRenameMap(); + } + + public void populate(DatasourceManagerProvider datasourceManager) { + this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME + + File.separator + datasourceManager.fileName()); + this.connectionListPane.populate(datasourceManager); + } + + public void update(DatasourceManagerProvider datasourceManager) { + this.connectionListPane.update(datasourceManager); + } + + /** + * 设置选中项 + * + * @param index 选中项的序列号 + */ + public void setSelectedIndex(int index) { + this.connectionListPane.setSelectedIndex(index); + } + + /** + * 名字是否允许 + * + * @return 允许返回true + */ + public boolean isNamePermitted() { + return connectionListPane.isNamePermitted(); + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java new file mode 100644 index 0000000000..ce857ddc65 --- /dev/null +++ b/designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java @@ -0,0 +1,15 @@ +package com.fr.design.data.datapane.connect; + +import com.fr.file.DatasourceManagerProvider; + +/** + * Created by yaoh.wu on 2017/4/22. + * 数据链接显示面板 + */ +public interface ConnectionShowPane { + void update(DatasourceManagerProvider datasourceManager); + + void populate(DatasourceManagerProvider datasourceManager); + + void setSelectedIndex(int index); +} From c86cfd1c1b0275ad3d6b4eafd734869d6891dd55 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 24 Apr 2017 09:21:32 +0800 Subject: [PATCH 47/60] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/FormSelectionUtils.java | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java index 1978e8432b..90945b1e80 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java @@ -132,29 +132,18 @@ public class FormSelectionUtils { XLayoutContainer container = layoutAdapter.getContainer(); boolean xOut = x < 0 || x + copiedCreator.getWidth() / 2 + xoffset > container.getWidth(); boolean yOut = y < 0 || y + copiedCreator.getHeight() / 2 + yoffset > container.getHeight(); - /* - * 组件原始位置位于布局的右下角, - * 和布局右下边界线紧挨, - * 粘贴时组件在原始位置向左错开20像素。 - * x,y同时越界 - */ - if (xOut && yOut) { - //向左偏移 - x = container.getWidth() - copiedCreator.getWidth() / 2 - DELAY_X_Y - xoffset; + + y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; + boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset); + if (xOut) { + if (isEdge) { + //向左偏移 + x = container.getWidth() - copiedCreator.getWidth() / 2 - DELAY_X_Y - xoffset; + } //紧贴下边界 - y = container.getHeight() - copiedCreator.getHeight() / 2 - yoffset; - return new Point(x, y); - } - /* - * 组件原始位置与布局边界距离小于20像素(下边界&右边界同时小于或者任意一个边界小于), - * 则粘贴时距离小于20像素一侧直接贴近布局边界, - * 距离大于20像素的一侧正常错开。 - * x,y中只有一个越界 - */ - if ((xOut || yOut)) { - x = xOut ? container.getWidth() - copiedCreator.getWidth() / 2 - xoffset : x; - y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; - return new Point(x, y); + else { + x = container.getWidth() - copiedCreator.getWidth() / 2 - xoffset; + } } } return new Point(x, y); From c72bb1de5577f4dc1ba591fed5238d69778e76b6 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 24 Apr 2017 16:15:24 +0800 Subject: [PATCH 48/60] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E7=B2=98=E8=B4=B4=EF=BC=8C=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E8=80=83=E8=99=91=E7=9A=84=E7=89=87=E9=9D=A2=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/FormSelectionUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java index 90945b1e80..7a03782c25 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java @@ -133,8 +133,10 @@ public class FormSelectionUtils { boolean xOut = x < 0 || x + copiedCreator.getWidth() / 2 + xoffset > container.getWidth(); boolean yOut = y < 0 || y + copiedCreator.getHeight() / 2 + yoffset > container.getHeight(); + boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset) + && (y - DELAY_X_Y == container.getHeight() - copiedCreator.getHeight() / 2 - yoffset); + y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; - boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset); if (xOut) { if (isEdge) { //向左偏移 From 9a6bc3f93dd325e7c3c46581983f742f26aef02a Mon Sep 17 00:00:00 2001 From: syoki Date: Tue, 25 Apr 2017 18:41:22 +0900 Subject: [PATCH 49/60] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E6=97=A5=E6=96=87=20design=E9=83=A8=E5=88=86=20?= =?UTF-8?q?=E7=AC=AC1-200=E4=B8=AAkey=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20=E5=BA=84=E5=A5=87=20syoki?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/locale/designer_ja_JP.properties | 278 +++++++++--------- 1 file changed, 139 insertions(+), 139 deletions(-) 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 87d0801981..a9b1b3923a 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -1,202 +1,202 @@ # generated time: \u661F\u671F\u56DB \u5341\u4E00\u6708 24 12:02:51 CST 2016 -FR-Designer-BBSLogin_Account=\u30E6\u30FC\u30B6\u30FC\u540D -FR-Designer-BBSLogin_Connection-Failure=\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u73FE\u5728\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u72B6\u614B\u3092\u691C\u67FB\u3057\u3066\u304F\u3060\u3055\u3044 +FR-Designer-BBSLogin_Account=\u30E6\u30FC\u30B6\u30FCID +FR-Designer-BBSLogin_Connection-Failure=\u30CD\u30C3\u30C8\u63A5\u7D9A\u5931\u6557\u3001\u30CD\u30C3\u30C8\u72B6\u614B\u3054\u78BA\u8A8D\u4E0B\u3055\u3044 FR-Designer-BBSLogin_Connection-Failure-Tip=\u30D2\u30F3\u30C8 -FR-Designer-BBSLogin_Forgot-Password=\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5FD8\u308C\u305F +FR-Designer-BBSLogin_Forgot-Password=\u30D1\u30B9\u30EF\u30FC\u30C9\u5FD8\u308C\u305F FR-Designer-BBSLogin_Login=\u30ED\u30B0\u30A4\u30F3 -FR-Designer-BBSLogin_Login-Failure-Tip=\u30E6\u30FC\u30B6\u30FC\u540D\u307E\u305F\u306F\u30D1\u30B9\u30EF\u30FC\u30C9\u30A8\u30E9\u30FC\u3067\u3059\u3002\u518D\u5EA6\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044 +FR-Designer-BBSLogin_Login-Failure-Tip=\u30E6\u30FC\u30B6\u30FCID\u3084\u30D1\u30B9\u30EF\u30FC\u30C9\u30A8\u30E9\u30FC\u3001\u518D\u30ED\u30B0\u30A4\u30F3\u4E0B\u3055\u3044 FR-Designer-BBSLogin_Password=\u30D1\u30B9\u30EF\u30FC\u30C9 -FR-Designer-BBSLogin_Password-Empty-Tip=\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 +FR-Designer-BBSLogin_Password-Empty-Tip=\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u7A7A\u6B04\u306B\u3067\u304D\u307E\u305B\u3093 FR-Designer-BBSLogin_Register-Account=\u30A2\u30AB\u30A6\u30F3\u30C8\u767B\u9332 -FR-Designer-BBSLogin_Switch-Account=\u30A2\u30AB\u30A6\u30F3\u30C8\u5207\u308A\u66FF\u3048 -FR-Designer-BBSLogin_Privite-Message=\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8\u30E1\u30C3\u30BB\u30FC\u30B8 -FR-Designer-BBSLogin_Times=\u6B21 -FR-Designer-BBSLogin_Username-Empty-Tip=\u30E6\u30FC\u30B6\u30FC\u540D\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 -FR-Designer-Basic_More_Color=\u3082\u3063\u3068\u8272 -FR-Designer-Estate_Any=\u4E0D\u9650 +FR-Designer-BBSLogin_Switch-Account=\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u5207\u308A\u66FF\u3048 +FR-Designer-BBSLogin_Privite-Message=\u500B\u4EBA\u30E1\u30C3\u30BB\u30FC\u30B8 +FR-Designer-BBSLogin_Times=\u56DE +FR-Designer-BBSLogin_Username-Empty-Tip=\u30E6\u30FC\u30B6\u30FCID\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093 +FR-Designer-Basic_More_Color=\u305D\u306E\u4ED6\uFF08\u8272\uFF09 +FR-Designer-Estate_Any=\u5236\u9650\u306A\u3057 FR-Designer-Estate_Default_Font=\u30C7\u30D5\u30A9\u30EB\u30C8\u30D5\u30A9\u30F3\u30C8 -FR-Designer-Estate_Default_Null=\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u7A7A\u6B04\u306B\u3059\u308B +FR-Designer-Estate_Default_Null=\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u7A7A FR-Designer-Estate_Default_Text=\u30C7\u30D5\u30A9\u30EB\u30C8\u5024 -FR-Designer-Estate_Parameter_Null_Text=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u7A7A\u6B04\u306B\u3057\u8868\u793A\u3059\u308B -FR-Designer-Estate_Radio-Group=\u4E0D\u52D5\u7523\u696D\u901A\u7528\u30DC\u30BF\u30F3\u30BB\u30C3\u30C8\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB -FR-Designer-Estate_Selected_Font=\u9078\u629E\u3057\u305F\u30D5\u30A9\u30F3\u30C8 -FR-Designer-Estate_Widget_Value=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u5024 -FR-Designer-Layout_Adaptive_Layout=\u81EA\u9069\u5FDC\u914D\u7F6E +FR-Designer-Estate_Parameter_Null_Text=\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u7A7A\u306B\u306A\u308B\u6642\u306E\u8868\u793A\u306F +FR-Designer-Estate_Radio-Group=\u4E0D\u52D5\u7523\u696D\u6C4E\u7528\u30E9\u30B8\u30AA\u30DC\u30BF\u30F3\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8 +FR-Designer-Estate_Selected_Font=\u30D5\u30A9\u30F3\u30C8\u3092\u9078\u629E +FR-Designer-Estate_Widget_Value=\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u5024 +FR-Designer-Layout_Adaptive_Layout=\u81EA\u5DF1\u8ABF\u6574\u30EC\u30A4\u30A2\u30A6\u30C8 FR-Designer-Output_Background_Set=\u80CC\u666F\u8A2D\u5B9A FR-Designer-Output_Default_Background=\u30C7\u30D5\u30A9\u30EB\u30C8\u80CC\u666F -FR-Designer-Output_Excel_Page=Excel\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8(\u30DA\u30FC\u30B8\u5225\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8) -FR-Designer-Output_Excel_Sheet=Excel\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8(\u30DA\u30FC\u30B8\u5225\u30B7\u30FC\u30C8\u5225\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8) -FR-Designer-Output_Excel_Simple=Excel\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8(\u5143\u306E\u307E\u307E\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8) -FR-Designer-Plugin_PluginMarket_Coding=\u30D7\u30E9\u30B0\u30A4\u30F3\u30DE\u30FC\u30B1\u30C3\u30C8\u306F\u958B\u767A\u4E2D\u3067\u3059\u3002\u3054\u671F\u5F85\u304F\u3060\u3055\u3044 -FR-Desinger-Plugin_Updater_UpdateAndUpgrade=\u66F4\u65B0\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8 -FR-Desinger-Plugin_Updater_Checking_Jar_Update=Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u30C1\u30A7\u30C3\u30AF\u66F4\u65B0\u4E2D -FR-Desinger-Plugin_Updater_Checking_Version_Update=\u30D0\u30FC\u30B8\u30E7\u30F3\u30C1\u30A7\u30C3\u30AF\u66F4\u65B0\u4E2D -FR-Desinger-Plugin_Updater_Update=\u66F4\u65B0 -FR-Desinger-Plugin_Updater_Upgrade=\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8 -FR-Desinger-Plugin_Updater_Restore=\u5FA9\u5143 -FR-Desinger-Plugin_Updater_New_Version_Available=\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3\u6709\u308A -FR-Desinger-Plugin_Updater_JarUpdate=Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u66F4\u65B0 -FR-Desinger-Plugin_Updater_VersionUpgrade=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7 -FR-Desinger-Plugin_Updater_Previous_Version=\u65E7\u30D0\u30FC\u30B8\u30E7\u30F3\u307E\u3067\u306B -FR-Desinger-Plugin_Updater_Current_Version=\u73FE\u30D0\u30FC\u30B8\u30E7\u30F3 -FR-Desinger-Plugin_Updater_Not_Install_Version=\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u306F\u306A\u3044 +FR-Designer-Output_Excel_Page=Excel\u51FA\u529B(\u30DA\u30FC\u30B8\u5225) +FR-Designer-Output_Excel_Sheet=Excel\u51FA\u529B(\u30DA\u30FC\u30B8\u5225\u30B7\u30FC\u30C8\u5225) +FR-Designer-Output_Excel_Simple=Excel\u51FA\u529B(\u5143\u306E\u307E\u307E) +FR-Designer-Plugin_PluginMarket_Coding=\u30D7\u30E9\u30B0\u30A4\u30F3\u30B9\u30C8\u30A2\u958B\u767A\u4E2D\u3001\u304A\u5F85\u3061\u4E0B\u3055\u3044 +FR-Desinger-Plugin_Updater_UpdateAndUpgrade=\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C8 +FR-Desinger-Plugin_Updater_Checking_Jar_Update=Jar\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u691C\u8A3C\u4E2D +FR-Desinger-Plugin_Updater_Checking_Version_Update=\u30D1\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u691C\u8A3C\u4E2D +FR-Desinger-Plugin_Updater_Update=\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8 +FR-Desinger-Plugin_Updater_Upgrade=\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9 +FR-Desinger-Plugin_Updater_Restore=\u30EA\u30AB\u30D0\u30EA +FR-Desinger-Plugin_Updater_New_Version_Available=\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059 +FR-Desinger-Plugin_Updater_JarUpdate=Jar\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8 +FR-Desinger-Plugin_Updater_VersionUpgrade=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C8 +FR-Desinger-Plugin_Updater_Previous_Version=\u4EE5\u524D\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3078? +FR-Desinger-Plugin_Updater_Current_Version=\u73FE\u5728\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF1A +FR-Desinger-Plugin_Updater_Not_Install_Version=\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u7528\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u306F\u3042\u308A\u307E\u305B\u3093 FR-Desinger-Plugin_Updater_Latest_Version=\u6700\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3 -FR-Desinger-Plugin_Updater_Jar_Downloading=Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u5B8C\u6210\u5F85\u3061 -FR-Desinger-Plugin_Updater_Version_Downloading=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30D1\u30C3\u30B1\u30FC\u30B8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u5B8C\u6210\u5F85\u3061 -FR-Desinger-Plugin_Updater_Restart_Designer=\u30C7\u30B6\u30A4\u30CA\u30FC\u518D\u8D77\u52D5 -FR-Desinger-Plugin_Updater_Connect_VersionUpdateServer_Failed=\u30D0\u30FC\u30B8\u30E7\u30F3\u66F4\u65B0\u30B5\u30FC\u30D0\u30FC\u63A5\u7D9A\u3067\u304D\u306A\u3044 -FR-Desinger-Plugin_Updater_Connect_VersionUpgradeServer_Failed=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u30B5\u30FC\u30D0\u30FC\u63A5\u7D9A\u3067\u304D\u306A\u3044 -FR-Desinger-Plugin_Updater_Already_Latest_Version=\u65E2\u306B\u6700\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3 -FR-Desinger-Plugin_Updater_Backup_OldJar_To=\u65E7Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u65E2\u306B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7 -FR-Desinger-Plugin_Updater_Backup_OldVersion_To=\u65E7\u30D0\u30FC\u30B8\u30E7\u30F3\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u65E2\u306B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7 -FR-Desinger-Plugin_Updater_Please_Restart=\u30C7\u30B6\u30A4\u30CA\u30FC\u306F\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044 -FR-Desinger-Plugin_Updater_Jar_Restore=\u65E7Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u5FA9\u5143 -FR-Desinger-Plugin_Updater_Version_Restore=\u30D0\u30FC\u30B8\u30E7\u30F3\u5FA9\u5143 -FR-Desinger-Plugin_Updater_Restore_To=\u5FA9\u5143 -FR-Desinger-Plugin_Updater_WorksAfterRestart=\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u518D\u8D77\u52D5\u5F8C\u306B\u6709\u52B9\u3059\u308B +FR-Desinger-Plugin_Updater_Jar_Downloading=Jar\u30D5\u30A1\u30A4\u30EB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u7D42\u4E86\u3092\u5F85\u3063\u3066\u3044\u308B +FR-Desinger-Plugin_Updater_Version_Downloading=\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C8\u30D1\u30C3\u30B1\u30FC\u30B8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3092\u5F85\u3063\u3066\u3044\u308B +FR-Desinger-Plugin_Updater_Restart_Designer=\u30C7\u30B6\u30A4\u30CA\u30FC\u3092\u518D\u8D77\u52D5 +FR-Desinger-Plugin_Updater_Connect_VersionUpdateServer_Failed=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u30B5\u30FC\u30D0\u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044 +FR-Desinger-Plugin_Updater_Connect_VersionUpgradeServer_Failed=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C8\u30B5\u30FC\u30D0\u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044 +FR-Desinger-Plugin_Updater_Already_Latest_Version=\u6700\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3\u306B\u306A\u308A\u307E\u3057\u305F +FR-Desinger-Plugin_Updater_Backup_OldJar_To=\u53E4\u3044Jar\u30D5\u30A1\u30A4\u30EB\u3092\u4E0B\u8A18\u306B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3057\u307E\u3057\u305F\uFF1A +FR-Desinger-Plugin_Updater_Backup_OldVersion_To=\u53E4\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u4E0B\u8A18\u306B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3057\u307E\u3057\u305F\uFF1A +FR-Desinger-Plugin_Updater_Please_Restart=\u3001\u30C7\u30B6\u30A4\u30CA\u30FC\u3092\u518D\u8D77\u52D5\u3057\u3066\u4E0B\u3055\u3044 +FR-Desinger-Plugin_Updater_Jar_Restore=Jar\u30D5\u30A1\u30A4\u30EB\u30EA\u30AB\u30D0\u30EA +FR-Desinger-Plugin_Updater_Version_Restore=\u30D0\u30FC\u30B8\u30E7\u30F3\u30EA\u30AB\u30D0\u30EA +FR-Desinger-Plugin_Updater_Restore_To=\u30EA\u30AB\u30D0\u30EA +FR-Desinger-Plugin_Updater_WorksAfterRestart=\u30D0\u30FC\u30B8\u30E7\u30F3\u3001\u518D\u8D77\u52D5\u5F8C\u6709\u52B9\u306B\u306A\u308A\u307E\u3059 FR-Designer-Submit_Condition=\u6761\u4EF6 -FR-Designer-Widget-Title_border=\u30D5\u30EC\u30FC\u30E0 +FR-Designer-Widget-Title_border=\u67A0 FR-Designer-Widget-Title_border_color=\u8272 FR-Designer_AbsoluteLayout=\u7D76\u5BFE\u30EC\u30A4\u30A2\u30A6\u30C8 -FR-Designer_Allow_Decimals=\u5C0F\u6570\u3092\u8A31\u53EF -FR-Designer_Allow_Negative=\u30DE\u30A4\u30CA\u30B9\u5024\u3092\u8A31\u53EF -FR-Designer_Background-Click=\u30DE\u30A6\u30B9\u30AF\u30EA\u30C3\u30AF\u80CC\u666F +FR-Designer_Allow_Decimals=\u5C0F\u6570\u306E\u8A31\u53EF +FR-Designer_Allow_Negative=\u8CA0\u5024\u306E\u8A31\u53EF +FR-Designer_Background-Click=\u30DE\u30A6\u30B9\u30AF\u30EA\u30C3\u30AF\u6642\u80CC\u666F FR-Designer_Background-Initial=\u521D\u671F\u80CC\u666F -FR-Designer_Background-Over=\u30DE\u30A6\u30B9\u30D5\u30ED\u30FC\u30C8\u80CC\u666F -FR-Designer_Bar-Code-Exception-Tip=\u30C7\u30FC\u30BF\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 -FR-Designer_Block-intersect=\u30E2\u30B8\u30E5\u30FC\u30EB\u3068\u30E2\u30B8\u30E5\u30FC\u30EB\u9593\u3092\u91CD\u306D\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +FR-Designer_Background-Over=\u30DE\u30A6\u30B9\u30AA\u30FC\u30D0\u30FC\u6642\u80CC\u666F +FR-Designer_Bar-Code-Exception-Tip=\u30C7\u30FC\u30BF\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093 +FR-Designer_Block-intersect=\u30D6\u30ED\u30C3\u30AF\u3068\u30D6\u30EB\u30C3\u30AF\u9593\u306E\u91CD\u306A\u308A\u7981\u6B62 FR-Designer_BorderLayout=\u30DC\u30FC\u30C0\u30FC\u30EC\u30A4\u30A2\u30A6\u30C8 FR-Designer_Button-Hotkeys=\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30AD\u30FC FR-Designer_Button-Icon=\u30DC\u30BF\u30F3\u30A2\u30A4\u30B3\u30F3 -FR-Designer_Button-Name=\u30DC\u30BF\u30F3\u540D\u79F0 +FR-Designer_Button-Name=\u30DC\u30BF\u30F3\u540D FR-Designer_Button-Type=\u30DC\u30BF\u30F3\u30BF\u30A4\u30D7 -FR-Designer_CardLayout=Tab\u914D\u7F6E +FR-Designer_CardLayout=Tab\u30EC\u30A4\u30A2\u30A6\u30C8 FR-Designer_Cell=\u30BB\u30EB -FR-Designer_Chart_Cell=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u9023\u52D5\u30BB\u30EB -FR-Designer_Chart_Float=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u9023\u52D5\u30D5\u30ED\u30FC\u8981\u7D20 -FR-Designer_Chart_Float_chart=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u30D5\u30ED\u30FC\u7A93\u30B0\u30E9\u30D5 -FR-Designer_Check-for-Updates=\u66F4\u65B0\u3092\u78BA\u8A8D -FR-Designer_Choose-Data-Confusion-Tip=\ \u6DF7\u4EA4\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u5F8C\u30D7\u30EC\u30D3\u30E5\u30FC\u3057\u3066\u304F\u3060\u3055\u3044 -FR-Designer_Close=\u30AF\u30ED\u30FC\u30BA +FR-Designer_Chart_Cell=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u30BB\u30EB\u9023\u52D5 +FR-Designer_Chart_Float=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u8981\u7D20\u9023\u52D5 +FR-Designer_Chart_Float_chart=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30A6\u30A3\u30F3\u30C9\u30A6\u30B0\u30E9\u30D5 +FR-Designer_Check-for-Updates=\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3092\u78BA\u8A8D +FR-Designer_Choose-Data-Confusion-Tip=\ \u6DF7\u4E71\u3055\u305B\u308B\u3079\u304D\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u30D7\u30EC\u30D3\u30E5\u30FC\u4E0B\u3055\u3044 +FR-Designer_Close=\u9589\u3058\u308B FR-Designer_Column=\u5217 -FR-Designer_Column_Measure=\u5217\u8EF8/\u5EA6\u91CF\u5024 +FR-Designer_Column_Measure=\u5217\u8EF8/\u30E1\u30C8\u30EA\u30C3\u30AF FR-Designer_Condition_Attributes=\u6761\u4EF6\u5C5E\u6027 -FR-Designer_Confusion-Col-Name=\u30D5\u30A3\u30FC\u30EB\u30C9\u540D\u79F0 -FR-Designer_Confusion-key=\u6DF7\u4EA4\u3059\u308B\u30AD\u30FC\u30EF\u30FC\u30C9 -FR-Designer_Currency_Line=\u91D1\u984D\u7DDA -FR-Designer_Current_tab=\u73FE\u5728\u306E\u7DE8\u96C6tab -FR-Designer_Custom=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA -FR-Designer_Custom-Angle=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u89D2\u5EA6 -FR-Designer_DS-Dictionary=\u30C7\u30FC\u30BF\u5B57\u5178 -FR-Designer_Data-confusion=\u30C7\u30FC\u30BF\u6DF7\u4EA4 +FR-Designer_Confusion-Col-Name=\u30D5\u30A3\u30FC\u30EB\u30C9\u540D +FR-Designer_Confusion-key=\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u6DF7\u4E71\u3055\u305B\u308B +FR-Designer_Currency_Line=\u6841\u533A\u5207\u308A\u7DDA +FR-Designer_Current_tab=tab\u7DE8\u96C6\u4E2D +FR-Designer_Custom=\u30AB\u30B9\u30BF\u30E0 +FR-Designer_Custom-Angle=\u30AB\u30B9\u30BF\u30E0\u89D2\u5EA6 +FR-Designer_DS-Dictionary=\u30C7\u30FC\u30BF\u8F9E\u66F8 +FR-Designer_Data-confusion=\u30C7\u30FC\u30BF\u6DF7\u4E71 FR-Designer_Data_Type=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7 -FR-Designer_Double_Click_Edit_OR_Clear=\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\u307E\u305F\u306F\u30AF\u30EA\u30A2\u3059\u308B -FR-Designer_Edit_Button_ToolBar=\u30DC\u30BF\u30F3\u306B\u3042\u308B\u30C4\u30FC\u30EB\u6B04\u7DE8\u96C6 -FR-Designer_Email=\u30E1\u30FC\u30EB +FR-Designer_Double_Click_Edit_OR_Clear=\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\u3084\u30AF\u30EA\u30A2\u3092\u884C\u3046 +FR-Designer_Edit_Button_ToolBar=\u30DC\u30BF\u30F3\u306E\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u7DE8\u96C6 +FR-Designer_Email=E\u30E1\u30FC\u30EB FR-Designer_Enabled=\u4F7F\u7528\u53EF\u80FD -FR-Designer_End-Date=\u7D42\u4E86\u65E5\u671F -FR-Designer_ExportAndOutput=\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8 +FR-Designer_End-Date=\u7D42\u4E86\u65E5 +FR-Designer_ExportAndOutput=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8 FR-Designer_FRFont=\u30D5\u30A9\u30F3\u30C8 -FR-Designer_FS_Close_Other_Templates=\u305D\u306E\u4ED6\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9589\u3058\u308B +FR-Designer_FS_Close_Other_Templates=\u4ED6\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9589\u3058\u308B FR-Designer_File=\u30D5\u30A1\u30A4\u30EB -FR-Designer_Filter_Conditions=\u9078\u5225\u6761\u4EF6 -FR-Designer_Finish-Modify-Share=\u4FEE\u6B63\u3092\u5B8C\u4E86\u3057\u3066\u30B7\u30A7\u30A2 -FR-Designer_Fit-App=App\u81EA\u9069\u5FDC -FR-Designer_Fit=\u81EA\u9069\u5FDC -FR-Designer_Font-Family=\u30D5\u30A9\u30F3\u30C8\u540D\u79F0 -FR-Designer_Font-Size=\u30D5\u30A9\u30F3\u30C8\u5927\u5C0F -FR-Designer_Forbid_Drag_into_Adapt_Pane=\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306F\u30D5\u30A9\u30FC\u30E0\u672C\u6587\u3092\u30C9\u30E9\u30C3\u30B0\u3059\u308B\u3053\u3068\u306F\u8A31\u3055\u308C\u306A\u3044 -FR-Designer_Forbid_Drag_into_Para_Pane=\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306F\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u30D1\u30CD\u30EB\u306B\u30C9\u30E9\u30C3\u30B0\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 +FR-Designer_Filter_Conditions=\u30D5\u30A3\u30EB\u30BF\u6761\u4EF6 +FR-Designer_Finish-Modify-Share=\u4FEE\u6B63\u3092\u7D42\u4E86\u3055\u305B\u3066\u5171\u6709 +FR-Designer_Fit-App=\u30A2\u30D7\u30EA\u81EA\u5DF1\u8ABF\u6574 +FR-Designer_Fit=\u81EA\u5DF1\u8ABF\u6574 +FR-Designer_Font-Family=\u30D5\u30A9\u30F3\u30C8\u540D +FR-Designer_Font-Size=\u30D5\u30A9\u30F3\u30C8\u30B5\u30A4\u30BA +FR-Designer_Forbid_Drag_into_Adapt_Pane=\u5F53\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u4E3B\u4F53\u306B\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u306F\u306A\u3089\u306A\u3044 +FR-Designer_Forbid_Drag_into_Para_Pane=\u5F53\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u30D1\u30E9\u30E1\u30FC\u30BF\u30D1\u30CD\u30EB\u306B\u30C9\u30E9\u30C3\u30B0\u3067\u304D\u307E\u305B\u3093 FR-Designer_Foreground=\u8272 -FR-Designer_Form-AuthorityEdited_Cannot_be_Supported=\u8868\u306E\u6A29\u9650\u7DE8\u96C6\u306B\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093 -FR-Designer_Form-Report=\u5E33\u7968\u30E2\u30B8\u30E5\u30FC\u30EB -FR-Designer_Form_EmbeddedTD=\u8868(\u5185\u8535\u30C7\u30FC\u30BF) -FR-Designer_Form_Module=\u8868\u30E2\u30B8\u30E5\u30FC\u30EB +FR-Designer_Form-AuthorityEdited_Cannot_be_Supported=\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u6A29\u9650\u7DE8\u96C6\u306F\u73FE\u6642\u70B9\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093 +FR-Designer_Form-Report=\u5E33\u7968\u30D6\u30ED\u30C3\u30AF +FR-Designer_Form_EmbeddedTD=\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9(\u7D44\u307F\u8FBC\u307F\u30C7\u30FC\u30BF) +FR-Designer_Form_Module=\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30E2\u30B8\u30E5\u30FC\u30EB FR-Designer_Format_explan=\u66F8\u5F0F\u8AAC\u660E -FR-Designer_Formula=\u516C\u5F0F -FR-Designer_Forum=BBS +FR-Designer_Formula=\u6570\u5F0F +FR-Designer_Forum=\u30D5\u30A9\u30FC\u30E9\u30E0 FR-Designer_Get-Cube=cube\u53D6\u5F97\u4E2D FR-Designer_Help=\u30D8\u30EB\u30D7 -FR-Designer_Hide=\u96A0\u3059 -FR-Designer_Hyperlink=\u30B9\u30FC\u30D1\u30FC\u30EA\u30F3\u30AF -FR-Designer_Hyperlink-Form_link=\u73FE\u5728\u306E\u8868\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8 +FR-Designer_Hide=\u975E\u8868\u793A +FR-Designer_Hyperlink=\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF +FR-Designer_Hyperlink-Form_link=\u73FE\u5728\u306E\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8 FR-Designer_IDCard=\u8EAB\u5206\u8A3C\u660E\u66F8 FR-Designer_Icon=\u30A2\u30A4\u30B3\u30F3 FR-Designer_Index=\u5217\u8EF8/\u6307\u6A19 -FR-Designer_Input_Rule=\u30EB\u30FC\u30EB\u8A18\u5165 +FR-Designer_Input_Rule=\u5165\u529B\u898F\u5247 FR-Designer_Language_Default=\u30C7\u30D5\u30A9\u30EB\u30C8 -FR-Designer_Layout=\u914D\u7F6E -FR-Designer_Layout-HBox=\u6C34\u5E73\u30B1\u30FC\u30B9\u914D\u7F6E -FR-Designer_Layout-Index=\u7D22\u5F15 -FR-Designer_Layout_Constraints=\u4F4D\u7F6E\u3068\u5927\u5C0F +FR-Designer_Layout=\u30EC\u30A4\u30A2\u30A6\u30C8 +FR-Designer_Layout-HBox=\u6C34\u5E73\u30DC\u30C3\u30AF\u30B9\u306E\u30EC\u30A4\u30A2\u30A6\u30C8 +FR-Designer_Layout-Index=\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9 +FR-Designer_Layout_Constraints=\u4F4D\u7F6E\u3068\u30B5\u30A4\u30BA FR-Designer_Length=\u9577\u3055 -FR-Designer_Loading_Data=\u30C7\u30FC\u30BF\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u3044\u307E\u3059 -FR-Designer_M-Exit=\u9000\u51FA +FR-Designer_Loading_Data=\u30C7\u30FC\u30BF\u30ED\u30FC\u30C9\u4E2D +FR-Designer_M-Exit=\u7D42\u4E86 FR-Designer_M-Help=\u30D8\u30EB\u30D7 FR-Designer_M-Insert=\u633F\u5165 -FR-Designer_M-Repeat-Freeze=\u91CD\u8907\u3068\u30D5\u30EA\u30FC\u30BA\u8A2D\u5B9A -FR-Designer_M-Server=\u30B5\u30FC\u30D0\u30FC -FR-Designer_M-SwitchWorkspace=\u4F5C\u696D\u76EE\u6B21\u5207\u308A\u66FF\u3048 +FR-Designer_M-Repeat-Freeze=\u7E70\u308A\u8FD4\u3057\u3068\u56FA\u5B9A\u306E\u8A2D\u5B9A +FR-Designer_M-Server=\u30B5\u30FC\u30D0 +FR-Designer_M-SwitchWorkspace=\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u5207\u308A\u66FF\u3048 FR-Designer_M-Template=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 -FR-Designer_MDX_Explain=\u6587\u6CD5\u66F8\u5F0F\u306FMDX\u6587\u6CD5\u3092\u53C2\u8003\u3002\n\u4F8B\u3048\u3070\uFF1A\nWITH\nMEMBER [Measures].[Special Discount] AS\n[Measures].[Discount Amount] * 1.5\nSELECT\n[Measures].[Special Discount] on COLUMNS,\nNON EMPTY [Product].[Product].MEMBERS ON Rows\nFROM [Adventure Works]\nWHERE [Product].[Category].[Bikes]\n\u6CE8\uFF1ACOLUMNS\u3001ROWS\u306F0\u30011\u3092\u4F7F\u7528\u3057\u3066\u4EE3\u66FF\u53EF\u80FD\u3067\u3059\u3002\u30AF\u30A8\u30EA\u8EF8\u306F\u4E8C\u3064\u306E\u8EF8\u623B\u3057\u306B\u306E\u307F\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002 +FR-Designer_MDX_Explain=\u6587\u6CD5\u66F8\u5F0F\u306FMDX\u6587\u6CD5\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u4F8B\:\nWITH\nMEMBER [Measures].[Special Discount] AS\n[Measures].[Discount Amount] * 1.5\nSELECT\n[Measures].[Special Discount] on COLUMNS,\nNON EMPTY [Product].[Product].MEMBERS ON Rows\nFROM [Adventure Works]\nWHERE [Product].[Category].[Bikes]\n\u6CE8\uFF1ACOLUMNS\u3001ROWS\u30011\u3067\u53D6\u308A\u63DB\u3048\u308B\u3053\u3068\u304C\u3067\u304D\u3001\u691C\u7D22\u8EF8\u306F2\u8EF8\u306E\u623B\u308A\u3057\u304B\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 FR-Designer_M_Help-About_Software=\u30BD\u30D5\u30C8\u30A6\u30A7\u30A2\u306B\u3064\u3044\u3066 FR-Designer_M_Help-Tutorial=\u30D8\u30EB\u30D7\u30C1\u30E5\u30FC\u30C8\u30EA\u30A2\u30EB FR-Designer_Max_Value=\u6700\u5927\u5024 FR-Designer_Min_Value=\u6700\u5C0F\u5024 -FR-Designer_MobilePhone=\u643A\u5E2F\u96FB\u8A71 -FR-Designer_New_Value=\u65B0\u5024 +FR-Designer_MobilePhone=\u30B9\u30DE\u30FC\u30C8\u30D5\u30A9\u30F3 +FR-Designer_New_Value=\u65B0\u3057\u3044\u5024 FR-Designer_None=\u7121\u3057 -FR-Designer_PaperSize-Mobile=\u643A\u5E2F\u96FB\u8A71 -FR-Designer_PaperSize-Mobile-Large=\u643A\u5E2F\u96FB\u8A71\u5927\u30B9\u30AF\u30EA\u30FC\u30F3 -FR-Designer_PaperSize-Mobile-Small=\u643A\u5E2F\u96FB\u8A71\u5C0F\u30B9\u30AF\u30EA\u30FC\u30F3 -FR-Designer_Para-Body=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u753B\u9762 -FR-Designer_Parameters=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC +FR-Designer_PaperSize-Mobile=\u30B9\u30DE\u30FC\u30C8\u30D5\u30A9\u30F3 +FR-Designer_PaperSize-Mobile-Large=\u643A\u5E2F\u5927\u753B\u9762 +FR-Designer_PaperSize-Mobile-Small=\u643A\u5E2F\u5C0F\u753B\u9762 +FR-Designer_Para-Body=\u30D1\u30E9\u30E1\u30FC\u30BF\u30D1\u30CD\u30EB +FR-Designer_Parameters=\u30D1\u30E9\u30E1\u30FC\u30BF FR-Designer_Phone=\u96FB\u8A71 FR-Designer_PostCode=\u90F5\u4FBF\u756A\u53F7 -FR-Designer_Present=\u30D5\u30A9\u30EB\u30E0 +FR-Designer_Present=\u5F62\u614B FR-Designer_Preview=\u30D7\u30EC\u30D3\u30E5\u30FC -FR-Designer_Preview-Data-Confusion=\u6DF7\u4EA4\u5F8C\u306E\u30C7\u30FC\u30BF\u3092\u30D7\u30EC\u30D3\u30E5\u30FC +FR-Designer_Preview-Data-Confusion=\u6DF7\u4E71\u3055\u308C\u305F\u30C7\u30FC\u30BF\u3092\u30D7\u30EC\u30D3\u30E5\u30FC FR-Designer_Product_Demo=\u88FD\u54C1\u30C7\u30E2 -FR-Designer_Query_Type=\u30AF\u30A8\u30EA\u65B9\u6CD5 +FR-Designer_Query_Type=\u30AF\u30A8\u30EA\u30BF\u30A4\u30D7 FR-Designer_Refresh=\u66F4\u65B0 -FR-Designer_Refresh_Parameter_In_SQL=SQL\u4E2D\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3059\u304B -FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u73FE\u5F0F -FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u3055 -FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u3055 -FR-Designer_Remove_Button_ToolBar=\u30DC\u30BF\u30F3\u304C\u3042\u308B\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u30EA\u30E0\u30FC\u30D6 -FR-Designer_ReportColumns-Columns=\u6BB5\u7D44\u307F -FR-Designer_Return-Date=\u65E5\u671F\u306B\u623B\u308B -FR-Designer_RichText=\u30EA\u30C3\u30C1\u6587\u66F8\u633F\u5165 -FR-Designer_RichTextEditor=\u30EA\u30C3\u30C1\u6587\u66F8\u30A8\u30C7\u30A3\u30BF +FR-Designer_Refresh_Parameter_In_SQL=SQL\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u66F4\u65B0\u3057\u307E\u3059\u304B +FR-Designer_Reg_Expressions=\u6B63\u898F\u8868\u73FE +FR-Designer_Reg_Max_Length=\u6700\u5927 +FR-Designer_Reg_Min_Length=\u6700\u5C0F +FR-Designer_Remove_Button_ToolBar=\u30DC\u30BF\u30F3\u306E\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u524A\u9664 +FR-Designer_ReportColumns-Columns=\u30B5\u30D6\u30D5\u30A3\u30FC\u30EB\u30C9 +FR-Designer_Return-Date=\u65E5\u4ED8\u578B\u3092\u623B\u3059 +FR-Designer_RichText=\u30EA\u30C3\u30C1\u30C6\u30AD\u30B9\u30C8 +FR-Designer_RichTextEditor=\u30EA\u30C3\u30C1\u30C6\u30AD\u30B9\u30C8\u30A8\u30C7\u30A3\u30BF FR-Designer_Row=\u884C -FR-Designer_Row_Dimension=\u884C\u8EF8/\u7DEF\u5EA6 +FR-Designer_Row_Dimension=\u884C\u8EF8/\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3 FR-Designer_Save=\u4FDD\u5B58 FR-Designer_Search=\u691C\u7D22 FR-Designer_Set=\u8A2D\u5B9A -FR-Designer_Share-Template=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30B7\u30A7\u30A2 -FR-Designer_Simple_general=\u30B7\u30F3\u30D7\u30EB\u901A\u7528\u30AF\u30A8\u30EA +FR-Designer_Share-Template=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u5171\u6709 +FR-Designer_Simple_general=\u7C21\u6613\u4E00\u822C\u691C\u7D22 FR-Designer_Song_TypeFace=\u5B8B\u4F53 -FR-Designer_Start-Date=\u958B\u59CB\u65E5\u671F +FR-Designer_Start-Date=\u958B\u59CB\u65E5 FR-Designer_Subscript=\u4E0B\u4ED8\u304D FR-Designer_Superscript=\u4E0A\u4ED8\u304D -FR-Designer_Support_QQ=\u6280\u8853QQ +FR-Designer_Support_QQ=\u6280\u8853\u30B5\u30DD\u30FC\u30C8QQ FR-Designer_Swatch=\u30B5\u30F3\u30D7\u30EB -FR-Designer_Tab_title=tab\u30BF\u30A4\u30C8\u30EB +FR-Designer_Tab_title=\u30BF\u30D6\u30BF\u30A4\u30C8\u30EB FR-Designer_TableData=\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 -FR-Designer_Thank_guest=\u7279\u306B\u5F53\u8A72\u30D0\u30FC\u30B8\u30E7\u30F3\u30C7\u30B6\u30A4\u30CA\u30FC\u306E\u4F7F\u3044\u3084\u3059\u3055\u306B\u3064\u3044\u3066\u8CA2\u732E\u3057\u3066\u304F\u308C\u305F\u4EE5\u4E0B\u306EBBS\u306E\u5E06\u30BD\u30D5\u30C8\u30D5\u30A1\u30F3\u306B\u611F\u8B1D\u3057\u307E\u3059 +FR-Designer_Thank_guest=\u7279\u306B\u4EE5\u4E0B\u306E\u30D5\u30A9\u30FC\u30E9\u30E0\u5E06\u85AF\u304C\u5F53\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u30C7\u30B6\u30A4\u30CA\u30FC\u306E\u4F7F\u3044\u3084\u3059\u3055\u306B\u9855\u8457\u306A\u8CA2\u732E\u306B\u611F\u8B1D FR-Designer_Thanks-To=\u611F\u8B1D FR-Designer_Title=\u30BF\u30A4\u30C8\u30EB -FR-Designer_Total=\u5168\u90E8\u3067 +FR-Designer_Total=\u5408\u8A08 FR-Designer_UnSignIn=\u672A\u30ED\u30B0\u30A4\u30F3 -FR-Designer_Underline=\u30A2\u30F3\u30C0\u30FC\u30E9\u30A4\u30F3 -FR-Designer_Used=\u6700\u8FD1\u4F7F\u7528\u3057\u305F -FR-Designer_User-defined-MDX=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BAMDX\u30AF\u30A8\u30EA -FR-Designer_SampleText=\u30C6\u30AD\u30B9\u30C8\u4F8B -FR-Designer_Vertical-LeftToRight=\u6587\u5B57\u7E26\u66F8(\u5DE6\u304B\u3089\u53F3\u3078\uFF09 +FR-Designer_Underline=\u4E0B\u7DDA +FR-Designer_Used=\u6700\u8FD1\u4F7F\u7528 +FR-Designer_User-defined-MDX=\u30AB\u30B9\u30BF\u30E0MDX\u691C\u7D22 +FR-Designer_SampleText=\u30B5\u30F3\u30D7\u30EB\u30C6\u30AD\u30B9\u30C8 \u30B5\u30F3\u30D7\u30EB\u30C6\u30AD\u30B9\u30C8 +FR-Designer_Vertical-LeftToRight=\u6587\u5B57\u7E26\u66F8\u304D(\u5DE6\u304B\u3089\u53F3\u3078) FR-Designer_Vertical-RightToLeft=\u6587\u5B57\u7E26\u66F8(\u53F3\u304B\u3089\u5DE6\u3078) -FR-Designer_VerticalBoxLayout=\u5782\u76F4\u30B1\u30FC\u30B9\u914D\u7F6E -FR-Designer_Visible=\u53EF\u8996 -FR-Designer_WLayout-Border-ToolTips=\u5B8C\u74A7\u306A\u30DC\u30FC\u30C0\u30FC\u30EC\u30A4\u30A2\u30A6\u30C8\u5BB9\u5668\u306F\u6771\u897F\u5357\u5317\u4E2D\u306E\u4E94\u3064\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u304B\u3089\u69CB\u6210\u3055\u308C\u307E\u3059\u3002\\uff4e\u305D\u306E\u3046\u3061\u3001\u5357\u5317\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u9AD8\u3055\u3092\u8ABF\u6574\u3067\u304D\u3001\u6771\u897F\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u5E45\u3092\u8ABF\u6574\u3067\u304D\u307E\u3059\u3002 +FR-Designer_VerticalBoxLayout=\u5782\u76F4\u30DC\u30C3\u30AF\u30B9\u30EC\u30A4\u30A2\u30A6\u30C8 +FR-Designer_Visible=\u8868\u793A +FR-Designer_WLayout-Border-ToolTips=\u5B8C\u5168\u306A\u30DC\u30FC\u30C0\u30FC\u30EC\u30A4\u30A2\u30A6\u30C8\u30B3\u30F3\u30C6\u30CA\u306F\u3001\u6771\u3001\u5357\u3001\u897F\u3001\u5317\u3001\u4E2D\u592E\u306E5\u30D6\u30ED\u30C3\u30AF\u3088\u308A\u69CB\u6210\u3055\u308C\u307E\u3059\u3002\n\u5317\u90E8\u3068\u5357\u90E8\u3067\u306F\u9AD8\u3055\u3092\u3001\u6771\u90E8\u3068\u897F\u90E8\u3068\u3067\u306F\u5E45\u3092\u8ABF\u6574\u3067\u304D\u307E\u3059\u3002 FR-Designer_WaterMark=\u900F\u304B\u3057 FR-Designer_Widget=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB FR-Designer_Widget-Settings=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u8A2D\u5B9A From c0c2ed2f6033a68d233b0cf4c538a9536396ba17 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Wed, 26 Apr 2017 11:04:22 +0800 Subject: [PATCH 50/60] =?UTF-8?q?REPORT-2381=20=E5=AE=A2=E6=88=B7bug?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E9=81=97=E7=95=99=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=95=E5=8F=91=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF=E7=94=9F=E6=88=90=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=9C=80=E7=BB=88=E5=AF=BC=E8=87=B4=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/WidgetPropertyPane.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index 6a8480206d..201ab203e4 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -259,8 +259,11 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper xCreator = designer.getRootComponent(); } XLayoutContainer container = XCreatorUtils.getHotspotContainer(xCreator); - //TODO container可能为空,引发空指针异常 - return xCreator.acceptType(XWParameterLayout.class) || container.acceptType(XWParameterLayout.class); + + boolean xCreatorAccept = xCreator.acceptType(XWParameterLayout.class); + boolean containerAccept = container!=null && container.acceptType(XWParameterLayout.class); + + return xCreatorAccept || containerAccept; } public void setEditingFormDesigner(BaseFormDesigner editor) { From c96943543ece4080e6294d7847a7c5e325075a2e Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 26 Apr 2017 16:19:38 +0800 Subject: [PATCH 51/60] =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E7=9A=84=E6=A1=86?= =?UTF-8?q?=E9=80=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ComponentTree.java | 46 ++++++++++--------- .../com/fr/design/mainframe/FormDesigner.java | 3 +- .../mainframe/widget/UITreeComboBox.java | 28 +++++------ 3 files changed, 41 insertions(+), 36 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java index 4d58c4887d..67894b991e 100644 --- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java +++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java @@ -1,30 +1,26 @@ package com.fr.design.mainframe; -import java.awt.Component; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.ArrayList; - -import javax.swing.DropMode; -import javax.swing.JPopupMenu; -import javax.swing.JTree; -import javax.swing.tree.TreePath; -import javax.swing.tree.TreeSelectionModel; - import com.fr.design.constants.UIConstants; -import com.fr.design.designer.beans.AdapterBus; -import com.fr.design.designer.beans.ComponentAdapter; -import com.fr.design.designer.beans.events.DesignerEditListener; -import com.fr.design.designer.beans.events.DesignerEvent; -import com.fr.design.designer.creator.*; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; +import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.treeview.ComponentTreeCellRenderer; import com.fr.design.designer.treeview.ComponentTreeModel; import com.fr.stable.StringUtils; +import javax.swing.*; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; +import java.awt.*; +import java.util.ArrayList; + public class ComponentTree extends JTree { private FormDesigner designer; private ComponentTreeModel model; + //xiaoxia 保存框选的全部组件,只显示第一个 + private TreePath[] allSelectedTreePaths; public ComponentTree(FormDesigner designer) { this.designer = designer; @@ -92,9 +88,10 @@ public class ComponentTree extends JTree { } } - public void setAndScrollSelectionPath(TreePath treepath) { - setSelectionPath(treepath); - scrollPathToVisible(treepath); + public void setAndScrollSelectionPath(TreePath[] treepath) { + this.setAllSelectedTreePaths(treepath); + setSelectionPath(treepath[0]); + scrollPathToVisible(treepath[0]); } @@ -112,7 +109,6 @@ public class ComponentTree extends JTree { public TreePath[] getSelectedTreePath() { XCreator[] creators = designer.getSelectionModel().getSelection().getSelectedCreators(); TreePath[] paths = new TreePath[creators.length]; - for (int i = 0; i < paths.length; i++) { paths[i] = buildTreePath(creators[i]); } @@ -141,7 +137,7 @@ public class ComponentTree extends JTree { paths[i] = buildTreePath(searchList.get(i)); } if(paths.length > 0) { - setAndScrollSelectionPath(paths[0]); + setAndScrollSelectionPath(paths); } else { setSelectionPath(); } @@ -217,4 +213,12 @@ public class ComponentTree extends JTree { Object[] components = path.toArray(); return new TreePath(components); } + + public TreePath[] getAllSelectedTreePaths() { + return allSelectedTreePaths; + } + + public void setAllSelectedTreePaths(TreePath[] allSelectedTreePaths) { + this.allSelectedTreePaths = allSelectedTreePaths; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 0c77059935..3e29f41281 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -1008,7 +1008,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection @Override public void valueChanged(TreeSelectionEvent e) { ComponentTree tree = (ComponentTree) e.getSource(); - TreePath[] paths = tree.getSelectionPaths(); + TreePath[] paths = tree.getAllSelectedTreePaths(); if (paths != null) { ArrayList selected = new ArrayList(); @@ -1018,7 +1018,6 @@ public class FormDesigner extends TargetComponent implements TreeSelection } if (!BaseUtils.isAuthorityEditing()) { - selectionModel.setSelectedCreators(selected); TreePath path = e.getNewLeadSelectionPath(); diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java index 0d7b224f64..258fd15d31 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java +++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java @@ -3,22 +3,24 @@ package com.fr.design.mainframe.widget; /** * Created by xiaxiang on 2016/9/30. */ -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.plaf.*; -import javax.swing.plaf.basic.*; -import javax.swing.plaf.metal.*; -import javax.swing.tree.*; -import com.fr.design.designer.beans.*; +import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.mainframe.ComponentTree; -import com.sun.java.swing.plaf.motif.*; -import com.sun.java.swing.plaf.windows.*; +import com.sun.java.swing.plaf.motif.MotifComboBoxUI; +import com.sun.java.swing.plaf.windows.WindowsComboBoxUI; + +import javax.swing.*; +import javax.swing.plaf.ComboBoxUI; +import javax.swing.plaf.basic.ComboPopup; +import javax.swing.plaf.metal.MetalComboBoxUI; +import javax.swing.tree.TreeCellRenderer; +import javax.swing.tree.TreePath; +import java.awt.*; +import java.awt.event.*; /** * 控件树下拉列表框 @@ -110,7 +112,7 @@ public class UITreeComboBox extends JComboBox{ int index, boolean isSelected, boolean cellHasFocus){ if(tree != null && tree.getSelectedTreePath().length > 0){ TreePath path = tree.getSelectedTreePath()[0]; - tree.setAndScrollSelectionPath(path); + tree.setAndScrollSelectionPath(tree.getSelectedTreePath()); Object node = path.getLastPathComponent(); value = node; TreeCellRenderer r = tree.getCellRenderer(); @@ -132,7 +134,7 @@ public class UITreeComboBox extends JComboBox{ if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { TreePath[] paths = tree.getSelectedTreePath(); if (tree != null && paths.length > 0) { - tree.setAndScrollSelectionPath(paths[0]); + tree.setAndScrollSelectionPath(paths); setSelectedItem(paths[0]); MenuSelectionManager.defaultManager().clearSelectedPath(); } @@ -141,7 +143,7 @@ public class UITreeComboBox extends JComboBox{ tree.refreshUI(); TreePath[] paths = tree.getSelectedTreePath(); if (tree != null && paths.length > 0) { - tree.setAndScrollSelectionPath(paths[0]); + tree.setAndScrollSelectionPath(paths); setSelectedItem(paths[0]); MenuSelectionManager.defaultManager().clearSelectedPath(); } From f7b05c896eaae670a010e1a471b755d25ad4ef66 Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 27 Apr 2017 15:01:59 +0800 Subject: [PATCH 52/60] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20master?= =?UTF-8?q?=E7=9A=84boundsWidget=E5=88=B0release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/ConnectorCreator.java | 9 ++--- .../adapters/layout/FRFitLayoutAdapter.java | 4 +- .../beans/location/AccessDirection.java | 2 +- .../design/designer/beans/location/Inner.java | 2 +- .../designer/creator/XWAbsoluteLayout.java | 40 ++++++++++++------- .../design/designer/creator/XWFitLayout.java | 18 ++++----- .../designer/creator/XWScaleLayout.java | 9 ++--- .../designer/creator/XWTitleLayout.java | 2 +- .../cardlayout/XWCardMainBorderLayout.java | 11 ++--- .../creator/cardlayout/XWTabFitLayout.java | 2 +- .../fr/design/mainframe/ConnectorHelper.java | 15 +++---- 11 files changed, 58 insertions(+), 56 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java b/designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java index 350235d453..ed83c12d67 100644 --- a/designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java +++ b/designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java @@ -1,13 +1,12 @@ package com.fr.design.designer.beans; -import java.awt.Point; -import java.awt.Rectangle; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; +import com.fr.form.ui.container.WLayout; + +import java.awt.*; import java.util.ArrayList; import java.util.PriorityQueue; -import com.fr.form.ui.container.WLayout; -import com.fr.form.ui.widget.BoundsWidget; - public class ConnectorCreator { public static final int UNIT = 10; diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index 12e53ccdd3..74a69e525c 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -16,13 +16,11 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FRFitLayoutConstraints; import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; -import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.mainframe.JForm; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.LayoutBorderStyle; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; -import com.fr.form.ui.widget.BoundsWidget; import com.fr.general.ComparatorUtils; import java.awt.*; diff --git a/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java b/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java index 088f29a0a0..c39dfc4dba 100644 --- a/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java +++ b/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java @@ -10,7 +10,7 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelection; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.container.WAbsoluteLayout; -import com.fr.form.ui.widget.BoundsWidget; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import java.awt.*; diff --git a/designer_form/src/com/fr/design/designer/beans/location/Inner.java b/designer_form/src/com/fr/design/designer/beans/location/Inner.java index 4f475adf09..c909244898 100644 --- a/designer_form/src/com/fr/design/designer/beans/location/Inner.java +++ b/designer_form/src/com/fr/design/designer/beans/location/Inner.java @@ -9,7 +9,7 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelection; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.container.WAbsoluteLayout; -import com.fr.form.ui.widget.BoundsWidget; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.stable.ArrayUtils; import java.awt.*; 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 1854b91f46..852cdf1220 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -3,31 +3,35 @@ */ package com.fr.design.designer.creator; -import java.awt.*; -import java.awt.event.ContainerEvent; -import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; -import java.beans.IntrospectionException; -import java.util.HashMap; - import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.models.SelectionModel; +import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.form.layout.FRAbsoluteLayout; import com.fr.design.icon.IconPathConstants; -import com.fr.design.mainframe.*; +import com.fr.design.mainframe.EditingMouseListener; +import com.fr.design.mainframe.FormArea; +import com.fr.design.mainframe.FormDesigner; import com.fr.form.ui.Connector; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WLayout; -import com.fr.form.ui.widget.BoundsWidget; import com.fr.general.FRScreen; import com.fr.general.IOUtils; import com.fr.general.Inter; +import java.awt.*; +import java.awt.event.ContainerEvent; +import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; +import java.beans.IntrospectionException; +import java.util.ArrayList; +import java.util.HashMap; + /** * @author richer * @since 6.5.3 @@ -159,7 +163,15 @@ public class XWAbsoluteLayout extends XLayoutContainer { if (xCreator.acceptType(XWAbsoluteLayout.class)) { ((XWAbsoluteLayout) xCreator).updateBoundsWidget(); } - BoundsWidget boundsWidget = layout.getBoundsWidget(xCreator.toData()); + // 如果子组件时tab布局,则tab布局内部的组件的wiget也要更新,否则保存后重新打开大小不对 + ArrayList childrenList = xCreator.getTargetChildrenList(); + if (!childrenList.isEmpty()) { + for (int i = 0; i < childrenList.size(); i++) { + XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(i); + tabLayout.updateBoundsWidget(); + } + } + BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); } @@ -184,7 +196,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { double percentH = ((double) backupBound.height / (double) currentBound.height); for (int index = 0, n = this.getComponentCount(); index < n; index++) { XCreator creator = (XCreator) this.getComponent(index); - BoundsWidget wgt = layout.getBoundsWidget(creator.toData()); + BoundsWidget wgt = (BoundsWidget) layout.getBoundsWidget(creator.toData()); // 用当前的显示大小计算后调正具体位置 Rectangle wgtBound = creator.getBounds(); Rectangle rec = calculateBound(wgtBound, percentW, percentH); @@ -217,7 +229,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { 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()); + BoundsWidget wgt = (BoundsWidget) toData().getBoundsWidget(creator.toData()); wgt.setBounds(rec); creator.setBounds(rec); creator.updateChildBound(minHeight); @@ -481,7 +493,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { XCreator xCreator = (XCreator) getComponent(i); Rectangle rectangle = xCreator.getBounds(); xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height); - BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); + BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(xCreator.toData()); widget.setBounds(xCreator.getBounds()); } } @@ -498,7 +510,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { XCreator xCreator = (XCreator) getComponent(i); Rectangle rectangle = xCreator.getBounds(); xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent)); - BoundsWidget widget = toData().getBoundsWidget(xCreator.toData()); + BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(xCreator.toData()); widget.setBounds(xCreator.getBounds()); } } 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 340ec9cd1e..2ab8910223 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java @@ -1,14 +1,5 @@ package com.fr.design.designer.creator; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.awt.event.ContainerEvent; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter; import com.fr.design.designer.beans.location.Direction; @@ -20,14 +11,19 @@ import com.fr.design.mainframe.FormArea; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; -import com.fr.form.ui.widget.BoundsWidget; import com.fr.general.FRScreen; -import com.fr.general.Inter; import com.fr.stable.ArrayUtils; +import java.awt.*; +import java.awt.event.ContainerEvent; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + /** * @author jim * @date 2014-6-23 diff --git a/designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java b/designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java index 8dad2c7f07..2c592cc217 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java @@ -3,16 +3,15 @@ */ package com.fr.design.designer.creator; -import java.awt.Dimension; -import java.awt.Rectangle; -import java.awt.event.ContainerEvent; - import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRScaleLayoutAdapter; import com.fr.design.form.layout.FRScaleLayout; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WScaleLayout; -import com.fr.form.ui.widget.BoundsWidget; + +import java.awt.*; +import java.awt.event.ContainerEvent; /** * 自适应布局中添加组件时,部分控件如数字文本下拉等需要保持控件默认高度21, 用此容器来实现 diff --git a/designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java b/designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java index 0e1a293bdf..7b9a5380c2 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java @@ -11,7 +11,7 @@ import com.fr.form.ui.Label; import com.fr.form.ui.Widget; import com.fr.form.ui.WidgetTitle; import com.fr.form.ui.container.WTitleLayout; -import com.fr.form.ui.widget.BoundsWidget; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.general.ComparatorUtils; import java.awt.*; diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index 9b778f850f..94dfaf92e5 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -3,10 +3,6 @@ */ package com.fr.design.designer.creator.cardlayout; -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; -import java.util.ArrayList; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.models.SelectionModel; @@ -17,12 +13,17 @@ import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.icon.IconPathConstants; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; -import com.fr.form.ui.widget.BoundsWidget; import com.fr.general.IOUtils; import com.fr.general.Inter; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; +import java.util.ArrayList; + /** * card布局主体框架 * 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 c0d1a06ed1..5a2afa00c0 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 @@ -18,7 +18,7 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout; -import com.fr.form.ui.widget.BoundsWidget; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.general.Background; import com.fr.general.FRLogger; import com.fr.general.Inter; diff --git a/designer_form/src/com/fr/design/mainframe/ConnectorHelper.java b/designer_form/src/com/fr/design/mainframe/ConnectorHelper.java index a640058123..93add36341 100644 --- a/designer_form/src/com/fr/design/mainframe/ConnectorHelper.java +++ b/designer_form/src/com/fr/design/mainframe/ConnectorHelper.java @@ -1,18 +1,15 @@ package com.fr.design.mainframe; -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.MouseEvent; -import java.util.ArrayList; - -import com.fr.form.ui.widget.BoundsWidget; -import com.fr.stable.Constants; import com.fr.base.GraphHelper; import com.fr.design.designer.beans.ConnectorCreator; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.form.ui.Connector; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; +import com.fr.stable.Constants; + +import java.awt.*; +import java.awt.event.MouseEvent; +import java.util.ArrayList; public class ConnectorHelper { //这个类是用来画连接线的,暂时用不到 From ba60f5ad9a0efa80d8e2d5201ddedd8f634620fd Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 27 Apr 2017 17:08:36 +0800 Subject: [PATCH 53/60] =?UTF-8?q?=E6=A1=86=E9=80=89=E6=94=B9=E9=94=99?= =?UTF-8?q?=E5=95=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ComponentTree.java | 31 ++++++------------- .../com/fr/design/mainframe/FormDesigner.java | 2 +- .../mainframe/widget/UITreeComboBox.java | 23 ++++++-------- 3 files changed, 21 insertions(+), 35 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java index 67894b991e..1ceab13c0a 100644 --- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java +++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java @@ -1,26 +1,23 @@ package com.fr.design.mainframe; +import java.awt.Component; +import java.util.ArrayList; + +import javax.swing.DropMode; +import javax.swing.JTree; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; + import com.fr.design.constants.UIConstants; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWAbsoluteBodyLayout; -import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.*; import com.fr.design.designer.treeview.ComponentTreeCellRenderer; import com.fr.design.designer.treeview.ComponentTreeModel; import com.fr.stable.StringUtils; -import javax.swing.*; -import javax.swing.tree.TreePath; -import javax.swing.tree.TreeSelectionModel; -import java.awt.*; -import java.util.ArrayList; - public class ComponentTree extends JTree { private FormDesigner designer; private ComponentTreeModel model; - //xiaoxia 保存框选的全部组件,只显示第一个 - private TreePath[] allSelectedTreePaths; public ComponentTree(FormDesigner designer) { this.designer = designer; @@ -89,8 +86,7 @@ public class ComponentTree extends JTree { } public void setAndScrollSelectionPath(TreePath[] treepath) { - this.setAllSelectedTreePaths(treepath); - setSelectionPath(treepath[0]); + setSelectionPaths(treepath); scrollPathToVisible(treepath[0]); } @@ -214,11 +210,4 @@ public class ComponentTree extends JTree { return new TreePath(components); } - public TreePath[] getAllSelectedTreePaths() { - return allSelectedTreePaths; - } - - public void setAllSelectedTreePaths(TreePath[] allSelectedTreePaths) { - this.allSelectedTreePaths = allSelectedTreePaths; - } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 3e29f41281..3aa9e24ee1 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -1008,7 +1008,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection @Override public void valueChanged(TreeSelectionEvent e) { ComponentTree tree = (ComponentTree) e.getSource(); - TreePath[] paths = tree.getAllSelectedTreePaths(); + TreePath[] paths = tree.getSelectionPaths(); if (paths != null) { ArrayList selected = new ArrayList(); diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java index 258fd15d31..62c9aa0678 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java +++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java @@ -3,24 +3,22 @@ package com.fr.design.mainframe.widget; /** * Created by xiaxiang on 2016/9/30. */ +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import javax.swing.plaf.*; +import javax.swing.plaf.basic.*; +import javax.swing.plaf.metal.*; +import javax.swing.tree.*; -import com.fr.design.designer.beans.AdapterBus; +import com.fr.design.designer.beans.*; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.mainframe.ComponentTree; -import com.sun.java.swing.plaf.motif.MotifComboBoxUI; -import com.sun.java.swing.plaf.windows.WindowsComboBoxUI; - -import javax.swing.*; -import javax.swing.plaf.ComboBoxUI; -import javax.swing.plaf.basic.ComboPopup; -import javax.swing.plaf.metal.MetalComboBoxUI; -import javax.swing.tree.TreeCellRenderer; -import javax.swing.tree.TreePath; -import java.awt.*; -import java.awt.event.*; +import com.sun.java.swing.plaf.motif.*; +import com.sun.java.swing.plaf.windows.*; /** * 控件树下拉列表框 @@ -67,7 +65,6 @@ public class UITreeComboBox extends JComboBox{ * @param o Object */ public void setSelectedItem(Object o){ - tree.setSelectionPath((TreePath)o); getModel().setSelectedItem(o); } From 589725a8dd2b624c33cd78fa0fe93c65aab3ede5 Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 28 Apr 2017 11:39:11 +0800 Subject: [PATCH 54/60] =?UTF-8?q?REPORT-2526=20tab=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E6=94=B9=E8=89=AF=E5=90=8E=E7=BB=AD--tab=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9A=84=E8=A7=86=E8=A7=89=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/images/control/tab/end.png | Bin 0 -> 248 bytes .../com/fr/design/images/control/tab/end_not.png | Bin 0 -> 250 bytes .../com/fr/design/images/control/tab/first.png | Bin 0 -> 264 bytes .../fr/design/images/control/tab/first_not.png | Bin 0 -> 264 bytes .../src/com/fr/design/images/control/tab/next.png | Bin 0 -> 265 bytes .../com/fr/design/images/control/tab/next_not.png | Bin 0 -> 257 bytes .../src/com/fr/design/images/control/tab/prev.png | Bin 0 -> 272 bytes .../com/fr/design/images/control/tab/prev_not.png | Bin 0 -> 273 bytes .../creator/cardlayout/TabMoveEndAction.java | 2 +- .../creator/cardlayout/TabMoveFirstAction.java | 2 +- .../creator/cardlayout/TabMoveNextAction.java | 2 +- .../creator/cardlayout/TabMovePrevAction.java | 2 +- 12 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/control/tab/end.png create mode 100644 designer_base/src/com/fr/design/images/control/tab/end_not.png create mode 100644 designer_base/src/com/fr/design/images/control/tab/first.png create mode 100644 designer_base/src/com/fr/design/images/control/tab/first_not.png create mode 100644 designer_base/src/com/fr/design/images/control/tab/next.png create mode 100644 designer_base/src/com/fr/design/images/control/tab/next_not.png create mode 100644 designer_base/src/com/fr/design/images/control/tab/prev.png create mode 100644 designer_base/src/com/fr/design/images/control/tab/prev_not.png diff --git a/designer_base/src/com/fr/design/images/control/tab/end.png b/designer_base/src/com/fr/design/images/control/tab/end.png new file mode 100644 index 0000000000000000000000000000000000000000..da848239fb915844ab692e00126c47b426ae3222 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}n><|{Lo`H_ z6BdYwg;Nh8iy_jbVPyaU?_{`%x#&GH5{5YdIdiTD?b9?fr3r8w5U$9wQ|6jsS zJooSXhG6y(CRgQ<9`1|-HBNrVmkFjx#w~w*x#Rjv9fQaG_x>;?FS^jv)1&aOUco`| zc(!uDQ&Taqu*;iWZMXwV7%eSKnR25}oH(3ZWz_#yYL}XT{JW4DDglSh6|A{u>l&CU uNX06j$XvK1$MG6Rxt8K`#q32LybQm#JM&yh_nr%MJ%gvKpUXO@geCw>-B~~Y literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/control/tab/end_not.png b/designer_base/src/com/fr/design/images/control/tab/end_not.png new file mode 100644 index 0000000000000000000000000000000000000000..1f08bdf35a524a08badaa957e60cca45f00c1eab GIT binary patch literal 250 zcmVPx#v`IukR45gtkTD9wAQXnRI0d{&X1fX=qH{avQfbbUJ(~s>j}RxdTA~D_5n4ff z`oHh}KLYUY5<d9a=|lu@qju;pLv|e4!Dcw|6c#~rRw3#1+ywg-_!){UZze z8CSbac(nOt&;5pN>I|mMAIwXb3$j`?k321Dl5%7dcw92Wl_is5-)85{y$mjAfWBey MboFyt=akR{0RC%dP5=M^ literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/control/tab/first_not.png b/designer_base/src/com/fr/design/images/control/tab/first_not.png new file mode 100644 index 0000000000000000000000000000000000000000..50d048a19d3ac8d8058ea133b5d4bc61f37dcb8b GIT binary patch literal 264 zcmV+j0r&oiP)Px#!bwCyR45gtkg*NJAP_}OM3usWxW+9KlZ2^K$8|<=?+%a~k6>tQa%TlZWC)Rh zgzn(}IX7ec$)!lFqZ>JK7V3A1*0)idu@6LfA(~a5-j#5cq@Q=SKeID1;a&r9CL7sLC`a z5H+0hscqXH+=mQvTxCI=FveDJmjFvRu6UQOA{a!a=v5FO_$7KUs@4~cu1U}+2aLu5 O0000Px#!%0LzR45f=V4x-_-12`x!{!hTB8K*|5VlJQo^RYRd5u^Yp@gJM1$YP9)4A+1-wAYLA8c3Xwjc~o_PG|m#YjX;tFGmUybqxczU(?SMr?yR%v zjNf2t@!AN~08*HBwuomTOaqL@rxC?zFbyyoYp8;p#>m5C3iA(4F;!>)C^J2@0$neI P00000NkvXXu0mjf`8#cI literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/control/tab/next_not.png b/designer_base/src/com/fr/design/images/control/tab/next_not.png new file mode 100644 index 0000000000000000000000000000000000000000..f002a0b9ee64e093045296811dcc45efe22c80d3 GIT binary patch literal 257 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}yFFbTLo`I! zPT0tMSV6$m*Cn-6@vc zG4>qpZVjq>K1cuLx;&eY3Rb>pe_DdimwIxXd}&m1mu-&B*7v_Px#%1J~)R45f=V4wwPIP;&YaLfM%*vw|aCI}KM-u7SX(@TcaKxRBPHCQzkZT+9{ z?;peI|Nj}ZuxSE`u^>x;oc8er!!)1qN&beY< z6m=lADA92?o$(vc_5?;oMiBl6Qh*DfXoM*u#_3o!f($sB$9|2GhsP9X^Fo+`RG|S} W)<$1S+_;JW0000TW{_F literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/control/tab/prev_not.png b/designer_base/src/com/fr/design/images/control/tab/prev_not.png new file mode 100644 index 0000000000000000000000000000000000000000..2530395fd12212d71f33bf72a2a15d8ac0c846d7 GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}r#)R9Lo`IU zPBi3eHsEpfoZ8vwy}|Hs7mK*&@}#z%?uy3A4XxY?jLeE#C&oCYF5$@)(>_=K&%X2d z-{juMFS6Ha=Y4C=PRf^P%ZQwIEb8|Y6P+8Sv57sI3>_96)t_n_E?z6u{a%|MdoIdR zx@TMNZSHT|^_K7+4v-0qT_ou8wd2-z+dYj-=LOr!Y}Q%5bPA`yT4B~j=Vb*0ynbFb znR-8d!tmbO%@8im(4huSngy?{h0iVZTeZS V2G{Tfdx73!@O1TaS?83{1OOMXY<~a% literal 0 HcmV?d00001 diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java index 5da5dd1c73..e8c7c04b02 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java @@ -14,7 +14,7 @@ public class TabMoveEndAction extends TabMoveAction { public TabMoveEndAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { super(t, xCardSwitchButton); this.setName(Inter.getLocText("FR-Designer-Move_Tab_End")); - this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/rightright.png")); + this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/tab/end.png")); } //改变Tab的索引号 diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java index 26195b9462..a2483c01e9 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java @@ -14,7 +14,7 @@ public class TabMoveFirstAction extends TabMoveAction { public TabMoveFirstAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { super(t, xCardSwitchButton); this.setName(Inter.getLocText("FR-Designer-Move_Tab_First")); - this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/leftleft.png")); + this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/tab/first.png")); } @Override diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java index 10e796abc9..f3e34208ca 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java @@ -14,7 +14,7 @@ public class TabMoveNextAction extends TabMoveAction { public TabMoveNextAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { super(t, xCardSwitchButton); this.setName(Inter.getLocText("FR-Designer-Move_Tab_Next")); - this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/right.png")); + this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/tab/next.png")); } @Override diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java index 859a27eea2..94f501c57e 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java @@ -14,7 +14,7 @@ public class TabMovePrevAction extends TabMoveAction { public TabMovePrevAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { super(t, xCardSwitchButton); this.setName(Inter.getLocText("FR-Designer-Move_Tab_Prev")); - this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/left.png")); + this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/tab/prev.png")); } @Override From a4788f9f94b45e179af0f7bcce7f2039471c4372 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 2 May 2017 10:28:45 +0800 Subject: [PATCH 55/60] ct --- .../mainframe/templateinfo/TemplateInfoCollector.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index f8e985f667..e5c6688ec9 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -67,8 +67,16 @@ public class TemplateInfoCollector implements Serializable { try{ ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile())); instance = (TemplateInfoCollector) is.readObject(); - } catch (Exception ex) { + } catch (FileNotFoundException ex) { + // 如果之前没有存储过,则创建新对象 instance = new TemplateInfoCollector(); + } catch (InvalidClassException ex) { + // 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖) + // 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现 + instance = new TemplateInfoCollector(); + } + catch (Exception ex) { + FRLogger.getLogger().error(ex.getMessage(), ex); } } return instance; From 22aa93fff25b1462f2ca5c84ef83f43c02f78d4f Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 2 May 2017 10:34:53 +0800 Subject: [PATCH 56/60] 1 --- .../com/fr/design/mainframe/ConnectorHelper.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/ConnectorHelper.java b/designer_form/src/com/fr/design/mainframe/ConnectorHelper.java index 93add36341..215ff8036d 100644 --- a/designer_form/src/com/fr/design/mainframe/ConnectorHelper.java +++ b/designer_form/src/com/fr/design/mainframe/ConnectorHelper.java @@ -1,15 +1,18 @@ package com.fr.design.mainframe; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import java.util.ArrayList; + +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; +import com.fr.stable.Constants; import com.fr.base.GraphHelper; import com.fr.design.designer.beans.ConnectorCreator; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.form.ui.Connector; -import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; -import com.fr.stable.Constants; - -import java.awt.*; -import java.awt.event.MouseEvent; -import java.util.ArrayList; public class ConnectorHelper { //这个类是用来画连接线的,暂时用不到 From 89240801d5b1d94e66d95824c6d4499c8143e8fe Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 2 May 2017 10:52:50 +0800 Subject: [PATCH 57/60] ct --- .../src/com/fr/design/mainframe/FormSelectionUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java index b288ec2029..7a03782c25 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java @@ -25,7 +25,6 @@ public class FormSelectionUtils { //组件重命名后缀 private static final String POSTFIX = "_c"; - private FormSelectionUtils() { } @@ -134,8 +133,10 @@ public class FormSelectionUtils { boolean xOut = x < 0 || x + copiedCreator.getWidth() / 2 + xoffset > container.getWidth(); boolean yOut = y < 0 || y + copiedCreator.getHeight() / 2 + yoffset > container.getHeight(); + boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset) + && (y - DELAY_X_Y == container.getHeight() - copiedCreator.getHeight() / 2 - yoffset); + y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; - boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset); if (xOut) { if (isEdge) { //向左偏移 From b828924647c4473a9c253c764c87700f2c664914 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 2 May 2017 10:53:07 +0800 Subject: [PATCH 58/60] ct --- .../designer/beans/ConnectorCreator.java | 9 +- .../adapters/layout/FRFitLayoutAdapter.java | 2306 +++++++++-------- .../design/designer/beans/location/Inner.java | 2 +- .../design/designer/creator/XElementCase.java | 10 +- .../designer/creator/XWAbsoluteLayout.java | 924 ++++--- .../design/designer/creator/XWFitLayout.java | 39 +- .../designer/creator/XWScaleLayout.java | 9 +- .../designer/creator/XWTitleLayout.java | 2 +- 8 files changed, 1647 insertions(+), 1654 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java b/designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java index ed83c12d67..ca9934416a 100644 --- a/designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java +++ b/designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java @@ -1,12 +1,13 @@ package com.fr.design.designer.beans; -import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; -import com.fr.form.ui.container.WLayout; - -import java.awt.*; +import java.awt.Point; +import java.awt.Rectangle; import java.util.ArrayList; import java.util.PriorityQueue; +import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; + public class ConnectorCreator { public static final int UNIT = 10; diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index 74a69e525c..03962df487 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -1,1183 +1,1185 @@ -/** - * - */ -package com.fr.design.designer.beans.adapters.layout; - -import com.fr.design.beans.GroupModel; -import com.fr.design.designer.beans.ConstraintsGroupModel; -import com.fr.design.designer.beans.HoverPainter; -import com.fr.design.designer.beans.painters.FRFitLayoutPainter; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWFitLayout; -import com.fr.design.designer.creator.cardlayout.XWCardLayout; -import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; -import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; -import com.fr.design.designer.properties.FRFitLayoutConstraints; -import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; -import com.fr.design.utils.ComponentUtils; -import com.fr.form.ui.LayoutBorderStyle; -import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; -import com.fr.form.ui.container.WLayout; -import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; -import com.fr.general.ComparatorUtils; - +/** + * + */ +package com.fr.design.designer.beans.adapters.layout; + +import com.fr.design.beans.GroupModel; +import com.fr.design.designer.beans.ConstraintsGroupModel; +import com.fr.design.designer.beans.HoverPainter; +import com.fr.design.designer.beans.painters.FRFitLayoutPainter; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.cardlayout.XWCardLayout; +import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; +import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.designer.properties.FRFitLayoutConstraints; +import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; +import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.mainframe.JForm; +import com.fr.design.utils.ComponentUtils; +import com.fr.form.ui.LayoutBorderStyle; +import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; +import com.fr.general.ComparatorUtils; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; + import java.awt.*; import java.util.ArrayList; import java.util.List; -/** - * 自适应布局的容器适配器 - * - * @author jim - * @date 2014-6-24 - */ -public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { - - public static final String WIDGETPANEICONPATH = "/com/fr/web/images/form/resources/layout_absolute.png"; - private static final int DEPENDING_SCOPE = 3; - private HoverPainter painter; - //区分拖拽和编辑宽高 - private boolean isEdit; - - public boolean isEdit() { - return isEdit; - } - - public void setEdit(boolean edit) { - isEdit = edit; - } - - /** - * 构造函数 - * - * @param container XWFitLayout容器 - */ - public FRFitLayoutAdapter(XLayoutContainer container) { - super(container); - painter = new FRFitLayoutPainter(container); - initMinSize(); - } - - private void initMinSize() { - XWFitLayout layout = (XWFitLayout) container; - minWidth = layout.getActualMinWidth(); - minHeight = layout.getActualMinHeight(); - actualVal = layout.getAcualInterval(); - margin = layout.toData().getMargin(); - } - - @Override - public HoverPainter getPainter() { - return painter; - } - - /** - * 返回布局自身属性,方便一些特有设置在layout刷新时处理 - */ - @Override - public GroupModel getLayoutProperties() { - XWFitLayout xfl = (XWFitLayout) container; - return new FRFitLayoutPropertiesGroupModel(xfl); - } - - /** - * 添加组件 - * - * @param child 待添加的组件 - * @param x 坐标x - * @param y 坐标y - */ - @Override - public void addComp(XCreator child, int x, int y) { - fix(child, x, y); - if (child.shouldScaleCreator() || child.hasTitleStyle()) { - addParentCreator(child); - } else { - container.add(child, child.toData().getWidgetName()); - } - XWFitLayout layout = (XWFitLayout) container; - // 更新对应的BoundsWidget - layout.updateBoundsWidget(); - updateCreatorBackBound(); - } - - public void updateCreatorBackBound() { - for (int i = 0, size = container.getComponentCount(); i < size; i++) { - XCreator creator = (XCreator) container.getComponent(i); - creator.updateChildBound(minHeight); - creator.setBackupBound(creator.getBounds()); - } - } - - - private void addParentCreator(XCreator child) { - XLayoutContainer parentPanel = child.initCreatorWrapper(minHeight); - container.add(parentPanel, child.toData().getWidgetName()); - } - - /** - * 能否对应位置放置当前组件 - * - * @param creator 组件 - * @param x 添加的位置x,该位置是相对于container的 - * @param y 添加的位置y,该位置是相对于container的 - * @return 是否可以放置 - */ - @Override - public boolean accept(XCreator creator, int x, int y) { - // 计算是否能拖入鼠标区域时,会用到fix 的方法 - isFindRelatedComps = false; - //拖入组件判断时,先判断是否为交叉点区域,其次三等分区域,再次平分区域 - Component comp = container.getComponentAt(x, y); +/** + * 自适应布局的容器适配器 + * + * @author jim + * @date 2014-6-24 + */ +public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { + + public static final String WIDGETPANEICONPATH = "/com/fr/web/images/form/resources/layout_absolute.png"; + private static final int DEPENDING_SCOPE = 3; + private HoverPainter painter; + //区分拖拽和编辑宽高 + private boolean isEdit; + + public boolean isEdit() { + return isEdit; + } + + public void setEdit(boolean edit) { + isEdit = edit; + } + + /** + * 构造函数 + * + * @param container XWFitLayout容器 + */ + public FRFitLayoutAdapter(XLayoutContainer container) { + super(container); + painter = new FRFitLayoutPainter(container); + initMinSize(); + } + + private void initMinSize() { + XWFitLayout layout = (XWFitLayout) container; + minWidth = layout.getActualMinWidth(); + minHeight = layout.getActualMinHeight(); + actualVal = layout.getAcualInterval(); + margin = layout.toData().getMargin(); + } + + @Override + public HoverPainter getPainter() { + return painter; + } + + /** + * 返回布局自身属性,方便一些特有设置在layout刷新时处理 + */ + @Override + public GroupModel getLayoutProperties() { + XWFitLayout xfl = (XWFitLayout) container; + return new FRFitLayoutPropertiesGroupModel(xfl); + } + + /** + * 添加组件 + * + * @param child 待添加的组件 + * @param x 坐标x + * @param y 坐标y + */ + @Override + public void addComp(XCreator child, int x, int y) { + fix(child, x, y); + if (child.shouldScaleCreator() || child.hasTitleStyle()) { + addParentCreator(child); + } else { + container.add(child, child.toData().getWidgetName()); + } + XWFitLayout layout = (XWFitLayout) container; + // 更新对应的BoundsWidget + layout.updateBoundsWidget(); + updateCreatorBackBound(); + } + + public void updateCreatorBackBound() { + for (int i = 0, size = container.getComponentCount(); i < size; i++) { + XCreator creator = (XCreator) container.getComponent(i); + creator.updateChildBound(minHeight); + creator.setBackupBound(creator.getBounds()); + } + } + + + private void addParentCreator(XCreator child) { + XLayoutContainer parentPanel = child.initCreatorWrapper(minHeight); + container.add(parentPanel, child.toData().getWidgetName()); + } + + /** + * 能否对应位置放置当前组件 + * + * @param creator 组件 + * @param x 添加的位置x,该位置是相对于container的 + * @param y 添加的位置y,该位置是相对于container的 + * @return 是否可以放置 + */ + @Override + public boolean accept(XCreator creator, int x, int y) { + // 计算是否能拖入鼠标区域时,会用到fix 的方法 + isFindRelatedComps = false; + //拖入组件判断时,先判断是否为交叉点区域,其次三等分区域,再次平分区域 + Component comp = container.getComponentAt(x, y); if (comp == null || checkInterval(comp)) { - return false; - } - //如果当前处于边缘地带, 那么就把他贴到父容器上 - boolean isMatchEdge = matchEdge(x, y); - - int componentHeight = comp.getHeight(); - int componentWidth = comp.getWidth(); - //上半部分高度 - int upHeight = (int) (componentHeight * TOP_HALF) + comp.getY(); - //下半部分高度 - int downHeight = (int) (componentHeight * BOTTOM_HALF) + comp.getY(); - - //布局控件要先判断是不是可编辑 - XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator) comp).getTopLayout(); - if (topLayout != null && !isMatchEdge && !topLayout.isEditable()) { - return false; - } - - if (isCrossPointArea(comp, x, y)) { - return canAcceptWhileCrossPoint(comp, x, y); - } - - if (isTrisectionArea(comp, x, y)) { - return canAcceptWhileTrisection(comp, x, y); - } - - boolean horizonValid = componentWidth >= minWidth * 2 + actualVal; - boolean verticalValid = componentHeight >= minHeight * 2 + actualVal; - return y > upHeight && y < downHeight ? horizonValid : verticalValid; - } - - // 间隔区域 - private boolean checkInterval(Component comp) { - return container.getComponentCount() > 0 && comp == container; - } - - /** - * 是否在组件边缘 - * - * @param x 横坐标 - * @param y 纵坐标 - * @return 是否在组件边缘 - */ - public boolean matchEdge(int x, int y) { - if (intersectsEdge(x, y, container)) { - //寻找最近的fit, 在边缘地段添加的控件, 将其送给该fit - XLayoutContainer parent = container.findNearestFit(); - container = parent != null ? parent : container; - return true; - } - return false; - } - - /** - * 是否在组件边缘 - * - * @param x 横坐标 - * @param y 纵坐标 - * @param container 参照组件 - * @return 是否在组件边缘 - */ - //是否包含于边缘地段, 按顺序上, 下, 左, 右检测 - public boolean intersectsEdge(int x, int y, XLayoutContainer container) { - int containerX = container.getX(); - int containerY = container.getY(); - int containerWidth = container.getWidth(); - int containerHeight = container.getHeight(); - - // 当前坐标点 - Rectangle currentXY = new Rectangle(x, y, 1, 1); - // 上边缘 - Rectangle upEdge = new Rectangle(containerX, containerY, containerWidth, BORDER_PROPORTION); - if (upEdge.intersects(currentXY)) { - return true; - } - - int bottomY = containerY + containerHeight - BORDER_PROPORTION; - // 下边缘 - Rectangle bottomEdge = new Rectangle(containerX, bottomY, containerWidth, BORDER_PROPORTION); - if (bottomEdge.intersects(currentXY)) { - return true; - } - - //左右边缘的高度 -10*2 是为了不和上下边缘重合 - int verticalHeight = containerHeight - BORDER_PROPORTION * 2; - int leftY = containerY + BORDER_PROPORTION; - // 左边缘 - Rectangle leftEdge = new Rectangle(containerX, leftY, BORDER_PROPORTION, verticalHeight); - if (leftEdge.intersects(currentXY)) { - return true; - } - - int rightY = containerY + BORDER_PROPORTION; - int rightX = containerX + containerWidth - BORDER_PROPORTION; - // 右边缘 - Rectangle rightEdge = new Rectangle(rightX, rightY, BORDER_PROPORTION, verticalHeight); - return rightEdge.intersects(currentXY); - } - - /** - * 交叉点区域时,能否对应位置放入组件 - */ - protected boolean canAcceptWhileCrossPoint(Component comp, int x, int y) { - return super.canAcceptWhileCrossPoint(comp, x, y); - } - - protected boolean canAcceptWhileTrisection(Component comp, int x, int y) { - return super.canAcceptWhileTrisection(comp, x, y); - } - - /** - * 判断是否鼠标在组件的三等分区域,如果组件在布局管理器中间,上下左右都可能会三等分 - * - * @param parentComp 鼠标所在区域的组件 - * @param x 坐标x - * @param y 坐标y - * @return 是则返回true - */ - public boolean isTrisectionArea(Component parentComp, int x, int y) { - return super.isTrisectionArea(parentComp, x, y); - } - - /** - * 是否为组件交叉点区域 或者是相邻三组建中间点 - * - * @param currentComp 当前组件 - * @param x 坐标x - * @param y 坐标y - * @return 是则返回true - */ - public boolean isCrossPointArea(Component currentComp, int x, int y) { - return super.isCrossPointArea(currentComp, x, y); - } - - + return false; + } + //如果当前处于边缘地带, 那么就把他贴到父容器上 + boolean isMatchEdge = matchEdge(x, y); + + int componentHeight = comp.getHeight(); + int componentWidth = comp.getWidth(); + //上半部分高度 + int upHeight = (int) (componentHeight * TOP_HALF) + comp.getY(); + //下半部分高度 + int downHeight = (int) (componentHeight * BOTTOM_HALF) + comp.getY(); + + //布局控件要先判断是不是可编辑 + XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator) comp).getTopLayout(); + if (topLayout != null && !isMatchEdge && !topLayout.isEditable()) { + return false; + } + + if (isCrossPointArea(comp, x, y)) { + return canAcceptWhileCrossPoint(comp, x, y); + } + + if (isTrisectionArea(comp, x, y)) { + return canAcceptWhileTrisection(comp, x, y); + } + + boolean horizonValid = componentWidth >= minWidth * 2 + actualVal; + boolean verticalValid = componentHeight >= minHeight * 2 + actualVal; + return y > upHeight && y < downHeight ? horizonValid : verticalValid; + } + + // 间隔区域 + private boolean checkInterval(Component comp) { + return container.getComponentCount() > 0 && comp == container; + } + + /** + * 是否在组件边缘 + * + * @param x 横坐标 + * @param y 纵坐标 + * @return 是否在组件边缘 + */ + public boolean matchEdge(int x, int y) { + if (intersectsEdge(x, y, container)) { + //寻找最近的fit, 在边缘地段添加的控件, 将其送给该fit + XLayoutContainer parent = container.findNearestFit(); + container = parent != null ? parent : container; + return true; + } + return false; + } + + /** + * 是否在组件边缘 + * + * @param x 横坐标 + * @param y 纵坐标 + * @param container 参照组件 + * @return 是否在组件边缘 + */ + //是否包含于边缘地段, 按顺序上, 下, 左, 右检测 + public boolean intersectsEdge(int x, int y, XLayoutContainer container) { + int containerX = container.getX(); + int containerY = container.getY(); + int containerWidth = container.getWidth(); + int containerHeight = container.getHeight(); + + // 当前坐标点 + Rectangle currentXY = new Rectangle(x, y, 1, 1); + // 上边缘 + Rectangle upEdge = new Rectangle(containerX, containerY, containerWidth, BORDER_PROPORTION); + if (upEdge.intersects(currentXY)) { + return true; + } + + int bottomY = containerY + containerHeight - BORDER_PROPORTION; + // 下边缘 + Rectangle bottomEdge = new Rectangle(containerX, bottomY, containerWidth, BORDER_PROPORTION); + if (bottomEdge.intersects(currentXY)) { + return true; + } + + //左右边缘的高度 -10*2 是为了不和上下边缘重合 + int verticalHeight = containerHeight - BORDER_PROPORTION * 2; + int leftY = containerY + BORDER_PROPORTION; + // 左边缘 + Rectangle leftEdge = new Rectangle(containerX, leftY, BORDER_PROPORTION, verticalHeight); + if (leftEdge.intersects(currentXY)) { + return true; + } + + int rightY = containerY + BORDER_PROPORTION; + int rightX = containerX + containerWidth - BORDER_PROPORTION; + // 右边缘 + Rectangle rightEdge = new Rectangle(rightX, rightY, BORDER_PROPORTION, verticalHeight); + return rightEdge.intersects(currentXY); + } + + /** + * 交叉点区域时,能否对应位置放入组件 + */ + protected boolean canAcceptWhileCrossPoint(Component comp, int x, int y) { + return super.canAcceptWhileCrossPoint(comp, x, y); + } + + protected boolean canAcceptWhileTrisection(Component comp, int x, int y) { + return super.canAcceptWhileTrisection(comp, x, y); + } + + /** + * 判断是否鼠标在组件的三等分区域,如果组件在布局管理器中间,上下左右都可能会三等分 + * + * @param parentComp 鼠标所在区域的组件 + * @param x 坐标x + * @param y 坐标y + * @return 是则返回true + */ + public boolean isTrisectionArea(Component parentComp, int x, int y) { + return super.isTrisectionArea(parentComp, x, y); + } + + /** + * 是否为组件交叉点区域 或者是相邻三组建中间点 + * + * @param currentComp 当前组件 + * @param x 坐标x + * @param y 坐标y + * @return 是则返回true + */ + public boolean isCrossPointArea(Component currentComp, int x, int y) { + return super.isCrossPointArea(currentComp, x, y); + } + + protected Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout) { - return mainLayout.getBounds(); - } - - private Rectangle adjustBackupBound(Rectangle backupBound, XWCardMainBorderLayout mainLayout) { + return mainLayout.getBounds(); + } + + private Rectangle adjustBackupBound(Rectangle backupBound, XWCardMainBorderLayout mainLayout) { // zhouping: REPORT-2334 表单tab布局中图表放大缩小会明显 // 这边不需要单独处理参数面板高度了,下面的方法中获取的是XWCardMainBorderLayout相对坐标 - Rectangle rec = getLayoutBound(mainLayout); - // XWTabLayout里面的横纵坐标收到外层XWCardMainBorderLayout的横纵坐标影响 - // 减掉之后可以按照它原来的逻辑执行 - backupBound.x -= rec.x; - backupBound.y -= rec.y; - XWCardLayout cardLayout = mainLayout.getCardPart(); - LayoutBorderStyle style = cardLayout.toData().getBorderStyle(); - // 当tab布局为标题样式时,才需要处理标题栏高度产生的影响 - if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { - backupBound.y -= WCardMainBorderLayout.TAB_HEIGHT; - } - return backupBound; - } - - /** - * 拖拽控件边框后,根据控件的大小尺寸,进行相关组件的调整 - * - * @param creator 组件 - */ - @Override - public void fix(XCreator creator) { - //拖拽组件原大小、位置 - Rectangle backupBound = creator.getBackupBound(); - backupBound.x -= container.getX(); - backupBound.y -= container.getY(); - //当前拖拽组件的位置 - int x = creator.getX(); - int y = creator.getY(); - - // 获取容器所有内部组件横坐标 - int[] posXs = container.getHors(); - // 获取容器所有内部组件纵坐标 - int[] posYs = container.getVeris(); - - XLayoutContainer outerLayout = container.getOuterLayout(); - if (!ComparatorUtils.equals(outerLayout, container.getBackupParent())) { - XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) outerLayout; - backupBound = adjustBackupBound(backupBound, mainLayout); - } - - //拖拽组件拖拽以后的大小 - int w = creator.getWidth(); - int h = creator.getHeight(); - initCompsList(); - creator.setBounds(backupBound); - int difference = 0; - if (x != backupBound.x) { - dealLeft(backupBound, x, posXs, difference, creator); - } else if (w != backupBound.width) { - dealRight(backupBound, x, w, posXs, difference, creator); - } else if (y != backupBound.y) { - dealTop(backupBound, y, posYs, difference, creator); - } else if (h != backupBound.height) { - dealButtom(backupBound, y, h, posYs, difference, creator); - } - clearCompsList(); - XWFitLayout layout = (XWFitLayout) container; - layout.updateBoundsWidget(); // 更新对应的BoundsWidget - updateCreatorBackBound(); - } - - /** - * 拖拽控件边框后,根据控件的大小尺寸,进行相关组件的调整 - * - * @param backupBound 边界备份 + Rectangle rec = getLayoutBound(mainLayout); + // XWTabLayout里面的横纵坐标收到外层XWCardMainBorderLayout的横纵坐标影响 + // 减掉之后可以按照它原来的逻辑执行 + backupBound.x -= rec.x; + backupBound.y -= rec.y; + XWCardLayout cardLayout = mainLayout.getCardPart(); + LayoutBorderStyle style = cardLayout.toData().getBorderStyle(); + // 当tab布局为标题样式时,才需要处理标题栏高度产生的影响 + if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { + backupBound.y -= WCardMainBorderLayout.TAB_HEIGHT; + } + return backupBound; + } + + /** + * 拖拽控件边框后,根据控件的大小尺寸,进行相关组件的调整 + * + * @param creator 组件 + */ + @Override + public void fix(XCreator creator) { + //拖拽组件原大小、位置 + Rectangle backupBound = creator.getBackupBound(); + backupBound.x -= container.getX(); + backupBound.y -= container.getY(); + //当前拖拽组件的位置 + int x = creator.getX(); + int y = creator.getY(); + + // 获取容器所有内部组件横坐标 + int[] posXs = container.getHors(); + // 获取容器所有内部组件纵坐标 + int[] posYs = container.getVeris(); + + XLayoutContainer outerLayout = container.getOuterLayout(); + if (!ComparatorUtils.equals(outerLayout, container.getBackupParent())) { + XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) outerLayout; + backupBound = adjustBackupBound(backupBound, mainLayout); + } + + //拖拽组件拖拽以后的大小 + int w = creator.getWidth(); + int h = creator.getHeight(); + initCompsList(); + creator.setBounds(backupBound); + int difference = 0; + if (x != backupBound.x) { + dealLeft(backupBound, x, posXs, difference, creator); + } else if (w != backupBound.width) { + dealRight(backupBound, x, w, posXs, difference, creator); + } else if (y != backupBound.y) { + dealTop(backupBound, y, posYs, difference, creator); + } else if (h != backupBound.height) { + dealButtom(backupBound, y, h, posYs, difference, creator); + } + clearCompsList(); + XWFitLayout layout = (XWFitLayout) container; + layout.updateBoundsWidget(); // 更新对应的BoundsWidget + updateCreatorBackBound(); + } + + /** + * 拖拽控件边框后,根据控件的大小尺寸,进行相关组件的调整 + * + * @param backupBound 边界备份 * @param bounds 组件边界 * @param xCreator 组件 * @param row 选中的行 * @param difference 偏移量 - */ - public void calculateBounds(Rectangle backupBound, Rectangle bounds, XCreator xCreator, int row, int difference) { + */ + public void calculateBounds(Rectangle backupBound, Rectangle bounds, XCreator xCreator, int row, int difference) { Rectangle rc = new Rectangle(0, 0, 0, 0); - XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(xCreator); - if (parent != null) { - Rectangle rec = ComponentUtils.getRelativeBounds(parent); - rc.x = rec.x; - rc.y = rec.y; - } - int x = backupBound.x - rc.x, y = backupBound.y - rc.y; - //处理左右延伸 - switch (row) { - case 0: + XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(xCreator); + if (parent != null) { + Rectangle rec = ComponentUtils.getRelativeBounds(parent); + rc.x = rec.x; + rc.y = rec.y; + } + int x = backupBound.x - rc.x, y = backupBound.y - rc.y; + //处理左右延伸 + switch (row) { + case 0: if (backupBound.width + backupBound.x == container.getWidth() - margin.getRight() + rc.x) { - x += difference; - } - break; - case 1: + x += difference; + } + break; + case 1: if (backupBound.y + backupBound.height == container.getHeight() - margin.getBottom() + rc.y) { - y += difference; - } - break; - } + y += difference; + } + break; + } bounds.setLocation(x, y); - xCreator.setBackupBound(backupBound); - xCreator.setBounds(bounds); - this.fix(xCreator); - } - - private void dealLeft(Rectangle backupBound, int x, int[] posXs, int difference, XCreator creator) { - if (backupBound.x == margin.getLeft()) { - return; - } - x = adjustCoordinateByDependingLine(x, posXs); - difference = x - backupBound.x; - dealDirectionAtLeft(backupBound, difference, creator); - } - - private void dealRight(Rectangle backupBound, int x, int w, int[] posXs, int difference, XCreator creator) { - if (backupBound.width + backupBound.x == container.getWidth() - margin.getRight()) { - return; - } - w = adjustDiffByDependingLine(x, posXs, w); - difference = w - backupBound.width; //拖拽长度 - dealDirectionAtRight(backupBound, difference, creator); - } - - private void dealTop(Rectangle backupBound, int y, int[] posYs, int difference, XCreator creator) { - if (backupBound.y == margin.getTop()) { - return; - } - y = adjustCoordinateByDependingLine(y, posYs); - difference = y - backupBound.y; - dealDirectionAtTop(backupBound, difference, creator); - } - - private void dealButtom(Rectangle backupBound, int y, int h, int[] posYs, int difference, XCreator creator) { - if (backupBound.y + backupBound.height == container.getHeight() - margin.getBottom()) { - return; - } - h = adjustDiffByDependingLine(y, posYs, h); - difference = h - backupBound.height; - dealDirectionABottom(backupBound, difference, creator); - } - - // 根据需要依附的位置调整拖拽的坐标值 - private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) { + xCreator.setBackupBound(backupBound); + xCreator.setBounds(bounds); + this.fix(xCreator); + } + + private void dealLeft(Rectangle backupBound, int x, int[] posXs, int difference, XCreator creator) { + if (backupBound.x == margin.getLeft()) { + return; + } + x = adjustCoordinateByDependingLine(x, posXs); + difference = x - backupBound.x; + dealDirectionAtLeft(backupBound, difference, creator); + } + + private void dealRight(Rectangle backupBound, int x, int w, int[] posXs, int difference, XCreator creator) { + if (backupBound.width + backupBound.x == container.getWidth() - margin.getRight()) { + return; + } + w = adjustDiffByDependingLine(x, posXs, w); + difference = w - backupBound.width; //拖拽长度 + dealDirectionAtRight(backupBound, difference, creator); + } + + private void dealTop(Rectangle backupBound, int y, int[] posYs, int difference, XCreator creator) { + if (backupBound.y == margin.getTop()) { + return; + } + y = adjustCoordinateByDependingLine(y, posYs); + difference = y - backupBound.y; + dealDirectionAtTop(backupBound, difference, creator); + } + + private void dealButtom(Rectangle backupBound, int y, int h, int[] posYs, int difference, XCreator creator) { + if (backupBound.y + backupBound.height == container.getHeight() - margin.getBottom()) { + return; + } + h = adjustDiffByDependingLine(y, posYs, h); + difference = h - backupBound.height; + dealDirectionABottom(backupBound, difference, creator); + } + + // 根据需要依附的位置调整拖拽的坐标值 + private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) { if (!isEdit) { - for (int i = 0; i < coordinates.length; i++) { - if (coordinate == coordinates[i]) { - continue; - } - if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) { - coordinate = coordinates[i]; - break; - } - } - } - return coordinate; - } - - // 根据需要依附的位置调整拖拽的距离 - private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) { + for (int i = 0; i < coordinates.length; i++) { + if (coordinate == coordinates[i]) { + continue; + } + if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) { + coordinate = coordinates[i]; + break; + } + } + } + return coordinate; + } + + // 根据需要依附的位置调整拖拽的距离 + private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) { if (!isEdit) { - for (int i = 0; i < coordinates.length; i++) { - if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) { - diff = coordinates[i] - coordinate; - break; - } - } - } - return diff; - } - - // 左侧边框拉伸,循环找出对齐的两侧控件 - private void dealDirectionAtLeft(Rectangle backupBound, int difference, Component creator) { - rightComps.add(creator); - Component rightComp = null; - int leftx = backupBound.x - DEFAULT_AREA_LENGTH - actualVal; - // 取左侧边框右面的组件x值 - int rightx = backupBound.x + DEFAULT_AREA_LENGTH; - Component leftComp = container.getLeftComp(backupBound.x, backupBound.y); - leftComps.add(leftComp); - //先找上侧对齐时(y相等)的左右两边组件 - int ry = backupBound.y; - int ly = leftComp.getY(); - int min = margin.getTop(); - int max = container.getHeight() - margin.getBottom(); - while (ry >= min && ly >= min) { - if (ry == ly) { - break; - } else { - if (ry > ly) { - rightComp = container.getTopComp(rightx, ry); - ry = rightComp.getY(); - rightComps.add(rightComp); - } else { - leftComp = container.getTopComp(leftx, ly); - ly = leftComp.getY(); - leftComps.add(leftComp); - } - } - } - // 下侧对齐时(y+h相等)两边组件 - ry = backupBound.y + backupBound.height; - ly = leftComps.get(0).getY() + leftComps.get(0).getHeight(); - while (ry <= max && ly <= max) { - if (ry == ly) { - break; - } else { - if (ry > ly) { - leftComp = container.getComponentAt(leftx, ly + DEFAULT_AREA_LENGTH + actualVal); - ly = leftComp.getY() + leftComp.getHeight(); - leftComps.add(leftComp); - } else { - rightComp = container.getComponentAt(rightx, ry + DEFAULT_AREA_LENGTH + actualVal); - ry = rightComp.getY() + rightComp.getHeight(); - rightComps.add(rightComp); - } - } - } - dealHorDirection(backupBound.x, difference); - } - - // 右侧边框拉伸,循环找出对齐的两侧控件 - private void dealDirectionAtRight(Rectangle backupBound, int difference, Component creator) { - leftComps.add(creator); - Component leftComp = null; - int leftx = backupBound.x + backupBound.width - DEFAULT_AREA_LENGTH; - // 取右侧边框右面的组件x值 - int rightx = backupBound.x + backupBound.width + DEFAULT_AREA_LENGTH + actualVal; - Component rightComp = container.getRightComp(backupBound.x, backupBound.y, backupBound.width); - rightComps.add(rightComp); - int ly = backupBound.y, ry = rightComp.getY(); - int min = margin.getTop(); - int max = container.getHeight() - margin.getBottom(); - while (ry >= min && ly >= min) { - if (ry == ly) { - break; - } else { - if (ry > ly) { - rightComp = container.getTopComp(rightx, ry); - ry = rightComp.getY(); - rightComps.add(rightComp); - } else { - leftComp = container.getTopComp(leftx, ly); - ly = leftComp.getY(); - leftComps.add(leftComp); - } - } - } - ly = backupBound.y + backupBound.height; - ry = rightComps.get(0).getY() + rightComps.get(0).getHeight(); - while (ry <= max && ly <= max) { - if (ry == ly) { - break; - } else { - if (ry > ly) { - leftComp = container.getComponentAt(leftx, ly + DEFAULT_AREA_LENGTH + actualVal); - ly = leftComp.getY() + leftComp.getHeight(); - leftComps.add(leftComp); - } else { - rightComp = container.getComponentAt(rightx, ry + DEFAULT_AREA_LENGTH + actualVal); - ry = rightComp.getY() + rightComp.getHeight(); - rightComps.add(rightComp); - } - } - } - dealHorDirection(backupBound.x + backupBound.width + actualVal, difference); - } - - /** - * 水平方向上拉伸边框的处理 - */ - private void dealHorDirection(int objx, int difference) { - if (difference > 0) { - difference = Math.min(getMinWidth(rightComps) - minWidth, difference); - } else { - difference = Math.max(difference, minWidth - getMinWidth(leftComps)); - } - //重新计算左右两侧组件size、point + for (int i = 0; i < coordinates.length; i++) { + if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) { + diff = coordinates[i] - coordinate; + break; + } + } + } + return diff; + } + + // 左侧边框拉伸,循环找出对齐的两侧控件 + private void dealDirectionAtLeft(Rectangle backupBound, int difference, Component creator) { + rightComps.add(creator); + Component rightComp = null; + int leftx = backupBound.x - DEFAULT_AREA_LENGTH - actualVal; + // 取左侧边框右面的组件x值 + int rightx = backupBound.x + DEFAULT_AREA_LENGTH; + Component leftComp = container.getLeftComp(backupBound.x, backupBound.y); + leftComps.add(leftComp); + //先找上侧对齐时(y相等)的左右两边组件 + int ry = backupBound.y; + int ly = leftComp.getY(); + int min = margin.getTop(); + int max = container.getHeight() - margin.getBottom(); + while (ry >= min && ly >= min) { + if (ry == ly) { + break; + } else { + if (ry > ly) { + rightComp = container.getTopComp(rightx, ry); + ry = rightComp.getY(); + rightComps.add(rightComp); + } else { + leftComp = container.getTopComp(leftx, ly); + ly = leftComp.getY(); + leftComps.add(leftComp); + } + } + } + // 下侧对齐时(y+h相等)两边组件 + ry = backupBound.y + backupBound.height; + ly = leftComps.get(0).getY() + leftComps.get(0).getHeight(); + while (ry <= max && ly <= max) { + if (ry == ly) { + break; + } else { + if (ry > ly) { + leftComp = container.getComponentAt(leftx, ly + DEFAULT_AREA_LENGTH + actualVal); + ly = leftComp.getY() + leftComp.getHeight(); + leftComps.add(leftComp); + } else { + rightComp = container.getComponentAt(rightx, ry + DEFAULT_AREA_LENGTH + actualVal); + ry = rightComp.getY() + rightComp.getHeight(); + rightComps.add(rightComp); + } + } + } + dealHorDirection(backupBound.x, difference); + } + + // 右侧边框拉伸,循环找出对齐的两侧控件 + private void dealDirectionAtRight(Rectangle backupBound, int difference, Component creator) { + leftComps.add(creator); + Component leftComp = null; + int leftx = backupBound.x + backupBound.width - DEFAULT_AREA_LENGTH; + // 取右侧边框右面的组件x值 + int rightx = backupBound.x + backupBound.width + DEFAULT_AREA_LENGTH + actualVal; + Component rightComp = container.getRightComp(backupBound.x, backupBound.y, backupBound.width); + rightComps.add(rightComp); + int ly = backupBound.y, ry = rightComp.getY(); + int min = margin.getTop(); + int max = container.getHeight() - margin.getBottom(); + while (ry >= min && ly >= min) { + if (ry == ly) { + break; + } else { + if (ry > ly) { + rightComp = container.getTopComp(rightx, ry); + ry = rightComp.getY(); + rightComps.add(rightComp); + } else { + leftComp = container.getTopComp(leftx, ly); + ly = leftComp.getY(); + leftComps.add(leftComp); + } + } + } + ly = backupBound.y + backupBound.height; + ry = rightComps.get(0).getY() + rightComps.get(0).getHeight(); + while (ry <= max && ly <= max) { + if (ry == ly) { + break; + } else { + if (ry > ly) { + leftComp = container.getComponentAt(leftx, ly + DEFAULT_AREA_LENGTH + actualVal); + ly = leftComp.getY() + leftComp.getHeight(); + leftComps.add(leftComp); + } else { + rightComp = container.getComponentAt(rightx, ry + DEFAULT_AREA_LENGTH + actualVal); + ry = rightComp.getY() + rightComp.getHeight(); + rightComps.add(rightComp); + } + } + } + dealHorDirection(backupBound.x + backupBound.width + actualVal, difference); + } + + /** + * 水平方向上拉伸边框的处理 + */ + private void dealHorDirection(int objx, int difference) { + if (difference > 0) { + difference = Math.min(getMinWidth(rightComps) - minWidth, difference); + } else { + difference = Math.max(difference, minWidth - getMinWidth(leftComps)); + } + //重新计算左右两侧组件size、point if (calculateLefttRelatComponent(difference)) { calculateRightRelatComponent(objx + difference, -difference); - } - } - - // 上侧边框拉伸,循环找出对齐的两侧控件 - private void dealDirectionAtTop(Rectangle backupBound, int difference, Component creator) { - downComps.add(creator); - // 取上侧边框上面的组件用的y值 - int topy = backupBound.y - DEFAULT_AREA_LENGTH - actualVal; - // 上侧边框下面的组件y值 - int bottomy = backupBound.y + DEFAULT_AREA_LENGTH; - Component topComp = container.getTopComp(backupBound.x, backupBound.y); - upComps.add(topComp); - Component bottomComp = null; - int min = margin.getLeft(); - int max = container.getWidth() - margin.getRight(); - //先找左侧侧对齐时(x相等)的上下两边组件 - int ux = topComp.getX(); - int dx = backupBound.x; - while (ux >= min && dx >= min) { - if (ux == dx) { - break; - } else { - if (ux < dx) { - bottomComp = container.getLeftComp(dx, bottomy); - dx = bottomComp.getX(); - downComps.add(bottomComp); - } else { - topComp = container.getLeftComp(ux, topy); - ux = topComp.getX(); - upComps.add(topComp); - } - } - } - // 右侧对齐时(x+w相等)两边组件 - ux = upComps.get(0).getX() + upComps.get(0).getWidth(); - dx = backupBound.x + backupBound.width; - while (ux <= max && dx <= max) { - if (ux == dx) { - break; - } else { - if (ux < dx) { - topComp = container.getComponentAt(ux + DEFAULT_AREA_LENGTH + actualVal, topy); - ux = topComp.getX() + topComp.getWidth(); - upComps.add(topComp); - } else { - bottomComp = container.getComponentAt(dx + DEFAULT_AREA_LENGTH + actualVal, bottomy); - dx = bottomComp.getX() + bottomComp.getWidth(); - downComps.add(bottomComp); - } - } - } - - dealVertiDirection(backupBound.y, difference); - } - - // 下侧边框拉伸,循环找出对齐的两侧控件 - private void dealDirectionABottom(Rectangle backupBound, int difference, Component creator) { - upComps.add(creator); - Component topComp = null; - Component bottomComp = container.getBottomComp(backupBound.x, backupBound.y, backupBound.height); - // 下侧边框下面的组件y坐标 - int bottomy = backupBound.y + backupBound.height + DEFAULT_AREA_LENGTH + actualVal; - // 取下侧边框上面的组件用的y值 - int topy = backupBound.y + backupBound.height - DEFAULT_AREA_LENGTH; - downComps.add(bottomComp); - int dx = bottomComp.getX(); - int ux = backupBound.x; - int min = margin.getLeft(); - int max = container.getWidth() - margin.getRight(); - while (ux >= min && dx >= min) { - if (ux == dx) { - break; - } else { - if (ux < dx) { - bottomComp = container.getLeftComp(dx, bottomy); - dx = bottomComp.getX(); - downComps.add(bottomComp); - } else { - topComp = container.getLeftComp(ux, topy); - ux = topComp.getX(); - upComps.add(topComp); - } - } - } - dx = downComps.get(0).getX() + downComps.get(0).getWidth(); - ux = backupBound.x + backupBound.width; - while (ux <= max && dx <= max) { - if (ux == dx) { - break; - } else { - if (ux < dx) { - topComp = container.getComponentAt(ux + DEFAULT_AREA_LENGTH + actualVal, topy); - ux = topComp.getX() + topComp.getWidth(); - upComps.add(topComp); - } else { - bottomComp = container.getComponentAt(dx + DEFAULT_AREA_LENGTH + actualVal, bottomy); - dx = bottomComp.getX() + bottomComp.getWidth(); - downComps.add(bottomComp); - } - } - } - dealVertiDirection(backupBound.y + backupBound.height + actualVal, difference); - } - - /** - * 垂直方向上拉伸边框的处理 - */ - private void dealVertiDirection(int objY, int difference) { - if (difference > 0) { - difference = Math.min(getMinHeight(downComps) - minHeight, difference); - } else { - difference = Math.max(difference, minHeight - getMinHeight(upComps)); - } - //重新计算上下两侧组件size、point + } + } + + // 上侧边框拉伸,循环找出对齐的两侧控件 + private void dealDirectionAtTop(Rectangle backupBound, int difference, Component creator) { + downComps.add(creator); + // 取上侧边框上面的组件用的y值 + int topy = backupBound.y - DEFAULT_AREA_LENGTH - actualVal; + // 上侧边框下面的组件y值 + int bottomy = backupBound.y + DEFAULT_AREA_LENGTH; + Component topComp = container.getTopComp(backupBound.x, backupBound.y); + upComps.add(topComp); + Component bottomComp = null; + int min = margin.getLeft(); + int max = container.getWidth() - margin.getRight(); + //先找左侧侧对齐时(x相等)的上下两边组件 + int ux = topComp.getX(); + int dx = backupBound.x; + while (ux >= min && dx >= min) { + if (ux == dx) { + break; + } else { + if (ux < dx) { + bottomComp = container.getLeftComp(dx, bottomy); + dx = bottomComp.getX(); + downComps.add(bottomComp); + } else { + topComp = container.getLeftComp(ux, topy); + ux = topComp.getX(); + upComps.add(topComp); + } + } + } + // 右侧对齐时(x+w相等)两边组件 + ux = upComps.get(0).getX() + upComps.get(0).getWidth(); + dx = backupBound.x + backupBound.width; + while (ux <= max && dx <= max) { + if (ux == dx) { + break; + } else { + if (ux < dx) { + topComp = container.getComponentAt(ux + DEFAULT_AREA_LENGTH + actualVal, topy); + ux = topComp.getX() + topComp.getWidth(); + upComps.add(topComp); + } else { + bottomComp = container.getComponentAt(dx + DEFAULT_AREA_LENGTH + actualVal, bottomy); + dx = bottomComp.getX() + bottomComp.getWidth(); + downComps.add(bottomComp); + } + } + } + + dealVertiDirection(backupBound.y, difference); + } + + // 下侧边框拉伸,循环找出对齐的两侧控件 + private void dealDirectionABottom(Rectangle backupBound, int difference, Component creator) { + upComps.add(creator); + Component topComp = null; + Component bottomComp = container.getBottomComp(backupBound.x, backupBound.y, backupBound.height); + // 下侧边框下面的组件y坐标 + int bottomy = backupBound.y + backupBound.height + DEFAULT_AREA_LENGTH + actualVal; + // 取下侧边框上面的组件用的y值 + int topy = backupBound.y + backupBound.height - DEFAULT_AREA_LENGTH; + downComps.add(bottomComp); + int dx = bottomComp.getX(); + int ux = backupBound.x; + int min = margin.getLeft(); + int max = container.getWidth() - margin.getRight(); + while (ux >= min && dx >= min) { + if (ux == dx) { + break; + } else { + if (ux < dx) { + bottomComp = container.getLeftComp(dx, bottomy); + dx = bottomComp.getX(); + downComps.add(bottomComp); + } else { + topComp = container.getLeftComp(ux, topy); + ux = topComp.getX(); + upComps.add(topComp); + } + } + } + dx = downComps.get(0).getX() + downComps.get(0).getWidth(); + ux = backupBound.x + backupBound.width; + while (ux <= max && dx <= max) { + if (ux == dx) { + break; + } else { + if (ux < dx) { + topComp = container.getComponentAt(ux + DEFAULT_AREA_LENGTH + actualVal, topy); + ux = topComp.getX() + topComp.getWidth(); + upComps.add(topComp); + } else { + bottomComp = container.getComponentAt(dx + DEFAULT_AREA_LENGTH + actualVal, bottomy); + dx = bottomComp.getX() + bottomComp.getWidth(); + downComps.add(bottomComp); + } + } + } + dealVertiDirection(backupBound.y + backupBound.height + actualVal, difference); + } + + /** + * 垂直方向上拉伸边框的处理 + */ + private void dealVertiDirection(int objY, int difference) { + if (difference > 0) { + difference = Math.min(getMinHeight(downComps) - minHeight, difference); + } else { + difference = Math.max(difference, minHeight - getMinHeight(upComps)); + } + //重新计算上下两侧组件size、point if (calculateUpRelatComponent(difference)) { calculateDownRelatComponent(objY + difference, -difference); - } - } - - /** - * 新拖入组件时,计算调整其他关联组件位置大小 - * - * @param child 新拖入的组件 - * @param x 鼠标所在x坐标 - * @param y 鼠标所在y坐标 - */ - public void fix(XCreator child, int x, int y) { - Component parentComp = container.getComponentAt(x, y); - if (container.getComponentCount() == 0) { - child.setLocation(0, 0); - child.setSize(parentComp.getWidth(), parentComp.getHeight()); - } else if (isCrossPointArea(parentComp, x, y)) { - //交叉区域插入组件时,根据具体位置进行上下或者左右或者相邻三个组件的位置大小插入 - fixCrossPointArea(parentComp, child, x, y); - return; - } else if (isTrisectionArea(parentComp, x, y)) { - // 在边界三等分区域,就不再和组件二等分了 - fixTrisect(parentComp, child, x, y); - return; - } else { - fixHalve(parentComp, child, x, y); - } - } - - /** - * 平分,正常情况拖入组件时,按照上1/4区域、下1/4区域为上下平分,中左侧1/2区域、中右侧1/2区域为左右平分 - */ - protected void fixHalve(Component currentComp, XCreator child, int x, int y) { - super.fixHalve(currentComp, child, x, y); - } - - /** - * 组件交叉区域进行插入时,调整受到变动的其他组件,之前是交叉区域插入也按照三等分逻辑,后面测试中发现有bug,改为和bi一样的鼠标所在侧平分 - * 默认左上角、右下角区域是垂直方向插入组件 - * 右上角和左下角是水平方向插入组件,这样避免田字块时重复 - */ - protected void fixCrossPointArea(Component currentComp, XCreator child, int x, int y) { - super.fixCrossPointArea(currentComp, child, x, y); - } - - /** - * 三等分区域时,调整相关联的组件 - * - * @param currentComp 鼠标所在组件 - * @param child 待插入组件 - */ - protected void fixTrisect(Component currentComp, XCreator child, int x, int y) { - super.fixTrisect(currentComp, child, x, y); - } - - /** - * 删除组件或者重新拖动时,其它组件重新计算位置大小 - */ - protected void delete(XCreator creator, int creatorWidth, int creatorHeight) { - int x = creator.getX(); - int y = creator.getY(); - recalculateChildrenSize(x, y, creatorWidth, creatorHeight); - } - - /** - * 重新计算内部组件大小 - * - * @param x 坐标x - * @param y 坐标y - * @param creatorWidth 删除的组件之前所在布局的宽度 - * @param creatorHeight 删除的组件之前所在布局的高度 - */ - public void recalculateChildrenSize(int x, int y, int creatorWidth, int creatorHeight) { - if (container.getComponentCount() == 0) { - return; - } else { - initCompsList(); - int width = creatorWidth; - int height = creatorHeight; - calculateRelatedComponent(x, y, width, height); - if (!rightComps.isEmpty() && getAllHeight(rightComps) == height) { + } + } + + /** + * 新拖入组件时,计算调整其他关联组件位置大小 + * + * @param child 新拖入的组件 + * @param x 鼠标所在x坐标 + * @param y 鼠标所在y坐标 + */ + public void fix(XCreator child, int x, int y) { + Component parentComp = container.getComponentAt(x, y); + if (container.getComponentCount() == 0) { + child.setLocation(0, 0); + child.setSize(parentComp.getWidth(), parentComp.getHeight()); + } else if (isCrossPointArea(parentComp, x, y)) { + //交叉区域插入组件时,根据具体位置进行上下或者左右或者相邻三个组件的位置大小插入 + fixCrossPointArea(parentComp, child, x, y); + return; + } else if (isTrisectionArea(parentComp, x, y)) { + // 在边界三等分区域,就不再和组件二等分了 + fixTrisect(parentComp, child, x, y); + return; + } else { + fixHalve(parentComp, child, x, y); + } + } + + /** + * 平分,正常情况拖入组件时,按照上1/4区域、下1/4区域为上下平分,中左侧1/2区域、中右侧1/2区域为左右平分 + */ + protected void fixHalve(Component currentComp, XCreator child, int x, int y) { + super.fixHalve(currentComp, child, x, y); + } + + /** + * 组件交叉区域进行插入时,调整受到变动的其他组件,之前是交叉区域插入也按照三等分逻辑,后面测试中发现有bug,改为和bi一样的鼠标所在侧平分 + * 默认左上角、右下角区域是垂直方向插入组件 + * 右上角和左下角是水平方向插入组件,这样避免田字块时重复 + */ + protected void fixCrossPointArea(Component currentComp, XCreator child, int x, int y) { + super.fixCrossPointArea(currentComp, child, x, y); + } + + /** + * 三等分区域时,调整相关联的组件 + * + * @param currentComp 鼠标所在组件 + * @param child 待插入组件 + */ + protected void fixTrisect(Component currentComp, XCreator child, int x, int y) { + super.fixTrisect(currentComp, child, x, y); + } + + /** + * 删除组件或者重新拖动时,其它组件重新计算位置大小 + */ + protected void delete(XCreator creator, int creatorWidth, int creatorHeight) { + int x = creator.getX(); + int y = creator.getY(); + recalculateChildrenSize(x, y, creatorWidth, creatorHeight); + } + + /** + * 重新计算内部组件大小 + * + * @param x 坐标x + * @param y 坐标y + * @param creatorWidth 删除的组件之前所在布局的宽度 + * @param creatorHeight 删除的组件之前所在布局的高度 + */ + public void recalculateChildrenSize(int x, int y, int creatorWidth, int creatorHeight) { + if (container.getComponentCount() == 0) { + return; + } else { + initCompsList(); + int width = creatorWidth; + int height = creatorHeight; + calculateRelatedComponent(x, y, width, height); + if (!rightComps.isEmpty() && getAllHeight(rightComps) == height) { calculateRightRelatComponent(x, width + actualVal); - } else if (!leftComps.isEmpty() && getAllHeight(leftComps) == height) { + } else if (!leftComps.isEmpty() && getAllHeight(leftComps) == height) { calculateLefttRelatComponent(width + actualVal); - } else if (!downComps.isEmpty() && getAllWidth(downComps) == width) { + } else if (!downComps.isEmpty() && getAllWidth(downComps) == width) { calculateDownRelatComponent(y, height + actualVal); - } else if (!upComps.isEmpty() && getAllWidth(upComps) == width) { + } else if (!upComps.isEmpty() && getAllWidth(upComps) == width) { calculateUpRelatComponent(height + actualVal); - } else { - // 由于布局三等分的存在,可能会出现删除组件时,找不到关联的组件填充,此时特殊处理 - calculateNoRelatedComponent(x, y, width, height); - } - } - clearCompsList(); - } - - /** - * 四侧边框都没有对齐的,此时每侧有且只有一个方向不对齐 - * 比如右侧不对齐,那么必然右上或右下没对齐,不会同时不对齐,否则不会出现此情况 - * 正常删除是右左下上优先原则,这边目前只调整右侧以至填充完整, - * 右侧不对齐时的组件先上下微调,再向左侧填充。 - */ - private void calculateNoRelatedComponent(int x, int y, int width, int height) { - // 只有最后一个组件了,直接删除 - if (container.getComponentCount() <= 1) { - return; - } - // 删除当前组件时,由于没有刚好边框对齐的其他组件,这时候需要调整的组件 - Component rightComp = container.getRightComp(x, y, width); - if (rightComp == null) { - return; - } - - int ry = rightComp.getY(); - clearCompsList(); - initCompsList(); - Rectangle rec = new Rectangle(x, y, width, height); - if (ry != y) { - calculateNoRelatedWhileRightTop(rec, rightComp); - } else { - calculateNoRelatedWhileRightBott(rec, rightComp); - } - - } - - private void calculateNoRelatedWhileRightTop(Rectangle bound, Component rcomp) { - if (rcomp == null) { - return; - } - - int ry = rcomp.getY(); - int rh = rcomp.getHeight(); - int rw = rcomp.getWidth(); - int dh = bound.y - ry - actualVal; - // 没法缩小高度 - if (dh < minHeight) { - // 没法缩小时则拉伸rcomp的上边框 - dealDirectionAtTop(rcomp.getBounds(), dh + actualVal, rcomp); - //调整的时候可能有组件达到最小高度,判断下 - if (rcomp.getY() != bound.y) { - clearCompsList(); - initCompsList(); - dealDirectionAtTop(rcomp.getBounds(), bound.y - rcomp.getY() - minHeight - actualVal, rcomp); - ry = rcomp.getY(); - int rx = rcomp.getX(); - rcomp.setBounds(rx, ry, rw, minHeight); - recalculateChildrenSize(rx, bound.y, rw, rh - dh - actualVal); - recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); - return; - } - } else { - // 右侧控件底部对齐 - if (rh + ry == bound.y + bound.height) { - rcomp.setSize(rw, dh); - bound.width += rw; - bound.width += actualVal; - } else { - recalculateChildrenSize(bound.x, ry + rh + actualVal, bound.width, bound.height + bound.y - rh - ry - actualVal); - recalculateChildrenSize(bound.x, bound.y, bound.width, ry + rh - bound.y); - return; - } - } - recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); - } - - private void calculateNoRelatedWhileRightBott(Rectangle bound, Component rcomp) { - rcomp = container.getBottomRightComp(bound.x, bound.y, bound.height, bound.width); - int ry = rcomp.getY(); - int rh = rcomp.getHeight(); - int rw = rcomp.getWidth(); - int dh = ry + rh - bound.y - bound.height - actualVal; - if (dh < minHeight) { - dealDirectionABottom(rcomp.getBounds(), -dh - actualVal, rcomp); - //调整的时候可能有组件达到最小高度,判断下 - if (rcomp.getHeight() + ry != bound.y + bound.height) { - clearCompsList(); - initCompsList(); - dh = ry + rcomp.getHeight() - bound.y - bound.height - actualVal; - dealDirectionABottom(rcomp.getBounds(), minHeight - dh, rcomp); - rh = rcomp.getHeight(); - int rx = rcomp.getX(); - rcomp.setBounds(rx, bound.y + bound.height + actualVal, rw, minHeight); - recalculateChildrenSize(rx, ry, rw, rh - minHeight - actualVal); - recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); - return; - } - } else { - if (ry == bound.y) { - rcomp.setBounds(rcomp.getX(), bound.y + bound.height + actualVal, rw, dh); - bound.width += rw; - bound.width += actualVal; - } else { - recalculateChildrenSize(bound.x, bound.y, bound.width, ry - bound.y - actualVal); - recalculateChildrenSize(bound.x, ry, bound.width, bound.height - ry + bound.y); - return; - } - } - recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); - } - - private int getMinWidth(List comps) { - if (comps.isEmpty()) { - return 0; - } - int minWidth = container.getWidth() - margin.getLeft() - margin.getRight(); - for (int i = 0, size = comps.size(); i < size; i++) { - minWidth = minWidth > comps.get(i).getWidth() ? comps.get(i).getWidth() : minWidth; - } - return minWidth; - } - - private int getMinHeight(List comps) { - if (comps.isEmpty()) { - return 0; - } - int minH = container.getHeight() - margin.getTop() - margin.getBottom(); - for (int i = 0, size = comps.size(); i < size; i++) { - minH = minH > comps.get(i).getHeight() ? comps.get(i).getHeight() : minH; - } - return minH; - } - - // 删除时计算待删除组件上下侧的组件是否何其对齐 - private int getAllHeight(List comps) { - int allHeight = 0; - if (comps.isEmpty()) { - return allHeight; - } - int n = comps.size(); - for (int i = 0; i < n; i++) { - allHeight += comps.get(i).getHeight(); - } - allHeight += (n - 1) * actualVal; - return allHeight; - } - - private int getAllWidth(List comps) { - int allWidth = 0; - if (comps.isEmpty()) { - return allWidth; - } - int n = comps.size(); - for (int i = 0; i < n; i++) { - allWidth += comps.get(i).getWidth(); - } - allWidth += (n - 1) * actualVal; - return allWidth; - } - - /** - * 获取有哪些相关联的组件 - */ - protected void calculateRelatedComponent(int objX, int objY, int objWidth, int objHeight) { - int count = container.getComponentCount(); - for (int i = 0; i < count; i++) { - Component relatComp = container.getComponent(i); - int rx = relatComp.getX(); - int ry = relatComp.getY(); - int rwidth = relatComp.getWidth(); - int rheight = relatComp.getHeight(); - int verti = ry - objY; - int hori = rx - objX; - boolean isHori = verti >= 0 && objHeight >= (rheight + verti); - boolean isVerti = hori >= 0 && objWidth >= (rwidth + hori); - if (isHori && (objX + objWidth + actualVal) == rx) { - rightComps.add(relatComp); - } else if (isHori && objX == (rx + rwidth + actualVal)) { - leftComps.add(relatComp); - } else if (isVerti && (objY + objHeight + actualVal) == ry) { - downComps.add(relatComp); - } else if (isVerti && objY == (ry + rheight + actualVal)) { - upComps.add(relatComp); - } - } - } - - /** - * 拖拽组件时遍历某一侧组件得到该侧组件能够缩放的最小宽度,tab布局最小宽度 = 内部组件数 * 单个组件最小宽度 - * - * @param list 某一侧组件的集合 如:leftComps - * @return int 最小宽度 - */ - private int getCompsMinWidth(List list) { - return getMaxCompsNum(list, true) * WLayout.MIN_WIDTH; - } - - /** - * 拖拽组件遍历某一侧得到该侧组件能够缩放的最小高度,tab布局最小高度 = 内部组件数 * 单个组件最小高度 + 标题高度 - * - * @param list 某一侧组件集合 - * @return int 最小高度 - */ - private int getCompsMinHeight(List list) { - for (int i = 0; i < list.size(); i++) { - XCreator creator = (XCreator) list.get(i); - ArrayList childrenList = creator.getTargetChildrenList(); - if (!childrenList.isEmpty()) { - return getMaxCompsNum(list, false) * WLayout.MIN_HEIGHT + WCardMainBorderLayout.TAB_HEIGHT; - } - } - return WLayout.MIN_HEIGHT; - } - - /** - * 根据子组件的横(纵)坐标获取某一侧组件的最大内部组件数 - * - * @param list 某一侧组件集合 - * @param isHor 是否以横坐标为准 - * @return int 最大内部组件数 - */ - private int getMaxCompsNum(List list, boolean isHor) { - int maxCompNums = 1; - for (int i = 0, size = list.size(); i < size; i++) { - XCreator creator = (XCreator) list.get(i); - ArrayList childrenList = creator.getTargetChildrenList(); - int count = childrenList.size(); - if (count > 0) { - for (int j = 0; j < count; j++) { - XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j); - int[] positions = isHor ? tabLayout.getHors(true) : tabLayout.getVeris(true); - int compNums = positions.length - 1; - maxCompNums = Math.max(compNums, maxCompNums); - } - } - } - return maxCompNums; - } - - /** - * 根据偏移量缩放内部组件大小,(tab布局用到) - * - * @param creator tab布局 - * @param offset 偏移量 - * @param isHor 是否为横向拖拽 - */ - private void adjustCompsSize(XCreator creator, int offset, boolean isHor) { - ArrayList childrenList = creator.getTargetChildrenList(); - int size = childrenList.size(); - if (size > 0) { - for (int j = 0; j < size; j++) { - XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j); - tabLayout.setBackupBound(tabLayout.getBounds()); - int refSize = isHor ? tabLayout.getWidth() : tabLayout.getHeight(); - double percent = (double) offset / refSize; - if (percent < 0 && !tabLayout.canReduce(percent)) { - return; - } - setAdjustedSize(tabLayout, offset, isHor); - for (int m = 0; m < tabLayout.getComponentCount(); m++) { - XCreator childCreator = tabLayout.getXCreator(m); - BoundsWidget wgt = tabLayout.toData().getBoundsWidget(childCreator.toData()); - wgt.setBounds(tabLayout.getComponent(m).getBounds()); - } - adjustCreatorsSize(percent, tabLayout, isHor); - } - - } - } - - // 纵向拖拽,先将tab布局的高度设置为拖拽后的实际高度 - private void setAdjustedHeight(XWTabFitLayout tabLayout, int offset) { - tabLayout.setSize(tabLayout.getWidth(), tabLayout.getHeight() + offset); - } - - // 横向拖拽,先将tab布局的宽度设置为拖拽后的实际宽度 - private void setAdjustedSize(XWTabFitLayout tabLayout, int offset, boolean isHor) { - if (offset < 0) { - // 缩放时需要备份原tab布局宽高 - tabLayout.setReferDim(new Dimension(tabLayout.getWidth(), tabLayout.getHeight())); - } - if (isHor) { - tabLayout.setSize(tabLayout.getWidth() + offset, tabLayout.getHeight()); - return; - } - setAdjustedHeight(tabLayout, offset); - } - - // 按照拖拽偏移量,对tab布局进行缩放 - private void adjustCreatorsSize(double percent, XWTabFitLayout tabLayout, boolean isHor) { - if (isHor) { - tabLayout.adjustCreatorsWidth(percent); - return; - } - tabLayout.adjustCreatorsHeight(percent); - } - - - /** - * 删除或拉伸控件右边框 调整右侧组件位置大小 - * - * @param objX 调整后的坐标x - * @param objWidth 调整后的宽度 - */ + } else { + // 由于布局三等分的存在,可能会出现删除组件时,找不到关联的组件填充,此时特殊处理 + calculateNoRelatedComponent(x, y, width, height); + } + } + clearCompsList(); + } + + /** + * 四侧边框都没有对齐的,此时每侧有且只有一个方向不对齐 + * 比如右侧不对齐,那么必然右上或右下没对齐,不会同时不对齐,否则不会出现此情况 + * 正常删除是右左下上优先原则,这边目前只调整右侧以至填充完整, + * 右侧不对齐时的组件先上下微调,再向左侧填充。 + */ + private void calculateNoRelatedComponent(int x, int y, int width, int height) { + // 只有最后一个组件了,直接删除 + if (container.getComponentCount() <= 1) { + return; + } + // 删除当前组件时,由于没有刚好边框对齐的其他组件,这时候需要调整的组件 + Component rightComp = container.getRightComp(x, y, width); + if (rightComp == null) { + return; + } + + int ry = rightComp.getY(); + clearCompsList(); + initCompsList(); + Rectangle rec = new Rectangle(x, y, width, height); + if (ry != y) { + calculateNoRelatedWhileRightTop(rec, rightComp); + } else { + calculateNoRelatedWhileRightBott(rec, rightComp); + } + + } + + private void calculateNoRelatedWhileRightTop(Rectangle bound, Component rcomp) { + if (rcomp == null) { + return; + } + + int ry = rcomp.getY(); + int rh = rcomp.getHeight(); + int rw = rcomp.getWidth(); + int dh = bound.y - ry - actualVal; + // 没法缩小高度 + if (dh < minHeight) { + // 没法缩小时则拉伸rcomp的上边框 + dealDirectionAtTop(rcomp.getBounds(), dh + actualVal, rcomp); + //调整的时候可能有组件达到最小高度,判断下 + if (rcomp.getY() != bound.y) { + clearCompsList(); + initCompsList(); + dealDirectionAtTop(rcomp.getBounds(), bound.y - rcomp.getY() - minHeight - actualVal, rcomp); + ry = rcomp.getY(); + int rx = rcomp.getX(); + rcomp.setBounds(rx, ry, rw, minHeight); + recalculateChildrenSize(rx, bound.y, rw, rh - dh - actualVal); + recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); + return; + } + } else { + // 右侧控件底部对齐 + if (rh + ry == bound.y + bound.height) { + rcomp.setSize(rw, dh); + bound.width += rw; + bound.width += actualVal; + } else { + recalculateChildrenSize(bound.x, ry + rh + actualVal, bound.width, bound.height + bound.y - rh - ry - actualVal); + recalculateChildrenSize(bound.x, bound.y, bound.width, ry + rh - bound.y); + return; + } + } + recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); + } + + private void calculateNoRelatedWhileRightBott(Rectangle bound, Component rcomp) { + rcomp = container.getBottomRightComp(bound.x, bound.y, bound.height, bound.width); + int ry = rcomp.getY(); + int rh = rcomp.getHeight(); + int rw = rcomp.getWidth(); + int dh = ry + rh - bound.y - bound.height - actualVal; + if (dh < minHeight) { + dealDirectionABottom(rcomp.getBounds(), -dh - actualVal, rcomp); + //调整的时候可能有组件达到最小高度,判断下 + if (rcomp.getHeight() + ry != bound.y + bound.height) { + clearCompsList(); + initCompsList(); + dh = ry + rcomp.getHeight() - bound.y - bound.height - actualVal; + dealDirectionABottom(rcomp.getBounds(), minHeight - dh, rcomp); + rh = rcomp.getHeight(); + int rx = rcomp.getX(); + rcomp.setBounds(rx, bound.y + bound.height + actualVal, rw, minHeight); + recalculateChildrenSize(rx, ry, rw, rh - minHeight - actualVal); + recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); + return; + } + } else { + if (ry == bound.y) { + rcomp.setBounds(rcomp.getX(), bound.y + bound.height + actualVal, rw, dh); + bound.width += rw; + bound.width += actualVal; + } else { + recalculateChildrenSize(bound.x, bound.y, bound.width, ry - bound.y - actualVal); + recalculateChildrenSize(bound.x, ry, bound.width, bound.height - ry + bound.y); + return; + } + } + recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); + } + + private int getMinWidth(List comps) { + if (comps.isEmpty()) { + return 0; + } + int minWidth = container.getWidth() - margin.getLeft() - margin.getRight(); + for (int i = 0, size = comps.size(); i < size; i++) { + minWidth = minWidth > comps.get(i).getWidth() ? comps.get(i).getWidth() : minWidth; + } + return minWidth; + } + + private int getMinHeight(List comps) { + if (comps.isEmpty()) { + return 0; + } + int minH = container.getHeight() - margin.getTop() - margin.getBottom(); + for (int i = 0, size = comps.size(); i < size; i++) { + minH = minH > comps.get(i).getHeight() ? comps.get(i).getHeight() : minH; + } + return minH; + } + + // 删除时计算待删除组件上下侧的组件是否何其对齐 + private int getAllHeight(List comps) { + int allHeight = 0; + if (comps.isEmpty()) { + return allHeight; + } + int n = comps.size(); + for (int i = 0; i < n; i++) { + allHeight += comps.get(i).getHeight(); + } + allHeight += (n - 1) * actualVal; + return allHeight; + } + + private int getAllWidth(List comps) { + int allWidth = 0; + if (comps.isEmpty()) { + return allWidth; + } + int n = comps.size(); + for (int i = 0; i < n; i++) { + allWidth += comps.get(i).getWidth(); + } + allWidth += (n - 1) * actualVal; + return allWidth; + } + + /** + * 获取有哪些相关联的组件 + */ + protected void calculateRelatedComponent(int objX, int objY, int objWidth, int objHeight) { + int count = container.getComponentCount(); + for (int i = 0; i < count; i++) { + Component relatComp = container.getComponent(i); + int rx = relatComp.getX(); + int ry = relatComp.getY(); + int rwidth = relatComp.getWidth(); + int rheight = relatComp.getHeight(); + int verti = ry - objY; + int hori = rx - objX; + boolean isHori = verti >= 0 && objHeight >= (rheight + verti); + boolean isVerti = hori >= 0 && objWidth >= (rwidth + hori); + if (isHori && (objX + objWidth + actualVal) == rx) { + rightComps.add(relatComp); + } else if (isHori && objX == (rx + rwidth + actualVal)) { + leftComps.add(relatComp); + } else if (isVerti && (objY + objHeight + actualVal) == ry) { + downComps.add(relatComp); + } else if (isVerti && objY == (ry + rheight + actualVal)) { + upComps.add(relatComp); + } + } + } + + /** + * 拖拽组件时遍历某一侧组件得到该侧组件能够缩放的最小宽度,tab布局最小宽度 = 内部组件数 * 单个组件最小宽度 + * + * @param list 某一侧组件的集合 如:leftComps + * @return int 最小宽度 + */ + private int getCompsMinWidth(List list) { + return getMaxCompsNum(list, true) * WLayout.MIN_WIDTH; + } + + /** + * 拖拽组件遍历某一侧得到该侧组件能够缩放的最小高度,tab布局最小高度 = 内部组件数 * 单个组件最小高度 + 标题高度 + * + * @param list 某一侧组件集合 + * @return int 最小高度 + */ + private int getCompsMinHeight(List list) { + for (int i = 0; i < list.size(); i++) { + XCreator creator = (XCreator) list.get(i); + ArrayList childrenList = creator.getTargetChildrenList(); + if (!childrenList.isEmpty()) { + return getMaxCompsNum(list, false) * WLayout.MIN_HEIGHT + WCardMainBorderLayout.TAB_HEIGHT; + } + } + return WLayout.MIN_HEIGHT; + } + + /** + * 根据子组件的横(纵)坐标获取某一侧组件的最大内部组件数 + * + * @param list 某一侧组件集合 + * @param isHor 是否以横坐标为准 + * @return int 最大内部组件数 + */ + private int getMaxCompsNum(List list, boolean isHor) { + int maxCompNums = 1; + for (int i = 0, size = list.size(); i < size; i++) { + XCreator creator = (XCreator) list.get(i); + ArrayList childrenList = creator.getTargetChildrenList(); + int count = childrenList.size(); + if (count > 0) { + for (int j = 0; j < count; j++) { + XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j); + int[] positions = isHor ? tabLayout.getHors(true) : tabLayout.getVeris(true); + int compNums = positions.length - 1; + maxCompNums = Math.max(compNums, maxCompNums); + } + } + } + return maxCompNums; + } + + /** + * 根据偏移量缩放内部组件大小,(tab布局用到) + * + * @param creator tab布局 + * @param offset 偏移量 + * @param isHor 是否为横向拖拽 + */ + private void adjustCompsSize(XCreator creator, int offset, boolean isHor) { + ArrayList childrenList = creator.getTargetChildrenList(); + int size = childrenList.size(); + if (size > 0) { + for (int j = 0; j < size; j++) { + XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j); + tabLayout.setBackupBound(tabLayout.getBounds()); + int refSize = isHor ? tabLayout.getWidth() : tabLayout.getHeight(); + double percent = (double) offset / refSize; + if (percent < 0 && !tabLayout.canReduce(percent)) { + return; + } + setAdjustedSize(tabLayout, offset, isHor); + for (int m = 0; m < tabLayout.getComponentCount(); m++) { + XCreator childCreator = tabLayout.getXCreator(m); + BoundsWidget wgt = (BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); + wgt.setBounds(tabLayout.getComponent(m).getBounds()); + } + adjustCreatorsSize(percent, tabLayout, isHor); + } + + } + } + + // 纵向拖拽,先将tab布局的高度设置为拖拽后的实际高度 + private void setAdjustedHeight(XWTabFitLayout tabLayout, int offset) { + tabLayout.setSize(tabLayout.getWidth(), tabLayout.getHeight() + offset); + } + + // 横向拖拽,先将tab布局的宽度设置为拖拽后的实际宽度 + private void setAdjustedSize(XWTabFitLayout tabLayout, int offset, boolean isHor) { + if (offset < 0) { + // 缩放时需要备份原tab布局宽高 + tabLayout.setReferDim(new Dimension(tabLayout.getWidth(), tabLayout.getHeight())); + } + if (isHor) { + tabLayout.setSize(tabLayout.getWidth() + offset, tabLayout.getHeight()); + return; + } + setAdjustedHeight(tabLayout, offset); + } + + // 按照拖拽偏移量,对tab布局进行缩放 + private void adjustCreatorsSize(double percent, XWTabFitLayout tabLayout, boolean isHor) { + if (isHor) { + tabLayout.adjustCreatorsWidth(percent); + return; + } + tabLayout.adjustCreatorsHeight(percent); + } + + + /** + * 删除或拉伸控件右边框 调整右侧组件位置大小 + * + * @param objX 调整后的坐标x + * @param objWidth 调整后的宽度 + */ protected void calculateRightRelatComponent(int objX, int objWidth) { - int count = rightComps.size(); - for (int i = 0; i < count; i++) { - XCreator creator = (XCreator) rightComps.get(i); - adjustCompsSize(creator, objWidth, true); - int ry = creator.getY(); - int rwidth = creator.getWidth(); - int rheight = creator.getHeight(); - creator.setLocation(objX, ry); - creator.setSize(rwidth + objWidth, rheight); - } - } - - /** - * 实际拖拽偏移量是否超出了可调整的宽度范围 - * - * @param offset 实际偏移量 - * @return boolean 是否超出调整范围 - */ - private boolean isBeyondAdjustWidthScope(int offset) { - boolean isBeyondScope = false; - isBeyondScope = offset < 0 ? isBeyondWidthScope(offset, leftComps) : isBeyondWidthScope(offset, rightComps); - return isBeyondScope; - } - - // 实际拖拽偏移量是否超出某一侧的可调整宽度 - private boolean isBeyondWidthScope(int offset, List compsList) { - int compMinWidth = getCompsMinWidth(compsList); - for (int i = 0; i < compsList.size(); i++) { - XCreator creator = (XCreator) compsList.get(i); - if (Math.abs(offset) > (creator.getWidth() - compMinWidth)) { - return true; - } - } - return false; - } - - /** - * 删除或拉伸控件左边框时 调整左侧的组件位置大小; - */ + int count = rightComps.size(); + for (int i = 0; i < count; i++) { + XCreator creator = (XCreator) rightComps.get(i); + adjustCompsSize(creator, objWidth, true); + int ry = creator.getY(); + int rwidth = creator.getWidth(); + int rheight = creator.getHeight(); + creator.setLocation(objX, ry); + creator.setSize(rwidth + objWidth, rheight); + } + } + + /** + * 实际拖拽偏移量是否超出了可调整的宽度范围 + * + * @param offset 实际偏移量 + * @return boolean 是否超出调整范围 + */ + private boolean isBeyondAdjustWidthScope(int offset) { + boolean isBeyondScope = false; + isBeyondScope = offset < 0 ? isBeyondWidthScope(offset, leftComps) : isBeyondWidthScope(offset, rightComps); + return isBeyondScope; + } + + // 实际拖拽偏移量是否超出某一侧的可调整宽度 + private boolean isBeyondWidthScope(int offset, List compsList) { + int compMinWidth = getCompsMinWidth(compsList); + for (int i = 0; i < compsList.size(); i++) { + XCreator creator = (XCreator) compsList.get(i); + if (Math.abs(offset) > (creator.getWidth() - compMinWidth)) { + return true; + } + } + return false; + } + + /** + * 删除或拉伸控件左边框时 调整左侧的组件位置大小; + */ protected boolean calculateLefttRelatComponent(int objWidth) { - if (isBeyondAdjustWidthScope(objWidth)) { - return false; - } - int count = leftComps.size(); - for (int i = 0; i < count; i++) { - XCreator creator = (XCreator) leftComps.get(i); - adjustCompsSize(creator, objWidth, true); - int rwidth = creator.getWidth(); - int rheight = creator.getHeight(); - creator.setSize(rwidth + objWidth, rheight); - } - return true; - } - - /** - * 删除或拉伸下边框 调整下方的组件位置大小 - */ + if (isBeyondAdjustWidthScope(objWidth)) { + return false; + } + int count = leftComps.size(); + for (int i = 0; i < count; i++) { + XCreator creator = (XCreator) leftComps.get(i); + adjustCompsSize(creator, objWidth, true); + int rwidth = creator.getWidth(); + int rheight = creator.getHeight(); + creator.setSize(rwidth + objWidth, rheight); + } + return true; + } + + /** + * 删除或拉伸下边框 调整下方的组件位置大小 + */ protected void calculateDownRelatComponent(int objY, int objHeight) { - int count = downComps.size(); - for (int i = 0; i < count; i++) { - XCreator creator = (XCreator) downComps.get(i); - adjustCompsSize(creator, objHeight, false); - int rx = creator.getX(); - int rwidth = creator.getWidth(); - int rheight = creator.getHeight(); - creator.setLocation(rx, objY); - creator.setSize(rwidth, rheight + objHeight); - } - } - - /** - * 实际拖拽偏移量是否超出了可调整的高度范围 - * - * @param offset 实际偏移量 - * @return boolean 是否超出调整范围 - */ - private boolean isBeyondAdjustHeightScope(int offset) { - boolean isBeyondScope = false; - isBeyondScope = offset < 0 ? isBeyondHeightScope(offset, upComps) : isBeyondHeightScope(offset, downComps); - return isBeyondScope; - } - - // 实际拖拽偏移量是否超出某一侧的可调整高度 - private boolean isBeyondHeightScope(int offset, List compsList) { - int minHeight = getCompsMinHeight(compsList); - for (int i = 0; i < compsList.size(); i++) { - XCreator creator = (XCreator) compsList.get(i); - if (Math.abs(offset) > (creator.getHeight() - minHeight)) { - return true; - } - } - return false; - } - - /** - * 删除或拉伸上边框 调整上方的组件位置大小 - */ + int count = downComps.size(); + for (int i = 0; i < count; i++) { + XCreator creator = (XCreator) downComps.get(i); + adjustCompsSize(creator, objHeight, false); + int rx = creator.getX(); + int rwidth = creator.getWidth(); + int rheight = creator.getHeight(); + creator.setLocation(rx, objY); + creator.setSize(rwidth, rheight + objHeight); + } + } + + /** + * 实际拖拽偏移量是否超出了可调整的高度范围 + * + * @param offset 实际偏移量 + * @return boolean 是否超出调整范围 + */ + private boolean isBeyondAdjustHeightScope(int offset) { + boolean isBeyondScope = false; + isBeyondScope = offset < 0 ? isBeyondHeightScope(offset, upComps) : isBeyondHeightScope(offset, downComps); + return isBeyondScope; + } + + // 实际拖拽偏移量是否超出某一侧的可调整高度 + private boolean isBeyondHeightScope(int offset, List compsList) { + int minHeight = getCompsMinHeight(compsList); + for (int i = 0; i < compsList.size(); i++) { + XCreator creator = (XCreator) compsList.get(i); + if (Math.abs(offset) > (creator.getHeight() - minHeight)) { + return true; + } + } + return false; + } + + /** + * 删除或拉伸上边框 调整上方的组件位置大小 + */ protected boolean calculateUpRelatComponent(int objHeight) { - if (isBeyondAdjustHeightScope(objHeight)) { - return false; - } - int count = upComps.size(); - for (int i = 0; i < count; i++) { - XCreator creator = (XCreator) upComps.get(i); - adjustCompsSize(creator, objHeight, false); - int rwidth = creator.getWidth(); - int rheight = creator.getHeight(); - creator.setSize(rwidth, rheight + objHeight); - } - return true; - } - - /** - * 不调整,只计算位置 - * - * @return child的位置 - */ - public int[] getChildPosition(Component currentComp, XCreator child, int x, int y) { - return super.getChildPosition(currentComp, child, x, y); - } - - @Override - public ConstraintsGroupModel getLayoutConstraints(XCreator creator) { - return new FRFitLayoutConstraints((XWFitLayout) container, creator); - } + if (isBeyondAdjustHeightScope(objHeight)) { + return false; + } + int count = upComps.size(); + for (int i = 0; i < count; i++) { + XCreator creator = (XCreator) upComps.get(i); + adjustCompsSize(creator, objHeight, false); + int rwidth = creator.getWidth(); + int rheight = creator.getHeight(); + creator.setSize(rwidth, rheight + objHeight); + } + return true; + } + + /** + * 不调整,只计算位置 + * + * @return child的位置 + */ + public int[] getChildPosition(Component currentComp, XCreator child, int x, int y) { + return super.getChildPosition(currentComp, child, x, y); + } + + @Override + public ConstraintsGroupModel getLayoutConstraints(XCreator creator) { + return new FRFitLayoutConstraints((XWFitLayout) container, creator); + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/beans/location/Inner.java b/designer_form/src/com/fr/design/designer/beans/location/Inner.java index c909244898..b07b18b4ac 100644 --- a/designer_form/src/com/fr/design/designer/beans/location/Inner.java +++ b/designer_form/src/com/fr/design/designer/beans/location/Inner.java @@ -9,8 +9,8 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelection; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.container.WAbsoluteLayout; -import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.stable.ArrayUtils; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import java.awt.*; import java.awt.Rectangle; 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 56aca1c43a..7eb967a9f7 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -10,9 +10,11 @@ import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.*; -import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor; +import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; +import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; +import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; @@ -86,7 +88,8 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme @Override public void propertyChange() { - makeVisible(toData().isVisible());} + makeVisible(toData().isVisible()); + } }), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( WLayoutBorderStyleEditor.class).setI18NName( @@ -97,12 +100,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void propertyChange() { initStyle(); } - }), new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) .setI18NName(Inter.getLocText("FR-Layout_Padding")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("toolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) + new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class) .setI18NName(Inter.getLocText("Form-EC_toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; 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 852cdf1220..b585383c66 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -3,6 +3,14 @@ */ package com.fr.design.designer.creator; +import java.awt.*; +import java.awt.event.ContainerEvent; +import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; +import java.beans.IntrospectionException; +import java.util.ArrayList; +import java.util.HashMap; + import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.LayoutAdapter; @@ -12,369 +20,345 @@ import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.form.layout.FRAbsoluteLayout; import com.fr.design.icon.IconPathConstants; -import com.fr.design.mainframe.EditingMouseListener; -import com.fr.design.mainframe.FormArea; -import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.*; import com.fr.form.ui.Connector; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; -import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.general.FRScreen; import com.fr.general.IOUtils; import com.fr.general.Inter; -import java.awt.*; -import java.awt.event.ContainerEvent; -import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; -import java.beans.IntrospectionException; -import java.util.ArrayList; -import java.util.HashMap; - /** * @author richer * @since 6.5.3 */ public class XWAbsoluteLayout extends XLayoutContainer { - private static final int EDIT_BTN_WIDTH = 60; - private static final int EDIT_BTN_HEIGHT = 24; - private int minWidth = WLayout.MIN_WIDTH; - private int minHeight = WLayout.MIN_HEIGHT; - - //由于屏幕分辨率不同,界面上的容器大小可能不是默认的100%,此时拖入组件时,保存的大小按照100%时的计算 - protected double containerPercent = 1.0; - - private HashMap xConnectorMap; - - public XWAbsoluteLayout() { - this(new WAbsoluteLayout(), new Dimension()); - } - - public XWAbsoluteLayout(WAbsoluteLayout widget) { - this(widget, new Dimension()); - } - - public XWAbsoluteLayout(WAbsoluteLayout widget, Dimension initSize) { - super(widget, initSize); - this.xConnectorMap = new HashMap(); - Connector connector; - for (int i = 0; i < widget.connectorCount(); i++) { - connector = widget.getConnectorIndex(i); - xConnectorMap.put(connector, new XConnector(connector, this)); - } - - initPercent(widget); - } - - /** - * 初始化时默认的组件大小 - * - * @return 默认Dimension - */ - @Override - public Dimension initEditorSize() { - return new Dimension(500, 300); - } - - //根据屏幕大小来确定显示的百分比, 1440*900默认100%, 1366*768缩放90% - private void initPercent(WAbsoluteLayout widget) { - Toolkit toolkit = Toolkit.getDefaultToolkit(); - Dimension scrnsize = toolkit.getScreenSize(); - double screenValue = FRScreen.getByDimension(scrnsize).getValue(); - if (screenValue != FormArea.DEFAULT_SLIDER) { - this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER); - } - } - - /** - * 返回容器大小的百分比 - * - * @return the containerPercent - */ - public double getContainerPercent() { - return containerPercent; - } - - /** - * 设置容器大小的百分比 - * - * @param containerPercent the containerPercent to set - */ - public void setContainerPercent(double containerPercent) { - this.containerPercent = containerPercent; - minWidth = (int) (XWAbsoluteLayout.MIN_WIDTH * containerPercent); - minHeight = (int) (XWAbsoluteLayout.MIN_HEIGHT * containerPercent); - } - - /** - * 返回界面处根据百分比调整后的最小宽度 - * - * @return 最小宽度 - */ - public int getActualMinWidth() { - return this.minWidth; - } - - /** - * 返回界面处根据百分比调整后的最小高度 - * - * @return 最小高度 - */ - public int getActualMinHeight() { - return this.minHeight; - } - - /** - * 返回界面处根据百分比调整后的间隔大小(且为偶数) - * - * @return 间隔 - */ - public int getAcualInterval() { - // adapter那边交叉三等分、删除都要判断是否对齐,所以间隔转为偶数 - int interval = (int) (toData().getCompInterval() * containerPercent); - int val = interval / 2; - return val * 2; - } - - /** - * 界面容器大小不是默认的时,处理控件的BoundsWidget,且避免出现空隙 - */ - private Rectangle dealWidgetBound(Rectangle rec) { - if (containerPercent == 1.0) { - return rec; - } - rec.x = (int) (rec.x / containerPercent); - rec.y = (int) (rec.y / containerPercent); - rec.width = (int) (rec.width / containerPercent); - rec.height = (int) (rec.height / containerPercent); - return rec; - } - - /** - * 新增删除拉伸后单个组件的BoundsWidget - */ - public void updateBoundsWidget(XCreator xCreator) { - WAbsoluteLayout layout = this.toData(); - if (xCreator.hasTitleStyle()) { - xCreator = (XLayoutContainer) xCreator.getParent(); - } - if (xCreator.acceptType(XWAbsoluteLayout.class)) { - ((XWAbsoluteLayout) xCreator).updateBoundsWidget(); - } - // 如果子组件时tab布局,则tab布局内部的组件的wiget也要更新,否则保存后重新打开大小不对 - ArrayList childrenList = xCreator.getTargetChildrenList(); - if (!childrenList.isEmpty()) { - for (int i = 0; i < childrenList.size(); i++) { - XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(i); - tabLayout.updateBoundsWidget(); - } - } - BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); - Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); - } - - private Rectangle calculateBound(Rectangle rec, double pw, double ph) { - Rectangle calRec = new Rectangle(0, 0, 0, 0); - calRec.x = (int) (rec.x / pw); - calRec.y = (int) (rec.y / ph); - calRec.width = (int) (rec.width / pw); - calRec.height = (int) (rec.height / ph); - return calRec; - } - - /** - * 新增删除拉伸后每个组件的BoundsWidget - */ - public void updateBoundsWidget() { - WAbsoluteLayout layout = this.toData(); - Rectangle backupBound = this.getBackupBound(); - Rectangle currentBound = this.getBounds(); - if (backupBound != null && layout.getCompState() == WAbsoluteLayout.STATE_FIT) { - double percentW = ((double) backupBound.width / (double) currentBound.width); - double percentH = ((double) backupBound.height / (double) currentBound.height); - for (int index = 0, n = this.getComponentCount(); index < n; index++) { - XCreator creator = (XCreator) this.getComponent(index); - BoundsWidget wgt = (BoundsWidget) layout.getBoundsWidget(creator.toData()); - // 用当前的显示大小计算后调正具体位置 - Rectangle wgtBound = creator.getBounds(); - Rectangle rec = calculateBound(wgtBound, percentW, percentH); - wgt.setBounds(rec); - creator.setBounds(rec); - //绝对布局嵌套,要更新内部的绝对布局 - if (creator.acceptType(XWAbsoluteLayout.class)) { - creator.setBackupBound(wgtBound); - ((XWAbsoluteLayout) creator).updateBoundsWidget(); - } - } - } - } - - /** - * 更新子组件的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 = (BoundsWidget) toData().getBoundsWidget(creator.toData()); - wgt.setBounds(rec); - creator.setBounds(rec); - creator.updateChildBound(minHeight); - } - } - toData().setDesigningResolution(Toolkit.getDefaultToolkit().getScreenSize()); - } - - /** - * 增加对齐线 - * - * @param connector 对齐线 - */ - public void addConnector(Connector connector) { - xConnectorMap.put(connector, new XConnector(connector, this)); - ((WAbsoluteLayout) data).addConnector(connector); - } - - public XConnector getXConnector(Connector connector) { - return xConnectorMap.get(connector); - } - - /** - * 去除对齐线 - * - * @param connector 对齐线 - */ - public void removeConnector(Connector connector) { - ((WAbsoluteLayout) data).removeConnector(connector); - xConnectorMap.remove(connector); - } - - /** - * 返回对应的widget容器 - * - * @return 返回WAbsoluteLayout - */ - @Override - public WAbsoluteLayout toData() { - return (WAbsoluteLayout) data; - } - - @Override - protected String getIconName() { - return "layout_absolute_new.png"; - } - - /** - * 返回默认的容器name - * - * @return 返回绝对布局容器名 - */ - @Override - public String createDefaultName() { - return "absolute"; - } - - @Override - protected void initLayoutManager() { - this.setLayout(new FRAbsoluteLayout()); - } - - /** - * 是否支持标题样式 - * - * @return 默认false - */ - @Override - public boolean hasTitleStyle() { - return false; - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - WAbsoluteLayout layout = (WAbsoluteLayout) data; - Connector[] connector = layout.getConnector(); - for (int i = 0, size = connector.length; i < size; i++) { - connector[i].draw(g); - } - } - - /** - * 转换保存组件信息的wlayout为对应的container - */ - @Override - public void convert() { - isRefreshing = true; - WAbsoluteLayout abs = toData(); - this.removeAll(); - for (int i = 0, count = abs.getWidgetCount(); i < count; i++) { - BoundsWidget bw = (BoundsWidget) abs.getWidget(i); - if (bw != null) { - Rectangle bounds = bw.getBounds(); - XWidgetCreator comp = (XWidgetCreator) XCreatorUtils.createXCreator(bw.getWidget()); - if (!comp.acceptType(XWParameterLayout.class)) { - comp.setDirections(Direction.ALL); - } - add(comp); - comp.setBounds(bounds); - } - } - isRefreshing = false; - } - - /** - * 当前组件zorder位置替换新的控件 - * - * @param widget 控件 - * @param oldcreator 旧组件 - * @return 组件 - */ - @Override - public XCreator replace(Widget widget, XCreator oldcreator) { - int i = this.getComponentZOrder(oldcreator); - if (i != -1) { - this.toData().replace(new BoundsWidget(widget, oldcreator.getBounds()), - new BoundsWidget(oldcreator.toData(), oldcreator.getBounds())); - this.convert(); - return (XCreator) this.getComponent(i); - } - return null; - } - - /** + private static final int EDIT_BTN_WIDTH = 60; + private static final int EDIT_BTN_HEIGHT = 24; + private int minWidth = WLayout.MIN_WIDTH; + private int minHeight = WLayout.MIN_HEIGHT; + + //由于屏幕分辨率不同,界面上的容器大小可能不是默认的100%,此时拖入组件时,保存的大小按照100%时的计算 + protected double containerPercent = 1.0; + + private HashMap xConnectorMap; + + public XWAbsoluteLayout() { + this(new WAbsoluteLayout(),new Dimension()); + } + + public XWAbsoluteLayout(WAbsoluteLayout widget) { + this(widget,new Dimension()); + } + + public XWAbsoluteLayout(WAbsoluteLayout widget, Dimension initSize) { + super(widget, initSize); + this.xConnectorMap = new HashMap(); + Connector connector; + for (int i = 0; i < widget.connectorCount(); i++) { + connector = widget.getConnectorIndex(i); + xConnectorMap.put(connector, new XConnector(connector, this)); + } + + initPercent(widget); + } + + /** + * 初始化时默认的组件大小 + * + * @return 默认Dimension + */ + @Override + public Dimension initEditorSize() { + return new Dimension(500, 300); + } + + //根据屏幕大小来确定显示的百分比, 1440*900默认100%, 1366*768缩放90% + private void initPercent(WAbsoluteLayout widget){ + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Dimension scrnsize = toolkit.getScreenSize(); + double screenValue = FRScreen.getByDimension(scrnsize).getValue(); + if(screenValue != FormArea.DEFAULT_SLIDER){ + this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER); + } + } + + /** + * 返回容器大小的百分比 + * @return the containerPercent + */ + public double getContainerPercent() { + return containerPercent; + } + + /** + * 设置容器大小的百分比 + * @param containerPercent the containerPercent to set + */ + public void setContainerPercent(double containerPercent) { + this.containerPercent = containerPercent; + minWidth = (int) (XWAbsoluteLayout.MIN_WIDTH*containerPercent); + minHeight = (int) (XWAbsoluteLayout.MIN_HEIGHT*containerPercent); + } + + /** + * 返回界面处根据百分比调整后的最小宽度 + * @return 最小宽度 + */ + public int getActualMinWidth() { + return this.minWidth; + } + + /** + * 返回界面处根据百分比调整后的最小高度 + * @return 最小高度 + */ + public int getActualMinHeight() { + return this.minHeight; + } + + /** + * 返回界面处根据百分比调整后的间隔大小(且为偶数) + * @return 间隔 + */ + public int getAcualInterval() { + // adapter那边交叉三等分、删除都要判断是否对齐,所以间隔转为偶数 + int interval = (int) (toData().getCompInterval()*containerPercent); + int val = interval/2; + return val*2; + } + + /** + * 界面容器大小不是默认的时,处理控件的BoundsWidget,且避免出现空隙 + */ + private Rectangle dealWidgetBound(Rectangle rec) { + if (containerPercent == 1.0) { + return rec; + } + rec.x = (int) (rec.x/containerPercent); + rec.y = (int) (rec.y/containerPercent); + rec.width = (int) (rec.width/containerPercent); + rec.height = (int) (rec.height/containerPercent); + return rec; + } + + /** + * 新增删除拉伸后单个组件的BoundsWidget + */ + public void updateBoundsWidget(XCreator xCreator) { + WAbsoluteLayout layout = this.toData(); + if (xCreator.hasTitleStyle()) { + xCreator = (XLayoutContainer)xCreator.getParent(); + } + if (xCreator.acceptType(XWAbsoluteLayout.class)){ + ((XWAbsoluteLayout) xCreator).updateBoundsWidget(); + } + // 如果子组件时tab布局,则tab布局内部的组件的wiget也要更新,否则保存后重新打开大小不对 + ArrayList childrenList = xCreator.getTargetChildrenList(); + if(!childrenList.isEmpty()){ + for(int i=0; i Date: Tue, 2 May 2017 14:25:48 +0800 Subject: [PATCH 59/60] ct --- .../layout/FRAbsoluteLayoutAdapter.java | 685 +++++++------ .../adapters/layout/FRFitLayoutAdapter.java | 68 +- .../beans/location/AccessDirection.java | 89 +- .../designer/beans/models/AddingModel.java | 280 +++--- .../designer/beans/models/StateModel.java | 950 +++++++++--------- .../beans/painters/AbstractPainter.java | 190 ++-- .../design/mainframe/FormSelectionUtils.java | 4 +- 7 files changed, 1128 insertions(+), 1138 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 8ca2012525..539e60450f 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 @@ -1,346 +1,341 @@ -package com.fr.design.designer.beans.adapters.layout; - -import com.fr.design.beans.GroupModel; -import com.fr.design.designer.beans.ConstraintsGroupModel; -import com.fr.design.designer.beans.HoverPainter; -import com.fr.design.designer.beans.painters.FRAbsoluteLayoutPainter; -import com.fr.design.designer.creator.*; -import com.fr.design.designer.properties.BoundsGroupModel; -import com.fr.design.designer.properties.FRAbsoluteLayoutPropertiesGroupModel; -import com.fr.design.utils.ComponentUtils; -import com.fr.design.utils.gui.LayoutUtils; -import com.fr.form.ui.container.WAbsoluteLayout; -import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; - -import java.awt.*; - -public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { - //是不是添加到父容器上 - private boolean isAdd2ParentLayout = false; - private HoverPainter painter; - - public FRAbsoluteLayoutAdapter(XLayoutContainer container) { - super(container); - painter = new FRAbsoluteLayoutPainter(container); - initMinSize(); - } - - private void initMinSize() { - XWAbsoluteLayout layout = (XWAbsoluteLayout) container; - minWidth = layout.getActualMinWidth(); - minHeight = layout.getActualMinHeight(); - actualVal = layout.getAcualInterval(); - margin = layout.toData().getMargin(); - } - - @Override - public HoverPainter getPainter() { - return painter; - } - - /** - * 是否能在指定位置添加组件 - * - * @param creator 组件 - * @param x 坐标x - * @param y 坐标y - * @return 能则返回true - */ - //这个地方的逻辑非常复杂, - // 1.当前绝对布局是不可编辑且是最外层,那么其他控件添加在它周围, - // 2.当前绝对布局是不可编辑且不是最外层,那么控件不可添加,(嵌套) - // 3.当前绝对布局可编辑,那么控件添加 - @Override - public boolean accept(XCreator creator, int x, int y) { - Component comp = container.getComponentAt(x, y); - //布局控件要先判断是不是可编辑 - //可以编辑,按原有逻辑判断 - //不可编辑,当成一整个控件处理 - 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; - } - XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator) comp).getTopLayout(); - if (topLayout != null) { - if (topLayout.isEditable()) { - return topLayoutAccept(creator, x, y); - } - //绝对布局嵌套,处于内层,不可编辑,不添加,topLayout只能获取到最外层可编辑的布局 - else if (((XLayoutContainer) topLayout.getParent()).acceptType(XWAbsoluteLayout.class)) { - return false; - } else { - return acceptWidget(x, y); - } - } else { - FRLogger.getLogger().error("top layout is null!"); - } - - return false; - } - - //topLayout假如可以编辑的话就往里面添加组件 - private boolean topLayoutAccept(XCreator creator, int x, int y) { - //允许组件重叠,可以不判断有没有和当前控件重叠 - //先计算当前控件的位置 - int creatorX, creatorY; - if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { - Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); - creatorX = creatorRectangle.x; - creatorY = creatorRectangle.y; - } else { - //这边计算得到的组件其实位置是正确的, - //因为传入的x和y已经加上了宽度或者高度的一半,再减去相同的宽度和高度的一半是没区别的, - // 例如高度为21,那么就是+10-10; - // 高度为20,那么就是+10-10; 没区别 - int w = creator.getWidth() / 2; - int h = creator.getHeight() / 2; - creatorX = x - w; - creatorY = y - h; - } - 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 鼠标所在区域的组件 - * @param x 坐标x - * @param y 坐标y - * @return 是则返回true - */ - public boolean isTrisectionArea(Component parentComp, int x, int y) { - XCreator creator = (XCreator) parentComp; - trisectAreaDirect = 0; - if (container.getComponentCount() <= 1) { - return false; - } - int maxWidth = parentComp.getWidth(); - int maxHeight = parentComp.getHeight(); - int xL = parentComp.getX(); - int yL = parentComp.getY(); - // 组件宽高的十分之一和默认值取大 - int minRangeWidth = Math.max(maxWidth / BORDER_PROPORTION, DEFAULT_AREA_LENGTH); - int minRangeHeight = Math.max(maxHeight / BORDER_PROPORTION, DEFAULT_AREA_LENGTH); - if (y < yL + minRangeHeight) { - // 在组件上侧三等分 - trisectAreaDirect = COMP_TOP; - } else if (y > yL + maxHeight - minRangeHeight) { - // 在组件下侧三等分 - trisectAreaDirect = COMP_BOTTOM; - } else if (x < xL + minRangeWidth) { - // 在组件左侧三等分 - trisectAreaDirect = COMP_LEFT; - } else if (x > xL + maxWidth - minRangeWidth) { - // 在组件右侧三等分 - trisectAreaDirect = COMP_RIGHT; - } - // tab布局的边界特殊处理,不进行三等分 - if (!creator.getTargetChildrenList().isEmpty()) { - return false; - } - - return !ComparatorUtils.equals(trisectAreaDirect, 0); - } - - //当前绝对布局不可编辑,就当成一个控件,组件添加在周围 - private boolean acceptWidget(int x, int y) { - isFindRelatedComps = false; - //拖入组件判断时,先判断是否为交叉点区域,其次三等分区域,再次平分区域 - Component comp = container.getComponentAt(x, y); - //如果当前处于边缘地带, 那么就把他贴到父容器上 - XLayoutContainer parent = container.findNearestFit(); - container = parent != null ? parent : container; - isAdd2ParentLayout = true; - - int componentHeight = comp.getHeight(); - int componentWidth = comp.getWidth(); - //上半部分高度 - int upHeight = (int) (componentHeight * TOP_HALF) + comp.getY(); - //下半部分高度 - int downHeight = (int) (componentHeight * BOTTOM_HALF) + comp.getY(); - - if (isCrossPointArea(comp, x, y)) { - return canAcceptWhileCrossPoint(comp, x, y); - } - - if (isTrisectionArea(comp, x, y)) { - return canAcceptWhileTrisection(comp, x, y); - } - - boolean horizonValid = componentWidth >= minWidth * 2 + actualVal; - boolean verticalValid = componentHeight >= minHeight * 2 + actualVal; - return y > upHeight && y < downHeight ? horizonValid : verticalValid; - } - - /** - * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 - * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 - * - * @param creator 被添加的新组件 - * @param x 添加的位置x,该位置是相对于container的 - * @param y 添加的位置y,该位置是相对于container的 - * @return 是否添加成功,成功返回true,否则false - */ - @Override - public boolean addBean(XCreator creator, int x, int y) { - Rectangle rect = ComponentUtils.getRelativeBounds(container); - - int posX = x + rect.x; - int posY = y + rect.y; - if (!accept(creator, x, y)) { - return false; - } - addComp(creator, posX, posY); - ((XWidgetCreator) creator).recalculateChildrenSize(); - return true; - } - - @Override - protected void addComp(XCreator creator, int x, int y) { - if (!isAdd2ParentLayout) { - Rectangle r = ComponentUtils.getRelativeBounds(container); - x = x - r.x; - y = y - r.y; - if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { - - Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); - x = creatorRectangle.x - r.x; - y = creatorRectangle.y - r.y; - } else { - int w = creator.getWidth() / 2; - int h = creator.getHeight() / 2; - x = x - w; - y = y - h; - } - fix(creator, x, y); - - if (creator.hasTitleStyle()) { - addParentCreator(creator); - } else { - container.add(creator, creator.toData().getWidgetName(), 0); - } - XWAbsoluteLayout layout = (XWAbsoluteLayout) container; - layout.updateBoundsWidget(creator); - updateCreatorBackBound(); - LayoutUtils.layoutRootContainer(container); - } else { - fixAbsolute(creator, x, y); - if (creator.shouldScaleCreator() || creator.hasTitleStyle()) { - addParentCreator(creator); - } else { - container.add(creator, creator.toData().getWidgetName(), 0); - } - XWFitLayout layout = (XWFitLayout) container; - // 更新对应的BoundsWidget - layout.updateBoundsWidget(); - updateCreatorBackBound(); - } - } - - private void updateCreatorBackBound() { - for (int i = 0, size = container.getComponentCount(); i < size; i++) { - XCreator creator = (XCreator) container.getComponent(i); - creator.updateChildBound(minHeight); - creator.setBackupBound(creator.getBounds()); - } - } - - private void addParentCreator(XCreator child) { - XLayoutContainer parentPanel = child.initCreatorWrapper(child.getHeight()); - container.add(parentPanel, child.toData().getWidgetName(), 0); - } - - /** - * 新拖入组件时,计算调整其他关联组件位置大小 - * - * @param child 新拖入的组件 - * @param x 鼠标所在x坐标 - * @param y 鼠标所在y坐标 - */ - private void fixAbsolute(XCreator child, int x, int y) { - Component parentComp = container.getComponentAt(x, y); - if (container.getComponentCount() == 0) { - child.setLocation(0, 0); - child.setSize(parentComp.getWidth(), parentComp.getHeight()); - } else if (isCrossPointArea(parentComp, x, y)) { - //交叉区域插入组件时,根据具体位置进行上下或者左右或者相邻三个组件的位置大小插入 - fixCrossPointArea(parentComp, child, x, y); - return; - } else if (isTrisectionArea(parentComp, x, y)) { - // 在边界三等分区域,就不再和组件二等分了 - fixTrisect(parentComp, child, x, y); - return; - } else { - fixHalve(parentComp, child, x, y); - } - } - - /** - * 组件拖拽后调整大小 - * - * @param creator 组件 - */ - @Override - public void fix(XCreator creator) { - WAbsoluteLayout wabs = (WAbsoluteLayout) container.toData(); - fix(creator, creator.getX(), creator.getY()); - wabs.setBounds(creator.toData(), creator.getBounds()); - - XWAbsoluteLayout layout = (XWAbsoluteLayout) container; - layout.updateBoundsWidget(creator); - } - - /** - * 调整组件大小到合适尺寸位置 - * - * @param creator 组件 - * @param x 坐标x - * @param y 坐标y - */ - public void fix(XCreator creator, int x, int y) { - int height = creator.getHeight(); - int width = creator.getWidth(); - if (x < 0) { - x = container.getX(); - } else if (x + creator.getWidth() > container.getWidth()) { - x = container.getWidth() - width; - } - - if (y < 0) { - y = container.getY(); - } else if (y + creator.getHeight() > container.getHeight()) { - y = container.getHeight() - height; - } - - creator.setBounds(x, y, width, height); - } - - @Override - public ConstraintsGroupModel getLayoutConstraints(XCreator creator) { - return new BoundsGroupModel((XWAbsoluteLayout) container, creator); - } - - @Override - public GroupModel getLayoutProperties() { - XWAbsoluteLayout xwAbsoluteLayout = (XWAbsoluteLayout) container; - return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout); - } +package com.fr.design.designer.beans.adapters.layout; + +import com.fr.design.beans.GroupModel; +import com.fr.design.designer.beans.ConstraintsGroupModel; +import com.fr.design.designer.beans.HoverPainter; +import com.fr.design.designer.beans.painters.FRAbsoluteLayoutPainter; +import com.fr.design.designer.creator.*; +import com.fr.design.designer.properties.BoundsGroupModel; +import com.fr.design.designer.properties.FRAbsoluteLayoutPropertiesGroupModel; +import com.fr.design.utils.ComponentUtils; +import com.fr.design.utils.gui.LayoutUtils; +import com.fr.form.ui.container.WAbsoluteLayout; +import com.fr.general.ComparatorUtils; +import com.fr.general.FRLogger; + +import java.awt.*; + +public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { + //是不是添加到父容器上 + private boolean isAdd2ParentLayout = false; + private HoverPainter painter; + + public FRAbsoluteLayoutAdapter(XLayoutContainer container) { + super(container); + painter = new FRAbsoluteLayoutPainter(container); + initMinSize(); + } + + private void initMinSize() { + XWAbsoluteLayout layout = (XWAbsoluteLayout) container; + minWidth = layout.getActualMinWidth(); + minHeight = layout.getActualMinHeight(); + actualVal = layout.getAcualInterval(); + margin = layout.toData().getMargin(); + } + + @Override + public HoverPainter getPainter() { + return painter; + } + + /** + * 是否能在指定位置添加组件 + * @param creator 组件 + * @param x 坐标x + * @param y 坐标y + * @return 能则返回true + */ + //这个地方的逻辑非常复杂, + // 1.当前绝对布局是不可编辑且是最外层,那么其他控件添加在它周围, + // 2.当前绝对布局是不可编辑且不是最外层,那么控件不可添加,(嵌套) + // 3.当前绝对布局可编辑,那么控件添加 + @Override + public boolean accept(XCreator creator, int x, int y) { + Component comp = container.getComponentAt(x, y); + //布局控件要先判断是不是可编辑 + //可以编辑,按原有逻辑判断 + //不可编辑,当成一整个控件处理 + 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; + } + XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator)comp).getTopLayout(); + if(topLayout != null){ + if (topLayout.isEditable()){ + return topLayoutAccept(creator, x, y); + } + //绝对布局嵌套,处于内层,不可编辑,不添加,topLayout只能获取到最外层可编辑的布局 + else if (((XLayoutContainer)topLayout.getParent()).acceptType(XWAbsoluteLayout.class)) { + return false; + } else { + return acceptWidget(x, y); + } + } else { + FRLogger.getLogger().error("top layout is null!"); + } + + return false; + } + + //topLayout假如可以编辑的话就往里面添加组件 + private boolean topLayoutAccept(XCreator creator, int x, int y) { + //允许组件重叠,可以不判断有没有和当前控件重叠 + //先计算当前控件的位置 + int creatorX, creatorY; + if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { + Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); + creatorX = creatorRectangle.x; + creatorY = creatorRectangle.y; + } else { + //这边计算得到的组件其实位置是正确的, + //因为传入的x和y已经加上了宽度或者高度的一半,再减去相同的宽度和高度的一半是没区别的, + // 例如高度为21,那么就是+10-10; + // 高度为20,那么就是+10-10; 没区别 + int w = creator.getWidth() / 2; + int h = creator.getHeight() / 2; + creatorX = x - w; + creatorY = y - h; + } + 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 鼠标所在区域的组件 + * @param x 坐标x + * @param y 坐标y + * @return 是则返回true + */ + public boolean isTrisectionArea(Component parentComp, int x, int y) { + XCreator creator = (XCreator)parentComp; + trisectAreaDirect = 0; + if (container.getComponentCount()<=1) { + return false; + } + int maxWidth = parentComp.getWidth(); + int maxHeight = parentComp.getHeight(); + int xL = parentComp.getX(); + int yL = parentComp.getY(); + // 组件宽高的十分之一和默认值取大 + int minRangeWidth = Math.max(maxWidth/BORDER_PROPORTION, DEFAULT_AREA_LENGTH); + int minRangeHeight = Math.max(maxHeight/BORDER_PROPORTION, DEFAULT_AREA_LENGTH); + if(yyL+maxHeight-minRangeHeight) { + // 在组件下侧三等分 + trisectAreaDirect = COMP_BOTTOM; + } else if (xxL+maxWidth-minRangeWidth) { + // 在组件右侧三等分 + trisectAreaDirect = COMP_RIGHT; + } + // tab布局的边界特殊处理,不进行三等分 + if(!creator.getTargetChildrenList().isEmpty()){ + return false; + } + + return !ComparatorUtils.equals(trisectAreaDirect, 0); + } + + //当前绝对布局不可编辑,就当成一个控件,组件添加在周围 + private boolean acceptWidget(int x, int y) { + isFindRelatedComps = false; + //拖入组件判断时,先判断是否为交叉点区域,其次三等分区域,再次平分区域 + Component comp = container.getComponentAt(x, y); + //如果当前处于边缘地带, 那么就把他贴到父容器上 + XLayoutContainer parent = container.findNearestFit(); + container = parent != null ? parent : container; + isAdd2ParentLayout = true; + + int componentHeight = comp.getHeight(); + int componentWidth = comp.getWidth(); + //上半部分高度 + int upHeight = (int) (componentHeight * TOP_HALF) + comp.getY(); + //下半部分高度 + int downHeight = (int) (componentHeight * BOTTOM_HALF) + comp.getY(); + + if (isCrossPointArea(comp, x, y)) { + return canAcceptWhileCrossPoint(comp, x, y); + } + + if (isTrisectionArea(comp, x, y)) { + return canAcceptWhileTrisection(comp, x, y); + } + + boolean horizonValid = componentWidth >= minWidth * 2 + actualVal; + boolean verticalValid = componentHeight >= minHeight * 2 + actualVal; + return y > upHeight && y < downHeight ? horizonValid : verticalValid; + } + + /** + * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 + * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 + * + * @param creator 被添加的新组件 + * @param x 添加的位置x,该位置是相对于container的 + * @param y 添加的位置y,该位置是相对于container的 + * @return 是否添加成功,成功返回true,否则false + */ + @Override + public boolean addBean(XCreator creator, int x, int y) { + Rectangle rect = ComponentUtils.getRelativeBounds(container); + + int posX = x + rect.x; + int posY = y + rect.y; + if (!accept(creator, x, y)) { + return false; + } + addComp(creator, posX, posY); + ((XWidgetCreator) creator).recalculateChildrenSize(); + return true; + } + + @Override + protected void addComp(XCreator creator, int x, int y) { + if(!isAdd2ParentLayout) { + Rectangle r = ComponentUtils.getRelativeBounds(container); + x = x - r.x; + y = y - r.y; + if (XCreatorUtils.getParentXLayoutContainer(creator) != null) { + + Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator); + x = creatorRectangle.x - r.x; + y = creatorRectangle.y - r.y; + } else { + int w = creator.getWidth() / 2; + int h = creator.getHeight() / 2; + x = x - w; + y = y - h; + } + fix(creator, x, y); + + if (creator.hasTitleStyle()) { + addParentCreator(creator); + } else { + container.add(creator, creator.toData().getWidgetName(),0); + } + XWAbsoluteLayout layout = (XWAbsoluteLayout) container; + layout.updateBoundsWidget(creator); + updateCreatorBackBound(); + LayoutUtils.layoutRootContainer(container); + }else{ + fixAbsolute(creator, x, y); + if (creator.shouldScaleCreator() || creator.hasTitleStyle()) { + addParentCreator(creator); + } else { + container.add(creator, creator.toData().getWidgetName(),0); + } + XWFitLayout layout = (XWFitLayout) container; + // 更新对应的BoundsWidget + layout.updateBoundsWidget(); + updateCreatorBackBound(); + } + } + + private void updateCreatorBackBound() { + for (int i=0,size=container.getComponentCount(); i container.getWidth()) { + x = container.getWidth() - width; + } + + if (y < 0) { + y = container.getY(); + } else if (y + creator.getHeight() > container.getHeight()) { + y = container.getHeight() - height; + } + + creator.setBounds(x, y, width, height); + } + + @Override + public ConstraintsGroupModel getLayoutConstraints(XCreator creator) { + return new BoundsGroupModel((XWAbsoluteLayout)container, creator); + } + + @Override + public GroupModel getLayoutProperties() { + XWAbsoluteLayout xwAbsoluteLayout = (XWAbsoluteLayout) container; + return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout); + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index 03962df487..3a030f7f2b 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -16,19 +16,17 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FRFitLayoutConstraints; import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; -import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.mainframe.JForm; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.LayoutBorderStyle; +import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.ComparatorUtils; -import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + /** * 自适应布局的容器适配器 * @@ -50,7 +48,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { public void setEdit(boolean edit) { isEdit = edit; } - + /** * 构造函数 * @@ -133,7 +131,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { isFindRelatedComps = false; //拖入组件判断时,先判断是否为交叉点区域,其次三等分区域,再次平分区域 Component comp = container.getComponentAt(x, y); - if (comp == null || checkInterval(comp)) { + if (comp == null || checkInterval(comp)) { return false; } //如果当前处于边缘地带, 那么就把他贴到父容器上 @@ -269,13 +267,13 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { } - protected Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout) { + protected Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout) { return mainLayout.getBounds(); } private Rectangle adjustBackupBound(Rectangle backupBound, XWCardMainBorderLayout mainLayout) { - // zhouping: REPORT-2334 表单tab布局中图表放大缩小会明显 - // 这边不需要单独处理参数面板高度了,下面的方法中获取的是XWCardMainBorderLayout相对坐标 + // zhouping: REPORT-2334 表单tab布局中图表放大缩小会明显 + // 这边不需要单独处理参数面板高度了,下面的方法中获取的是XWCardMainBorderLayout相对坐标 Rectangle rec = getLayoutBound(mainLayout); // XWTabLayout里面的横纵坐标收到外层XWCardMainBorderLayout的横纵坐标影响 // 减掉之后可以按照它原来的逻辑执行 @@ -341,13 +339,13 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { * 拖拽控件边框后,根据控件的大小尺寸,进行相关组件的调整 * * @param backupBound 边界备份 - * @param bounds 组件边界 - * @param xCreator 组件 - * @param row 选中的行 - * @param difference 偏移量 + * @param bounds 组件边界 + * @param xCreator 组件 + * @param row 选中的行 + * @param difference 偏移量 */ public void calculateBounds(Rectangle backupBound, Rectangle bounds, XCreator xCreator, int row, int difference) { - Rectangle rc = new Rectangle(0, 0, 0, 0); + Rectangle rc = new Rectangle(0, 0, 0, 0); XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(xCreator); if (parent != null) { Rectangle rec = ComponentUtils.getRelativeBounds(parent); @@ -358,17 +356,17 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { //处理左右延伸 switch (row) { case 0: - if (backupBound.width + backupBound.x == container.getWidth() - margin.getRight() + rc.x) { + if (backupBound.width + backupBound.x == container.getWidth() - margin.getRight() + rc.x) { x += difference; } break; case 1: - if (backupBound.y + backupBound.height == container.getHeight() - margin.getBottom() + rc.y) { + if (backupBound.y + backupBound.height == container.getHeight() - margin.getBottom() + rc.y) { y += difference; } break; } - bounds.setLocation(x, y); + bounds.setLocation(x, y); xCreator.setBackupBound(backupBound); xCreator.setBounds(bounds); this.fix(xCreator); @@ -412,7 +410,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { // 根据需要依附的位置调整拖拽的坐标值 private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) { - if (!isEdit) { + if (!isEdit) { for (int i = 0; i < coordinates.length; i++) { if (coordinate == coordinates[i]) { continue; @@ -428,7 +426,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { // 根据需要依附的位置调整拖拽的距离 private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) { - if (!isEdit) { + if (!isEdit) { for (int i = 0; i < coordinates.length; i++) { if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) { diff = coordinates[i] - coordinate; @@ -546,8 +544,8 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { difference = Math.max(difference, minWidth - getMinWidth(leftComps)); } //重新计算左右两侧组件size、point - if (calculateLefttRelatComponent(difference)) { - calculateRightRelatComponent(objx + difference, -difference); + if (calculateLefttRelatComponent(difference)) { + calculateRightRelatComponent(objx + difference, -difference); } } @@ -662,8 +660,8 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { difference = Math.max(difference, minHeight - getMinHeight(upComps)); } //重新计算上下两侧组件size、point - if (calculateUpRelatComponent(difference)) { - calculateDownRelatComponent(objY + difference, -difference); + if (calculateUpRelatComponent(difference)) { + calculateDownRelatComponent(objY + difference, -difference); } } @@ -744,13 +742,13 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { int height = creatorHeight; calculateRelatedComponent(x, y, width, height); if (!rightComps.isEmpty() && getAllHeight(rightComps) == height) { - calculateRightRelatComponent(x, width + actualVal); + calculateRightRelatComponent(x, width + actualVal); } else if (!leftComps.isEmpty() && getAllHeight(leftComps) == height) { - calculateLefttRelatComponent(width + actualVal); + calculateLefttRelatComponent(width + actualVal); } else if (!downComps.isEmpty() && getAllWidth(downComps) == width) { - calculateDownRelatComponent(y, height + actualVal); + calculateDownRelatComponent(y, height + actualVal); } else if (!upComps.isEmpty() && getAllWidth(upComps) == width) { - calculateUpRelatComponent(height + actualVal); + calculateUpRelatComponent(height + actualVal); } else { // 由于布局三等分的存在,可能会出现删除组件时,找不到关联的组件填充,此时特殊处理 calculateNoRelatedComponent(x, y, width, height); @@ -1013,7 +1011,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { setAdjustedSize(tabLayout, offset, isHor); for (int m = 0; m < tabLayout.getComponentCount(); m++) { XCreator childCreator = tabLayout.getXCreator(m); - BoundsWidget wgt = (BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); + WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); wgt.setBounds(tabLayout.getComponent(m).getBounds()); } adjustCreatorsSize(percent, tabLayout, isHor); @@ -1056,7 +1054,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { * @param objX 调整后的坐标x * @param objWidth 调整后的宽度 */ - protected void calculateRightRelatComponent(int objX, int objWidth) { + protected void calculateRightRelatComponent(int objX, int objWidth) { int count = rightComps.size(); for (int i = 0; i < count; i++) { XCreator creator = (XCreator) rightComps.get(i); @@ -1096,7 +1094,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { /** * 删除或拉伸控件左边框时 调整左侧的组件位置大小; */ - protected boolean calculateLefttRelatComponent(int objWidth) { + protected boolean calculateLefttRelatComponent(int objWidth) { if (isBeyondAdjustWidthScope(objWidth)) { return false; } @@ -1114,7 +1112,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { /** * 删除或拉伸下边框 调整下方的组件位置大小 */ - protected void calculateDownRelatComponent(int objY, int objHeight) { + protected void calculateDownRelatComponent(int objY, int objHeight) { int count = downComps.size(); for (int i = 0; i < count; i++) { XCreator creator = (XCreator) downComps.get(i); @@ -1154,7 +1152,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { /** * 删除或拉伸上边框 调整上方的组件位置大小 */ - protected boolean calculateUpRelatComponent(int objHeight) { + protected boolean calculateUpRelatComponent(int objHeight) { if (isBeyondAdjustHeightScope(objHeight)) { return false; } diff --git a/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java b/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java index c39dfc4dba..3538d2fd9f 100644 --- a/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java +++ b/designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java @@ -11,6 +11,7 @@ import com.fr.design.mainframe.FormSelection; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; +import com.fr.form.ui.container.WParameterLayout; import java.awt.*; @@ -24,7 +25,7 @@ public abstract class AccessDirection implements Direction { private int ymin; private int xmin; - abstract int getCursor(); + abstract int getCursor(); protected abstract Rectangle getDraggedBounds(int dx, int dy, Rectangle currentBounds, FormDesigner designer, Rectangle oldBounds); @@ -51,14 +52,14 @@ public abstract class AccessDirection implements Direction { x = designer.getRootComponent().getWidth(); } //参数面板可以无下限拉长 - if (y < 0) { - y = 0; - } else if (y > designer.getRootComponent().getHeight() + designer.getParaHeight() && designer.getSelectionModel().hasSelectionComponent() + if (y < 0) { + y = 0; + } else if (y > designer.getRootComponent().getHeight() + designer.getParaHeight() && designer.getSelectionModel().hasSelectionComponent() && !designer.getSelectionModel().getSelection().getSelectedCreator().acceptType(XWParameterLayout.class)) { - y = designer.getRootComponent().getHeight() + designer.getParaHeight(); - } - return new Point(x, y); - } + y = designer.getRootComponent().getHeight() + designer.getParaHeight(); + } + return new Point(x, y); + } protected void sorptionPoint(Point point, Rectangle currentBounds, FormDesigner designer) { boolean findInX = currentBounds.getWidth() <= MoveUtils.SORPTION_UNIT; @@ -95,10 +96,10 @@ public abstract class AccessDirection implements Direction { findInY = true; } - } - if (findInX && findInY) { - break; - } + } + if (findInX && findInY) { + break; + } } setDesignerStateModelProperties(designer, findInX, findInY, currentBounds, point); @@ -124,7 +125,7 @@ public abstract class AccessDirection implements Direction { } - private WAbsoluteLayout getLayout(final FormDesigner designer) { + private WAbsoluteLayout getLayout(final FormDesigner designer){ XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator( designer.getTarget().getContainer()); WAbsoluteLayout layout; @@ -156,52 +157,50 @@ public abstract class AccessDirection implements Direction { return; } //设定控件最小高度21,因每次拖曳至少移动1,防止控件高度等于21时,拖曳导致rec.y的变化使得控件不停的向上或向下移动。 - if (rec.height == MINHEIGHT) { + if(rec.height == MINHEIGHT){ ymin = rec.y; } - if (rec.height == MINHEIGHT - 1) { + if(rec.height == MINHEIGHT - 1){ ymin = ymin == rec.y ? rec.y : rec.y - 1; } - if (rec.height < MINHEIGHT) { + if(rec.height < MINHEIGHT){ rec.height = MINHEIGHT; rec.y = ymin; } // 增加下宽度也设最小为21 if (rec.width == MINWIDTH) { - xmin = rec.x; + xmin = rec.x; } - if (rec.width == MINWIDTH - 1) { - xmin = xmin == rec.x ? rec.x : rec.x - 1; + if(rec.width == MINWIDTH - 1){ + xmin = xmin == rec.x ? rec.x : rec.x - 1; } if (rec.width < MINWIDTH) { - rec.width = MINWIDTH; - rec.x = xmin; + rec.width = MINWIDTH; + rec.x = xmin; } } - /** - * 更新鼠标指针形状 - * - * @param formEditor 设计界面组件 - */ - public void updateCursor(FormDesigner formEditor) { - - // 调用位置枚举的多态方法getCursor获取鼠标形状 - int type = getCursor(); - - if (type != formEditor.getCursor().getType()) { - // 设置当前形状 - formEditor.setCursor(Cursor.getPredefinedCursor(type)); - } - } - - /** - * 生成组件备用的bound - * - * @param formEditor 设计界面组件 - */ - public void backupBounds(FormDesigner formEditor) { - formEditor.getSelectionModel().getSelection().backupBounds(); - } + /** + * 更新鼠标指针形状 + * @param formEditor 设计界面组件 + */ + public void updateCursor(FormDesigner formEditor) { + + // 调用位置枚举的多态方法getCursor获取鼠标形状 + int type = getCursor(); + + if (type != formEditor.getCursor().getType()) { + // 设置当前形状 + formEditor.setCursor(Cursor.getPredefinedCursor(type)); + } + } + + /** + * 生成组件备用的bound + * @param formEditor 设计界面组件 + */ + public void backupBounds(FormDesigner formEditor) { + formEditor.getSelectionModel().getSelection().backupBounds(); + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java b/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java index 54033694d9..9d308b9d4b 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/AddingModel.java @@ -1,141 +1,141 @@ -package com.fr.design.designer.beans.models; - -import java.awt.Rectangle; - -import com.fr.design.designer.creator.XWAbsoluteLayout; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.designer.beans.AdapterBus; -import com.fr.design.designer.beans.ComponentAdapter; -import com.fr.design.designer.beans.adapters.component.CompositeComponentAdapter; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWParameterLayout; -import com.fr.design.utils.ComponentUtils; -import com.fr.general.ComparatorUtils; - -/** - * 添加状态下的model - */ -public class AddingModel { - - // 当前要添加的组件 - private XCreator creator; - // 记录当前鼠标的位置信息 - private int currentX; - private int currentY; - private boolean added; - - public AddingModel(FormDesigner designer, XCreator xCreator) { - String creatorName = getXCreatorName(designer, xCreator); - this.creator = xCreator; - instantiateCreator(designer, creatorName); - // 初始的时候隐藏该组件的图标 - currentY = -this.creator.getWidth(); - currentX = -this.creator.getHeight(); - } - - /** - * 待说明 - * - * @param designer 设计器 - * @param creatorName 组件名 - */ - public void instantiateCreator(FormDesigner designer, String creatorName) { - creator.toData().setWidgetName(creatorName); - ComponentAdapter adapter = new CompositeComponentAdapter(designer, creator); - adapter.initialize(); - creator.addNotify(); - creator.putClientProperty(AdapterBus.CLIENT_PROPERTIES, adapter); - } - - public AddingModel(XCreator xCreator, int x, int y) { - this.creator = xCreator; - this.creator.backupCurrentSize(); - this.creator.backupParent(); - this.creator.setSize(xCreator.initEditorSize()); - currentX = x - (xCreator.getWidth() / 2); - currentY = y - (xCreator.getHeight() / 2); - } - - /** - * 隐藏当前组件的图标 - */ - public void reset() { - currentX = -this.creator.getWidth(); - currentY = -this.creator.getHeight(); - } - - public String getXCreatorName(FormDesigner designer, XCreator x) { - String def = x.createDefaultName(); - if (x.acceptType(XWParameterLayout.class)) { - return def; - } - int i = 0; - while (designer.getTarget().isNameExist(def + i)) { - i++; - } - return def + i; - } - - public int getCurrentX() { - return currentX; - } - - public int getCurrentY() { - return currentY; - } - - - /** - * 移动组件图标到鼠标事件发生的位置 - * - * @param x 坐标 - * @param y 坐标 - */ - public void moveTo(int x, int y) { - currentX = x - (this.creator.getWidth() / 2); - currentY = y - (this.creator.getHeight() / 2); - } - - public XCreator getXCreator() { - return this.creator; - } - - /** - * 当前组件是否已经添加到某个容器中 - * - * @return 是返回true - */ - public boolean isCreatorAdded() { - return added; - } - - /** - * 加入容器 - * - * @param designer 设计器 - * @param container 容器 - * @param x 坐标 - * @param y 坐标 - * @return 成功返回true - */ - public boolean add2Container(FormDesigner designer, XLayoutContainer container, int x, int y) { - //考虑不同布局嵌套的情况,获取顶层容器 - XLayoutContainer xLayoutContainer = container.getTopLayout(); - if (xLayoutContainer != null && xLayoutContainer.acceptType(XWAbsoluteLayout.class)) { - container = xLayoutContainer; - } - - Rectangle rect = ComponentUtils.getRelativeBounds(container); - if (!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())) { - added = container.getLayoutAdapter().addBean(creator, - x + designer.getArea().getHorizontalValue(), - y + designer.getArea().getVerticalValue()); - return added; - } - added = container.getLayoutAdapter().addBean(creator, - x + designer.getArea().getHorizontalValue() - rect.x, - y + designer.getArea().getVerticalValue() - rect.y); - return added; - } +package com.fr.design.designer.beans.models; + +import java.awt.Rectangle; + +import com.fr.design.designer.creator.XWAbsoluteLayout; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.designer.beans.AdapterBus; +import com.fr.design.designer.beans.ComponentAdapter; +import com.fr.design.designer.beans.adapters.component.CompositeComponentAdapter; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.utils.ComponentUtils; +import com.fr.general.ComparatorUtils; + +/** + * 添加状态下的model + */ +public class AddingModel { + + // 当前要添加的组件 + private XCreator creator; + // 记录当前鼠标的位置信息 + private int currentX; + private int currentY; + private boolean added; + + public AddingModel(FormDesigner designer, XCreator xCreator) { + String creatorName = getXCreatorName(designer, xCreator); + this.creator = xCreator; + instantiateCreator(designer, creatorName); + // 初始的时候隐藏该组件的图标 + currentY = -this.creator.getWidth(); + currentX = -this.creator.getHeight(); + } + + /** + * 待说明 + * + * @param designer 设计器 + * @param creatorName 组件名 + */ + public void instantiateCreator(FormDesigner designer, String creatorName) { + creator.toData().setWidgetName(creatorName); + ComponentAdapter adapter = new CompositeComponentAdapter(designer, creator); + adapter.initialize(); + creator.addNotify(); + creator.putClientProperty(AdapterBus.CLIENT_PROPERTIES, adapter); + } + + public AddingModel(XCreator xCreator, int x, int y) { + this.creator = xCreator; + this.creator.backupCurrentSize(); + this.creator.backupParent(); + this.creator.setSize(xCreator.initEditorSize()); + currentX = x - (xCreator.getWidth() / 2); + currentY = y - (xCreator.getHeight() / 2); + } + + /** + * 隐藏当前组件的图标 + */ + public void reset() { + currentX = -this.creator.getWidth(); + currentY = -this.creator.getHeight(); + } + + public String getXCreatorName(FormDesigner designer, XCreator x) { + String def = x.createDefaultName(); + if (x.acceptType(XWParameterLayout.class)) { + return def; + } + int i = 0; + while (designer.getTarget().isNameExist(def + i)) { + i++; + } + return def + i; + } + + public int getCurrentX() { + return currentX; + } + + public int getCurrentY() { + return currentY; + } + + + /** + * 移动组件图标到鼠标事件发生的位置 + * + * @param x 坐标 + * @param y 坐标 + */ + public void moveTo(int x, int y) { + currentX = x - (this.creator.getWidth() / 2); + currentY = y - (this.creator.getHeight() / 2); + } + + public XCreator getXCreator() { + return this.creator; + } + + /** + * 当前组件是否已经添加到某个容器中 + * + * @return 是返回true + */ + public boolean isCreatorAdded() { + return added; + } + + /** + * 加入容器 + * + * @param designer 设计器 + * @param container 容器 + * @param x 坐标 + * @param y 坐标 + * @return 成功返回true + */ + public boolean add2Container(FormDesigner designer, XLayoutContainer container, int x, int y) { + //考虑不同布局嵌套的情况,获取顶层容器 + XLayoutContainer xLayoutContainer = container.getTopLayout(); + if (xLayoutContainer != null && xLayoutContainer.acceptType(XWAbsoluteLayout.class)) { + container = xLayoutContainer; + } + + Rectangle rect = ComponentUtils.getRelativeBounds(container); + if (!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())) { + added = container.getLayoutAdapter().addBean(creator, + x + designer.getArea().getHorizontalValue(), + y + designer.getArea().getVerticalValue()); + return added; + } + added = container.getLayoutAdapter().addBean(creator, + x + designer.getArea().getHorizontalValue() - rect.x, + y + designer.getArea().getVerticalValue() - rect.y); + return added; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/beans/models/StateModel.java b/designer_form/src/com/fr/design/designer/beans/models/StateModel.java index f3aeb8f901..ff3fcbedcd 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/StateModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/StateModel.java @@ -1,476 +1,476 @@ -package com.fr.design.designer.beans.models; - -import com.fr.design.beans.location.Absorptionline; -import com.fr.design.designer.beans.AdapterBus; -import com.fr.design.designer.beans.HoverPainter; -import com.fr.design.designer.beans.LayoutAdapter; -import com.fr.design.designer.beans.events.DesignerEvent; -import com.fr.design.designer.beans.location.Direction; -import com.fr.design.designer.beans.location.Location; -import com.fr.design.designer.creator.*; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.FormSelectionUtils; -import com.fr.design.utils.ComponentUtils; - -import java.awt.*; -import java.awt.event.MouseEvent; -import java.util.ArrayList; - -/** - * 普通模式下的状态model - */ -public class StateModel { - // 对应的selection model - - private SelectionModel selectionModel; - // 当前鼠标进入拖拽区域的位置类型 - private Direction driection; - - // 当前拖拽的起始位置 - private int currentX; - private int currentY; - - //拖拽组件原始位置大小备份 - private Rectangle selectedPositionBackup; - - private Point startPoint = new Point(); - private Point currentPoint = new Point(); - - private Absorptionline lineInX; - private Absorptionline lineInY; - //等距线 - private Absorptionline lineEquidistant; - - // 当前是否处于拖拽选择状态 - private boolean selecting; - private boolean dragging; - - private boolean addable; - - private FormDesigner designer; - - public StateModel(FormDesigner designer) { - this.designer = designer; - selectionModel = designer.getSelectionModel(); - } - - /** - * 返回direction - * - * @return direction方向 - */ - public Direction getDirection() { - return driection; - } - - /** - * 是否有组件正被选中 - * - * @return true 如果至少一个组件被选中 - */ - public boolean isSelecting() { - return selecting; - } - - /** - * 是否能拖拽 - * - * @return 非outer且选中为空 - */ - public boolean dragable() { - return ((driection != Location.outer) && !selecting); - } - - /** - * 拖拽中是否可以转换为添加模式: - * 如果拖拽组件只有一个,鼠标当前所在位置的最底层表单容器与这个组件的容器不同; - * 如果拖拽组件为多个,鼠标当前所在位置的最底层表单容器除了要求要跟这些组件的容器不同外,还必须是绝对定位布局 - */ - private void checkAddable(MouseEvent e) { - addable = false; - designer.setPainter(null); - - if (driection != Location.inner) { - return; - } - - XCreator comp = designer.getComponentAt(e.getX(), e.getY(), selectionModel.getSelection().getSelectedCreators()); - XLayoutContainer container = XCreatorUtils.getHotspotContainer(comp); - XCreator creator = selectionModel.getSelection().getSelectedCreator(); - Component creatorContainer = XCreatorUtils.getParentXLayoutContainer(creator); - if (creatorContainer != null && creatorContainer != container - && (selectionModel.getSelection().size() == 1 || container instanceof XWAbsoluteLayout)) { - HoverPainter painter = AdapterBus.getContainerPainter(designer, container); - designer.setPainter(painter); - if (painter != null) { - Rectangle rect = ComponentUtils.getRelativeBounds(container); - rect.x -= designer.getArea().getHorizontalValue(); - rect.y -= designer.getArea().getVerticalValue(); - painter.setRenderingBounds(rect); - painter.setHotspot(new Point(e.getX(), e.getY())); - painter.setCreator(creator); - } - addable = true; - } - } - - /** - * @param container 容器 - * @param mouseX 鼠标释放位置X - * @param mouseY 鼠标释放位置Y - * @return 是否成功 - */ - private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) { - LayoutAdapter adapter = container.getLayoutAdapter(); - Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container); - if (selectionModel.getSelection().size() == 1) { - return adapter.addBean(selectionModel.getSelection().getSelectedCreator(), - mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, - mouseY + designer.getArea().getVerticalValue() - rectangleContainer.y); - } - for (XCreator creator : selectionModel.getSelection().getSelectedCreators()) { - adapter.addBean(creator, - mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, - mouseY + designer.getArea().getVerticalValue() - rectangleContainer.y); - } - return true; - } - - /** - * @param mouseReleasedX 鼠标释放位置X - * @param mouseReleasedY 鼠标释放位置Y - */ - private void adding(int mouseReleasedX, int mouseReleasedY) { - // 当前鼠标所在的组件 - XCreator hoveredComponent = designer.getComponentAt(mouseReleasedX, mouseReleasedY, selectionModel.getSelection().getSelectedCreators()); - - // 获取该组件所在的焦点容器 - XLayoutContainer container = XCreatorUtils.getHotspotContainer(hoveredComponent); - - boolean success = false; - - if (container != null) { - // 如果是容器,则调用其acceptComponent接受组件 - success = addBean(container, mouseReleasedX, mouseReleasedY); - } - - if (success) { - FormSelectionUtils.rebuildSelection(designer); - designer.getEditListenerTable().fireCreatorModified( - selectionModel.getSelection().getSelectedCreator(), DesignerEvent.CREATOR_ADDED); - } else { - selectionModel.getSelection().setSelectionBounds(selectedPositionBackup, designer); - Toolkit.getDefaultToolkit().beep(); - } - // 取消提示 - designer.setPainter(null); - } - - /** - * 是否拖拽 - * - * @return dragging状态 - */ - public boolean isDragging() { - return dragging; - } - - /** - * 是否可以开始画线 - * - * @return startPoint不为空返回true - */ - public boolean prepareForDrawLining() { - return startPoint != null; - } - - /** - * 设置开始位置 - * - * @param p point位置 - */ - public void setStartPoint(Point p) { - this.startPoint = p; - } - - /** - * 返回开始位置 - * - * @return 点位置 - */ - public Point getStartPoint() { - return startPoint; - } - - /** - * 返回当前点位置 - * - * @return 点位置 - */ - public Point getEndPoint() { - return currentPoint; - } - - /** - * 当前选中组件 - * - * @param e 鼠标事件 - */ - public void startSelecting(MouseEvent e) { - selecting = true; - selectionModel.setHotspotBounds(new Rectangle()); - currentX = getMouseXY(e).x; - currentY = getMouseXY(e).y; - } - - /** - * 当前鼠标的xy - * - * @param e 鼠标事件 - */ - public void startResizing(MouseEvent e) { - if (!selectionModel.getSelection().isEmpty()) { - driection.backupBounds(designer); - } - currentX = getMouseXY(e).x; - currentY = getMouseXY(e).y; - } - - /** - * 起始点开始DrawLine - * - * @param p 点位置 - */ - public void startDrawLine(Point p) { - this.startPoint = p; - if (p != null) { - try { - designer.setCursor(XConnector.connectorCursor); - } catch (Exception e) { - } - } else { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - } - - /** - * 鼠标释放时所在的区域及圈中的组件 - * - * @param e 鼠标事件 - */ - public void selectCreators(MouseEvent e) { - int x = getMouseXY(e).x; - int y = getMouseXY(e).y; - - Rectangle bounds = createCurrentBounds(x, y); - - if ((x != currentX) || (y != currentY)) { - selectionModel.setSelectedCreators(getHotspotCreators(bounds, designer.getRootComponent())); - } - selectionModel.setHotspotBounds(null); - } - - /** - * 画所在区域线 - * - * @param e 鼠标事件 - */ - public void drawLine(MouseEvent e) { - designer.getDrawLineHelper().setDrawLine(true); - Point p = designer.getDrawLineHelper().getNearWidgetPoint(e); - if (p != null) { - currentPoint = p; - } else { - currentPoint.x = e.getX() + designer.getArea().getHorizontalValue(); - currentPoint.y = e.getY() + designer.getArea().getVerticalValue(); - } - } - - private Rectangle createCurrentBounds(int x, int y) { - Rectangle bounds = new Rectangle(); - - bounds.x = Math.min(x, currentX); - bounds.y = Math.min(y, currentY); - bounds.width = Math.max(x, currentX) - bounds.x; - bounds.height = Math.max(y, currentY) - bounds.y; - - return bounds; - } - - private ArrayList getHotspotCreators(Rectangle selection, XCreator root) { - ArrayList creators = new ArrayList<>(); - - if (!root.isVisible() && !designer.isRoot(root)) { - return creators; - } - - if (root instanceof XLayoutContainer) { - XLayoutContainer container = (XLayoutContainer) root; - int count = container.getXCreatorCount(); - Rectangle clipped = new Rectangle(selection); - - for (int i = count - 1; i >= 0; i--) { - XCreator child = container.getXCreator(i); - - if (selection.contains(child.getBounds())) { - creators.add(child); - } else { - clipped.x = selection.x - child.getX(); - clipped.y = selection.y - child.getY(); - creators.addAll(getHotspotCreators(clipped, child)); - } - } - } - - return creators; - } - - - /** - * 重置model - */ - public void resetModel() { - dragging = false; - selecting = false; - } - - /** - * 重置 - */ - public void reset() { - driection = Location.outer; - dragging = false; - selecting = false; - } - - /** - * 取消拖拽 - */ - public void draggingCancel() { - designer.repaint(); - reset(); - } - - /** - * 设置可拉伸方向 - * - * @param dir 拉伸方向 - */ - public void setDirection(Direction dir) { - if (driection != dir) { - this.driection = dir; - driection.updateCursor(designer); - } - } - - /** - * x吸附线赋值 - * - * @param line 线 - */ - public void setXAbsorptionline(Absorptionline line) { - this.lineInX = line; - } - - /** - * y吸附线赋值 - * - * @param line 线 - */ - public void setYAbsorptionline(Absorptionline line) { - this.lineInY = line; - } - - /** - * 等距线赋值 - * - * @param line 线 - */ - public void setEquidistantLine(Absorptionline line) { - this.lineEquidistant = line; - } - - /** - * 画吸附线 - * - * @param g Graphics类 - */ - public void paintAbsorptionline(Graphics g) { - if (lineInX != null) { - lineInX.paint(g, designer.getArea()); - } - if (lineInY != null) { - lineInY.paint(g, designer.getArea()); - } - if (lineEquidistant != null) { - lineEquidistant.paint(g, designer.getArea()); - } - } - - /** - * 拖拽 - * - * @param e 鼠标事件 - */ - public void dragging(MouseEvent e) { - //进入dragging状态时备份组件大小和位置 - if (!dragging) { - selectedPositionBackup = selectionModel.getSelection().getRelativeBounds(); - } - checkAddable(e); - setDependLinePainter(e); - driection.drag(getMouseXY(e).x - currentX, getMouseXY(e).y - currentY, designer); - this.dragging = true; - } - - // 拖拽时画依附线用到的painter - private void setDependLinePainter(MouseEvent e) { - XCreator comp = designer.getComponentAt(e.getX(), e.getY(), selectionModel.getSelection().getSelectedCreators()); - XLayoutContainer container = XCreatorUtils.getHotspotContainer(comp); - XCreator creator = selectionModel.getSelection().getSelectedCreator(); - HoverPainter painter = AdapterBus.getContainerPainter(designer, container); - designer.setPainter(painter); - if (painter != null) { - painter.setHotspot(new Point(e.getX(), e.getY())); - painter.setCreator(creator); - } - } - - /** - * 释放捕获 - * - * @param e 鼠标事件 - */ - public void releaseDragging(MouseEvent e) { - this.dragging = false; - if (addable) { - adding(e.getX(), e.getY()); - } else if (!selectionModel.getSelection().isEmpty()) { - selectionModel.releaseDragging(); - } - designer.repaint(); - } - - /** - * 改变选择区域 - * - * @param e 鼠标事件 - */ - public void changeSelection(MouseEvent e) { - Rectangle bounds = createCurrentBounds(getMouseXY(e).x, getMouseXY(e).y); - selectionModel.setHotspotBounds(bounds); - } - - /** - * 返回鼠标所在的x、y 考虑滚动条的值 - * - * @param e 鼠标事件 - * @return xy值 - */ - public Point getMouseXY(MouseEvent e) { - Point p1 = new Point(e.getX() + designer.getArea().getHorizontalValue(), e.getY() - + designer.getArea().getVerticalValue()); - return p1; - } - +package com.fr.design.designer.beans.models; + +import com.fr.design.beans.location.Absorptionline; +import com.fr.design.designer.beans.AdapterBus; +import com.fr.design.designer.beans.HoverPainter; +import com.fr.design.designer.beans.LayoutAdapter; +import com.fr.design.designer.beans.events.DesignerEvent; +import com.fr.design.designer.beans.location.Direction; +import com.fr.design.designer.beans.location.Location; +import com.fr.design.designer.creator.*; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.FormSelectionUtils; +import com.fr.design.utils.ComponentUtils; + +import java.awt.*; +import java.awt.event.MouseEvent; +import java.util.ArrayList; + +/** + * 普通模式下的状态model + */ +public class StateModel { + // 对应的selection model + + private SelectionModel selectionModel; + // 当前鼠标进入拖拽区域的位置类型 + private Direction driection; + + // 当前拖拽的起始位置 + private int currentX; + private int currentY; + + //拖拽组件原始位置大小备份 + private Rectangle selectedPositionBackup; + + private Point startPoint = new Point(); + private Point currentPoint = new Point(); + + private Absorptionline lineInX; + private Absorptionline lineInY; + //等距线 + private Absorptionline lineEquidistant; + + // 当前是否处于拖拽选择状态 + private boolean selecting; + private boolean dragging; + + private boolean addable; + + private FormDesigner designer; + + public StateModel(FormDesigner designer) { + this.designer = designer; + selectionModel = designer.getSelectionModel(); + } + + /** + * 返回direction + * + * @return direction方向 + */ + public Direction getDirection() { + return driection; + } + + /** + * 是否有组件正被选中 + * + * @return true 如果至少一个组件被选中 + */ + public boolean isSelecting() { + return selecting; + } + + /** + * 是否能拖拽 + * + * @return 非outer且选中为空 + */ + public boolean dragable() { + return ((driection != Location.outer) && !selecting); + } + + /** + * 拖拽中是否可以转换为添加模式: + * 如果拖拽组件只有一个,鼠标当前所在位置的最底层表单容器与这个组件的容器不同; + * 如果拖拽组件为多个,鼠标当前所在位置的最底层表单容器除了要求要跟这些组件的容器不同外,还必须是绝对定位布局 + */ + private void checkAddable(MouseEvent e) { + addable = false; + designer.setPainter(null); + + if (driection != Location.inner) { + return; + } + + XCreator comp = designer.getComponentAt(e.getX(), e.getY(), selectionModel.getSelection().getSelectedCreators()); + XLayoutContainer container = XCreatorUtils.getHotspotContainer(comp); + XCreator creator = selectionModel.getSelection().getSelectedCreator(); + Component creatorContainer = XCreatorUtils.getParentXLayoutContainer(creator); + if (creatorContainer != null && creatorContainer != container + && (selectionModel.getSelection().size() == 1 || container instanceof XWAbsoluteLayout)) { + HoverPainter painter = AdapterBus.getContainerPainter(designer, container); + designer.setPainter(painter); + if (painter != null) { + Rectangle rect = ComponentUtils.getRelativeBounds(container); + rect.x -= designer.getArea().getHorizontalValue(); + rect.y -= designer.getArea().getVerticalValue(); + painter.setRenderingBounds(rect); + painter.setHotspot(new Point(e.getX(), e.getY())); + painter.setCreator(creator); + } + addable = true; + } + } + + /** + * @param container 容器 + * @param mouseX 鼠标释放位置X + * @param mouseY 鼠标释放位置Y + * @return 是否成功 + */ + private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) { + LayoutAdapter adapter = container.getLayoutAdapter(); + Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container); + if (selectionModel.getSelection().size() == 1) { + return adapter.addBean(selectionModel.getSelection().getSelectedCreator(), + mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, + mouseY + designer.getArea().getVerticalValue() - rectangleContainer.y); + } + for (XCreator creator : selectionModel.getSelection().getSelectedCreators()) { + adapter.addBean(creator, + mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, + mouseY + designer.getArea().getVerticalValue() - rectangleContainer.y); + } + return true; + } + + /** + * @param mouseReleasedX 鼠标释放位置X + * @param mouseReleasedY 鼠标释放位置Y + */ + private void adding(int mouseReleasedX, int mouseReleasedY) { + // 当前鼠标所在的组件 + XCreator hoveredComponent = designer.getComponentAt(mouseReleasedX, mouseReleasedY, selectionModel.getSelection().getSelectedCreators()); + + // 获取该组件所在的焦点容器 + XLayoutContainer container = XCreatorUtils.getHotspotContainer(hoveredComponent); + + boolean success = false; + + if (container != null) { + // 如果是容器,则调用其acceptComponent接受组件 + success = addBean(container, mouseReleasedX, mouseReleasedY); + } + + if (success) { + FormSelectionUtils.rebuildSelection(designer); + designer.getEditListenerTable().fireCreatorModified( + selectionModel.getSelection().getSelectedCreator(), DesignerEvent.CREATOR_ADDED); + } else { + selectionModel.getSelection().setSelectionBounds(selectedPositionBackup, designer); + Toolkit.getDefaultToolkit().beep(); + } + // 取消提示 + designer.setPainter(null); + } + + /** + * 是否拖拽 + * + * @return dragging状态 + */ + public boolean isDragging() { + return dragging; + } + + /** + * 是否可以开始画线 + * + * @return startPoint不为空返回true + */ + public boolean prepareForDrawLining() { + return startPoint != null; + } + + /** + * 设置开始位置 + * + * @param p point位置 + */ + public void setStartPoint(Point p) { + this.startPoint = p; + } + + /** + * 返回开始位置 + * + * @return 点位置 + */ + public Point getStartPoint() { + return startPoint; + } + + /** + * 返回当前点位置 + * + * @return 点位置 + */ + public Point getEndPoint() { + return currentPoint; + } + + /** + * 当前选中组件 + * + * @param e 鼠标事件 + */ + public void startSelecting(MouseEvent e) { + selecting = true; + selectionModel.setHotspotBounds(new Rectangle()); + currentX = getMouseXY(e).x; + currentY = getMouseXY(e).y; + } + + /** + * 当前鼠标的xy + * + * @param e 鼠标事件 + */ + public void startResizing(MouseEvent e) { + if (!selectionModel.getSelection().isEmpty()) { + driection.backupBounds(designer); + } + currentX = getMouseXY(e).x; + currentY = getMouseXY(e).y; + } + + /** + * 起始点开始DrawLine + * + * @param p 点位置 + */ + public void startDrawLine(Point p) { + this.startPoint = p; + if (p != null) { + try { + designer.setCursor(XConnector.connectorCursor); + } catch (Exception e) { + } + } else { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + } + + /** + * 鼠标释放时所在的区域及圈中的组件 + * + * @param e 鼠标事件 + */ + public void selectCreators(MouseEvent e) { + int x = getMouseXY(e).x; + int y = getMouseXY(e).y; + + Rectangle bounds = createCurrentBounds(x, y); + + if ((x != currentX) || (y != currentY)) { + selectionModel.setSelectedCreators(getHotspotCreators(bounds, designer.getRootComponent())); + } + selectionModel.setHotspotBounds(null); + } + + /** + * 画所在区域线 + * + * @param e 鼠标事件 + */ + public void drawLine(MouseEvent e) { + designer.getDrawLineHelper().setDrawLine(true); + Point p = designer.getDrawLineHelper().getNearWidgetPoint(e); + if (p != null) { + currentPoint = p; + } else { + currentPoint.x = e.getX() + designer.getArea().getHorizontalValue(); + currentPoint.y = e.getY() + designer.getArea().getVerticalValue(); + } + } + + private Rectangle createCurrentBounds(int x, int y) { + Rectangle bounds = new Rectangle(); + + bounds.x = Math.min(x, currentX); + bounds.y = Math.min(y, currentY); + bounds.width = Math.max(x, currentX) - bounds.x; + bounds.height = Math.max(y, currentY) - bounds.y; + + return bounds; + } + + private ArrayList getHotspotCreators(Rectangle selection, XCreator root) { + ArrayList creators = new ArrayList<>(); + + if (!root.isVisible() && !designer.isRoot(root)) { + return creators; + } + + if (root instanceof XLayoutContainer) { + XLayoutContainer container = (XLayoutContainer) root; + int count = container.getXCreatorCount(); + Rectangle clipped = new Rectangle(selection); + + for (int i = count - 1; i >= 0; i--) { + XCreator child = container.getXCreator(i); + + if (selection.contains(child.getBounds())) { + creators.add(child); + } else { + clipped.x = selection.x - child.getX(); + clipped.y = selection.y - child.getY(); + creators.addAll(getHotspotCreators(clipped, child)); + } + } + } + + return creators; + } + + + /** + * 重置model + */ + public void resetModel() { + dragging = false; + selecting = false; + } + + /** + * 重置 + */ + public void reset() { + driection = Location.outer; + dragging = false; + selecting = false; + } + + /** + * 取消拖拽 + */ + public void draggingCancel() { + designer.repaint(); + reset(); + } + + /** + * 设置可拉伸方向 + * + * @param dir 拉伸方向 + */ + public void setDirection(Direction dir) { + if (driection != dir) { + this.driection = dir; + driection.updateCursor(designer); + } + } + + /** + * x吸附线赋值 + * + * @param line 线 + */ + public void setXAbsorptionline(Absorptionline line) { + this.lineInX = line; + } + + /** + * y吸附线赋值 + * + * @param line 线 + */ + public void setYAbsorptionline(Absorptionline line) { + this.lineInY = line; + } + + /** + * 等距线赋值 + * + * @param line 线 + */ + public void setEquidistantLine(Absorptionline line) { + this.lineEquidistant = line; + } + + /** + * 画吸附线 + * + * @param g Graphics类 + */ + public void paintAbsorptionline(Graphics g) { + if (lineInX != null) { + lineInX.paint(g, designer.getArea()); + } + if (lineInY != null) { + lineInY.paint(g, designer.getArea()); + } + if (lineEquidistant != null) { + lineEquidistant.paint(g, designer.getArea()); + } + } + + /** + * 拖拽 + * + * @param e 鼠标事件 + */ + public void dragging(MouseEvent e) { + //进入dragging状态时备份组件大小和位置 + if (!dragging) { + selectedPositionBackup = selectionModel.getSelection().getRelativeBounds(); + } + checkAddable(e); + setDependLinePainter(e); + driection.drag(getMouseXY(e).x - currentX, getMouseXY(e).y - currentY, designer); + this.dragging = true; + } + + // 拖拽时画依附线用到的painter + private void setDependLinePainter(MouseEvent e) { + XCreator comp = designer.getComponentAt(e.getX(), e.getY(), selectionModel.getSelection().getSelectedCreators()); + XLayoutContainer container = XCreatorUtils.getHotspotContainer(comp); + XCreator creator = selectionModel.getSelection().getSelectedCreator(); + HoverPainter painter = AdapterBus.getContainerPainter(designer, container); + designer.setPainter(painter); + if (painter != null) { + painter.setHotspot(new Point(e.getX(), e.getY())); + painter.setCreator(creator); + } + } + + /** + * 释放捕获 + * + * @param e 鼠标事件 + */ + public void releaseDragging(MouseEvent e) { + this.dragging = false; + if (addable) { + adding(e.getX(), e.getY()); + } else if (!selectionModel.getSelection().isEmpty()) { + selectionModel.releaseDragging(); + } + designer.repaint(); + } + + /** + * 改变选择区域 + * + * @param e 鼠标事件 + */ + public void changeSelection(MouseEvent e) { + Rectangle bounds = createCurrentBounds(getMouseXY(e).x, getMouseXY(e).y); + selectionModel.setHotspotBounds(bounds); + } + + /** + * 返回鼠标所在的x、y 考虑滚动条的值 + * + * @param e 鼠标事件 + * @return xy值 + */ + public Point getMouseXY(MouseEvent e) { + Point p1 = new Point(e.getX() + designer.getArea().getHorizontalValue(), e.getY() + + designer.getArea().getVerticalValue()); + return p1; + } + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/beans/painters/AbstractPainter.java b/designer_form/src/com/fr/design/designer/beans/painters/AbstractPainter.java index cb5c6a4a0a..fca5197aee 100644 --- a/designer_form/src/com/fr/design/designer/beans/painters/AbstractPainter.java +++ b/designer_form/src/com/fr/design/designer/beans/painters/AbstractPainter.java @@ -1,96 +1,96 @@ -package com.fr.design.designer.beans.painters; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Stroke; - -import com.fr.design.designer.beans.HoverPainter; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.form.util.XCreatorConstants; -import com.fr.general.Inter; - -public abstract class AbstractPainter implements HoverPainter { - - protected Point hotspot; - protected Rectangle hotspot_bounds; - protected XLayoutContainer container; - protected XCreator creator; - - /** - * 构造函数 - * - * @param container 容器 - */ - public AbstractPainter(XLayoutContainer container) { - this.container = container; - } - - @Override - public void setHotspot(Point p) { - hotspot = p; - } - - /** - * 画初始区域 - * - * @param g 画图类 - * @param startX 起始x位置 - * @param startY 起始y位置 - */ - public void paint(Graphics g, int startX, int startY) { - if (hotspot_bounds != null) { - drawHotspot(g, hotspot_bounds.x, hotspot_bounds.y, hotspot_bounds.width, hotspot_bounds.height, Color.lightGray, true, false); - } - } - - /** - * 设置边界 - * - * @param rect 位置 - */ - @Override - public void setRenderingBounds(Rectangle rect) { - hotspot_bounds = rect; - } - - @Override - public void setCreator(XCreator component) { - this.creator = component; - } - - protected void drawHotspot(Graphics g, int x, int y, int width, int height, boolean accept) { - Color bColor = accept ? XCreatorConstants.LAYOUT_HOTSPOT_COLOR : XCreatorConstants.LAYOUT_FORBIDDEN_COLOR; - drawHotspot(g, x, y, width, height, bColor, accept, false); - } - - /** - * 自适应布局那边渲染提示,要画整个背景,不是画边框 - */ - protected void drawRegionBackground(Graphics g, int x, int y, int width, int height, Color bColor, boolean accept) { - drawHotspot(g, x, y, width, height, bColor, accept, true); - } - - protected void drawHotspot(Graphics g, int x, int y, int width, int height, Color bColor, boolean accept, boolean drawBackground) { - Graphics2D g2d = (Graphics2D) g; - Color color = g2d.getColor(); - Stroke backup = g2d.getStroke(); - // 设置线条的样式 - g2d.setStroke(XCreatorConstants.STROKE); - g2d.setColor(bColor); - if (!accept) { - g2d.drawString(Inter.getLocText("Cannot-Add_To_This_Area") + "!", x + width / 3, y + height / 2); - } else if (drawBackground) { - g2d.fillRect(x, y, width, height); - } else { - g2d.drawRect(x, y, width, height); - } - g2d.setStroke(backup); - g2d.setColor(color); - } - - +package com.fr.design.designer.beans.painters; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Stroke; + +import com.fr.design.designer.beans.HoverPainter; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.form.util.XCreatorConstants; +import com.fr.general.Inter; + +public abstract class AbstractPainter implements HoverPainter { + + protected Point hotspot; + protected Rectangle hotspot_bounds; + protected XLayoutContainer container; + protected XCreator creator; + + /** + * 构造函数 + * + * @param container 容器 + */ + public AbstractPainter(XLayoutContainer container) { + this.container = container; + } + + @Override + public void setHotspot(Point p) { + hotspot = p; + } + + /** + * 画初始区域 + * + * @param g 画图类 + * @param startX 起始x位置 + * @param startY 起始y位置 + */ + public void paint(Graphics g, int startX, int startY) { + if (hotspot_bounds != null) { + drawHotspot(g, hotspot_bounds.x, hotspot_bounds.y, hotspot_bounds.width, hotspot_bounds.height, Color.lightGray, true, false); + } + } + + /** + * 设置边界 + * + * @param rect 位置 + */ + @Override + public void setRenderingBounds(Rectangle rect) { + hotspot_bounds = rect; + } + + @Override + public void setCreator(XCreator component) { + this.creator = component; + } + + protected void drawHotspot(Graphics g, int x, int y, int width, int height, boolean accept) { + Color bColor = accept ? XCreatorConstants.LAYOUT_HOTSPOT_COLOR : XCreatorConstants.LAYOUT_FORBIDDEN_COLOR; + drawHotspot(g, x, y, width, height, bColor, accept, false); + } + + /** + * 自适应布局那边渲染提示,要画整个背景,不是画边框 + */ + protected void drawRegionBackground(Graphics g, int x, int y, int width, int height, Color bColor, boolean accept) { + drawHotspot(g, x, y, width, height, bColor, accept, true); + } + + protected void drawHotspot(Graphics g, int x, int y, int width, int height, Color bColor, boolean accept, boolean drawBackground) { + Graphics2D g2d = (Graphics2D) g; + Color color = g2d.getColor(); + Stroke backup = g2d.getStroke(); + // 设置线条的样式 + g2d.setStroke(XCreatorConstants.STROKE); + g2d.setColor(bColor); + if (!accept) { + g2d.drawString(Inter.getLocText("Cannot-Add_To_This_Area") + "!", x + width / 3, y + height / 2); + } else if (drawBackground) { + g2d.fillRect(x, y, width, height); + } else { + g2d.drawRect(x, y, width, height); + } + g2d.setStroke(backup); + g2d.setColor(color); + } + + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java index 7a03782c25..90945b1e80 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java @@ -133,10 +133,8 @@ public class FormSelectionUtils { boolean xOut = x < 0 || x + copiedCreator.getWidth() / 2 + xoffset > container.getWidth(); boolean yOut = y < 0 || y + copiedCreator.getHeight() / 2 + yoffset > container.getHeight(); - boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset) - && (y - DELAY_X_Y == container.getHeight() - copiedCreator.getHeight() / 2 - yoffset); - y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y; + boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset); if (xOut) { if (isEdge) { //向左偏移 From 487e1b17c31dec3809a4581d75b439a0043c1774 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 2 May 2017 14:31:35 +0800 Subject: [PATCH 60/60] ct --- .../com/fr/design/locale/designer.properties | 20 +- .../design/locale/designer_en_US.properties | 20 +- .../design/locale/designer_ja_JP.properties | 365 ++++++++---------- .../design/locale/designer_ko_KR.properties | 49 +-- .../design/locale/designer_zh_CN.properties | 18 +- .../design/locale/designer_zh_TW.properties | 50 +-- .../com/fr/design/mainframe/JTemplate.java | 105 +++-- .../templateinfo/TemplateInfoCollector.java | 14 + .../fr/design/chart/axis/MinMaxValuePane.java | 50 +-- 9 files changed, 309 insertions(+), 382 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index ada13b4600..cc75cee8ac 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -91,7 +91,6 @@ FR-Designer_DS-Dictionary= FR-Designer_Data-confusion= FR-Designer_Data_Type= FR-Designer_Double_Click_Edit_OR_Clear= -FR-Designer_Edit_Button_ToolBar= FR-Designer_Email= FR-Designer_Enabled= FR-Designer_End-Date= @@ -163,7 +162,6 @@ FR-Designer_Refresh_Parameter_In_SQL= FR-Designer_Reg_Expressions= FR-Designer_Reg_Max_Length= FR-Designer_Reg_Min_Length= -FR-Designer_Remove_Button_ToolBar= FR-Designer_ReportColumns-Columns= FR-Designer_Return-Date= FR-Designer_RichText= @@ -544,7 +542,7 @@ FR-Designer_Left_Display=Left FR-Designer_About_Version=Version FR-Designer_About_CopyRight=Copy Right FR-Designer_Service_Phone=Service Phone -FR-Designer_Allow_Null=Allow Null +FR-Designer_Allow_Null=Allow null FR-Designer_PageSetup_Page=Page FR-Designer_Custom_Job_Description=Description FR-Designer_Property=Property @@ -590,15 +588,15 @@ FR-Designer-Move_Tab_First=move to first FR-Designer-Move_Tab_End=move to end FR-Designer-Move_Tab_Next=move to next FR-Designer-Move_Tab_Prev=move to previous + +FR-Designer_Too_Large_To_Paste=too large to paste +FR-Designer_Too_Small_To_Paste=Too small to paste + FR-Designer_AxisReversed=AxisValue FR-Designer_Logarithmic=Logarithmic FR-Designer_Chart_Log_Base=Log Base FR-Designer_Chart_F_Radar_Axis=Chart_F_Radar_Axis -FR-Designer_Too_Large_To_Paste=too large to paste -FR-Designer_Too_Small_To_Paste=Too small to paste -FR-Designer_Validate= -FR-Designer_Get-CubeGetting cube= -FR-Designer_Get-CubeGetting= -FR-Designer_Fit= -FR-Designer_Properties_Mobile= -FR-Designer_Oracle= +FR-Designer_Style=Style +FR-Designer_Color=Color +FR-Designer_Border=Border +FR-Designer_Background-Pattern=Pattern 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 6f7aff98f9..1c646aebeb 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 @@ -91,7 +91,6 @@ FR-Designer_DS-Dictionary=Data Dictionary FR-Designer_Data-confusion=Data Confusion FR-Designer_Data_Type=Data type FR-Designer_Double_Click_Edit_OR_Clear=Double Click to Edit or Clear -FR-Designer_Edit_Button_ToolBar=Edit Button ToolBar FR-Designer_Email=Mail FR-Designer_Enabled=Enabled FR-Designer_End-Date=End Date @@ -164,7 +163,6 @@ FR-Designer_Refresh_Parameter_In_SQL=Whether to refresh parameters in the SQL FR-Designer_Reg_Expressions=Regular expressions FR-Designer_Reg_Max_Length=max length FR-Designer_Reg_Min_Length=min length -FR-Designer_Remove_Button_ToolBar=Remove Button ToolBar FR-Designer_ReportColumns-Columns=Multi-columns/lines FR-Designer_Return-Date=Return Date FR-Designer_RichText=Insert Rich Text @@ -544,7 +542,7 @@ FR-Designer_Left_Display=Left FR-Designer_About_Version=Version FR-Designer_About_CopyRight=Copy Right FR-Designer_Service_Phone=Service Phone -FR-Designer_Allow_Null=Allow Null +FR-Designer_Allow_Null=Allow null FR-Designer_PageSetup_Page=Page FR-Designer_Custom_Job_Description=Description FR-Designer_Property=Property @@ -590,14 +588,16 @@ FR-Designer-Move_Tab_First=move to first FR-Designer-Move_Tab_End=move to end FR-Designer-Move_Tab_Next=move to next FR-Designer-Move_Tab_Prev=move to previous + +FR-Designer_Too_Large_To_Paste=Too large to paste! +FR-Designer_Too_Small_To_Paste=Too small to paste! + FR-Designer_AxisReversed=Axis in reverse order FR-Designer_Logarithmic=Log scale FR-Designer_Chart_Log_Base=Log Base FR-Designer_Chart_F_Radar_Axis=Value Axis -FR-Designer_Too_Large_To_Paste=Too large to paste! -FR-Designer_Too_Small_To_Paste=Too small to paste! -FR-Designer_SimpleCross_Report= -FR-Designer_Get-Cube= -FR-Designer_DoubleLayer_Report= -FR-Designer_Get-CubeGetting= -FR-Designer_SimpleDetail_Report= +FR-Designer_Style=Style +FR-Designer_Color=Color +FR-Designer_Border=Border +FR-Designer_Background-Pattern=Pattern + 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 ee6cc00271..2f4affb916 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -1,202 +1,200 @@ # generated time: \u661F\u671F\u56DB \u5341\u4E00\u6708 24 12:02:51 CST 2016 -FR-Designer-BBSLogin_Account=\u30E6\u30FC\u30B6\u30FCID -FR-Designer-BBSLogin_Connection-Failure=\u30CD\u30C3\u30C8\u63A5\u7D9A\u5931\u6557\u3001\u30CD\u30C3\u30C8\u72B6\u614B\u3054\u78BA\u8A8D\u4E0B\u3055\u3044 +FR-Designer-BBSLogin_Account=\u30E6\u30FC\u30B6\u30FC\u540D +FR-Designer-BBSLogin_Connection-Failure=\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u73FE\u5728\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u72B6\u614B\u3092\u691C\u67FB\u3057\u3066\u304F\u3060\u3055\u3044 FR-Designer-BBSLogin_Connection-Failure-Tip=\u30D2\u30F3\u30C8 -FR-Designer-BBSLogin_Forgot-Password=\u30D1\u30B9\u30EF\u30FC\u30C9\u5FD8\u308C\u305F +FR-Designer-BBSLogin_Forgot-Password=\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5FD8\u308C\u305F FR-Designer-BBSLogin_Login=\u30ED\u30B0\u30A4\u30F3 -FR-Designer-BBSLogin_Login-Failure-Tip=\u30E6\u30FC\u30B6\u30FCID\u3084\u30D1\u30B9\u30EF\u30FC\u30C9\u30A8\u30E9\u30FC\u3001\u518D\u30ED\u30B0\u30A4\u30F3\u4E0B\u3055\u3044 +FR-Designer-BBSLogin_Login-Failure-Tip=\u30E6\u30FC\u30B6\u30FC\u540D\u307E\u305F\u306F\u30D1\u30B9\u30EF\u30FC\u30C9\u30A8\u30E9\u30FC\u3067\u3059\u3002\u518D\u5EA6\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044 FR-Designer-BBSLogin_Password=\u30D1\u30B9\u30EF\u30FC\u30C9 -FR-Designer-BBSLogin_Password-Empty-Tip=\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u7A7A\u6B04\u306B\u3067\u304D\u307E\u305B\u3093 +FR-Designer-BBSLogin_Password-Empty-Tip=\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 FR-Designer-BBSLogin_Register-Account=\u30A2\u30AB\u30A6\u30F3\u30C8\u767B\u9332 -FR-Designer-BBSLogin_Switch-Account=\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u5207\u308A\u66FF\u3048 -FR-Designer-BBSLogin_Privite-Message=\u500B\u4EBA\u30E1\u30C3\u30BB\u30FC\u30B8 -FR-Designer-BBSLogin_Times=\u56DE -FR-Designer-BBSLogin_Username-Empty-Tip=\u30E6\u30FC\u30B6\u30FCID\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093 -FR-Designer-Basic_More_Color=\u305D\u306E\u4ED6\uFF08\u8272\uFF09 -FR-Designer-Estate_Any=\u5236\u9650\u306A\u3057 +FR-Designer-BBSLogin_Switch-Account=\u30A2\u30AB\u30A6\u30F3\u30C8\u5207\u308A\u66FF\u3048 +FR-Designer-BBSLogin_Privite-Message=\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8\u30E1\u30C3\u30BB\u30FC\u30B8 +FR-Designer-BBSLogin_Times=\u6B21 +FR-Designer-BBSLogin_Username-Empty-Tip=\u30E6\u30FC\u30B6\u30FC\u540D\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 +FR-Designer-Basic_More_Color=\u3082\u3063\u3068\u8272 +FR-Designer-Estate_Any=\u4E0D\u9650 FR-Designer-Estate_Default_Font=\u30C7\u30D5\u30A9\u30EB\u30C8\u30D5\u30A9\u30F3\u30C8 -FR-Designer-Estate_Default_Null=\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u7A7A +FR-Designer-Estate_Default_Null=\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u7A7A\u6B04\u306B\u3059\u308B FR-Designer-Estate_Default_Text=\u30C7\u30D5\u30A9\u30EB\u30C8\u5024 -FR-Designer-Estate_Parameter_Null_Text=\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u7A7A\u306B\u306A\u308B\u6642\u306E\u8868\u793A\u306F -FR-Designer-Estate_Radio-Group=\u4E0D\u52D5\u7523\u696D\u6C4E\u7528\u30E9\u30B8\u30AA\u30DC\u30BF\u30F3\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8 -FR-Designer-Estate_Selected_Font=\u30D5\u30A9\u30F3\u30C8\u3092\u9078\u629E -FR-Designer-Estate_Widget_Value=\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u5024 -FR-Designer-Layout_Adaptive_Layout=\u81EA\u5DF1\u8ABF\u6574\u30EC\u30A4\u30A2\u30A6\u30C8 +FR-Designer-Estate_Parameter_Null_Text=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u7A7A\u6B04\u306B\u3057\u8868\u793A\u3059\u308B +FR-Designer-Estate_Radio-Group=\u4E0D\u52D5\u7523\u696D\u901A\u7528\u30DC\u30BF\u30F3\u30BB\u30C3\u30C8\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB +FR-Designer-Estate_Selected_Font=\u9078\u629E\u3057\u305F\u30D5\u30A9\u30F3\u30C8 +FR-Designer-Estate_Widget_Value=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u5024 +FR-Designer-Layout_Adaptive_Layout=\u81EA\u9069\u5FDC\u914D\u7F6E FR-Designer-Output_Background_Set=\u80CC\u666F\u8A2D\u5B9A FR-Designer-Output_Default_Background=\u30C7\u30D5\u30A9\u30EB\u30C8\u80CC\u666F -FR-Designer-Output_Excel_Page=Excel\u51FA\u529B(\u30DA\u30FC\u30B8\u5225) -FR-Designer-Output_Excel_Sheet=Excel\u51FA\u529B(\u30DA\u30FC\u30B8\u5225\u30B7\u30FC\u30C8\u5225) -FR-Designer-Output_Excel_Simple=Excel\u51FA\u529B(\u5143\u306E\u307E\u307E) -FR-Designer-Plugin_PluginMarket_Coding=\u30D7\u30E9\u30B0\u30A4\u30F3\u30B9\u30C8\u30A2\u958B\u767A\u4E2D\u3001\u304A\u5F85\u3061\u4E0B\u3055\u3044 -FR-Desinger-Plugin_Updater_UpdateAndUpgrade=\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C8 -FR-Desinger-Plugin_Updater_Checking_Jar_Update=Jar\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u691C\u8A3C\u4E2D -FR-Desinger-Plugin_Updater_Checking_Version_Update=\u30D1\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u691C\u8A3C\u4E2D -FR-Desinger-Plugin_Updater_Update=\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8 -FR-Desinger-Plugin_Updater_Upgrade=\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9 -FR-Desinger-Plugin_Updater_Restore=\u30EA\u30AB\u30D0\u30EA -FR-Desinger-Plugin_Updater_New_Version_Available=\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059 -FR-Desinger-Plugin_Updater_JarUpdate=Jar\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8 -FR-Desinger-Plugin_Updater_VersionUpgrade=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C8 -FR-Desinger-Plugin_Updater_Previous_Version=\u4EE5\u524D\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3078? -FR-Desinger-Plugin_Updater_Current_Version=\u73FE\u5728\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF1A -FR-Desinger-Plugin_Updater_Not_Install_Version=\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u7528\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +FR-Designer-Output_Excel_Page=Excel\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8(\u30DA\u30FC\u30B8\u5225\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8) +FR-Designer-Output_Excel_Sheet=Excel\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8(\u30DA\u30FC\u30B8\u5225\u30B7\u30FC\u30C8\u5225\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8) +FR-Designer-Output_Excel_Simple=Excel\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8(\u5143\u306E\u307E\u307E\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8) +FR-Designer-Plugin_PluginMarket_Coding=\u30D7\u30E9\u30B0\u30A4\u30F3\u30DE\u30FC\u30B1\u30C3\u30C8\u306F\u958B\u767A\u4E2D\u3067\u3059\u3002\u3054\u671F\u5F85\u304F\u3060\u3055\u3044 +FR-Desinger-Plugin_Updater_UpdateAndUpgrade=\u66F4\u65B0\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8 +FR-Desinger-Plugin_Updater_Checking_Jar_Update=Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u30C1\u30A7\u30C3\u30AF\u66F4\u65B0\u4E2D +FR-Desinger-Plugin_Updater_Checking_Version_Update=\u30D0\u30FC\u30B8\u30E7\u30F3\u30C1\u30A7\u30C3\u30AF\u66F4\u65B0\u4E2D +FR-Desinger-Plugin_Updater_Update=\u66F4\u65B0 +FR-Desinger-Plugin_Updater_Upgrade=\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8 +FR-Desinger-Plugin_Updater_Restore=\u5FA9\u5143 +FR-Desinger-Plugin_Updater_New_Version_Available=\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3\u6709\u308A +FR-Desinger-Plugin_Updater_JarUpdate=Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u66F4\u65B0 +FR-Desinger-Plugin_Updater_VersionUpgrade=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7 +FR-Desinger-Plugin_Updater_Previous_Version=\u65E7\u30D0\u30FC\u30B8\u30E7\u30F3\u307E\u3067\u306B +FR-Desinger-Plugin_Updater_Current_Version=\u73FE\u30D0\u30FC\u30B8\u30E7\u30F3 +FR-Desinger-Plugin_Updater_Not_Install_Version=\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u306F\u306A\u3044 FR-Desinger-Plugin_Updater_Latest_Version=\u6700\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3 -FR-Desinger-Plugin_Updater_Jar_Downloading=Jar\u30D5\u30A1\u30A4\u30EB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u7D42\u4E86\u3092\u5F85\u3063\u3066\u3044\u308B -FR-Desinger-Plugin_Updater_Version_Downloading=\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C8\u30D1\u30C3\u30B1\u30FC\u30B8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3092\u5F85\u3063\u3066\u3044\u308B -FR-Desinger-Plugin_Updater_Restart_Designer=\u30C7\u30B6\u30A4\u30CA\u30FC\u3092\u518D\u8D77\u52D5 -FR-Desinger-Plugin_Updater_Connect_VersionUpdateServer_Failed=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u30B5\u30FC\u30D0\u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044 -FR-Desinger-Plugin_Updater_Connect_VersionUpgradeServer_Failed=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C8\u30B5\u30FC\u30D0\u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044 -FR-Desinger-Plugin_Updater_Already_Latest_Version=\u6700\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3\u306B\u306A\u308A\u307E\u3057\u305F -FR-Desinger-Plugin_Updater_Backup_OldJar_To=\u53E4\u3044Jar\u30D5\u30A1\u30A4\u30EB\u3092\u4E0B\u8A18\u306B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3057\u307E\u3057\u305F\uFF1A -FR-Desinger-Plugin_Updater_Backup_OldVersion_To=\u53E4\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u4E0B\u8A18\u306B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3057\u307E\u3057\u305F\uFF1A -FR-Desinger-Plugin_Updater_Please_Restart=\u3001\u30C7\u30B6\u30A4\u30CA\u30FC\u3092\u518D\u8D77\u52D5\u3057\u3066\u4E0B\u3055\u3044 -FR-Desinger-Plugin_Updater_Jar_Restore=Jar\u30D5\u30A1\u30A4\u30EB\u30EA\u30AB\u30D0\u30EA -FR-Desinger-Plugin_Updater_Version_Restore=\u30D0\u30FC\u30B8\u30E7\u30F3\u30EA\u30AB\u30D0\u30EA -FR-Desinger-Plugin_Updater_Restore_To=\u30EA\u30AB\u30D0\u30EA -FR-Desinger-Plugin_Updater_WorksAfterRestart=\u30D0\u30FC\u30B8\u30E7\u30F3\u3001\u518D\u8D77\u52D5\u5F8C\u6709\u52B9\u306B\u306A\u308A\u307E\u3059 +FR-Desinger-Plugin_Updater_Jar_Downloading=Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u5B8C\u6210\u5F85\u3061 +FR-Desinger-Plugin_Updater_Version_Downloading=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30D1\u30C3\u30B1\u30FC\u30B8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u5B8C\u6210\u5F85\u3061 +FR-Desinger-Plugin_Updater_Restart_Designer=\u30C7\u30B6\u30A4\u30CA\u30FC\u518D\u8D77\u52D5 +FR-Desinger-Plugin_Updater_Connect_VersionUpdateServer_Failed=\u30D0\u30FC\u30B8\u30E7\u30F3\u66F4\u65B0\u30B5\u30FC\u30D0\u30FC\u63A5\u7D9A\u3067\u304D\u306A\u3044 +FR-Desinger-Plugin_Updater_Connect_VersionUpgradeServer_Failed=\u30D0\u30FC\u30B8\u30E7\u30F3\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u30B5\u30FC\u30D0\u30FC\u63A5\u7D9A\u3067\u304D\u306A\u3044 +FR-Desinger-Plugin_Updater_Already_Latest_Version=\u65E2\u306B\u6700\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3 +FR-Desinger-Plugin_Updater_Backup_OldJar_To=\u65E7Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u65E2\u306B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7 +FR-Desinger-Plugin_Updater_Backup_OldVersion_To=\u65E7\u30D0\u30FC\u30B8\u30E7\u30F3\u30D1\u30C3\u30B1\u30FC\u30B8\u306F\u65E2\u306B\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7 +FR-Desinger-Plugin_Updater_Please_Restart=\u30C7\u30B6\u30A4\u30CA\u30FC\u306F\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044 +FR-Desinger-Plugin_Updater_Jar_Restore=\u65E7Jar\u30D1\u30C3\u30B1\u30FC\u30B8\u5FA9\u5143 +FR-Desinger-Plugin_Updater_Version_Restore=\u30D0\u30FC\u30B8\u30E7\u30F3\u5FA9\u5143 +FR-Desinger-Plugin_Updater_Restore_To=\u5FA9\u5143 +FR-Desinger-Plugin_Updater_WorksAfterRestart=\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u518D\u8D77\u52D5\u5F8C\u306B\u6709\u52B9\u3059\u308B FR-Designer-Submit_Condition=\u6761\u4EF6 -FR-Designer-Widget-Title_border=\u67A0 +FR-Designer-Widget-Title_border=\u30D5\u30EC\u30FC\u30E0 FR-Designer-Widget-Title_border_color=\u8272 FR-Designer_AbsoluteLayout=\u7D76\u5BFE\u30EC\u30A4\u30A2\u30A6\u30C8 -FR-Designer_Allow_Decimals=\u5C0F\u6570\u306E\u8A31\u53EF -FR-Designer_Allow_Negative=\u8CA0\u5024\u306E\u8A31\u53EF -FR-Designer_Background-Click=\u30DE\u30A6\u30B9\u30AF\u30EA\u30C3\u30AF\u6642\u80CC\u666F +FR-Designer_Allow_Decimals=\u5C0F\u6570\u3092\u8A31\u53EF +FR-Designer_Allow_Negative=\u30DE\u30A4\u30CA\u30B9\u5024\u3092\u8A31\u53EF +FR-Designer_Background-Click=\u30DE\u30A6\u30B9\u30AF\u30EA\u30C3\u30AF\u80CC\u666F FR-Designer_Background-Initial=\u521D\u671F\u80CC\u666F -FR-Designer_Background-Over=\u30DE\u30A6\u30B9\u30AA\u30FC\u30D0\u30FC\u6642\u80CC\u666F -FR-Designer_Bar-Code-Exception-Tip=\u30C7\u30FC\u30BF\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093 -FR-Designer_Block-intersect=\u30D6\u30ED\u30C3\u30AF\u3068\u30D6\u30EB\u30C3\u30AF\u9593\u306E\u91CD\u306A\u308A\u7981\u6B62 +FR-Designer_Background-Over=\u30DE\u30A6\u30B9\u30D5\u30ED\u30FC\u30C8\u80CC\u666F +FR-Designer_Bar-Code-Exception-Tip=\u30C7\u30FC\u30BF\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 +FR-Designer_Block-intersect=\u30E2\u30B8\u30E5\u30FC\u30EB\u3068\u30E2\u30B8\u30E5\u30FC\u30EB\u9593\u3092\u91CD\u306D\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 FR-Designer_BorderLayout=\u30DC\u30FC\u30C0\u30FC\u30EC\u30A4\u30A2\u30A6\u30C8 FR-Designer_Button-Hotkeys=\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u30AD\u30FC FR-Designer_Button-Icon=\u30DC\u30BF\u30F3\u30A2\u30A4\u30B3\u30F3 -FR-Designer_Button-Name=\u30DC\u30BF\u30F3\u540D +FR-Designer_Button-Name=\u30DC\u30BF\u30F3\u540D\u79F0 FR-Designer_Button-Type=\u30DC\u30BF\u30F3\u30BF\u30A4\u30D7 -FR-Designer_CardLayout=Tab\u30EC\u30A4\u30A2\u30A6\u30C8 +FR-Designer_CardLayout=Tab\u914D\u7F6E FR-Designer_Cell=\u30BB\u30EB -FR-Designer_Chart_Cell=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u30BB\u30EB\u9023\u52D5 -FR-Designer_Chart_Float=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u8981\u7D20\u9023\u52D5 -FR-Designer_Chart_Float_chart=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30A6\u30A3\u30F3\u30C9\u30A6\u30B0\u30E9\u30D5 -FR-Designer_Check-for-Updates=\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3092\u78BA\u8A8D -FR-Designer_Choose-Data-Confusion-Tip=\ \u6DF7\u4E71\u3055\u305B\u308B\u3079\u304D\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u30D7\u30EC\u30D3\u30E5\u30FC\u4E0B\u3055\u3044 -FR-Designer_Close=\u9589\u3058\u308B +FR-Designer_Chart_Cell=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u9023\u52D5\u30BB\u30EB +FR-Designer_Chart_Float=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u9023\u52D5\u30D5\u30ED\u30FC\u8981\u7D20 +FR-Designer_Chart_Float_chart=\u30B0\u30E9\u30D5\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF-\u30D5\u30ED\u30FC\u7A93\u30B0\u30E9\u30D5 +FR-Designer_Check-for-Updates=\u66F4\u65B0\u3092\u78BA\u8A8D +FR-Designer_Choose-Data-Confusion-Tip=\ \u6DF7\u4EA4\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u5F8C\u30D7\u30EC\u30D3\u30E5\u30FC\u3057\u3066\u304F\u3060\u3055\u3044 +FR-Designer_Close=\u30AF\u30ED\u30FC\u30BA FR-Designer_Column=\u5217 -FR-Designer_Column_Measure=\u5217\u8EF8/\u30E1\u30C8\u30EA\u30C3\u30AF +FR-Designer_Column_Measure=\u5217\u8EF8/\u5EA6\u91CF\u5024 FR-Designer_Condition_Attributes=\u6761\u4EF6\u5C5E\u6027 -FR-Designer_Confusion-Col-Name=\u30D5\u30A3\u30FC\u30EB\u30C9\u540D -FR-Designer_Confusion-key=\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u6DF7\u4E71\u3055\u305B\u308B -FR-Designer_Currency_Line=\u6841\u533A\u5207\u308A\u7DDA -FR-Designer_Current_tab=tab\u7DE8\u96C6\u4E2D -FR-Designer_Custom=\u30AB\u30B9\u30BF\u30E0 -FR-Designer_Custom-Angle=\u30AB\u30B9\u30BF\u30E0\u89D2\u5EA6 -FR-Designer_DS-Dictionary=\u30C7\u30FC\u30BF\u8F9E\u66F8 -FR-Designer_Data-confusion=\u30C7\u30FC\u30BF\u6DF7\u4E71 +FR-Designer_Confusion-Col-Name=\u30D5\u30A3\u30FC\u30EB\u30C9\u540D\u79F0 +FR-Designer_Confusion-key=\u6DF7\u4EA4\u3059\u308B\u30AD\u30FC\u30EF\u30FC\u30C9 +FR-Designer_Currency_Line=\u91D1\u984D\u7DDA +FR-Designer_Current_tab=\u73FE\u5728\u306E\u7DE8\u96C6tab +FR-Designer_Custom=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA +FR-Designer_Custom-Angle=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u89D2\u5EA6 +FR-Designer_DS-Dictionary=\u30C7\u30FC\u30BF\u5B57\u5178 +FR-Designer_Data-confusion=\u30C7\u30FC\u30BF\u6DF7\u4EA4 FR-Designer_Data_Type=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7 -FR-Designer_Double_Click_Edit_OR_Clear=\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\u3084\u30AF\u30EA\u30A2\u3092\u884C\u3046 -FR-Designer_Edit_Button_ToolBar=\u30DC\u30BF\u30F3\u306E\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u7DE8\u96C6 -FR-Designer_Email=E\u30E1\u30FC\u30EB +FR-Designer_Double_Click_Edit_OR_Clear=\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\u307E\u305F\u306F\u30AF\u30EA\u30A2\u3059\u308B +FR-Designer_Email=\u30E1\u30FC\u30EB FR-Designer_Enabled=\u4F7F\u7528\u53EF\u80FD -FR-Designer_End-Date=\u7D42\u4E86\u65E5 -FR-Designer_ExportAndOutput=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8 +FR-Designer_End-Date=\u7D42\u4E86\u65E5\u671F +FR-Designer_ExportAndOutput=\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8 FR-Designer_FRFont=\u30D5\u30A9\u30F3\u30C8 -FR-Designer_FS_Close_Other_Templates=\u4ED6\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9589\u3058\u308B +FR-Designer_FS_Close_Other_Templates=\u305D\u306E\u4ED6\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9589\u3058\u308B FR-Designer_File=\u30D5\u30A1\u30A4\u30EB -FR-Designer_Filter_Conditions=\u30D5\u30A3\u30EB\u30BF\u6761\u4EF6 -FR-Designer_Finish-Modify-Share=\u4FEE\u6B63\u3092\u7D42\u4E86\u3055\u305B\u3066\u5171\u6709 -FR-Designer_Fit-App=\u30A2\u30D7\u30EA\u81EA\u5DF1\u8ABF\u6574 -FR-Designer_Fit=\u81EA\u5DF1\u8ABF\u6574 -FR-Designer_Font-Family=\u30D5\u30A9\u30F3\u30C8\u540D -FR-Designer_Font-Size=\u30D5\u30A9\u30F3\u30C8\u30B5\u30A4\u30BA -FR-Designer_Forbid_Drag_into_Adapt_Pane=\u5F53\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u4E3B\u4F53\u306B\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u306F\u306A\u3089\u306A\u3044 -FR-Designer_Forbid_Drag_into_Para_Pane=\u5F53\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u30D1\u30E9\u30E1\u30FC\u30BF\u30D1\u30CD\u30EB\u306B\u30C9\u30E9\u30C3\u30B0\u3067\u304D\u307E\u305B\u3093 +FR-Designer_Filter_Conditions=\u9078\u5225\u6761\u4EF6 +FR-Designer_Finish-Modify-Share=\u4FEE\u6B63\u3092\u5B8C\u4E86\u3057\u3066\u30B7\u30A7\u30A2 +FR-Designer_Fit-App=App\u81EA\u9069\u5FDC +FR-Designer_Fit=\u81EA\u9069\u5FDC +FR-Designer_Font-Family=\u30D5\u30A9\u30F3\u30C8\u540D\u79F0 +FR-Designer_Font-Size=\u30D5\u30A9\u30F3\u30C8\u5927\u5C0F +FR-Designer_Forbid_Drag_into_Adapt_Pane=\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306F\u30D5\u30A9\u30FC\u30E0\u672C\u6587\u3092\u30C9\u30E9\u30C3\u30B0\u3059\u308B\u3053\u3068\u306F\u8A31\u3055\u308C\u306A\u3044 +FR-Designer_Forbid_Drag_into_Para_Pane=\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306F\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u30D1\u30CD\u30EB\u306B\u30C9\u30E9\u30C3\u30B0\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 FR-Designer_Foreground=\u8272 -FR-Designer_Form-AuthorityEdited_Cannot_be_Supported=\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u6A29\u9650\u7DE8\u96C6\u306F\u73FE\u6642\u70B9\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093 -FR-Designer_Form-Report=\u5E33\u7968\u30D6\u30ED\u30C3\u30AF -FR-Designer_Form_EmbeddedTD=\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9(\u7D44\u307F\u8FBC\u307F\u30C7\u30FC\u30BF) -FR-Designer_Form_Module=\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30E2\u30B8\u30E5\u30FC\u30EB +FR-Designer_Form-AuthorityEdited_Cannot_be_Supported=\u8868\u306E\u6A29\u9650\u7DE8\u96C6\u306B\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093 +FR-Designer_Form-Report=\u5E33\u7968\u30E2\u30B8\u30E5\u30FC\u30EB +FR-Designer_Form_EmbeddedTD=\u8868(\u5185\u8535\u30C7\u30FC\u30BF) +FR-Designer_Form_Module=\u8868\u30E2\u30B8\u30E5\u30FC\u30EB FR-Designer_Format_explan=\u66F8\u5F0F\u8AAC\u660E -FR-Designer_Formula=\u6570\u5F0F -FR-Designer_Forum=\u30D5\u30A9\u30FC\u30E9\u30E0 +FR-Designer_Formula=\u516C\u5F0F +FR-Designer_Forum=BBS FR-Designer_Get-Cube=cube\u53D6\u5F97\u4E2D FR-Designer_Help=\u30D8\u30EB\u30D7 -FR-Designer_Hide=\u975E\u8868\u793A -FR-Designer_Hyperlink=\u30CF\u30A4\u30D1\u30FC\u30EA\u30F3\u30AF -FR-Designer_Hyperlink-Form_link=\u73FE\u5728\u306E\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8 +FR-Designer_Hide=\u96A0\u3059 +FR-Designer_Hyperlink=\u30B9\u30FC\u30D1\u30FC\u30EA\u30F3\u30AF +FR-Designer_Hyperlink-Form_link=\u73FE\u5728\u306E\u8868\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8 FR-Designer_IDCard=\u8EAB\u5206\u8A3C\u660E\u66F8 FR-Designer_Icon=\u30A2\u30A4\u30B3\u30F3 FR-Designer_Index=\u5217\u8EF8/\u6307\u6A19 -FR-Designer_Input_Rule=\u5165\u529B\u898F\u5247 +FR-Designer_Input_Rule=\u30EB\u30FC\u30EB\u8A18\u5165 FR-Designer_Language_Default=\u30C7\u30D5\u30A9\u30EB\u30C8 -FR-Designer_Layout=\u30EC\u30A4\u30A2\u30A6\u30C8 -FR-Designer_Layout-HBox=\u6C34\u5E73\u30DC\u30C3\u30AF\u30B9\u306E\u30EC\u30A4\u30A2\u30A6\u30C8 -FR-Designer_Layout-Index=\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9 -FR-Designer_Layout_Constraints=\u4F4D\u7F6E\u3068\u30B5\u30A4\u30BA +FR-Designer_Layout=\u914D\u7F6E +FR-Designer_Layout-HBox=\u6C34\u5E73\u30B1\u30FC\u30B9\u914D\u7F6E +FR-Designer_Layout-Index=\u7D22\u5F15 +FR-Designer_Layout_Constraints=\u4F4D\u7F6E\u3068\u5927\u5C0F FR-Designer_Length=\u9577\u3055 -FR-Designer_Loading_Data=\u30C7\u30FC\u30BF\u30ED\u30FC\u30C9\u4E2D -FR-Designer_M-Exit=\u7D42\u4E86 +FR-Designer_Loading_Data=\u30C7\u30FC\u30BF\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u3044\u307E\u3059 +FR-Designer_M-Exit=\u9000\u51FA FR-Designer_M-Help=\u30D8\u30EB\u30D7 FR-Designer_M-Insert=\u633F\u5165 -FR-Designer_M-Repeat-Freeze=\u7E70\u308A\u8FD4\u3057\u3068\u56FA\u5B9A\u306E\u8A2D\u5B9A -FR-Designer_M-Server=\u30B5\u30FC\u30D0 -FR-Designer_M-SwitchWorkspace=\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u5207\u308A\u66FF\u3048 +FR-Designer_M-Repeat-Freeze=\u91CD\u8907\u3068\u30D5\u30EA\u30FC\u30BA\u8A2D\u5B9A +FR-Designer_M-Server=\u30B5\u30FC\u30D0\u30FC +FR-Designer_M-SwitchWorkspace=\u4F5C\u696D\u76EE\u6B21\u5207\u308A\u66FF\u3048 FR-Designer_M-Template=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 -FR-Designer_MDX_Explain=\u6587\u6CD5\u66F8\u5F0F\u306FMDX\u6587\u6CD5\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u4F8B\:\nWITH\nMEMBER [Measures].[Special Discount] AS\n[Measures].[Discount Amount] * 1.5\nSELECT\n[Measures].[Special Discount] on COLUMNS,\nNON EMPTY [Product].[Product].MEMBERS ON Rows\nFROM [Adventure Works]\nWHERE [Product].[Category].[Bikes]\n\u6CE8\uFF1ACOLUMNS\u3001ROWS\u30011\u3067\u53D6\u308A\u63DB\u3048\u308B\u3053\u3068\u304C\u3067\u304D\u3001\u691C\u7D22\u8EF8\u306F2\u8EF8\u306E\u623B\u308A\u3057\u304B\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093\u3002 +FR-Designer_MDX_Explain=\u6587\u6CD5\u66F8\u5F0F\u306FMDX\u6587\u6CD5\u3092\u53C2\u8003\u3002\n\u4F8B\u3048\u3070\uFF1A\nWITH\nMEMBER [Measures].[Special Discount] AS\n[Measures].[Discount Amount] * 1.5\nSELECT\n[Measures].[Special Discount] on COLUMNS,\nNON EMPTY [Product].[Product].MEMBERS ON Rows\nFROM [Adventure Works]\nWHERE [Product].[Category].[Bikes]\n\u6CE8\uFF1ACOLUMNS\u3001ROWS\u306F0\u30011\u3092\u4F7F\u7528\u3057\u3066\u4EE3\u66FF\u53EF\u80FD\u3067\u3059\u3002\u30AF\u30A8\u30EA\u8EF8\u306F\u4E8C\u3064\u306E\u8EF8\u623B\u3057\u306B\u306E\u307F\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002 FR-Designer_M_Help-About_Software=\u30BD\u30D5\u30C8\u30A6\u30A7\u30A2\u306B\u3064\u3044\u3066 FR-Designer_M_Help-Tutorial=\u30D8\u30EB\u30D7\u30C1\u30E5\u30FC\u30C8\u30EA\u30A2\u30EB FR-Designer_Max_Value=\u6700\u5927\u5024 FR-Designer_Min_Value=\u6700\u5C0F\u5024 -FR-Designer_MobilePhone=\u30B9\u30DE\u30FC\u30C8\u30D5\u30A9\u30F3 -FR-Designer_New_Value=\u65B0\u3057\u3044\u5024 +FR-Designer_MobilePhone=\u643A\u5E2F\u96FB\u8A71 +FR-Designer_New_Value=\u65B0\u5024 FR-Designer_None=\u7121\u3057 -FR-Designer_PaperSize-Mobile=\u30B9\u30DE\u30FC\u30C8\u30D5\u30A9\u30F3 -FR-Designer_PaperSize-Mobile-Large=\u643A\u5E2F\u5927\u753B\u9762 -FR-Designer_PaperSize-Mobile-Small=\u643A\u5E2F\u5C0F\u753B\u9762 -FR-Designer_Para-Body=\u30D1\u30E9\u30E1\u30FC\u30BF\u30D1\u30CD\u30EB -FR-Designer_Parameters=\u30D1\u30E9\u30E1\u30FC\u30BF +FR-Designer_PaperSize-Mobile=\u643A\u5E2F\u96FB\u8A71 +FR-Designer_PaperSize-Mobile-Large=\u643A\u5E2F\u96FB\u8A71\u5927\u30B9\u30AF\u30EA\u30FC\u30F3 +FR-Designer_PaperSize-Mobile-Small=\u643A\u5E2F\u96FB\u8A71\u5C0F\u30B9\u30AF\u30EA\u30FC\u30F3 +FR-Designer_Para-Body=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u753B\u9762 +FR-Designer_Parameters=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC FR-Designer_Phone=\u96FB\u8A71 FR-Designer_PostCode=\u90F5\u4FBF\u756A\u53F7 -FR-Designer_Present=\u5F62\u614B +FR-Designer_Present=\u30D5\u30A9\u30EB\u30E0 FR-Designer_Preview=\u30D7\u30EC\u30D3\u30E5\u30FC -FR-Designer_Preview-Data-Confusion=\u6DF7\u4E71\u3055\u308C\u305F\u30C7\u30FC\u30BF\u3092\u30D7\u30EC\u30D3\u30E5\u30FC +FR-Designer_Preview-Data-Confusion=\u6DF7\u4EA4\u5F8C\u306E\u30C7\u30FC\u30BF\u3092\u30D7\u30EC\u30D3\u30E5\u30FC FR-Designer_Product_Demo=\u88FD\u54C1\u30C7\u30E2 -FR-Designer_Query_Type=\u30AF\u30A8\u30EA\u30BF\u30A4\u30D7 +FR-Designer_Query_Type=\u30AF\u30A8\u30EA\u65B9\u6CD5 FR-Designer_Refresh=\u66F4\u65B0 -FR-Designer_Refresh_Parameter_In_SQL=SQL\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u66F4\u65B0\u3057\u307E\u3059\u304B -FR-Designer_Reg_Expressions=\u6B63\u898F\u8868\u73FE -FR-Designer_Reg_Max_Length=\u6700\u5927 -FR-Designer_Reg_Min_Length=\u6700\u5C0F -FR-Designer_Remove_Button_ToolBar=\u30DC\u30BF\u30F3\u306E\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u524A\u9664 -FR-Designer_ReportColumns-Columns=\u30B5\u30D6\u30D5\u30A3\u30FC\u30EB\u30C9 -FR-Designer_Return-Date=\u65E5\u4ED8\u578B\u3092\u623B\u3059 -FR-Designer_RichText=\u30EA\u30C3\u30C1\u30C6\u30AD\u30B9\u30C8 -FR-Designer_RichTextEditor=\u30EA\u30C3\u30C1\u30C6\u30AD\u30B9\u30C8\u30A8\u30C7\u30A3\u30BF +FR-Designer_Refresh_Parameter_In_SQL=SQL\u4E2D\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3059\u304B +FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u73FE\u5F0F +FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u3055 +FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u3055 +FR-Designer_ReportColumns-Columns=\u6BB5\u7D44\u307F +FR-Designer_Return-Date=\u65E5\u671F\u306B\u623B\u308B +FR-Designer_RichText=\u30EA\u30C3\u30C1\u6587\u66F8\u633F\u5165 +FR-Designer_RichTextEditor=\u30EA\u30C3\u30C1\u6587\u66F8\u30A8\u30C7\u30A3\u30BF FR-Designer_Row=\u884C -FR-Designer_Row_Dimension=\u884C\u8EF8/\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3 +FR-Designer_Row_Dimension=\u884C\u8EF8/\u7DEF\u5EA6 FR-Designer_Save=\u4FDD\u5B58 FR-Designer_Search=\u691C\u7D22 FR-Designer_Set=\u8A2D\u5B9A -FR-Designer_Share-Template=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u5171\u6709 -FR-Designer_Simple_general=\u7C21\u6613\u4E00\u822C\u691C\u7D22 +FR-Designer_Share-Template=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30B7\u30A7\u30A2 +FR-Designer_Simple_general=\u30B7\u30F3\u30D7\u30EB\u901A\u7528\u30AF\u30A8\u30EA FR-Designer_Song_TypeFace=\u5B8B\u4F53 -FR-Designer_Start-Date=\u958B\u59CB\u65E5 +FR-Designer_Start-Date=\u958B\u59CB\u65E5\u671F FR-Designer_Subscript=\u4E0B\u4ED8\u304D FR-Designer_Superscript=\u4E0A\u4ED8\u304D -FR-Designer_Support_QQ=\u6280\u8853\u30B5\u30DD\u30FC\u30C8QQ +FR-Designer_Support_QQ=\u6280\u8853QQ FR-Designer_Swatch=\u30B5\u30F3\u30D7\u30EB -FR-Designer_Tab_title=\u30BF\u30D6\u30BF\u30A4\u30C8\u30EB +FR-Designer_Tab_title=tab\u30BF\u30A4\u30C8\u30EB FR-Designer_TableData=\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 -FR-Designer_Thank_guest=\u7279\u306B\u4EE5\u4E0B\u306E\u30D5\u30A9\u30FC\u30E9\u30E0\u5E06\u85AF\u304C\u5F53\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u30C7\u30B6\u30A4\u30CA\u30FC\u306E\u4F7F\u3044\u3084\u3059\u3055\u306B\u9855\u8457\u306A\u8CA2\u732E\u306B\u611F\u8B1D +FR-Designer_Thank_guest=\u7279\u306B\u5F53\u8A72\u30D0\u30FC\u30B8\u30E7\u30F3\u30C7\u30B6\u30A4\u30CA\u30FC\u306E\u4F7F\u3044\u3084\u3059\u3055\u306B\u3064\u3044\u3066\u8CA2\u732E\u3057\u3066\u304F\u308C\u305F\u4EE5\u4E0B\u306EBBS\u306E\u5E06\u30BD\u30D5\u30C8\u30D5\u30A1\u30F3\u306B\u611F\u8B1D\u3057\u307E\u3059 FR-Designer_Thanks-To=\u611F\u8B1D FR-Designer_Title=\u30BF\u30A4\u30C8\u30EB -FR-Designer_Total=\u5408\u8A08 +FR-Designer_Total=\u5168\u90E8\u3067 FR-Designer_UnSignIn=\u672A\u30ED\u30B0\u30A4\u30F3 -FR-Designer_Underline=\u4E0B\u7DDA -FR-Designer_Used=\u6700\u8FD1\u4F7F\u7528 -FR-Designer_User-defined-MDX=\u30AB\u30B9\u30BF\u30E0MDX\u691C\u7D22 -FR-Designer_SampleText=\u30B5\u30F3\u30D7\u30EB\u30C6\u30AD\u30B9\u30C8 \u30B5\u30F3\u30D7\u30EB\u30C6\u30AD\u30B9\u30C8 -FR-Designer_Vertical-LeftToRight=\u6587\u5B57\u7E26\u66F8\u304D(\u5DE6\u304B\u3089\u53F3\u3078) +FR-Designer_Underline=\u30A2\u30F3\u30C0\u30FC\u30E9\u30A4\u30F3 +FR-Designer_Used=\u6700\u8FD1\u4F7F\u7528\u3057\u305F +FR-Designer_User-defined-MDX=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BAMDX\u30AF\u30A8\u30EA +FR-Designer_SampleText=\u30C6\u30AD\u30B9\u30C8\u4F8B +FR-Designer_Vertical-LeftToRight=\u6587\u5B57\u7E26\u66F8(\u5DE6\u304B\u3089\u53F3\u3078\uFF09 FR-Designer_Vertical-RightToLeft=\u6587\u5B57\u7E26\u66F8(\u53F3\u304B\u3089\u5DE6\u3078) -FR-Designer_VerticalBoxLayout=\u5782\u76F4\u30DC\u30C3\u30AF\u30B9\u30EC\u30A4\u30A2\u30A6\u30C8 -FR-Designer_Visible=\u8868\u793A -FR-Designer_WLayout-Border-ToolTips=\u5B8C\u5168\u306A\u30DC\u30FC\u30C0\u30FC\u30EC\u30A4\u30A2\u30A6\u30C8\u30B3\u30F3\u30C6\u30CA\u306F\u3001\u6771\u3001\u5357\u3001\u897F\u3001\u5317\u3001\u4E2D\u592E\u306E5\u30D6\u30ED\u30C3\u30AF\u3088\u308A\u69CB\u6210\u3055\u308C\u307E\u3059\u3002\n\u5317\u90E8\u3068\u5357\u90E8\u3067\u306F\u9AD8\u3055\u3092\u3001\u6771\u90E8\u3068\u897F\u90E8\u3068\u3067\u306F\u5E45\u3092\u8ABF\u6574\u3067\u304D\u307E\u3059\u3002 +FR-Designer_VerticalBoxLayout=\u5782\u76F4\u30B1\u30FC\u30B9\u914D\u7F6E +FR-Designer_Visible=\u53EF\u8996 +FR-Designer_WLayout-Border-ToolTips=\u5B8C\u74A7\u306A\u30DC\u30FC\u30C0\u30FC\u30EC\u30A4\u30A2\u30A6\u30C8\u5BB9\u5668\u306F\u6771\u897F\u5357\u5317\u4E2D\u306E\u4E94\u3064\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u304B\u3089\u69CB\u6210\u3055\u308C\u307E\u3059\u3002\\uff4e\u305D\u306E\u3046\u3061\u3001\u5357\u5317\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u9AD8\u3055\u3092\u8ABF\u6574\u3067\u304D\u3001\u6771\u897F\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u5E45\u3092\u8ABF\u6574\u3067\u304D\u307E\u3059\u3002 FR-Designer_WaterMark=\u900F\u304B\u3057 FR-Designer_Widget=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB FR-Designer_Widget-Settings=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u8A2D\u5B9A @@ -366,30 +364,24 @@ FR-Designer_XMLA_Get_Catalog=\u30AB\u30BF\u30ED\u30B0\u3092\u691C\u7D22\u3059\u3 FR-Designer_XMLA_Not_NULL=\u3053\u3053\u306F\u7A7A\u6B04\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 FR-Designer_Column-Axis=\u5217\u8EF8 FR-Designer_LiteCondition_Common=\u4E00\u822C -FR-Designer_LiteCondition_Formula=\u6570\u5F0F +FR-Designer_LiteCondition_Formula=\u516C\u5F0F FR-Designer_LiteCondition_ConditionB-AND=\u30A2\u30F3\u30C9(AND) FR-Designer_LiteCondition_ConditionB-OR=\u30AA\u30A2(OR) FR-Designer_LiteCondition_Common_Condition=\u666E\u901A\u6761\u4EF6 -FR-Designer_LiteCondition_Formula_Condition=\u6570\u5F0F\u6761\u4EF6 +FR-Designer_LiteCondition_Formula_Condition=\u516C\u5F0F\u6761\u4EF6 FR-Designer_LiteCondition_Define=\u5B9A\u7FA9 -FR-Designer_Normal=\u6B63\u5E38 -FR-Designer_Alert=\u30A2\u30E9\u30FC\u30C8 FR-Designer_Select_All=\u5168\u9078\u629E -FR-Designer_Clear_All=\u5168\u3066\u3092\u30AF\u30EA\u30A2 -FR-Designer_Copy=\u30B3\u30D4\u30FC -FR-Designer_Log=\u30ED\u30B0 -FR-Designer-Plugin_Expire_Dialog_Title=\u30D7\u30E9\u30B0\u30A4\u30F3\u306F\u671F\u9650\u5207\u308C -FR-Designer-Plugin_Expire_Dialog_Text=\u30D7\u30E9\u30B0\u30A4\u30F3\u306F\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3001\u30D5\u30A1\u30F3\u30E9\u30F3\u30A2\u30D7\u30EA\u30BB\u30F3\u30BF\u30FC\u3078\u8CFC\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -FR-Designer-Plugin_Finerest_Addon=\u30D5\u30A1\u30F3\u30E9\u30F3\u30A2\u30D7\u30EA\u30BB\u30F3\u30BF\u30FC +FR-Designer-Plugin_Expire_Dialog_Title=\u671F\u9650\u5207\u308C\u306E\u30D7\u30E9\u30B0\u30A4\u30F3 +FR-Designer-Plugin_Expire_Dialog_Text=\u30D7\u30E9\u30B0\u30A4\u30F3\u306F\u3001\u8CFC\u5165\u3092\u3059\u308B\u305F\u3081\u306B\u5E06\u30BD\u30D5\u30C8\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30BB\u30F3\u30BF\u30FC\u3092\u884C\u304F\u3001\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002 +FR-Designer-Plugin_Finerest_Addon=\u5E06\u8EDF\u5FDC\u7528\u30BB\u30F3\u30BF\u30FC FR-Designer_Performance_First=\u6027\u80FD\u512A\u5148 FR-Designer_Total_N_Grade=\u5168\u90E8\u3067\:${N}\u5C64 FR-Designer_time(s)=\u56DE -FR-Designer_General=\u901A\u5E38 -FR-Designer_Advanced=\u8A73\u7D30 -FR-Designer_Validate=\u691C\u8A3C +FR-Designer_General=\u5E38\u7528 +FR-Designer_Advanced=\u9AD8\u7D1A FR-Designer_Oracle=\u3059\u3079\u3066\u306E\u30C6\u30FC\u30D6\u30EB FR-Designer_Product_improve=\u88FD\u54C1\u6539\u5584 -FR-Designer_Join_Product_improve=\u88FD\u54C1\u6539\u5584\u30D7\u30E9\u30F3\u306B\u5165\u308B +FR-Designer_Join_Product_improve=\u88FD\u54C1\u6539\u5584\u30D7\u30E9\u30F3\u306B\u52A0\u3048\u308B FR-Designer_Preference-Function=\u30D5\u30A1\u30F3\u30AF\u30B7\u30E7\u30F3\u8A2D\u5B9A FR-Designer_max_undo_limit=\u6700\u5927\u53D6\u308A\u6D88\u3057\u56DE\u6570 FR-Designer_Surport_String_To_Formula=\u30AD\u30E3\u30E9\u30AF\u30BF\u30FC\u6587\u5B57\u5217\u7DE8\u96C6\u3092\u516C\u5F0F\u3068\u3059\u308B\u3053\u3068\u306B\u30B5\u30DD\u30FC\u30C8 @@ -545,52 +537,31 @@ FR-Designer_Show_As_Download=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30EA\u30F3\u3 FR-Designer_File_Name_For_Download=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u540D FR-Designer_No=\u3044\u3044\u3048 FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0 -FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 +FR-Designer-Move_Tab_First= +FR-Designer-Move_Tab_End= +FR-Designer-Move_Tab_Next= +FR-Designer-Move_Tab_Prev= +FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9 FR-Designer_Parameter-Formula=\u6570\u5F0F -FR-Designer_Background_Null=\u80CC\u666F\u306A\u3057 -FR-Designer_Background_Color=\u8272 -FR-Designer_Background_Texture=\u30C6\u30AF\u30B9\u30C1\u30E3 -FR-Designer_Background_Pattern=\u30D1\u30BF\u30FC\u30F3 -FR-Designer_Background_Gradient_Color=\u30B0\u30E9\u30C7\u30FC\u30B7\u30E7\u30F3 -FR-Designer_Background_Image=\u753B\u50CF -FR-Designer_Background_Clear=\u30AF\u30EA\u30A2 -FR-Designer_Background_Image_Select=\u753B\u50CF\u9078\u629E -FR-Designer_Initial_Background_Tips=\u30DC\u30BF\u30F3\u306E\u521D\u671F\u80CC\u666F -FR-Designer_Mouse_Move_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u5909\u5316\u3059\u308B\u80CC\u666F -FR-Designer_Mouse_Click_Tips=\u30DC\u30BF\u30F3\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u6642\u5909\u5316\u3059\u308B\u80CC\u666F -FR-Designer-Move_Tab_First=\u30C8\u30C3\u30D7\u306B\u79FB\u3059 -FR-Designer-Move_Tab_End=\u6700\u5F8C\u306B\u79FB\u3059 -FR-Designer-Move_Tab_Next=\u5F8C\u308D\u306B\u79FB\u3059 -FR-Designer-Move_Tab_Prev=\u524D\u306B\u79FB\u3059 +FR-Designer_Background_Null= +FR-Designer_Background_Color= +FR-Designer_Background_Texture= +FR-Designer_Background_Pattern= +FR-Designer_Background_Gradient_Color= +FR-Designer_Background_Image= +FR-Designer_Background_Clear= +FR-Designer_Background_Image_Select= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Too_Large_To_Paste=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u30DC\u30FC\u30C0\u30FC\u306B\u8D85\u3048\u305F\u306E\u3067\u3001\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\uFF01 +FR-Designer_Too_Small_To_Paste=\u8A72\u5F53\u51E6\u306B\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u9AD8\u3059\u304E\uFF01 +FR-Designer_Mouse_Click_Tips= +FR-Designer_Plugin_Should_Update_Please_Contact_Developer= FR-Designer_AxisReversed=\u8EF8\u9006\u9806 FR-Designer_Logarithmic=\u5BFE\u6570\u76EE\u76DB\u308A FR-Designer_Chart_Log_Base=\u5E95\u6570 FR-Designer_Chart_F_Radar_Axis=\u5782\u76F4\u8EF8 -FR-Designer_Too_Large_To_Paste=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u30DC\u30FC\u30C0\u30FC\u306B\u8D85\u3048\u305F\u306E\u3067\u3001\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\uFF01 -FR-Designer_Too_Small_To_Paste=\u8A72\u5F53\u51E6\u306B\u8CBC\u308A\u4ED8\u3051\u3067\u304D\u307E\u305B\u3093\u3001\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30B5\u30A4\u30BA\u306F\u9AD8\u3059\u304E\uFF01 -FR-Designer_DoubleLayer_Report=\u4E8C\u968E\u30BF\u30A4\u30C8\u30EB -FR-Designer_Printer_Native_Button=\u30ED\u30FC\u30AB\u30EB\u5370\u5237 -FR-Designer_Mobile-Warning=\u6700\u5927\u306E\u9AD8\u3055\u306F\u8868\u793A\u30A8\u30EA\u30A2\u306E80\uFF05\u4EE5\u4E0A\u306B\u306A\u308A\u307E\u305B\u3093 -FR-Designer_Form-Fit-Tip=\u81EA\u5DF1\u9069\u5FDC\u30D7\u30E9\u30B0\u30A4\u30F3 -FR-Designer_Form-Forzen-Speed=\u3001\u305D\u3057\u3066\u6A2A\u65B9\u5411\u81EA\u5DF1\u9069\u5FDC\u307E\u305F\u306F2\u65B9\u5411\u81EA\u52D5\u9069\u5FDC\u3092\u5229\u7528\u3057\u3001\u5E33\u7968\u8868\u793A\u306E\u30B9\u30D4\u30FC\u30C9\u3092\u4E0A\u3052\u3067\u304D\u307E\u3059\u3002 -FR-Designer_Mobile_Form_Analysis_Annotation=\u8AAC\u660E\:\u8A72\u5F53\u8A2D\u5B9A\u3088\u308A\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u306E\u30A2\u30D7\u30EA\u3067\u306E\u89E3\u6790\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u3059\u3002 -FR-Designer_TableData-Default-Para=\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30D1\u30E9\u30E1\u30FC\u30BF -FR-Designer-Selected_Widget=\u5F53\u306E\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8 -FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u4F4E\u3044\u3067\u3059\u304C\u3001\u4E0D\u5177\u5408\u304C\u3067\u3063\u305F\u3001\u958B\u767A\u8005\u3068\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -FR-Designer_SimpleCross_Report=\u7C21\u5358\u30AF\u30ED\u30FC\u30B9\u8868 -FR-Designer_Button-Cancel=\u53D6\u308A\u6D88\u3057 -FR-Designer_Delete_Template=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u524A\u9664 -FR-Designer_Install_Template=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB -FR-Designer_SimpleDetail_Report=\u7C21\u5358\u660E\u7D30\u8868 -FR-Designer_LocalWidget=\u30ED\u30FC\u30AB\u30EB\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA -FR-Designer_WidgetOrder=\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8\u306E\u9806\u756A -FR-Designer_Form-Frozen-Tip=\u30D5\u30EA\u30FC\u30BA\u3092\u4F7F\u3046\u6642\u3001\u5F8C\u8A18\u306E\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\uFF1A -FR-Designer-Invalid_Page_Number=\u7121\u52B9\u306A\u30DA\u30FC\u30B8\u756A\u53F7 -FR-Designer_Reset=\u30EA\u30BB\u30C3\u30C8 -FR-Designer-Plugin_Please_Update_Jar=jar\u30D1\u30C3\u30AF\u3092\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3057\u3066\u304F\u3060\u3055\u3044 -FR-Designer_Get-CubeGetting cube= -FR-Designer_Mobile_Report_Analysis_Annotation=\u8AAC\u660E\:\u8A72\u5F53\u5C5E\u6027\u3088\u308A\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u306E\u30A2\u30D7\u30EA\u3067\u306E\u89E3\u6790\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u3059\u3001\u9801\u5206\u3051\u30D7\u30EC\u30D3\u30E5\u30FC\u3060\u3051\u3092\u652F\u6301\u3001\u66F8\u304D\u8FBC\u307F\u306B\u8A2D\u5B9A\u3059\u308B\u6642\u7121\u52B9\u306B\u306A\u308A\u307E\u3059\u3002 -FR-Designer_Properties_Mobile=\u30B9\u30DE\u30FC\u30C8\u30D5\u30A9\u30F3\u5C5E\u6027 -FR-Designer_Button-OK=\u5206\u304B\u308A\u307E\u3057\u305F -FR-Designer_Allow-Blank=\u7A7A\u306B\u8A31\u3059 -FR-Designer_AllCategories=\u5168\u3066\u306E\u7A2E\u985E +FR-Designer_Style=\u30B9\u30BF\u30A4\u30EB +FR-Designer_Color=\u8272 +FR-Designer_Border=\u67A0 +FR-Designer_Background-Pattern=\u30D1\u30BF\u30FC\u30F3 \ 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 c0c8e9e71d..075b017ab1 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 @@ -91,7 +91,6 @@ FR-Designer_DS-Dictionary=\uB370\uC774\uD130\uC0AC\uC804 FR-Designer_Data-confusion=\uB370\uC774\uD130\uD63C\uD569 FR-Designer_Data_Type=\uB370\uC774\uD130\uC720\uD615 FR-Designer_Double_Click_Edit_OR_Clear=\uB354\uBE14\uD074\uB9AD\uD558\uC5EC\uD3B8\uC9D1\uB610\uB294\uD074\uB9AC\uC5B4\uC2E4\uD589 -FR-Designer_Edit_Button_ToolBar=\uD0A4\uAC00\uC788\uB294\uD234\uBC14\uD3B8\uC9D1 FR-Designer_Email=\uBA54\uC77C FR-Designer_Enabled=\uC0AC\uC6A9\uAC00\uB2A5 FR-Designer_End-Date=\uC885\uB8CC\uB0A0\uC9DC @@ -163,7 +162,6 @@ FR-Designer_Refresh_Parameter_In_SQL=SQL\uC758\uB9E4\uAC1C\uBCC0\uC218\uB97C\uC0 FR-Designer_Reg_Expressions=\uC815\uADDC\uD45C\uD604\uC2DD FR-Designer_Reg_Max_Length=\uCD5C\uB300\uAE38\uC774 FR-Designer_Reg_Min_Length=\uCD5C\uC18C\uAE38\uC774 -FR-Designer_Remove_Button_ToolBar=\uD0A4\uAC00\uC788\uB294\uD234\uBC14\uC81C\uAC70 FR-Designer_ReportColumns-Columns=\uC140\uB098\uB204\uAE30 FR-Designer_Return-Date=\uB0A0\uC9DC\uB3CC\uC544\uAC00\uAE30 FR-Designer_RichText=\uB9AC\uCE58\uD14D\uC2A4\uD2B8\uBC15\uC2A4\uC0BD\uC785 @@ -553,49 +551,12 @@ FR-Designer_Background_Image_Select= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= FR-Designer_Mouse_Click_Tips= -FR-Designer-Move_Tab_First= -FR-Designer-Move_Tab_End= -FR-Designer-Move_Tab_Next= -FR-Designer-Move_Tab_Prev= +FR-Designer_Plugin_Should_Update_Please_Contact_Developer= FR-Designer_AxisReversed=\uCD95\uC5ED\uC21C FR-Designer_Logarithmic=\uB85C\uADF8\uB208\uAE08 FR-Designer_Chart_Log_Base=\uAE30\uC218 FR-Designer_Chart_F_Radar_Axis=\uAC12\uCD95 -FR-Designer_COMMUNITY_VIDEO= -FR-Designer_DoubleLayer_Report= -FR-Designer_Too_Small_To_Paste= -FR-Designer_formDesignerModule= -FR-Designer_Mobile-Warning= -FR-Designer_Mobile-Open= -FR-Designer_Form-Fit-Tip= -FR-Designer_Form-Forzen-Speed= -FR-Designer_Mobile_Form_Analysis_Annotation= -FR-Designer_Too_Large_To_Paste= -FR-Designer_COMMUNITY_HELP= -FR-Designer_Validate= -FR-Designer_Button-Cancel= -FR-Designer_Plugin_Should_Update_Please_Contact_Developer= -FR-Designer_COMMUNITY_QUESTIONS= -FR-Designer_SimpleCross_Report= -FR-Designer_COMMUNITY_NEED= -FR-Designer_Delete_Template= -FR-Designer_TableData-Default-Para= -FR-Designer_Allow-Blank= -FR-Designer_LocalWidget= -FR-Designer_WidgetOrder= -FR-Designer_Form-Frozen-Tip= -FR-Designer_Mobile-Horizontal= -FR-Designer-Invalid_Page_Number= -FR-Designer_COMMUNITY_BBS= -FR-Designer_COMMUNITY_SIGN= -FR-Designer_COMMUNITY_UPDATE= -FR-Designer_Mobile-Vertical= -FR-Designer_Get-CubeGetting cube= -FR-Designer_COMMUNITY= -FR-Designer_Mobile_Report_Analysis_Annotation= -FR-Designer_Properties_Mobile= -FR-Designer_Button-OK= -FR-Designer_COMMUNITY_BUG= -FR-Designer_AllCategories= -FR-Designer_Mobile-Attr= -FR-Designer_Mobile-Zoom= +FR-Designer_Style=\uC591\uC2DD +FR-Designer_Color=\uC0C9 +FR-Designer_Border=\uD14C\uB450\uB9AC +FR-Designer_Background-Pattern=\uC774\uBBF8\uC9C0 \ 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 f4fbdd11ad..d0a2b05203 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 @@ -91,7 +91,6 @@ FR-Designer_DS-Dictionary=\u6570\u636E\u5B57\u5178 FR-Designer_Data-confusion=\u6570\u636E\u6DF7\u6DC6 FR-Designer_Data_Type=\u6570\u636E\u7C7B\u578B FR-Designer_Double_Click_Edit_OR_Clear=\u53CC\u51FB\u8FDB\u884C\u7F16\u8F91\u6216\u6E05\u9664 -FR-Designer_Edit_Button_ToolBar=\u7F16\u8F91\u6309\u94AE\u6240\u5728\u5DE5\u5177\u680F FR-Designer_Email=\u90AE\u4EF6 FR-Designer_Enabled=\u53EF\u7528 FR-Designer_End-Date=\u7ED3\u675F\u65E5\u671F @@ -164,7 +163,6 @@ FR-Designer_Refresh_Parameter_In_SQL=\u662F\u5426\u5237\u65B0SQL\u4E2D\u7684\u53 FR-Designer_Reg_Expressions=\u6B63\u5219\u8868\u8FBE\u5F0F FR-Designer_Reg_Max_Length=\u6700\u5927\u957F\u5EA6 FR-Designer_Reg_Min_Length=\u6700\u5C0F\u957F\u5EA6 -FR-Designer_Remove_Button_ToolBar=\u79FB\u9664\u6309\u94AE\u6240\u5728\u5DE5\u5177\u680F FR-Designer_ReportColumns-Columns=\u5206\u680F FR-Designer_Return-Date=\u8FD4\u56DE\u65E5\u671F FR-Designer_RichText=\u63D2\u5165\u5BCC\u6587\u672C @@ -590,15 +588,15 @@ FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247 FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F -FR-Designer-Move_Tab_First=\u79FB\u52A8\u5230\u9996\u4F4D -FR-Designer-Move_Tab_End=\u79FB\u52A8\u5230\u672B\u5C3E -FR-Designer-Move_Tab_Next=\u5F80\u540E\u79FB\u52A8 -FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52A8 + +FR-Designer_Too_Large_To_Paste=\u7EC4\u4EF6\u5927\u5C0F\u8D85\u51FA\u8FB9\u754C\uFF0C\u65E0\u6CD5\u7C98\u8D34\uFF01 +FR-Designer_Too_Small_To_Paste=\u6B64\u5904\u65E0\u6CD5\u7C98\u8D34\uFF0C\u5C0F\u4E8E\u7EC4\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 + FR-Designer_AxisReversed=\u8F74\u9006\u5E8F FR-Designer_Logarithmic=\u5BF9\u6570\u523B\u5EA6 FR-Designer_Chart_Log_Base=\u5E95\u6570 FR-Designer_Chart_F_Radar_Axis=\u503C\u8F74 -FR-Designer_Too_Large_To_Paste=\u7EC4\u4EF6\u5927\u5C0F\u8D85\u51FA\u8FB9\u754C\uFF0C\u65E0\u6CD5\u7C98\u8D34\uFF01 -FR-Designer_Too_Small_To_Paste=\u6B64\u5904\u65E0\u6CD5\u7C98\u8D34\uFF0C\u5C0F\u4E8E\u7EC4\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 - -FR-Designer_Get-CubeGetting cube= +FR-Designer_Style=\u6837\u5F0F +FR-Designer_Color=\u989C\u8272 +FR-Designer_Border=\u8FB9\u6846 +FR-Designer_Background-Pattern=\u56FE\u6848 \ No newline at end of file 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 58c4e13fa6..bbaf3db36d 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 @@ -91,7 +91,6 @@ FR-Designer_DS-Dictionary=\u8CC7\u6599\u5B57\u5178 FR-Designer_Data-confusion=\u8CC7\u6599\u6DF7\u6DC6 FR-Designer_Data_Type=\u8CC7\u6599\u985E\u578B FR-Designer_Double_Click_Edit_OR_Clear=\u96D9\u64CA\u9032\u884C\u7DE8\u8F2F\u6216\u6E05\u9664 -FR-Designer_Edit_Button_ToolBar=\u7DE8\u8F2F\u6309\u9215\u6240\u5728\u5DE5\u5177\u6B04 FR-Designer_Email=\u90F5\u4EF6 FR-Designer_Enabled=\u53EF\u7528 FR-Designer_End-Date=\u7D50\u675F\u65E5\u671F @@ -163,7 +162,6 @@ FR-Designer_Refresh_Parameter_In_SQL=\u5728SQL\u4E2D\u91CD\u65B0\u6574\u7406\u76 FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u9054\u5F0F FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u5EA6 FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u5EA6 -FR-Designer_Remove_Button_ToolBar=\u79FB\u9664\u6309\u9215\u6240\u5728\u5DE5\u5177\u6B04 FR-Designer_ReportColumns-Columns=\u5831\u8868\u6B04\u4F4D FR-Designer_Return-Date=\u8FD4\u56DE\u65E5\u671F FR-Designer_RichText= RTF @@ -567,38 +565,24 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u633F\u4EF6\u7248\u67 FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002 - -FR-Designer_Background_Null=\u6C92\u6709\u80CC\u666F -FR-Designer_Background_Color=\u984F\u8272 -FR-Designer_Background_Texture=\u7D0B\u7406 -FR-Designer_Background_Pattern=\u5716\u6848 -FR-Designer_Background_Gradient_Color=\u6F38\u8B8A\u8272 -FR-Designer_Background_Image=\u5716\u7247 -FR-Designer_Background_Clear=\u6E05\u9664 -FR-Designer_Background_Image_Select=\u9078\u64C7\u5716\u7247 -FR-Designer_Initial_Background_Tips=\u6309\u9215\u7684\u521D\u59CB\u80CC\u666F -FR-Designer_Mouse_Move_Tips=\u6ED1\u9F20\u79FB\u52D5\u5230\u6309\u9215\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u7121\u5247\u4E0D\u6539\u8B8A\u80CC\u666F -FR-Designer_Mouse_Click_Tips=\u6ED1\u9F20\u9EDE\u64CA\u6309\u9215\u6642\u80CC\u666F\uFF0C\u82E5\u7121\u5247\u4E0D\u6539\u8B8A\u80CC\u666F -FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D -FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E -FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5 -FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52D5 +FR-Designer_Background_Null= +FR-Designer_Background_Color= +FR-Designer_Background_Texture= +FR-Designer_Background_Pattern= +FR-Designer_Background_Gradient_Color= +FR-Designer_Background_Image= +FR-Designer_Background_Clear= +FR-Designer_Background_Image_Select= +FR-Designer_Too_Large_To_Paste=\u7D44\u4EF6\u5927\u5C0F\u8D85\u51FA\u908A\u754C\uFF0C\u7121\u6CD5\u7C98\u8CBC\uFF01 +FR-Designer_Too_Small_To_Paste=\u6B64\u8655\u7121\u6CD5\u7C98\u8CBC\uFF0C\u5C0F\u65BC\u7D44\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= FR-Designer_AxisReversed=\u8EF8\u9006\u5E8F FR-Designer_Logarithmic=\u5C0D\u6578\u523B\u5EA6 FR-Designer_Chart_Log_Base=\u5E95\u6578 FR-Designer_Chart_F_Radar_Axis=\u503C\u8EF8 -FR-Designer_Too_Large_To_Paste=\u7D44\u4EF6\u5927\u5C0F\u8D85\u51FA\u908A\u754C\uFF0C\u7121\u6CD5\u7C98\u8CBC\uFF01 -FR-Designer_Too_Small_To_Paste=\u6B64\u8655\u7121\u6CD5\u7C98\u8CBC\uFF0C\u5C0F\u65BC\u7D44\u4EF6\u6700\u5C0F\u9AD8\u5EA6\uFF01 -FR-Designer_Download_Template= -FR-Designer-Selected_Widget= -FR-Designer_LocalWidget= -FR-Designer_Get-CubeGetting cube= -FR-Designer_Install_Template= -FR-Designer_Reset= -FR-Designer_SimpleCross_Report= -FR-Designer_Allow-Blank= -FR-Designer_AllCategories= -FR-Designer_SimpleDetail_Report= -FR-Designer_DoubleLayer_Report= -FR-Designer_Delete_Template= -FR-Designer_Validate= +FR-Designer_Style=\u6A23\u5F0F +FR-Designer_Color=\u984F\u8272 +FR-Designer_Border=\u6846\u7DDA +FR-Designer_Background-Pattern=\u5716\u6848 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index e28090299e..48371c7871 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -372,7 +372,7 @@ public abstract class JTemplate> ex } protected boolean accept(Object o){ - return true; + return true; } private void fireSuperTargetModified() { @@ -488,15 +488,15 @@ public abstract class JTemplate> ex collectInfo(); return this.saveFile(); } - + private boolean isCancelOperation(int operation){ - return operation == FILEChooserPane.CANCEL_OPTION || - operation == FILEChooserPane.JOPTIONPANE_CANCEL_OPTION; + return operation == FILEChooserPane.CANCEL_OPTION || + operation == FILEChooserPane.JOPTIONPANE_CANCEL_OPTION; } - + private boolean isOkOperation(int operation){ - return operation == FILEChooserPane.JOPTIONPANE_OK_OPTION || - operation == FILEChooserPane.OK_OPTION; + return operation == FILEChooserPane.JOPTIONPANE_OK_OPTION || + operation == FILEChooserPane.OK_OPTION; } private boolean saveAsTemplate(boolean isShowLoc) { @@ -513,8 +513,8 @@ public abstract class JTemplate> ex if (isCancelOperation(chooseResult)) { fileChooser = null; return false; - } - + } + if (isOkOperation(chooseResult)) { if (!FRContext.getCurrentEnv().hasFileFolderAllow(fileChooser.getSelectedFILE().getPath()) ) { JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_No-Privilege") + "!", Inter.getLocText("FR-Designer_Message"), JOptionPane.WARNING_MESSAGE); @@ -524,41 +524,40 @@ public abstract class JTemplate> ex mkNewFile(editingFILE); fileChooser = null; } - + return saveNewFile(editingFILE, oldName); } - - protected boolean saveNewFile(FILE editingFILE, String oldName){ - // 在保存之前,初始化 templateID - initForCollect(); // 如果保存新模板(新建模板直接保存,或者另存为),则添加 templateID + protected boolean saveNewFile(FILE editingFILE, String oldName){ this.editingFILE = editingFILE; + boolean result = this.saveFile(); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); + initForCollect(); // 如果保存新模板(新建模板直接保存,或者另存为),则添加 templateID collectInfo(); } //更换最近打开 DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getFullPathName()); return result; } - + protected void mkNewFile(FILE file){ try { - file.mkfile(); + file.mkfile(); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); } } - + /** - * 将模板另存为可以分享出去的混淆后内置数据集模板 - * - * @return 是否另存成功 - * - */ + * 将模板另存为可以分享出去的混淆后内置数据集模板 + * + * @return 是否另存成功 + * + */ public boolean saveShareFile(){ - return true; + return true; } public Widget getSelectElementCase(){ return new NoneWidget(); @@ -763,7 +762,7 @@ public abstract class JTemplate> ex public void revert() { } - + private int getVersionCompare(String versionString){ if (StringUtils.isBlank(versionString)) { return 0; @@ -773,7 +772,7 @@ public abstract class JTemplate> ex return ComparatorUtils.compare(versionString.substring(0, len), ProductConstants.DESIGNER_VERSION.substring(0, len)); } - + private int getVersionCompareHBB(String versionString){ if (StringUtils.isBlank(versionString)) { return 0; @@ -781,17 +780,17 @@ public abstract class JTemplate> ex return ComparatorUtils.compare(versionString, "HBB"); } - + private boolean isHigherThanCurrent(String versionString) { return getVersionCompare(versionString) > 0; } - + private boolean isLowerThanCurrent(String versionString) { - return getVersionCompare(versionString) < 0; + return getVersionCompare(versionString) < 0; } - + private boolean isLowerThanHBB(String versionString) { - return getVersionCompareHBB(versionString) < 0; + return getVersionCompareHBB(versionString) < 0; } /** @@ -801,7 +800,7 @@ public abstract class JTemplate> ex public boolean isNewDesigner() { String xmlDesignerVersion = getTarget().getXMLDesignerVersion(); if (isLowerThanHBB(xmlDesignerVersion)) { - String info = Inter.getLocText("FR-Designer_open-new-form-tip"); + String info = Inter.getLocText("FR-Designer_open-new-form-tip"); String moreInfo = Inter.getLocText("FR-Designer_Server-version-tip-moreInfo"); new InformationWarnPane(info, moreInfo, Inter.getLocText("FR-Designer_Tooltips")).show(); return true; @@ -855,13 +854,13 @@ public abstract class JTemplate> ex * @return 是则返回true */ public abstract boolean isJWorkBook(); - + /** * 返回当前支持的超链界面pane * @return 超链连接界面 */ public HyperlinkGroupPane getHyperLinkPane() { - return new HyperlinkGroupPane(); + return new HyperlinkGroupPane(); } /** @@ -916,29 +915,29 @@ public abstract class JTemplate> ex public void requestGridFocus() { } - + /** - * 创建内置sql提交的pane - * - * @return 内置sql提交的pane - * - * - * @date 2014-10-14-下午7:39:27 - */ + * 创建内置sql提交的pane + * + * @return 内置sql提交的pane + * + * + * @date 2014-10-14-下午7:39:27 + */ public DBManipulationPane createDBManipulationPane(){ - return new DBManipulationPane(); + return new DBManipulationPane(); } - + /** * 创建控件事件里内置sql提交的pane - * + * * @return 内置sql提交的pane - * + * * * @date 2014-10-14-下午7:39:27 */ public DBManipulationPane createDBManipulationPaneInWidget(){ - return new DBManipulationInWidgetEventPane(); + return new DBManipulationInWidgetEventPane(); } /** @@ -966,15 +965,15 @@ public abstract class JTemplate> ex public void styleChange(){ } - + /** - * 创建分享模板的按钮, 目前只有jworkbook实现了 - * - * @return 分享模板按钮 - * - */ + * 创建分享模板的按钮, 目前只有jworkbook实现了 + * + * @return 分享模板按钮 + * + */ public UIButton[] createShareButton(){ - return new UIButton[0]; + return new UIButton[0]; } /** diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index e5c6688ec9..b9b7aa194e 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -73,6 +73,8 @@ public class TemplateInfoCollector implements Serializable { } catch (InvalidClassException ex) { // 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖) // 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现 + FRLogger.getLogger().info(ex.getMessage()); + FRLogger.getLogger().info("use a new instance"); instance = new TemplateInfoCollector(); } catch (Exception ex) { @@ -121,6 +123,14 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); + String log = ""; + int count = 1; + for (String key : templateInfoList.keySet()) { + String createTime = ((HashMap)templateInfoList.get(key).get("consumingMap")).get("create_time").toString(); + log += (count + ". id: " + key + " " + createTime + "\n" + templateInfoList.get(key).toString() + "\n"); + count ++; + } + FRLogger.getLogger().info("writing tplInfo: \n" + log); os.writeObject(instance); os.close(); } catch (Exception ex) { @@ -231,7 +241,10 @@ public class TemplateInfoCollector implements Serializable { String jsonProcessMap = templateInfo.get("jsonProcessMap"); if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 + FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); removeFromTemplateInfoList(templateInfo.get("templateID")); + } else { + FRLogger.getLogger().info("send template info failed, will try next time, " + templateInfo.get("templateID")); } } saveInfo(); @@ -290,6 +303,7 @@ public class TemplateInfoCollector implements Serializable { private void removeFromTemplateInfoList(String key) { templateInfoList.remove(key); + FRLogger.getLogger().info(key + " is removed..."); } @SuppressWarnings("unchecked") diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 88a6b528ec..8a157f0843 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -31,17 +31,18 @@ public class MinMaxValuePane extends JPanel { protected UITextField secUnitField; public MinMaxValuePane() { - minCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Min_Value"})); - minValueField = new UITextField(6); - maxCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Max_Value"})); - maxValueField = new UITextField(6); - isCustomMainUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_MainGraduationUnit")); - mainUnitField = new UITextField(6); - isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit")); - secUnitField = new UITextField(6); + minCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Min_Value"})); + minValueField = new UITextField(6); + maxCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Max_Value"})); + maxValueField = new UITextField(6); + isCustomMainUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_MainGraduationUnit")); + mainUnitField = new UITextField(6); + isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit")); + secUnitField = new UITextField(6); + double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = { p, f }; + double[] columnSize = {p, f}; Component[][] components = getPanelComponents(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, getRowSize(p), columnSize); @@ -53,25 +54,26 @@ public class MinMaxValuePane extends JPanel { protected double[] getRowSize(double p) { return new double[]{p, p, p, p}; } - protected void addComponentListener(Component[][] components) { - for (int i = 0; i < components.length; i++) { - addListener((UICheckBox) components[i][0]); - ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); - } - } - protected void addListener(UICheckBox checkBox) { - checkBox.addActionListener(new ActionListener() { + protected void addComponentListener(Component[][] components) { + for (int i = 0; i < components.length; i++) { + addListener((UICheckBox) components[i][0]); + ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); + } + } + + protected void addListener(UICheckBox checkBox) { + checkBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - checkBoxUse(); - } - }); - } + @Override + public void actionPerformed(ActionEvent e) { + checkBoxUse(); + } + }); + } protected Component[][] getPanelComponents() { - return new Component[][]{ + return new Component[][]{ new Component[]{minCheckBox, minValueField}, new Component[]{maxCheckBox, maxValueField}, new Component[]{isCustomMainUnitBox, mainUnitField},