From 6f210916d7f33f4d41ce3efa817d994699f9ad7c Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 23 Jul 2020 10:48:31 +0800 Subject: [PATCH 01/47] =?UTF-8?q?REPORT-35568=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=EF=BC=8C=E6=92=A4=E9=94=80=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E4=B8=80=E4=B8=AA=E8=93=9D=E8=89=B2=E7=9A=84?= =?UTF-8?q?=E6=A1=86=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index ff52dac142..449ffc0744 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -760,6 +760,7 @@ public class JWorkBook extends JTemplate { if (centerPane.isUpEditMode()) { if (hasParameterPane()) { parameterPane.populate(u.getApplyTarget()); + setAutoHeightForCenterPane(); DesignModuleFactory.getFormHierarchyPane().refreshRoot(); } } else { From 063c2cd52be32536c21903efa0eb549a13e1a01d Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 24 Jul 2020 09:50:28 +0800 Subject: [PATCH 02/47] =?UTF-8?q?REPORT-35906=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=BC=96=E8=BE=91=E7=9A=84=E7=95=8C=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E6=B7=BB=E5=8A=A0=E8=A1=8C=E6=95=B0=E6=88=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=A1=8C=E6=95=B0=E5=90=8E=EF=BC=8C=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E4=BC=9A=E5=81=9A=E4=B8=80=E9=83=A8=E5=88=86=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=B7=BB=E5=8A=A0=EF=BC=8C=E6=A0=B9=E6=8D=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E9=A1=BA=E5=BA=8F=E7=89=B9=E7=82=B9=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E5=8E=BB=E5=A4=9A=E4=BD=99=E7=9A=84Component=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../tabledata/tabledatapane/MaxMemRowCountPanel.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 3118ed8a99..84c06b0b5e 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,7 @@ allprojects { dependencies { implementation 'com.fr.third:jxbrowser:6.23' - implementation 'com.fr.third:jxbrowser-swing:6.23' + //implementation 'com.fr.third:jxbrowser-swing:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23' implementation 'com.fr.third:jxbrowser-win64:6.23' implementation 'com.fr.third.server:servlet-api:3.0' diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index 00bbcc995b..fbab521b06 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -1,6 +1,6 @@ package com.fr.design.data.tabledata.tabledatapane; -import java.awt.Dimension; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itoolbar.UIToolbar; +import com.fr.design.i18n.Toolkit; public class MaxMemRowCountPanel extends UIToolbar { @@ -88,7 +89,11 @@ public class MaxMemRowCountPanel extends UIToolbar { switchCache.setSelectedIndex(MAX_IN_MEMORY); this.add(new UILabel(" ")); this.add(numberSpinner); - this.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row"))); + this.add(new UILabel(" " + Toolkit.i18nText("Fine-Design_Basic_Row"))); + if (this.getComponentCount() > 4) { + this.remove(1); + this.remove(1); + } this.validate(); this.repaint(); } From 604f611bda68d8b8df593079a89fc42bdcf907d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 24 Jul 2020 14:46:26 +0800 Subject: [PATCH 03/47] =?UTF-8?q?CHART-14801=20=E9=9D=A2=E6=9D=BF=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CategoryPlotMoreCateReportDataContentPane.java | 9 ++++----- .../report/CategoryPlotReportDataContentPane.java | 11 +++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java index fd8e08d87f..d4e1f64e77 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java @@ -13,21 +13,20 @@ import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; - import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; /** @@ -72,14 +71,14 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor catePane.add(boxPane, BorderLayout.SOUTH); - catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,6)); + catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,20)); this.add(catePane, "0,0,2,0"); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane); panel.setBorder(getSidesBorder()); filterPane.setBorder(getFilterPaneBorder()); - this.add(panel, "0,6,2,4"); + this.add(panel, "0,6,1,4"); addButton.addActionListener(new ActionListener() { @Override diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java index 298ee49370..68e5881c00 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java @@ -10,7 +10,6 @@ import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; - import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -18,9 +17,9 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import java.util.List; import java.awt.BorderLayout; import java.awt.Dimension; -import java.util.List; public class CategoryPlotReportDataContentPane extends AbstractReportDataContentPane { protected static final int PRE_WIDTH = 210; @@ -35,14 +34,14 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent public CategoryPlotReportDataContentPane(ChartDataPane parent) { initEveryPane(); categoryName = initCategoryBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Name")); - categoryName.setPreferredSize(new Dimension(246,30)); - categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,7)); - this.add(categoryName, "0,0,2,0"); + categoryName.setPreferredSize(new Dimension(236,30)); + categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,20)); + this.add(categoryName, "0,0,1,0"); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane); panel.setBorder(getSidesBorder()); filterPane.setBorder(getFilterPaneBorder()); - this.add(panel, "0,6,2,4"); } + this.add(panel, "0,6,1,4"); } protected TinyFormulaPane initCategoryBox(final String leftLabel) { TinyFormulaPane categoryName = new TinyFormulaPane() { From 0a80bfb61fbeb03598bb998fab667c630b57b546 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 24 Jul 2020 17:00:28 +0800 Subject: [PATCH 04/47] =?UTF-8?q?Merge=20branch=20'release/10.0'=20of=20ht?= =?UTF-8?q?tps://code.fineres.com/scm/~yvan/design=20into=20release/10.0?= =?UTF-8?q?=20#=20=E8=AF=B7=E8=BE=93=E5=85=A5=E4=B8=80=E4=B8=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BF=A1=E6=81=AF=E4=BB=A5=E8=A7=A3=E9=87=8A=E6=AD=A4?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E7=9A=84=E5=BF=85=E8=A6=81=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=B0=A4=E5=85=B6=E6=98=AF=E5=B0=86=E4=B8=80=E4=B8=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E7=9A=84=E4=B8=8A=E6=B8=B8=E5=88=86=E6=94=AF?= =?UTF-8?q?=20#=20=E5=90=88=E5=B9=B6=E5=88=B0=E4=B8=BB=E9=A2=98=E5=88=86?= =?UTF-8?q?=E6=94=AF=E3=80=82=20#=20#=20=E4=BB=A5=20'#'=20=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E8=A1=8C=E5=B0=86=E8=A2=AB=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E7=A9=BA=E7=9A=84=E6=8F=90=E4=BA=A4=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=B0=86=E7=BB=88=E6=AD=A2=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../tabledata/tabledatapane/MaxMemRowCountPanel.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 84c06b0b5e..3118ed8a99 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,7 @@ allprojects { dependencies { implementation 'com.fr.third:jxbrowser:6.23' - //implementation 'com.fr.third:jxbrowser-swing:6.23' + implementation 'com.fr.third:jxbrowser-swing:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23' implementation 'com.fr.third:jxbrowser-win64:6.23' implementation 'com.fr.third.server:servlet-api:3.0' diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index fbab521b06..3f5902d8a4 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -1,6 +1,7 @@ package com.fr.design.data.tabledata.tabledatapane; -import java.awt.*; + +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -87,13 +88,12 @@ public class MaxMemRowCountPanel extends UIToolbar { this.removeAll(); this.add(switchCache); switchCache.setSelectedIndex(MAX_IN_MEMORY); + if (this.getComponentCount() == 4) { + return; + } this.add(new UILabel(" ")); this.add(numberSpinner); this.add(new UILabel(" " + Toolkit.i18nText("Fine-Design_Basic_Row"))); - if (this.getComponentCount() > 4) { - this.remove(1); - this.remove(1); - } this.validate(); this.repaint(); } From 80554b04ffb68cc30392a0ba19dfa870e961b704 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 27 Jul 2020 10:43:05 +0800 Subject: [PATCH 05/47] =?UTF-8?q?Merge=20branch=20'release/10.0'=20of=20ht?= =?UTF-8?q?tps://code.fineres.com/scm/~yvan/design=20into=20release/10.0?= =?UTF-8?q?=20#=20=E8=AF=B7=E8=BE=93=E5=85=A5=E4=B8=80=E4=B8=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BF=A1=E6=81=AF=E4=BB=A5=E8=A7=A3=E9=87=8A=E6=AD=A4?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E7=9A=84=E5=BF=85=E8=A6=81=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=B0=A4=E5=85=B6=E6=98=AF=E5=B0=86=E4=B8=80=E4=B8=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E7=9A=84=E4=B8=8A=E6=B8=B8=E5=88=86=E6=94=AF?= =?UTF-8?q?=20#=20=E5=90=88=E5=B9=B6=E5=88=B0=E4=B8=BB=E9=A2=98=E5=88=86?= =?UTF-8?q?=E6=94=AF=E3=80=82=20#=20#=20=E4=BB=A5=20'#'=20=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E8=A1=8C=E5=B0=86=E8=A2=AB=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E7=A9=BA=E7=9A=84=E6=8F=90=E4=BA=A4=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=B0=86=E7=BB=88=E6=AD=A2=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/MaxMemRowCountPanel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index 3f5902d8a4..bb8f3128ba 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -21,7 +21,7 @@ public class MaxMemRowCountPanel extends UIToolbar { private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") }; private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 350 : 250; - + private static final int MAX_COMPONENT_COUNT_OF_MAX_MEMORY = 4; private static int getMaxComBoBoxWidth() { int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]); for (int i = 1; i < CACHE_LIST.length; i++) { @@ -88,7 +88,8 @@ public class MaxMemRowCountPanel extends UIToolbar { this.removeAll(); this.add(switchCache); switchCache.setSelectedIndex(MAX_IN_MEMORY); - if (this.getComponentCount() == 4) { + if (this.getComponentCount() == MAX_COMPONENT_COUNT_OF_MAX_MEMORY) { + //此处因为switchCache的setSelectedIndex可能会造成双层调用,然后因为重复添加组件产生bug,故而定义这个工具栏的正常最大组件数,做个判断 return; } this.add(new UILabel(" ")); From 46b4d5e81d6d325cbb3f377803df473e757bef4b Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 27 Jul 2020 11:16:35 +0800 Subject: [PATCH 06/47] =?UTF-8?q?Merge=20branch=20'release/10.0'=20of=20ht?= =?UTF-8?q?tps://code.fineres.com/scm/~yvan/design=20into=20release/10.0?= =?UTF-8?q?=20#=20=E8=AF=B7=E8=BE=93=E5=85=A5=E4=B8=80=E4=B8=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BF=A1=E6=81=AF=E4=BB=A5=E8=A7=A3=E9=87=8A=E6=AD=A4?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E7=9A=84=E5=BF=85=E8=A6=81=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=B0=A4=E5=85=B6=E6=98=AF=E5=B0=86=E4=B8=80=E4=B8=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E7=9A=84=E4=B8=8A=E6=B8=B8=E5=88=86=E6=94=AF?= =?UTF-8?q?=20#=20=E5=90=88=E5=B9=B6=E5=88=B0=E4=B8=BB=E9=A2=98=E5=88=86?= =?UTF-8?q?=E6=94=AF=E3=80=82=20#=20#=20=E4=BB=A5=20'#'=20=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E8=A1=8C=E5=B0=86=E8=A2=AB=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E7=A9=BA=E7=9A=84=E6=8F=90=E4=BA=A4=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=B0=86=E7=BB=88=E6=AD=A2=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/MaxMemRowCountPanel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index bb8f3128ba..d43e6bdee4 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -13,6 +13,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; +import com.fr.stable.StringUtils; public class MaxMemRowCountPanel extends UIToolbar { @@ -92,9 +93,9 @@ public class MaxMemRowCountPanel extends UIToolbar { //此处因为switchCache的setSelectedIndex可能会造成双层调用,然后因为重复添加组件产生bug,故而定义这个工具栏的正常最大组件数,做个判断 return; } - this.add(new UILabel(" ")); + this.add(new UILabel(StringUtils.BLANK)); this.add(numberSpinner); - this.add(new UILabel(" " + Toolkit.i18nText("Fine-Design_Basic_Row"))); + this.add(new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Basic_Row"))); this.validate(); this.repaint(); } From 46b31cea09de2cc64fa80034fae38bf9f3b205b7 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 27 Jul 2020 14:38:42 +0800 Subject: [PATCH 07/47] CHART-14813 dierta time --- .../main/java/com/fr/extended/chart/ExtendedOtherPane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java index 6fba552b76..74bc01282b 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java @@ -109,7 +109,7 @@ public class ExtendedOtherPane extends AbstractChartAtt } }); - autoRefreshTime = new UISpinner(0, Integer.MAX_VALUE, 1, 0); + autoRefreshTime = createIntervalTime(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f, 20}; @@ -129,6 +129,10 @@ public class ExtendedOtherPane extends AbstractChartAtt return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Refresh"), gapPane); } + protected UISpinner createIntervalTime() { + return new UISpinner(1, Integer.MAX_VALUE, 5, 60); + } + private JPanel createHyperlinkPane() { hyperLinkPane = new ExtendedChartHyperLinkPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), hyperLinkPane); From 0b4d28c4c22971e956e37de33f86a680c1316bf2 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 27 Jul 2020 14:49:36 +0800 Subject: [PATCH 08/47] =?UTF-8?q?REPORT-35568=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=B7=BB=E5=8A=A0=E5=A4=9A=E4=B8=AA=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=92=A4=E9=94=80=E4=BC=9A=E5=87=BA=E7=8E=B0=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=93=9D=E8=89=B2=E7=9A=84=E6=A1=86=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 449ffc0744..b68833f83f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -783,6 +783,7 @@ public class JWorkBook extends JTemplate { private void applyAll(WorkBookUndoState u) { if (hasParameterPane()) { parameterPane.populate(u.getApplyTarget()); + setAutoHeightForCenterPane(); DesignModuleFactory.getFormHierarchyPane().refreshRoot(); } //报表主体 From c3ce3949aaf88a55e6ca12b77970919ca4aefe96 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 27 Jul 2020 15:01:23 +0800 Subject: [PATCH 09/47] =?UTF-8?q?1.=E5=8E=9F=E6=9C=AC=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E9=87=8C=EF=BC=8CWARN=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=AF=B9=E5=BA=94=E4=B8=A5=E9=87=8D=EF=BC=8CERROR?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=AF=B9=E5=BA=94=E8=AD=A6=E5=91=8A=202.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=EF=BC=8CERROR=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E4=B8=A5=E9=87=8D=EF=BC=8CWARN=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=AF=B9=E5=BA=94=E8=AD=A6=E5=91=8A=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E7=9A=84=E4=BF=AE=E6=94=B9=E5=85=B6=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E5=92=8C=E8=AE=A1=E6=95=B0=203.=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=B8=B8=E9=87=8F=EF=BC=8C=E4=BD=BF=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=9B=B4=E7=AC=A6=E5=90=88=E5=B8=86=E8=BD=AF=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loghandler/DesignerLogHandler.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index b935eb11ea..1d67c47df1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -8,6 +8,7 @@ import com.fr.design.ui.util.UIUtil; import com.fr.general.ComparatorUtils; import com.fr.general.log.Log4jConfig; import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.third.apache.log4j.spi.ThrowableInformation; @@ -53,12 +54,14 @@ public class DesignerLogHandler { private static final int SERVER_GAP_Y = -20; - private static final String ERROR_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":"; + private static final String ERROR_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + ":"; - private static final String WARN_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + ":"; + private static final String WARN_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":"; private static final String NORMAL_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Normal") + ":"; + private static final String ACTION_MAP_KEY = "clear"; + public static DesignerLogHandler getInstance() { return HOLDER.singleton; @@ -223,14 +226,14 @@ public class DesignerLogHandler { InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction); - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear"); + inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), ACTION_MAP_KEY); ActionMap actionMap = resultPane.getActionMap(); - actionMap.put("clear", new AbstractAction() { + actionMap.put(ACTION_MAP_KEY, new AbstractAction() { @Override public void actionPerformed(ActionEvent evt) { - resultPane.setText(""); + resultPane.setText(StringUtils.EMPTY); caption.clearMessage(); } }); @@ -293,10 +296,10 @@ public class DesignerLogHandler { SimpleAttributeSet attrSet = new SimpleAttributeSet(); if (style == DesignerLogger.ERROR_INT) { - StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); + StyleConstants.setForeground(attrSet, Color.RED); StyleConstants.setBold(attrSet, true); } else if (style == DesignerLogger.WARN_INT) { - StyleConstants.setForeground(attrSet, Color.red); + StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); StyleConstants.setBold(attrSet, true); } else if (style == DesignerLogger.INFO_INT) { StyleConstants.setForeground(attrSet, Color.black); @@ -330,9 +333,9 @@ public class DesignerLogHandler { LogMessageBar.getInstance().setMessage(message); if (level == DesignerLogger.INFO_INT && showInfo.isSelected()) { caption.infoAdd(); - } else if (level == DesignerLogger.ERROR_INT && showError.isSelected()) { + } else if (level == DesignerLogger.WARN_INT && showError.isSelected()) { caption.errorAdd(); - } else if (level == DesignerLogger.WARN_INT && showServer.isSelected()) { + } else if (level == DesignerLogger.ERROR_INT && showServer.isSelected()) { caption.serverAdd(); } } @@ -343,7 +346,7 @@ public class DesignerLogHandler { this.copy.setEnabled(true); this.clear.setEnabled(true); - if (ComparatorUtils.equals(this.jTextArea.getText(), "")) { + if (ComparatorUtils.equals(this.jTextArea.getText(), StringUtils.EMPTY)) { this.selectAll.setEnabled(false); this.clear.setEnabled(false); } @@ -367,7 +370,7 @@ public class DesignerLogHandler { } else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.copy.getText())) { LogHandlerArea.this.jTextArea.copy(); } else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.clear.getText())) { - LogHandlerArea.this.jTextArea.setText(""); + LogHandlerArea.this.jTextArea.setText(StringUtils.EMPTY); caption.clearMessage(); } } From 975f4c6a3addac55a34eae4359e805c91930994e Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 27 Jul 2020 19:53:57 +0800 Subject: [PATCH 10/47] =?UTF-8?q?REPORT-35544=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E5=88=87=E6=8D=A2=E5=88=B0=E9=9F=A9=E6=96=87?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/iprogressbar/ProgressDialog.java | 5 +++++ .../fr/start/server/FineEmbedServerMonitor.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index e416083f73..6d10b48e56 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -96,4 +96,9 @@ public class ProgressDialog extends UIDialog { public void updateLoadingText(String text) { this.text.setText(text); } + + public void updateLoadingText(String text, FRFont font) { + this.text.setFont(font); + this.text.setText(text); + } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 0783721832..6bab19fded 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -7,7 +7,11 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.general.FRFont; +import com.fr.general.GeneralContext; +import javax.swing.plaf.ColorUIResource; +import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -86,8 +90,14 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - DesignerContext.getDesignerFrame().getProgressDialog() - .updateLoadingText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server")); + String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + //如果为韩文则改变字体 + if (GeneralContext.getLocale().equals(Locale.KOREA)) { + FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); + } else { + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); + } } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 4644b3d208f2b2739943a12327b042617f7e1867 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 27 Jul 2020 19:57:42 +0800 Subject: [PATCH 11/47] =?UTF-8?q?REPORT-35568=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=EF=BC=8C=E6=92=A4=E9=94=80=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E4=B8=80=E4=B8=AA=E8=93=9D=E8=89=B2=E7=9A=84?= =?UTF-8?q?=E6=A1=86=E7=BA=BF=20=20=E6=92=A4=E5=9B=9E=E5=8F=A6=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E4=BB=BB=E5=8A=A1=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/iprogressbar/ProgressDialog.java | 5 ----- .../fr/start/server/FineEmbedServerMonitor.java | 14 ++------------ 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index 6d10b48e56..e416083f73 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -96,9 +96,4 @@ public class ProgressDialog extends UIDialog { public void updateLoadingText(String text) { this.text.setText(text); } - - public void updateLoadingText(String text, FRFont font) { - this.text.setFont(font); - this.text.setText(text); - } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 6bab19fded..0783721832 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -7,11 +7,7 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; -import com.fr.general.FRFont; -import com.fr.general.GeneralContext; -import javax.swing.plaf.ColorUIResource; -import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -90,14 +86,8 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); - //如果为韩文则改变字体 - if (GeneralContext.getLocale().equals(Locale.KOREA)) { - FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); - } else { - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); - } + DesignerContext.getDesignerFrame().getProgressDialog() + .updateLoadingText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server")); } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 4ef4c4879589597d802cff088662de3376bf20ed Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 28 Jul 2020 10:04:32 +0800 Subject: [PATCH 12/47] =?UTF-8?q?REPORT-35544=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E5=88=87=E6=8D=A2=E5=88=B0=E9=9F=A9=E6=96=87?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/iprogressbar/ProgressDialog.java | 5 +++++ .../fr/start/server/FineEmbedServerMonitor.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index e416083f73..6d10b48e56 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -96,4 +96,9 @@ public class ProgressDialog extends UIDialog { public void updateLoadingText(String text) { this.text.setText(text); } + + public void updateLoadingText(String text, FRFont font) { + this.text.setFont(font); + this.text.setText(text); + } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 0783721832..6bab19fded 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -7,7 +7,11 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.general.FRFont; +import com.fr.general.GeneralContext; +import javax.swing.plaf.ColorUIResource; +import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -86,8 +90,14 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - DesignerContext.getDesignerFrame().getProgressDialog() - .updateLoadingText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server")); + String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + //如果为韩文则改变字体 + if (GeneralContext.getLocale().equals(Locale.KOREA)) { + FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); + } else { + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); + } } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 60e2a8b2bf8b94fa1e61db4a37a7e926c4d73dba Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 28 Jul 2020 11:42:35 +0800 Subject: [PATCH 13/47] =?UTF-8?q?REPORT-31992=20=E6=97=A5=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=201.=E9=80=9A=E8=BF=87=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEborder=E6=95=B0=E6=8D=AE=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=97=B4=E8=B7=9D=EF=BC=8C=E4=BD=BF=E5=BE=97?= =?UTF-8?q?=E8=A2=AB=E6=8C=A4=E5=87=BA=E7=95=8C=E9=9D=A2=E7=9A=84=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=A1=86=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA=202.?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BA=86=E6=AF=8F=E7=A7=8D=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E4=B8=8B=E7=9A=84bug=E6=89=80=E5=9C=A8=E7=9A=84=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=8F=91=E7=8E=B0=E6=94=B9=E5=8A=A8=E5=B9=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=BC=95=E8=B5=B7=E5=85=B6=E5=AE=83=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/hyperlink/ReportletHyperNorthPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index 43710cd0f2..8355d4f97f 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -395,7 +395,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane Date: Tue, 28 Jul 2020 11:50:15 +0800 Subject: [PATCH 14/47] =?UTF-8?q?REPORT-31758=20=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E8=BF=9B=E8=A1=8C=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/JFormSliderPane.java | 332 +++++------------- .../layout/FRBorderLayoutAdapter.java | 15 +- .../fr/design/designer/creator/XButton.java | 23 +- .../fr/design/designer/creator/XCreator.java | 9 + .../fr/design/designer/creator/XLabel.java | 6 +- .../designer/creator/XWAbsoluteLayout.java | 16 + .../designer/creator/XWBorderLayout.java | 56 ++- .../design/designer/creator/XWFitLayout.java | 86 +++-- .../creator/cardlayout/XCardSwitchButton.java | 6 +- .../creator/cardlayout/XWCardTagLayout.java | 2 - .../creator/cardlayout/XWTabFitLayout.java | 83 ++--- .../com/fr/design/mainframe/FormArea.java | 155 ++++---- .../com/fr/design/mainframe/FormDesigner.java | 6 +- .../fr/design/mainframe/FormSelection.java | 9 +- .../component/WidgetAbsoluteBoundPane.java | 14 +- .../designer/component/WidgetBoundPane.java | 29 +- .../component/WidgetCardTagBoundPane.java | 24 +- 17 files changed, 394 insertions(+), 477 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java index 1552d1b658..c47267897f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java @@ -1,45 +1,27 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ibutton.UIRadioButton; -import com.fr.design.gui.ibutton.UISliderButton; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.islider.UISlider; -import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; - - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.JFormattedTextField; import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JRadioButton; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import javax.swing.text.DefaultFormatterFactory; -import javax.swing.text.NumberFormatter; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.PlainDocument; import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Component; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.FlowLayout; -import java.awt.Font; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.math.BigDecimal; @@ -51,72 +33,37 @@ public class JFormSliderPane extends JPanel { private static final double ONEPOINTEIGHT = 1.8; private static final int SIX = 6; private static final int TEN = 10; - private static final int ONE_EIGHT = 18; - private static final int FONT_SIZE = 12; - private static final int SPINNER_WIDTH = 45; - private static final int SPINNER_HEIGHT = 20; private static final int HALF_HUNDRED = 50; private static final int HUNDRED = 100; private static final int TWO_HUNDRED = 200; - private static final int THREE_HUNDRED = 300; private static final int FOUR_HUNDRED = 400; - private static final int DIALOG_WIDTH = 157; - private static final int DIALOG_HEIGHT = 172; - private static final int SLIDER_WIDTH = 220; - private static final int SLIDER_HEIGHT = 20; private static final int SHOWVALBUTTON_WIDTH = 40; private static final int SHOWVALBUTTON_HEIGHTH = 20; - private static final int SLIDER_GAP = 5; + private static final String SUFFIX = "%"; + private static final String REGEX = "[\\d%]*"; private static final int TOOLTIP_Y = 30; private static final Color BACK_COLOR = new Color(245, 245, 247); public int showValue = 100; - public double resolutionTimes = 1.0; - private UITextField showVal; - private JSpinner showValSpinner; + private UITextField showValField; private UISlider slider; private int times; private int sliderValue; private UIButton downButton; private UIButton upButton; - private UISliderButton showValButton; - private UIRadioButton twoHundredButton; - private UIRadioButton oneHundredButton; - private UIRadioButton sevenFiveButton; - private UIRadioButton fiveTenButton; - private UIRadioButton twoFiveButton; - private UIRadioButton selfAdaptButton; - private UIRadioButton customButton; //拖动条处理和button、直接输入不一样 private boolean isButtonOrIsTxt = true; - //是否选中指定的几个缩放等级,避免触发不必要的事件 - private boolean selectSpecified = false; - private FormPopupPane dialog; - private int upButtonX; - private JPanel dialogContentPanel; public JFormSliderPane() { this.setLayout(new BorderLayout()); initSlider(); - initShowValSpinner(); - //MoMeak:控制只能输入10-400 - JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0"); - showValSpinner.setEditor(editor); - JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); - textField.setEditable(true); - DefaultFormatterFactory factory = (DefaultFormatterFactory) textField.getFormatterFactory(); - NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter(); - formatter.setAllowsInvalid(false); - initDownUpButton(); - initShowValButton(); - initUIRadioButton(); - initPane(); + initShowValField(); JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); panel.add(downButton); panel.add(slider); panel.add(upButton); - panel.add(showValButton); + panel.add(showValField); panel.setBackground(BACK_COLOR); this.add(panel, BorderLayout.NORTH); } @@ -131,6 +78,7 @@ public class JFormSliderPane extends JPanel { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } }; + slider.setValue(HALF_HUNDRED); slider.setUI(new JSliderPaneUI(slider)); slider.addChangeListener(listener); slider.setPreferredSize(new Dimension(220, 20)); @@ -139,16 +87,6 @@ public class JFormSliderPane extends JPanel { slider.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Slider")); } - private void initShowValSpinner() { - showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)) { - public Point getToolTipLocation(MouseEvent event) { - return new Point(event.getX(), event.getY() - TOOLTIP_Y); - } - }; - showValSpinner.setEnabled(true); - showValSpinner.addChangeListener(showValSpinnerChangeListener); - showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT)); - } private void initDownUpButton() { downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")) { @@ -173,128 +111,73 @@ public class JFormSliderPane extends JPanel { upButton.addActionListener(buttonActionListener); } - private void initShowValButton() { - showValButton = new UISliderButton(showValSpinner.getValue() + "%"); - showValButton.setBackground(BACK_COLOR); - showValButton.setBorderPainted(false); - showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); - showValButton.addActionListener(showValButtonActionListener); - showValButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Grade")); - } + private void initShowValField() { + showValField = new UITextField(showValue + SUFFIX); + showValField.setBorderPainted(false); + showValField.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); + showValField.addKeyListener(new KeyListener() { + @Override + public void keyTyped(KeyEvent e) { + + } + + @Override + public void keyPressed(KeyEvent e) { + + } - private void initUIRadioButton() { - twoHundredButton = new UIRadioButton("200%"); - oneHundredButton = new UIRadioButton("100%"); - sevenFiveButton = new UIRadioButton("75%"); - fiveTenButton = new UIRadioButton("50%"); - twoFiveButton = new UIRadioButton("25%"); - selfAdaptButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Self_Adapt_Button")); - selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); - customButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Custom_Button")); - customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); - twoHundredButton.addItemListener(radioButtonItemListener); - oneHundredButton.addItemListener(radioButtonItemListener); - sevenFiveButton.addItemListener(radioButtonItemListener); - fiveTenButton.addItemListener(radioButtonItemListener); - twoFiveButton.addItemListener(radioButtonItemListener); - customButton.addItemListener(new ItemListener() { @Override - public void itemStateChanged(ItemEvent e) { - JRadioButton temp = (JRadioButton) e.getSource(); - if (temp.isSelected()) { - JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); - textField.requestFocus(); - textField.selectAll(); + public void keyReleased(KeyEvent evt) { + int code = evt.getKeyCode(); + + if (code == KeyEvent.VK_ENTER) { + showValue = parseInputValue(); + showValField.setText(showValue + SUFFIX); + showValFieldChange(); + } + } + }); + showValField.setDocument(new PlainDocument() { + @Override + public void insertString(int offset, String s, AttributeSet a) throws BadLocationException { + if (!s.matches(REGEX)) { + return; } + super.insertString(offset, s, a); } }); - ButtonGroup bg = new ButtonGroup();// 初始化按钮组 - bg.add(twoHundredButton);// 加入按钮组 - bg.add(oneHundredButton); - bg.add(sevenFiveButton); - bg.add(fiveTenButton); - bg.add(twoFiveButton); - bg.add(selfAdaptButton); - bg.add(customButton); - customButton.setSelected(true); } - private void initPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p, p, p, p, p, p}; - UILabel upLabel = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce")); - upLabel.setOpaque(false); - JPanel septPane = new JPanel(new BorderLayout()); - JSeparator sept = new JSeparator(); - sept.setBackground(new Color(232, 232, 233)); - septPane.add(sept, BorderLayout.NORTH); - septPane.setBorder(BorderFactory.createEmptyBorder(2, 5, 1, 10)); - septPane.setBackground(BACK_COLOR); - twoHundredButton.setBackground(BACK_COLOR); - oneHundredButton.setBackground(BACK_COLOR); - sevenFiveButton.setBackground(BACK_COLOR); - fiveTenButton.setBackground(BACK_COLOR); - twoFiveButton.setBackground(BACK_COLOR); -// selfAdaptButton.setBackground(BACK_COLOR); - customButton.setBackground(BACK_COLOR); - Component[][] components = new Component[][]{ - new Component[]{upLabel, null}, - new Component[]{septPane, null}, - new Component[]{twoHundredButton, null}, - new Component[]{oneHundredButton, null}, - new Component[]{sevenFiveButton, null}, - new Component[]{fiveTenButton, null}, - new Component[]{twoFiveButton, null}, - new Component[]{customButton, createSpinnerPanel()} - }; - dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); - dialogContentPanel.setBackground(BACK_COLOR); - dialogContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + private void showValFieldChange() { + isButtonOrIsTxt = true; + if (showValue > FOUR_HUNDRED) { + showValue = FOUR_HUNDRED; + } + if (showValue < TEN) { + showValue = TEN; + } + refreshShowValueFieldText(); + refreshSlider(); } - private JPanel createSpinnerPanel() { - JPanel spinnerPanel = new JPanel(new FlowLayout()); - spinnerPanel.add(showValSpinner); - UILabel percent = new UILabel("%"); - percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); - spinnerPanel.add(percent); - spinnerPanel.setBackground(BACK_COLOR); - return spinnerPanel; + private void refreshShowValueFieldText(){ + showValField.setText(showValue + SUFFIX); } - private ActionListener showValButtonActionListener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - popupDialog(); + private int parseInputValue(){ + String text = showValField.getText(); + if (text.endsWith(SUFFIX)){ + text = text.substring(0, text.length() -1); } - }; - - private ChangeListener showValSpinnerChangeListener = new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - int val = (int) ((UIBasicSpinner) e.getSource()).getValue(); - isButtonOrIsTxt = true; - resolutionTimes = divide(showValue, 100, 2); - if (val > FOUR_HUNDRED) { - showValSpinner.setValue(FOUR_HUNDRED); - val = FOUR_HUNDRED; - } - if (val < TEN) { - showValSpinner.setValue(TEN); - val = TEN; - } - refreshSlider(val); - refreshBottun(val); - JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); - textField.setCaretPosition(showValSpinner.getValue().toString().length()); - if (!selectSpecified) { - customButton.setSelected(true); - } + try{ + return Integer.parseInt(text); + }catch (NumberFormatException e){ + return HUNDRED; } - }; + + } + //定义一个监听器,用于监听所有滑动条 @@ -302,13 +185,12 @@ public class JFormSliderPane extends JPanel { public void stateChanged(ChangeEvent event) { //取出滑动条的值,并在文本中显示出来 if (!isButtonOrIsTxt) { - customButton.setSelected(true); EventQueue.invokeLater(new Runnable() { public void run() { sliderValue = slider.getValue(); getTimes(sliderValue); showValue = times; - showValSpinner.setValue(times); + refreshShowValueFieldText(); } }); } else { @@ -317,20 +199,8 @@ public class JFormSliderPane extends JPanel { } }; - private ItemListener radioButtonItemListener = new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - JRadioButton temp = (JRadioButton) e.getSource(); - if (temp.isSelected()) { - selectSpecified = true; - showValSpinner.setValue(Integer.valueOf(temp.getText().substring(0, temp.getText().indexOf("%")))); - selectSpecified = false; - } - } - }; - private void refreshSlider(int val) { - showValue = val; + private void refreshSlider() { if (showValue > HUNDRED) { slider.setValue((int) (showValue + TWO_HUNDRED) / SIX); } else if (showValue < HUNDRED) { @@ -341,18 +211,6 @@ public class JFormSliderPane extends JPanel { } - private void refreshBottun(int val) { - showValButton.setText(val + "%"); - } - - public double getResolutionTimes() { - return this.resolutionTimes; - } - - public int getshowValue() { - return this.showValue; - } - public static double divide(double v1, double v2, int scale) { BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); @@ -362,30 +220,28 @@ public class JFormSliderPane extends JPanel { private ActionListener buttonActionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - showValue = (int) showValSpinner.getValue(); isButtonOrIsTxt = true; if ("less".equals(e.getActionCommand())) { int newDownVal = showValue - TEN; if (newDownVal >= TEN) { showValue = newDownVal; - showValSpinner.setValue(newDownVal); } else { - showValue = newDownVal; - showValSpinner.setValue(TEN); + showValue = TEN; } + refreshShowValueFieldText(); + refreshSlider(); } if ("more".equals(e.getActionCommand())) { int newUpVal = showValue + TEN; if (newUpVal <= FOUR_HUNDRED) { showValue = newUpVal; - showValSpinner.setValue(newUpVal); } else { - showValue = newUpVal; - showValSpinner.setValue(FOUR_HUNDRED); + showValue = TEN; } + refreshShowValueFieldText(); + refreshSlider(); } isButtonOrIsTxt = true; - customButton.setSelected(true); } }; @@ -396,37 +252,26 @@ public class JFormSliderPane extends JPanel { } else if (value < HALF_HUNDRED) { times = (int) Math.round(ONEPOINTEIGHT * value + TEN); } else { - times = (int) (SIX * value - TWO_HUNDRED); + times = SIX * value - TWO_HUNDRED; } } - public JSpinner getShowVal() { - return this.showValSpinner; + public int getShowValue() { + return this.showValue; } - public UIRadioButton getSelfAdaptButton() { - return this.selfAdaptButton; + public void setShowValue(int value) { + showValue = value; + showValFieldChange(); } - private void popupDialog() { - Point btnCoords = upButton.getLocationOnScreen(); - if (dialog == null) { - dialog = new FormPopupPane(upButton, dialogContentPanel); - if (upButtonX == 0) { - upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); - } - } else { - if (upButtonX == 0) { - upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); - } else { - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); - } - } + + public void addValueChangeListener(ChangeListener changeListener){ + this.slider.addChangeListener(changeListener); } + public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -440,16 +285,3 @@ public class JFormSliderPane extends JPanel { } } - -class FormPopupPane extends JPopupMenu { - private static final int DIALOG_WIDTH = 157; - private static final int DIALOG_HEIGHT = 172; - - FormPopupPane(UIButton b, JPanel dialogContentPanel) { - this.add(dialogContentPanel, BorderLayout.CENTER); - this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); - this.setBackground(new Color(245, 245, 247)); - } - - -} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBorderLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBorderLayoutAdapter.java index d010bad9a3..d1a5951ccb 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBorderLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBorderLayoutAdapter.java @@ -35,18 +35,19 @@ public class FRBorderLayoutAdapter extends AbstractLayoutAdapter { * @param creator 组件 */ public void fix(XCreator creator) { - FRBorderLayout layout = (FRBorderLayout)container.getFRLayout(); + FRBorderLayout layout = (FRBorderLayout) container.getFRLayout(); Object constraints = layout.getConstraints(creator); + double scale = container.getScale(); if (ComparatorUtils.equals(constraints, BorderLayout.NORTH)) { - ((XWBorderLayout)container).toData().setNorthSize(creator.getHeight()); + ((XWBorderLayout) container).toData().setNorthSize((int) (creator.getHeight() / scale)); } else if (ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) { - ((XWBorderLayout)container).toData().setSouthSize(creator.getHeight()); + ((XWBorderLayout) container).toData().setSouthSize((int) (creator.getHeight() / scale)); } else if (ComparatorUtils.equals(constraints, BorderLayout.EAST)) { - ((XWBorderLayout)container).toData().setEastSize(creator.getWidth()); + ((XWBorderLayout) container).toData().setEastSize((int) (creator.getWidth() / scale)); } else if (ComparatorUtils.equals(constraints, BorderLayout.WEST)) { - ((XWBorderLayout)container).toData().setWestSize(creator.getWidth()); + ((XWBorderLayout) container).toData().setWestSize((int) (creator.getWidth() / scale)); } else { - return; + return; } container.recalculateChildrenPreferredSize(); } @@ -185,4 +186,4 @@ public class FRBorderLayoutAdapter extends AbstractLayoutAdapter { return new FRBorderLayoutConstraints(container, creator); } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java index 44996df8cd..9dc7b7de9d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java @@ -147,7 +147,7 @@ public class XButton extends XWidgetCreator { public void propertyChange() { FreeButton button = (FreeButton) data; if (button.getFont() != null) { - contentLabel.setFont(button.getFont().applyResolutionNP( + setContentLabelFont(button.getFont().applyResolutionNP( FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } @@ -230,7 +230,7 @@ public class XButton extends XWidgetCreator { if (!button.isCustomStyle()) { l.setBorder(BorderFactory.createLineBorder(new Color(148, 148, 148))); bg = DEFAULTBG; - contentLabel.setFont(DEFAULTFT); + setContentLabelFont(DEFAULTFT); contentLabel.setForeground(DEFAULTFOREGROUNDCOLOR); editor.setLayout(new BorderLayout()); editor.add(l, BorderLayout.CENTER); @@ -239,7 +239,7 @@ public class XButton extends XWidgetCreator { editor.setLayout(new BorderLayout()); editor.add(l,BorderLayout.CENTER); if (button.getFont() != null) { - contentLabel.setFont(button.getFont().applyResolutionNP( + setContentLabelFont(button.getFont().applyResolutionNP( FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } @@ -302,11 +302,26 @@ public class XButton extends XWidgetCreator { setButtonText(button.getText()); checkButonType(); if (button.getFont() != null) { - contentLabel.setFont(button.getFont().applyResolutionNP( + setContentLabelFont(button.getFont().applyResolutionNP( FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } } + private void setContentLabelFont(Font font) { + float size = (float) (font.getSize() * getScale()); + contentLabel.setFont(font.deriveFont(size)); + } + + public void setScale(double scale){ + super.setScale(scale); + FreeButton button = (FreeButton) data; + if (button.getFont() != null) { + setContentLabelFont(button.getFont().applyResolutionNP( + FontTransformUtil.getDesignerFontResolution())); + }else { + setContentLabelFont(DEFAULTFT); + } + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index dcb6938836..0df6abaf16 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -49,6 +49,7 @@ import java.util.Set; * */ public abstract class XCreator extends JPanel implements XComponent, XCreatorTools { + private double scale = 1.0; protected static final Border DEFALUTBORDER = BorderFactory.createLineBorder(new Color(210, 210, 210), 1); public static final Dimension SMALL_PREFERRED_SIZE = new Dimension(80, 21); @@ -102,6 +103,14 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } } + public double getScale() { + return scale; + } + + public void setScale(double scale) { + this.scale = scale; + } + /** * 初始化组件大小 */ diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java b/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java index df2252c7af..705ecae5c0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java @@ -17,6 +17,7 @@ import com.fr.design.mainframe.widget.renderer.LabelHorizontalAlignmentRenderer; import com.fr.form.ui.Label; import com.fr.form.ui.container.WParameterLayout; +import com.fr.general.FRFont; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; import com.fr.stable.core.PropertyChangeAdapter; @@ -94,8 +95,11 @@ public class XLabel extends XWidgetCreator { } if (label.getWidgetValue() != null) { Graphics2D g2d = (Graphics2D) g.create(); + FRFont font = label.getFont(); + float fontsize = (float) (font.getSize() * this.getScale()); BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), label.getWidgetValue() - .toString(), Style.getInstance(label.getFont()).deriveHorizontalAlignment(label.getTextalign()) + .toString(), Style.getInstance(font.applySize(fontsize)) + .deriveHorizontalAlignment(label.getTextalign()) .deriveVerticalAlignment(label.isVerticalCenter() ? SwingConstants.CENTER : SwingConstants.TOP) .deriveTextStyle(label.isWrap() ? Style.TEXTSTYLE_WRAPTEXT : Style.TEXTSTYLE_SINGLELINE), FontTransformUtil.getDesignerFontResolution()); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 7c852f2820..faf544f3b1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -30,6 +30,8 @@ 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.WParameterLayout; +import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.FRScreen; import com.fr.general.IOUtils; @@ -397,6 +399,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { return; } XWidgetCreator creator = (XWidgetCreator) e.getChild(); + creator.setScale(this.getScale()); WAbsoluteLayout wabs = this.toData(); if (!creator.acceptType(XWFitLayout.class)) { creator.setDirections(Direction.ALL); @@ -602,4 +605,17 @@ public class XWAbsoluteLayout extends XLayoutContainer { return super.getWidgetPropertyUIProviders(); } } + + public void adjustCompSize(double percent) { + double p = percent + 1; + WAbsoluteLayout absoluteLayout = this.toData(); + for (int i = 0; i < this.getComponentCount(); i++) { + XCreator component = (XCreator) this.getComponent(i); + CRBoundsWidget boundsWidget = absoluteLayout.getBoundsWidget(component.toData()); + Rectangle rec = new Rectangle(boundsWidget.getBounds()); + component.adjustCompSize(percent); + component.setBounds((int) (rec.x * p), (int) (rec.y * p), (int) (rec.width * p), (int) (rec.height * p)); + } + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java index 6d2003e21c..c65421696e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java @@ -126,14 +126,14 @@ public class XWBorderLayout extends XLayoutContainer { WBorderLayout wlayout = this.toData(); Object constraints = wlayout.getConstraints(wgt); Dimension d = new Dimension(); - if (ComparatorUtils.equals(WBorderLayout.NORTH,constraints)) { - d.height = wlayout.getNorthSize(); - } else if (ComparatorUtils.equals(WBorderLayout.SOUTH,constraints)) { - d.height = wlayout.getSouthSize(); - } else if (ComparatorUtils.equals(WBorderLayout.EAST,constraints)) { - d.width = wlayout.getEastSize(); - } else if (ComparatorUtils.equals(WBorderLayout.WEST,constraints)) { - d.width = wlayout.getWestSize(); + if (ComparatorUtils.equals(WBorderLayout.NORTH, constraints)) { + d.height = (int) (wlayout.getNorthSize() * getScale()); + } else if (ComparatorUtils.equals(WBorderLayout.SOUTH, constraints)) { + d.height = (int) (wlayout.getSouthSize() * getScale()); + } else if (ComparatorUtils.equals(WBorderLayout.EAST, constraints)) { + d.width = (int) (wlayout.getEastSize() * getScale()); + } else if (ComparatorUtils.equals(WBorderLayout.WEST, constraints)) { + d.width = (int) (wlayout.getWestSize() * getScale()); } return d; } @@ -203,8 +203,40 @@ public class XWBorderLayout extends XLayoutContainer { } } - @Override - public LayoutAdapter getLayoutAdapter() { - return new FRBorderLayoutAdapter(this); - } + @Override + public LayoutAdapter getLayoutAdapter() { + return new FRBorderLayoutAdapter(this); + } + + + /** + * 自适应布局的缩放 + * + * @param percent 百分比 + */ + public void adjustCompSize(double percent) { + for (int i = 0; i < this.getComponentCount(); i++) { + XCreator creator = this.getXCreator(i); + WBorderLayout wlayout = this.toData(); + Object constraints = wlayout.getConstraints(creator.toData()); + if (ComparatorUtils.equals(BorderLayout.NORTH, constraints)) { + int northSize = (int) (this.toData().getNorthSize() * this.getScale()); + Dimension dim = creator.getSize(); + creator.setPreferredSize(new Dimension(dim.width, northSize)); + } else if (ComparatorUtils.equals(BorderLayout.SOUTH, constraints)) { + int southSize = (int) (this.toData().getSouthSize() * this.getScale()); + Dimension dim = creator.getSize(); + creator.setPreferredSize(new Dimension(dim.width, southSize)); + } else if (ComparatorUtils.equals(BorderLayout.EAST, constraints)) { + int eastSize = (int) (this.toData().getEastSize() * this.getScale()); + Dimension dim = creator.getSize(); + creator.setPreferredSize(new Dimension(eastSize, dim.height)); + } else if (ComparatorUtils.equals(BorderLayout.WEST, constraints)) { + int westSize = (int) (this.toData().getWestSize() * this.getScale()); + Dimension dim = creator.getSize(); + creator.setPreferredSize(new Dimension(westSize, dim.height)); + } + } + } } + diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 352899bcbb..2376ecc94a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -18,6 +18,7 @@ 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.CRBoundsWidget; import com.fr.general.FRLogger; import com.fr.general.FRScreen; import com.fr.stable.ArrayUtils; @@ -129,6 +130,7 @@ public class XWFitLayout extends XLayoutContainer { } } + /** * 直接拖动滑条改变整体像素大小时,不用考虑控件的最小高度宽度,内部组件全部一起缩小放大 * 只是界面显示大小改变,不改变对应的BoundsWidget大小 @@ -137,32 +139,28 @@ public class XWFitLayout extends XLayoutContainer { public void adjustCreatorsWhileSlide(double percent) { int count = this.getComponentCount(); if (count == 0) { - Dimension size = new Dimension(this.getSize()); - size.width += size.width*percent; - size.height += size.height*percent; + Dimension size = new Dimension(this.toData().getContentWidth(), this.toData().getContentHeight()); + size.width += size.width * percent; + size.height += size.height * percent; this.setSize(size); return; } - // 初始化时还未加间隔 - if (hasCalGap) { - moveContainerMargin(); - moveCompInterval(backupGap); - LayoutUtils.layoutContainer(this); - } int containerW = 0; int containerH = 0; - int[] hors = getHors(false); - int[] veris = getVeris(false); - PaddingMargin margin = toData().getMargin(); - for (int i=0; i posX = new ArrayList(); + // 保存实际大小时,组件大小已经去除内边距,此处也判断下 + posX.add(0); + int width = this.toData().getContainerWidth(); + posX.add(width); + for (int i = 0, len = this.toData().getWidgetCount(); i < len; i++) { + CRBoundsWidget widget = (CRBoundsWidget) this.toData().getWidget(i); + Rectangle rec = widget.getBounds(); + if (!posX.contains(rec.x)) { + posX.add(rec.x); + } + } + Collections.sort(posX); + return ArrayUtils.toPrimitive(posX.toArray(new Integer[]{posX.size()})); + } + + + public int[] getDataVeris() { + List posY = new ArrayList(); + // 保存实际大小时,组件大小已经去除内边距,此处也判断下 + posY.add(0); + int height = this.toData().getContainerHeight(); + posY.add(height); + for (int i = 0, len = this.toData().getWidgetCount(); i < len; i++) { + CRBoundsWidget boundsWidget = (CRBoundsWidget) this.toData().getWidget(i); + Rectangle rec = boundsWidget.getBounds(); + if (!posY.contains(rec.y)) { + posY.add(rec.y); + } + } + Collections.sort(posY); + return ArrayUtils.toPrimitive(posY.toArray(new Integer[]{posY.size()})); + } + /** * 获取内部组件纵坐标值 * @param isActualSize 实际大小 @@ -290,6 +321,7 @@ public class XWFitLayout extends XLayoutContainer { return ArrayUtils.toPrimitive(posY.toArray(new Integer[]{posY.size()})); } + /** * 是否能缩小 * @param percent 百分比 @@ -860,12 +892,14 @@ public class XWFitLayout extends XLayoutContainer { } super.add(comp, constraints); XCreator creator = (XCreator) comp; + creator.setScale(this.getScale()); dealDirections(creator, false); } private void add(Component comp, Object constraints, boolean isInit) { super.add(comp, constraints); XCreator creator = (XCreator) comp; + creator.setScale(this.getScale()); dealDirections(creator, isInit); } @@ -1331,4 +1365,14 @@ public class XWFitLayout extends XLayoutContainer { } } } + + /** + * 自适应布局的缩放 + * + * @param percent 百分比 + */ + @Override + public void adjustCompSize(double percent) { + this.adjustCreatorsWhileSlide(percent); + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index f0e23b977f..92d91dd732 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -237,6 +237,7 @@ public class XCardSwitchButton extends XButton { layout.setIndex(--tabFitIndex); } } + tagLayout.setTabsAndAdjust(); } @@ -337,7 +338,8 @@ public class XCardSwitchButton extends XButton { String titleText = button.getText(); this.setButtonText(titleText); FRFont font = widgetTitle.getFrFont(); - FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST); + int fontsize = font.getSize() + FONT_SIZE_ADJUST; + FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(), (float) (fontsize * getScale())); UILabel label = this.getContentLabel(); label.setFont(newFont); label.setForeground(font.getForeground()); @@ -459,7 +461,7 @@ public class XCardSwitchButton extends XButton { TitlePacker title = getWidgetTitle(); FRFont font = title.getFrFont(); int fontSize = font.getSize() + FONT_SIZE_ADJUST; - FRFont newFont = FRFont.getInstance(font.getName(), font.getStyle(), fontSize); + FRFont newFont = FRFont.getInstance(font.getName(), font.getStyle(), (float) (fontSize * getScale())); FontMetrics fm = GraphHelper.getFontMetrics(newFont); for (int i = 0; i < titleText.length(); i++) { titleStringBuf.append(titleText.charAt(i)); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java index dc8bb90801..0f141e7634 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java @@ -290,7 +290,6 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { @Override public void doLayout() { - setTabsAndAdjust(); //设置布局 super.doLayout(); } @@ -382,7 +381,6 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { } else { adjustTabsV(parent, tabLength, cardWidth, cardHeight); } - fixTitleLayout(parent); } public void adjustTabsH(XLayoutContainer parent, int tabLength, Map width, Map height) { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index 508f3f7dfa..e87e30b5f1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -8,15 +8,11 @@ import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; -import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; -import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; -import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormHierarchyTreePane; -import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.editors.ButtonTypeEditor; import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.utils.gui.LayoutUtils; @@ -44,7 +40,7 @@ import java.beans.IntrospectionException; * @date 2014-6-23 */ public class XWTabFitLayout extends XWFitLayout { - + private static final int MIN_SIZE = 0; private static final int WIDTH_SIDE_OFFSET = 57; @@ -101,7 +97,7 @@ public class XWTabFitLayout extends XWFitLayout { public XWTabFitLayout(){ this(new WTabFitLayout(), new Dimension()); } - + public XWTabFitLayout(WTabFitLayout widget, Dimension initSize) { super(widget, initSize); } @@ -252,13 +248,13 @@ public class XWTabFitLayout extends XWFitLayout { public LayoutAdapter getLayoutAdapter() { return new FRTabFitLayoutAdapter(this); } - + /** * tab布局里删除XWTabFitLayout对应的tab按钮 - * + * * @param creator 当前组件 * @param designer 表单设计器 - * + * */ @Override public void deleteRelatedComponent(XCreator creator, FormDesigner designer){ @@ -288,15 +284,15 @@ public class XWTabFitLayout extends XWFitLayout { deleteTabLayout(mainLayout,designer); return; } - + //刷新tab按钮和tabFitLayout的index refreshIndex(tag,cardLayout,index); - + LayoutUtils.layoutRootContainer(designer.getRootComponent()); } - - + + private void deleteTabLayout(XLayoutContainer mainLayout, FormDesigner designer){ SelectionModel selectionModel = designer.getSelectionModel(); if(mainLayout != null){ @@ -323,7 +319,7 @@ public class XWTabFitLayout extends XWFitLayout { } } } - + /** * tab布局里切换到相应的tab按钮 * @param comp 当前组件 @@ -344,44 +340,37 @@ public class XWTabFitLayout extends XWFitLayout { button.setShowButton(button.getIndex()==index); } } - - + + /** * 寻找最近的为自适应布局的父容器 - * + * * @return 布局容器 - * + * * * @date 2014-12-30-下午3:15:28 - * + * */ @Override public XLayoutContainer findNearestFit(){ XLayoutContainer parent = this.getBackupParent(); return parent == null ? null : parent.findNearestFit(); - } - - /** - * 非顶层自适应布局的缩放 - * @param percent 百分比 - */ - @Override - public void adjustCompSize(double percent) { - this.adjustCreatorsWhileSlide(percent); - } - + } + + + /** * 该布局需要隐藏,无需对边框进行操作 * @param border 边框 - * + * */ public void setBorder(Border border) { return; } - + /** * 按照百分比缩放内部组件宽度 - * + * * @param percent 宽度变化的百分比 */ @Override @@ -397,7 +386,7 @@ public class XWTabFitLayout extends XWFitLayout { moveCompInterval(getAcualInterval()); updateCompsWidget(); } - layoutWidthResize(percent); + layoutWidthResize(percent); if (percent < 0 && this.getNeedAddWidth() > 0) { this.setSize(this.getWidth()+this.getNeedAddWidth(), this.getHeight()); modifyEdgemostCreator(true); @@ -410,8 +399,8 @@ public class XWTabFitLayout extends XWFitLayout { updateWidgetBackupBounds(); LayoutUtils.layoutContainer(this); } - - + + /** * 布局容器高度手动修改时, * 同时调整容器内的组件们,缩小时需要考虑有的组件高度不满足缩小高度 @@ -441,13 +430,13 @@ public class XWTabFitLayout extends XWFitLayout { updateWidgetBackupBounds(); LayoutUtils.layoutContainer(this); } - + @Override public XLayoutContainer getOuterLayout(){ XWCardLayout cardLayout = (XWCardLayout) this.getBackupParent(); return cardLayout.getBackupParent(); } - + // 更新内部组件的widget private void updateCompsWidget(){ for(int m=0;m SHOWVALMAX ? SHOWVALMAX : value; value = value < SHOWVALMIN ? SHOWVALMIN : value; - JForm jf = (JForm) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - jf.getFormDesign().setResolution((int) value); - jf.getFormDesign().getArea().resolution = (int) value; - reCalculateRoot(value, true); + scale((int) value); JTemplate form = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (form != null) { form.fireTargetModified(); @@ -214,6 +194,12 @@ public class FormArea extends JComponent implements ScrollRulerComponent { } }; + private void scale(int value){ + this.designer.setResolution(value); + this.designer.getArea().resolution = value; + reCalculateRoot(value, true); + } + /** * 返回当前的屏幕分辨率对应的百分比值 * @@ -238,7 +224,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent { this.screenValue = FRScreen.getDesignScreenByDimension(scrnsize).getValue(); XLayoutContainer root = FormArea.this.designer.getRootComponent(); // 7.1.1不放缩放滑块,但表单大小仍按屏幕分辨率调整 -// slidePane.populateBean(screenValue); if (root.acceptType(XWFitLayout.class)) { XWFitLayout layout = (XWFitLayout) root; if ( !AssistUtils.equals(screenValue, DEFAULT_SLIDER) ) { @@ -246,7 +231,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { } else { // 组件间隔啊 // REPORT-2585 原有的逻辑导致嵌套的tab中的间隔加不上去,会在后续拖动的过程中出问题 - reCalculateDefaultRoot(screenValue, true); + reCalculateDefaultRoot(); } } LayoutUtils.layoutContainer(root); @@ -366,16 +351,14 @@ public class FormArea extends JComponent implements ScrollRulerComponent { * 修改大小后,再根据屏幕分辨率调整下 */ private void doReCalculateRoot(int width, int height, XWFitLayout layout) { -// double value = slidePane.updateBean(); //重置滑块的值为默认值100 - START_VALUE = DEFAULT_SLIDER; if ( AssistUtils.equals(screenValue, DEFAULT_SLIDER) ) { layout.getParent().setSize(width, height + designer.getParaHeight()); - FormArea.this.validate(); } else { layout.setBackupGap(screenValue / DEFAULT_SLIDER); - reCalculateRoot(screenValue, false); } + reCalculateRoot(slidePane.getShowValue(), true); + } /** @@ -385,71 +368,60 @@ public class FormArea extends JComponent implements ScrollRulerComponent { * @param value */ private void reCalculateRoot(double value, boolean needCalculateParaHeight) { - if ( AssistUtils.equals(value, START_VALUE) ) { - return; - } - double percent = (value - START_VALUE) / START_VALUE; + double percent = (value - DEFAULT_SLIDER) / DEFAULT_SLIDER; + double scale = value / DEFAULT_SLIDER; XLayoutContainer root = FormArea.this.designer.getRootComponent(); if (root.acceptType(XWFitLayout.class)) { XWFitLayout layout = (XWFitLayout) root; - layout.setContainerPercent(value / DEFAULT_SLIDER); + layout.setContainerPercent(scale); + layout.adjustCompSize(percent); traverAndAdjust(layout, percent); - layout.adjustCreatorsWhileSlide(percent); - // 拖动滑块,先将内部组件百分比大小计算,再计算容器大小 - Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); + XWBorderLayout parent = (XWBorderLayout) layout.getParent(); + root.setScale(scale); + parent.setScale(scale); // 自适应布局的父层是border if (layout.getParent() != null) { - int paraHeight = designer.getParaHeight(); - if (needCalculateParaHeight && paraHeight > 0) { - designer.setParaHeight(paraHeight); - XWBorderLayout parent = (XWBorderLayout) layout.getParent(); - parent.toData().setNorthSize(paraHeight); + int paraHeight = parent.toData().getNorthSize(); + XLayoutContainer paraComponent = designer.getParaComponent(); + if (needCalculateParaHeight && paraComponent != null) { + paraComponent.setScale(scale); + this.designer.setParaHeight(paraHeight); + paraComponent.setPreferredSize(new Dimension(d.width, this.designer.getParaHeight())); + paraComponent.adjustCompSize( percent); parent.removeAll(); - parent.add(designer.getParaComponent(), WBorderLayout.NORTH); - parent.add(designer.getRootComponent(), WBorderLayout.CENTER); + parent.add(paraComponent, WBorderLayout.NORTH); + parent.add(root, WBorderLayout.CENTER); + root.setBounds(0, this.designer.getParaHeight(), d.width, d.height); } - layout.getParent().setSize(d.width, d.height + paraHeight); + layout.getParent().setSize(d.width, d.height + this.designer.getParaHeight()); + // 调整自适应布局大小后,同步调整参数界面和border大小,此时刷新下formArea FormArea.this.validate(); + LayoutUtils.layoutRootContainer(designer.getRootComponent()); } - START_VALUE = value; } } /** * 按照界面大小的百分比值调整root大小 * - * @param needCalculateParaHeight 是否需要调整参数界面高度 - * @param value */ - private void reCalculateDefaultRoot(double value, boolean needCalculateParaHeight) { + private void reCalculateDefaultRoot() { XLayoutContainer root = FormArea.this.designer.getRootComponent(); if (root.acceptType(XWFitLayout.class)) { XWFitLayout layout = (XWFitLayout) root; - layout.setContainerPercent(1.0); - traverAndAdjust(layout, 0.0); - layout.adjustCreatorsWhileSlide(0.0); - - // 拖动滑块,先将内部组件百分比大小计算,再计算容器大小 - - Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); - // 自适应布局的父层是border - if (layout.getParent() != null) { - int paraHeight = designer.getParaHeight(); - if (needCalculateParaHeight && paraHeight > 0) { - designer.setParaHeight(paraHeight); - XWBorderLayout parent = (XWBorderLayout) layout.getParent(); - parent.toData().setNorthSize(paraHeight); - parent.removeAll(); - parent.add(designer.getParaComponent(), WBorderLayout.NORTH); - parent.add(designer.getRootComponent(), WBorderLayout.CENTER); - } - layout.getParent().setSize(d.width, d.height + paraHeight); - // 调整自适应布局大小后,同步调整参数界面和border大小,此时刷新下formArea - FormArea.this.validate(); + Dimension dimension = layout.getSize(); + double widthScale = 960D / dimension.width; + double heightScale = 960D / dimension.height; + final double scaleValue = Math.min(widthScale, heightScale); + int value = (int) (scaleValue * 100); + slidePane.setShowValue(value); + if (value == 100) { + return; } + scale(value); } } @@ -459,6 +431,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { Object object = creator.getComponent(i); if (object instanceof XCreator) { XCreator temp = (XCreator) object; + temp.setScale(1 + percent); temp.adjustCompSize(percent); traverAndAdjust(temp, percent); } @@ -480,17 +453,17 @@ public class FormArea extends JComponent implements ScrollRulerComponent { * 鼠标滚轮事件 * 由于表单设计界面要求: 容器大小大于界面时,滚动条才可以拖动,所以不支持滚动无限往下滚 */ - @Override - protected void processMouseWheelEvent(java.awt.event.MouseWheelEvent evt) { - int id = evt.getID(); - switch (id) { - case MouseEvent.MOUSE_WHEEL: { - onMouseWheelScroll(evt); - break; - } - default: - } - } +// @Override +// protected void processMouseWheelEvent(java.awt.event.MouseWheelEvent evt) { +// int id = evt.getID(); +// switch (id) { +// case MouseEvent.MOUSE_WHEEL: { +// onMouseWheelScroll(evt); +// break; +// } +// default: +// } +// } private void onMouseWheelScroll(MouseWheelEvent evt) { int value = this.verScrollBar.getValue() + evt.getWheelRotation() * ROTATIONS; @@ -763,7 +736,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent { layout.moveContainerMargin(); layout.addCompInterval(layout.getAcualInterval()); } else if (designer.getRootComponent().acceptType(XWFitLayout.class)) { - START_VALUE = DEFAULT_SLIDER; reCalculateRoot(slide, true); // slidePane.populateBean(slide); } @@ -840,7 +812,8 @@ public class FormArea extends JComponent implements ScrollRulerComponent { DESIGNERWIDTH = DESIGNERWIDTH > maxWidth ? maxWidth : DESIGNERWIDTH; DESIGNERHEIGHT = DESIGNERHEIGHT > maxHeight ? maxHeight : DESIGNERHEIGHT; int designerLeft = left + (verScrollBar.getX() - DESIGNERWIDTH) / 2; - rec = new Rectangle(designerLeft, TOPGAP, DESIGNERWIDTH, DESIGNERHEIGHT); + int designerTop = top + (horScrollBar.getY() - DESIGNERHEIGHT) / 2; + rec = new Rectangle(designerLeft, designerTop, DESIGNERWIDTH, DESIGNERHEIGHT); } // designer是整个表单设计界面中的面板部分,目前只放自适应布局和参数界面。 designer.setBounds(rec); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index b94ad57dbb..851758803a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -493,10 +493,12 @@ public class FormDesigner extends TargetComponent
implements TreeSelection public void setParaHeight(int height) { XWBorderLayout container = (XWBorderLayout) getTopContainer(); container.toData().setNorthSize(height); - container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight()); - paraHeight = height; + int displayHeight = (int) (height * container.getScale()); + container.setSize(container.getWidth(), container.getHeight() + displayHeight - getParaHeight()); + paraHeight = displayHeight; } + /** * 删除参数界面 */ diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java index cbebbcba16..8f95ecaf68 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java @@ -15,6 +15,8 @@ import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WBorderLayout; +import com.fr.form.ui.container.WParameterLayout; import com.fr.log.FineLoggerFactory; import java.awt.LayoutManager; @@ -232,12 +234,13 @@ public class FormSelection { int size = selection.size(); if (size == 1) { XCreator creator = selection.get(0); - if(creator.acceptType(XWCardTagLayout.class)){ - creator = (XCreator)selection.get(0).getParent(); + if (creator.acceptType(XWCardTagLayout.class)) { + creator = (XCreator) selection.get(0).getParent(); } creator.setBounds(rec); if (creator.acceptType(XWParameterLayout.class)) { - designer.setParaHeight((int) rec.getHeight()); + double height = rec.getHeight() / creator.getScale(); + designer.setParaHeight((int) height); designer.getArea().doLayout(); } LayoutUtils.layoutContainer(creator); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index 7ddff022f9..e1f7f882ad 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -8,6 +8,7 @@ import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.widget.CRBoundsWidget; import java.awt.Rectangle; @@ -42,15 +43,13 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); formDesigner.getSelectionModel().getSelection().backupBounds(); super.update(); - Rectangle bounds = new Rectangle(creator.getBounds()); - bounds.x = (int) x.getValue(); - bounds.y = (int) y.getValue(); + Rectangle bounds = new Rectangle((int) x.getValue(), (int) y.getValue(), (int) width.getValue(), (int) height.getValue()); if (parent == null) { return; } WLayout wabs = parent.toData(); wabs.setBounds(creator.toData(), bounds); - creator.setBounds(bounds); + parent.adjustCompSize(parent.getScale() -1); LayoutUtils.layoutContainer(creator); XWAbsoluteLayout layout = (XWAbsoluteLayout) parent; layout.updateBoundsWidget(creator); @@ -59,14 +58,13 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { @Override public void limitWidth(WLayout wabs, int w, Rectangle bounds, Rectangle rec){ bounds.width = w; - creator.setBounds(bounds); } @Override public void limitHeight(WLayout wabs, int h, Rectangle bounds, Rectangle rec){ bounds.height = h; - creator.setBounds(bounds); } + @Override protected String title4PopupWindow() { return "absoluteBound"; @@ -75,7 +73,9 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { @Override public void populate() { super.populate(); - Rectangle bounds = new Rectangle(creator.getBounds()); + WLayout wabs = parent.toData(); + CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + Rectangle bounds = boundsWidget.getBounds(); x.setValue(bounds.x); y.setValue(bounds.y); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index ab148f2ae6..6b538d14fe 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -20,9 +20,8 @@ import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.widget.CRBoundsWidget; - -import javax.swing.JOptionPane; import java.awt.Rectangle; @@ -46,8 +45,8 @@ public class WidgetBoundPane extends BasicPane { } public XLayoutContainer getParent(XCreator source) { - if(source.acceptType(XWCardTagLayout.class)){ - return (XLayoutContainer)source.getParent(); + if (source.acceptType(XWCardTagLayout.class)) { + return (XLayoutContainer) source.getParent(); } XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source); if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) { @@ -79,18 +78,21 @@ public class WidgetBoundPane extends BasicPane { } public void populate() { - Rectangle bounds = new Rectangle(creator.getBounds()); + WLayout wabs = parent.toData(); + CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + Rectangle bounds = new Rectangle(boundsWidget.getBounds()); width.setValue(bounds.width); height.setValue(bounds.height); } public void fix() { - Rectangle bounds = new Rectangle(creator.getBounds()); + WLayout wabs = parent.toData(); + CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + Rectangle bounds = new Rectangle(boundsWidget.getBounds()); creator.setBackupBound(creator.getBounds()); int w = (int) width.getValue(); int h = (int) height.getValue(); Rectangle rec = ComponentUtils.getRelativeBounds(parent); - WLayout wabs = parent.toData(); if (bounds.width != w) { limitWidth(wabs, w, bounds, rec); } @@ -101,25 +103,27 @@ public class WidgetBoundPane extends BasicPane { public void adjustComponents(Rectangle bounds, int difference, int row) { + double scale = parent.getScale(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); Rectangle backupBounds = getBound(); FRFitLayoutAdapter layoutAdapter = (FRFitLayoutAdapter) AdapterBus.searchLayoutAdapter(formDesigner, creator); if (layoutAdapter != null) { layoutAdapter.setEdit(true); - layoutAdapter.calculateBounds(backupBounds, bounds, creator, row, difference); + layoutAdapter.calculateBounds(backupBounds, new Rectangle((int) (bounds.x * scale), (int) (bounds.y * scale), (int) (bounds.width * scale), (int) (bounds.height * scale)), creator, row, difference); } } public void limitWidth(WLayout wabs, int w, Rectangle bounds, Rectangle rec) { int difference = 0; + double scale = parent.getScale(); int minWidth = (int) (MINWIDTH * ((WFitLayout) wabs).getResolutionScaling()); PaddingMargin margin = wabs.getMargin(); if (bounds.width != w) { - if (bounds.width == rec.width - margin.getLeft() - margin.getRight()) { + if ((int) (bounds.width * scale) == rec.width - margin.getLeft() - margin.getRight()) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); width.setValue(bounds.width); return; - } else if (w < minWidth) { + } else if (w * scale < minWidth) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Width") + Integer.toString(minWidth)); width.setValue(bounds.width); return; @@ -132,15 +136,16 @@ public class WidgetBoundPane extends BasicPane { } public void limitHeight(WLayout wabs, int h, Rectangle bounds, Rectangle rec) { + double scale = parent.getScale(); int difference = 0; PaddingMargin margin = wabs.getMargin(); int minHeight = (int) (MINHEIGHT * ((WFitLayout) wabs).getResolutionScaling()); if (bounds.height != h) { - if (bounds.height == rec.height - margin.getTop() - margin.getBottom()) { + if ((int) (bounds.height * scale) == rec.height - margin.getTop() - margin.getBottom()) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); height.setValue(bounds.height); return; - } else if (h < minHeight) { + } else if (h * scale < minHeight) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Height") + Integer.toString(minHeight)); height.setValue(bounds.height); return; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java index 22d544c1a6..e89fe09354 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java @@ -10,11 +10,9 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.container.WTabDisplayPosition; +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.ComparatorUtils; - - -import javax.swing.JOptionPane; import java.awt.Rectangle; /** @@ -39,6 +37,7 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane { if (parent == null) { return; } + double scale = parent.getScale(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); Rectangle parentBounds = new Rectangle(parent.getBounds()); @@ -48,17 +47,17 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane { XLayoutContainer tabLayout = creator.getTopLayout(); Rectangle rectangle = tabLayout.getBounds(); if(ComparatorUtils.equals(displayPosition, WTabDisplayPosition.TOP_POSITION) || ComparatorUtils.equals(displayPosition, WTabDisplayPosition.BOTTOM_POSITION)){ - if(rectangle.height < size){ + if(rectangle.height < size* scale){ FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return; } - parentBounds.height = size; + parentBounds.height = (int) (size * scale); }else{ - if(rectangle.width < size){ + if(rectangle.width < size*scale){ FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return; } - parentBounds.width = size; + parentBounds.width = (int) (size * scale); } parent.setBounds(parentBounds); @@ -76,15 +75,8 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane { @Override public void populate() { - WCardTagLayout tagLayout = (WCardTagLayout)creator.toData(); - Rectangle bounds = new Rectangle(creator.getBounds()); - WTabDisplayPosition displayPosition = tagLayout.getDisplayPosition(); - if( ComparatorUtils.equals(displayPosition, WTabDisplayPosition.TOP_POSITION) || ComparatorUtils.equals(displayPosition, WTabDisplayPosition.BOTTOM_POSITION)){ - cardTagWidth.setValue(bounds.height); - }else{ - cardTagWidth.setValue(bounds.width); - } - + WCardMainBorderLayout wCardMainBorderLayout = (WCardMainBorderLayout)creator.getTopLayout().toData(); + cardTagWidth.setValue(wCardMainBorderLayout.getTitleSize()); } } From 476d3965398362b3a3b4f203a3a10466f6ccc2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 28 Jul 2020 14:21:00 +0800 Subject: [PATCH 15/47] =?UTF-8?q?CHART-9760=20=E7=B3=BB=E5=88=97=E5=90=8D?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/SeriesNameUseFieldValuePane.java | 5 +- .../data/table/SeriesTypeUseComboxPane.java | 125 +++++++++++++----- .../chart/gui/style/ThirdTabPane.java | 12 +- 3 files changed, 97 insertions(+), 45 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java index aab267c545..37dcdebf47 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java @@ -14,15 +14,16 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.extended.chart.UIComboBoxWithNone; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.List; /** * 属性表 数据集 系列名使用 系列值 界面. @@ -38,7 +39,7 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane { +public class SeriesTypeUseComboxPane extends BasicBeanPane { private SeriesNameUseFieldValuePane nameFieldValuePane; private SeriesNameUseFieldNamePane nameFieldNamePane; @@ -39,50 +40,100 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { private ChartDataPane parent; private Plot initplot; - private boolean isNeedSummary = true; + private boolean isNeedSummary; + + protected UIButtonGroup content; + protected JPanel cardPane; public SeriesTypeUseComboxPane(ChartDataPane parent, Plot initplot) { this.initplot = initplot; this.parent = parent; - cards = initPaneList(); this.isNeedSummary = true; initComponents(); } + protected void initComponents() { + nameFieldValuePane = createValuePane(); + nameFieldNamePane = createNamePane(); + + cardPane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (content.getSelectedIndex() == 0) { + return nameFieldValuePane.getPreferredSize(); + } else { + return nameFieldNamePane.getPreferredSize(); + } + } + }; + cardPane.add(nameFieldValuePane, nameFieldValuePane.title4PopupWindow()); + cardPane.add(nameFieldNamePane, nameFieldNamePane.title4PopupWindow()); + + content = new UIButtonGroup<>(new String[]{nameFieldValuePane.title4PopupWindow(), nameFieldNamePane.title4PopupWindow()}); + + addItemChangeEvent(); + + initLayout(); + content.setSelectedIndex(0); + } + + private void addItemChangeEvent() { + content.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkCardPane(); + + } + }); + } + + protected void checkCardPane() { + comboBoxItemStateChanged(); + CardLayout cl = (CardLayout) cardPane.getLayout(); + if (content.getSelectedIndex() == 0) { + cl.show(cardPane, nameFieldValuePane.title4PopupWindow()); + } else { + cl.show(cardPane, nameFieldNamePane.title4PopupWindow()); + } + } + protected void initLayout() { this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); JPanel northPane = new JPanel(new BorderLayout(4, 0)); - UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); + UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); - northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); + JPanel borderLayoutPane = GUICoreUtils.createBorderLayoutPane(new Component[]{content, null, null, label1, null}); + northPane.add(borderLayoutPane); northPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 0, 15)); cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); - dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); - JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); - panel.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); - dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); + dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); + JPanel panel = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 250, 24, dataScreeningPane); + panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 15)); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.add(panel, BorderLayout.SOUTH); } - protected UIComboBox createComboBox() { - UIComboBox uiComboBox = new UIComboBox(); - UIComponentUtils.setPreferedWidth(uiComboBox, 100); - return uiComboBox; + public Dimension getPreferredSize() { + Dimension preferredSize = super.getPreferredSize(); + return new Dimension(260, (int) preferredSize.getHeight()); } + /** * 检查box 是否使用, hasUse, 表示上层已经使用, 否则, 则此界面都可使用 + * * @param hasUse 是否使用 */ public void checkUseBox(boolean hasUse) { - jcb.setEnabled(hasUse); + content.setEnabled(hasUse); nameFieldValuePane.checkUse(hasUse); dataScreeningPane.checkBoxUse(); } /** * 切换 变更数据集时, 刷新Box选中项目 + * * @param list 列表 */ public void refreshBoxListWithSelectTableData(List list) { @@ -93,28 +144,20 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { /** * 清空所有的box设置 */ - public void clearAllBoxList(){ + public void clearAllBoxList() { nameFieldValuePane.clearAllBoxList(); nameFieldNamePane.clearAllBoxList(); } /** * 界面标题 + * * @return 界面标题 */ protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"); } - @Override - protected List> initPaneList() { - nameFieldValuePane = createValuePane(); - nameFieldNamePane = createNamePane(); - List> paneList = new ArrayList>(); - paneList.add(nameFieldValuePane); - paneList.add(nameFieldNamePane); - return paneList; - } protected SeriesNameUseFieldValuePane createValuePane() { return new SeriesNameUseFieldValuePane(); @@ -135,15 +178,17 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { nameFieldNamePane.populateBean(ob, isNeedSummary); } dataScreeningPane.populateBean(ob, isNeedSummary); + checkCardPane(); } /** * 重新布局整个面板 + * * @param isNeedSummary 是否需要汇总 */ public void relayoutPane(boolean isNeedSummary) { this.isNeedSummary = isNeedSummary; - if (jcb.getSelectedIndex() == 0) { + if (this.getSelectedIndex() == 0) { nameFieldValuePane.relayoutPane(this.isNeedSummary); } else { nameFieldNamePane.relayoutPane(this.isNeedSummary); @@ -152,9 +197,8 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { } - @Override protected void comboBoxItemStateChanged() { - if (jcb.getSelectedIndex() == 0) { + if (this.getSelectedIndex() == 0) { nameFieldValuePane.relayoutPane(this.isNeedSummary); } else { nameFieldNamePane.relayoutPane(this.isNeedSummary); @@ -178,4 +222,21 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { dataScreeningPane.updateBean(ob); } + /** + * 保存数据 + * + * @return 待保存的对象 + */ + public ChartCollection updateBean() { + return null; + } + + + public int getSelectedIndex() { + return content.getSelectedIndex(); + } + + public void setSelectedIndex(int index) { + content.setSelectedIndex(index); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java index a0580ba468..a58a889164 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import javax.swing.JPanel; import javax.swing.border.Border; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -20,7 +21,6 @@ import java.awt.Graphics2D; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.List; public abstract class ThirdTabPane extends BasicBeanPane{ @@ -74,16 +74,6 @@ public abstract class ThirdTabPane extends BasicBeanPane{ } } - @Override - public void paint(Graphics g) { - super.paint(g); - if (!paneList.isEmpty()) { - Graphics2D g2d = (Graphics2D)g; - g2d.setColor(UIConstants.LINE_COLOR); - g2d.drawLine(getWidth() - 2, tabPane.getPreferredSize().height, getWidth() - 2, getHeight() - 1); - } - } - protected void initLayout() { this.setLayout(new BorderLayout()); if (!paneList.isEmpty()) { From 5d5e0386c67bcb8d3b3dfe07bf64e619e45fd18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 28 Jul 2020 15:40:11 +0800 Subject: [PATCH 16/47] =?UTF-8?q?CHART-9760=20=E4=BF=AE=E6=94=B9=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/table/SeriesNameUseFieldNamePane.java | 6 +++--- .../chart/gui/data/table/SeriesNameUseFieldValuePane.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index c6f4ac2041..3f5f70aae3 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -24,6 +24,8 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.event.ChangeEvent; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; @@ -31,8 +33,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.List; /** * 属性表 数据集界面: 系列名 使用字段名. @@ -129,7 +129,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane Date: Tue, 28 Jul 2020 16:11:24 +0800 Subject: [PATCH 17/47] =?UTF-8?q?REPORT-35544=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E5=88=87=E6=8D=A2=E5=88=B0=E9=9F=A9=E6=96=87?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20=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 --- .../gui/iprogressbar/ProgressDialog.java | 4 ++- .../design/locale/impl/SupportLocaleImpl.java | 13 +++++++++- .../start/server/FineEmbedServerMonitor.java | 26 ++++++++++++------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index 6d10b48e56..29214984c3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -98,7 +98,9 @@ public class ProgressDialog extends UIDialog { } public void updateLoadingText(String text, FRFont font) { - this.text.setFont(font); + if (font != null) { + this.text.setFont(font); + } this.text.setText(text); } } diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java index 61de25937c..c6c1b1f280 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java @@ -38,7 +38,18 @@ public enum SupportLocaleImpl implements SupportLocale { set.add(Locale.TAIWAN); return set; } - } + }, + /** + * 支持韩文 + */ + SUPPORT_KOREA { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.KOREA); + return set; + } + } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 6bab19fded..7e95c48d27 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -2,16 +2,18 @@ package com.fr.start.server; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.gui.iprogressbar.ProgressDialog; +import com.fr.design.i18n.Toolkit; +import com.fr.design.locale.impl.SupportLocaleImpl; import com.fr.design.mainframe.DesignerContext; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; import com.fr.general.FRFont; -import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleAction; +import com.fr.general.locale.LocaleCenter; import javax.swing.plaf.ColorUIResource; -import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -31,6 +33,11 @@ public class FineEmbedServerMonitor { private static final int STEP_HEARTBEAT = 40; private static volatile FineEmbedServerMonitor monitor; private static ProgressDialog progressBar = DesignerContext.getDesignerFrame().getProgressDialog(); + //由于默认值的字体不支持韩文,所以要对韩文单独生成字体 + private FRFont font = null; + private static final int FONT_RGB = 333334; + private static final int FONT_SIZE = 14; + private static final String FONT_NAME = "Dialog"; private FineEmbedServerMonitor() { } @@ -90,14 +97,15 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); //如果为韩文则改变字体 - if (GeneralContext.getLocale().equals(Locale.KOREA)) { - FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); - } else { - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); - } + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + font = FRFont.getInstance().applySize(FONT_SIZE).applyForeground(new ColorUIResource(FONT_RGB)).applyName(FONT_NAME); + } + }, SupportLocaleImpl.SUPPORT_KOREA); + String text = Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 07bb4980762755d68955225c93d2255fbfe4dde7 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 28 Jul 2020 17:27:31 +0800 Subject: [PATCH 18/47] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3118ed8a99..6446da4044 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,6 @@ allprojects { dependencies { implementation 'com.fr.third:jxbrowser:6.23' - implementation 'com.fr.third:jxbrowser-swing:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23' implementation 'com.fr.third:jxbrowser-win64:6.23' implementation 'com.fr.third.server:servlet-api:3.0' From 93ff2c993f6ab254b944d41ed6dbcdfa00b74287 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 28 Jul 2020 17:29:42 +0800 Subject: [PATCH 19/47] =?UTF-8?q?REPORT-29515=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=BC=B9=E7=AA=97=E7=AA=97=E4=BD=93=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=EF=BC=8C=E7=94=B1660*600=E6=94=B9=E6=88=90700*630?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9height=E6=98=AF=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E5=8F=AA=E6=94=B9width=EF=BC=8C=E7=9C=8B=E8=B5=B7=E6=9D=A5?= =?UTF-8?q?=E4=B8=8D=E5=A4=AA=E5=A5=BD=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/server/ServerConfigManagerAction.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java b/designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java index f25c6da3da..a75fa5d265 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/server/ServerConfigManagerAction.java @@ -18,12 +18,15 @@ import com.fr.transaction.Worker; import com.fr.web.attr.ReportWebAttr; import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; /** * Server Config Manager */ public class ServerConfigManagerAction extends UpdateAction { + public static final Dimension DEFAULT = new Dimension(700, 630); + public ServerConfigManagerAction() { this.setMenuKeySet(SERVER_CONFIG_MANAGER); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); @@ -48,8 +51,8 @@ public class ServerConfigManagerAction extends UpdateAction { } }; - final BasicDialog editReportServerParameterDialog = editReportServerParameterPane.showWindow( - DesignerContext.getDesignerFrame() + final BasicDialog editReportServerParameterDialog = editReportServerParameterPane.showWindowWithCustomSize( + DesignerContext.getDesignerFrame(), null, DEFAULT ); editReportServerParameterDialog.addDialogActionListener(new DialogActionAdapter() { From 0a98c77d3c54d8ec81117b477818aa455fd8d3cc Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 28 Jul 2020 17:40:35 +0800 Subject: [PATCH 20/47] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 6 +++--- .../ui/designer/component/WidgetAbsoluteBoundPane.java | 3 +++ .../widget/ui/designer/component/WidgetBoundPane.java | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 2d7180bba1..39c7f1a720 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -380,9 +380,9 @@ public class FormArea extends JComponent implements ScrollRulerComponent { Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); XWBorderLayout parent = (XWBorderLayout) layout.getParent(); root.setScale(scale); - parent.setScale(scale); // 自适应布局的父层是border - if (layout.getParent() != null) { + if (parent != null) { + parent.setScale(scale); int paraHeight = parent.toData().getNorthSize(); XLayoutContainer paraComponent = designer.getParaComponent(); if (needCalculateParaHeight && paraComponent != null) { @@ -395,7 +395,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { parent.add(root, WBorderLayout.CENTER); root.setBounds(0, this.designer.getParaHeight(), d.width, d.height); } - layout.getParent().setSize(d.width, d.height + this.designer.getParaHeight()); + parent.setSize(d.width, d.height + this.designer.getParaHeight()); // 调整自适应布局大小后,同步调整参数界面和border大小,此时刷新下formArea FormArea.this.validate(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index e1f7f882ad..80898f592d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -75,6 +75,9 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { super.populate(); WLayout wabs = parent.toData(); CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + if (boundsWidget == null){ + return; + } Rectangle bounds = boundsWidget.getBounds(); x.setValue(bounds.x); y.setValue(bounds.y); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index 6b538d14fe..d76c2f891e 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -80,6 +80,9 @@ public class WidgetBoundPane extends BasicPane { public void populate() { WLayout wabs = parent.toData(); CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + if (boundsWidget == null){ + return; + } Rectangle bounds = new Rectangle(boundsWidget.getBounds()); width.setValue(bounds.width); height.setValue(bounds.height); From 878d65de01648d02691829854b7f921f08ea4889 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 28 Jul 2020 18:43:02 +0800 Subject: [PATCH 21/47] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/JFormSliderPane.java | 39 ++++++++------ .../design/mainframe/JFormSliderPaneTest.java | 51 +++++++++++++++++++ 2 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java index c47267897f..0658d6040f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java @@ -131,7 +131,7 @@ public class JFormSliderPane extends JPanel { int code = evt.getKeyCode(); if (code == KeyEvent.VK_ENTER) { - showValue = parseInputValue(); + showValue = parseInputValue(showValField.getText()); showValField.setText(showValue + SUFFIX); showValFieldChange(); } @@ -151,22 +151,26 @@ public class JFormSliderPane extends JPanel { private void showValFieldChange() { isButtonOrIsTxt = true; - if (showValue > FOUR_HUNDRED) { - showValue = FOUR_HUNDRED; - } - if (showValue < TEN) { - showValue = TEN; - } + showValue = getPreferredValue(showValue); refreshShowValueFieldText(); refreshSlider(); } + private int getPreferredValue(int value){ + if (value > FOUR_HUNDRED) { + value = FOUR_HUNDRED; + } + if (value < TEN) { + value = TEN; + } + return value; + } + private void refreshShowValueFieldText(){ showValField.setText(showValue + SUFFIX); } - private int parseInputValue(){ - String text = showValField.getText(); + private int parseInputValue(String text){ if (text.endsWith(SUFFIX)){ text = text.substring(0, text.length() -1); } @@ -175,7 +179,6 @@ public class JFormSliderPane extends JPanel { }catch (NumberFormatException e){ return HUNDRED; } - } @@ -201,13 +204,19 @@ public class JFormSliderPane extends JPanel { private void refreshSlider() { - if (showValue > HUNDRED) { - slider.setValue((int) (showValue + TWO_HUNDRED) / SIX); - } else if (showValue < HUNDRED) { - slider.setValue((int) ((showValue - TEN) / ONEPOINTEIGHT)); + slider.setValue(calSliderValue(showValue)); + } + + private int calSliderValue(int value) { + int result; + if (value > HUNDRED) { + result = (value + TWO_HUNDRED) / SIX; + } else if (value < HUNDRED) { + result = (int) ((value - TEN) / ONEPOINTEIGHT); } else { - slider.setValue(HALF_HUNDRED); + result = HALF_HUNDRED; } + return result; } diff --git a/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java b/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java new file mode 100644 index 0000000000..59da9fc1fb --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java @@ -0,0 +1,51 @@ +package com.fr.design.mainframe; + +import com.fr.invoke.Reflect; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2020-07-28 + */ +public class JFormSliderPaneTest { + + @Test + public void testParseInputValue() { + JFormSliderPane sliderPane = new JFormSliderPane(); + int result = Reflect.on(sliderPane).call("parseInputValue", "100%").get(); + Assert.assertEquals(100, result); + result = Reflect.on(sliderPane).call("parseInputValue", "50%").get(); + Assert.assertEquals(50, result); + result = Reflect.on(sliderPane).call("parseInputValue", "50").get(); + Assert.assertEquals(50, result); + result = Reflect.on(sliderPane).call("parseInputValue", "50abc").get(); + Assert.assertEquals(100, result); + } + + @Test + public void testGetPreferredValue() { + JFormSliderPane sliderPane = new JFormSliderPane(); + int result = Reflect.on(sliderPane).call("getPreferredValue", 100).get(); + Assert.assertEquals(100, result); + result = Reflect.on(sliderPane).call("getPreferredValue", 0).get(); + Assert.assertEquals(10, result); + result = Reflect.on(sliderPane).call("getPreferredValue", 1000).get(); + Assert.assertEquals(400, result); + } + + @Test + public void testCalSliderValue() { + JFormSliderPane sliderPane = new JFormSliderPane(); + int result = Reflect.on(sliderPane).call("calSliderValue", 10).get(); + Assert.assertEquals(0, result); + result = Reflect.on(sliderPane).call("calSliderValue", 90).get(); + Assert.assertEquals(44, result); + result = Reflect.on(sliderPane).call("calSliderValue", 100).get(); + Assert.assertEquals(50, result); + result = Reflect.on(sliderPane).call("calSliderValue", 200).get(); + Assert.assertEquals(66, result); + result = Reflect.on(sliderPane).call("calSliderValue", 400).get(); + Assert.assertEquals(100, result); + + } +} From 0b69b9b61b7c2a3c8c8799ed5586bf706fe96096 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 28 Jul 2020 19:08:54 +0800 Subject: [PATCH 22/47] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 39c7f1a720..d92ca80a8a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -696,9 +696,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { * @return 百分比值 */ public double getSlideValue() { -// return slidePane.updateBean(); - //7.1.1不加缩放滑块 - return this.screenValue; + return slidePane.getShowValue(); } /** From ce908d9dca755361230746b9984a205b6f0b9864 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 29 Jul 2020 11:26:19 +0800 Subject: [PATCH 23/47] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormArea.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index d92ca80a8a..88b1b8ba24 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -25,8 +25,10 @@ import com.fr.general.FRScreen; import com.fr.stable.AssistUtils; +import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.JPanel; +import javax.swing.KeyStroke; import javax.swing.border.LineBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -43,12 +45,17 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; +import java.awt.event.KeyEvent; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; +import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; + public class FormArea extends JComponent implements ScrollRulerComponent { private static final double SLIDER_FLOAT = 400.0; private static final double SLIDER_MIN = 10.0; + private static final String SCALE_PLUS_COMMAND = "scale_plus"; + private static final String SCALE_MINUS_COMMAND = "scale_minus"; public static final double DEFAULT_SLIDER = 100.0; private static final int ROTATIONS = 50; private static final int SHOWVALMAX = 400; @@ -107,8 +114,31 @@ public class FormArea extends JComponent implements ScrollRulerComponent { } this.setFocusTraversalKeysEnabled(false); this.addMouseWheelListener(showValSpinnerMouseWheelListener); + registerShortCutKey(); + } + /** + * 注册缩放快捷键 + * mac: command + 和 command - + * windows: ctr + 和 ctr - + */ + private void registerShortCutKey() { + this.registerKeyboardAction(new AbstractAction() { + @Override + public void actionPerformed(ActionEvent e) { + int old_resolution = slidePane.getShowValue(); + slidePane.setShowValue(old_resolution + SHOWVALMIN); + } + }, SCALE_PLUS_COMMAND, KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, DEFAULT_MODIFIER), WHEN_IN_FOCUSED_WINDOW); + this.registerKeyboardAction(new AbstractAction() { + @Override + public void actionPerformed(ActionEvent e) { + int old_resolution = slidePane.getShowValue(); + slidePane.setShowValue(old_resolution - SHOWVALMIN); + } + }, SCALE_MINUS_COMMAND, KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, DEFAULT_MODIFIER), WHEN_IN_FOCUSED_WINDOW); + } public void onMobileAttrModified() { FormMobileAttr formMobileAttr = designer.getTarget().getFormMobileAttr(); From b0f6f123f3ddfa9ab6979243be7ad93b6c3c6e70 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 29 Jul 2020 11:42:37 +0800 Subject: [PATCH 24/47] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/designer/creator/XTextArea.java | 4 +++- .../main/java/com/fr/design/designer/creator/XTextEditor.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java index 845fe43d9e..62dc92a2d0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java @@ -59,8 +59,10 @@ public class XTextArea extends XFieldEditor { TextArea area = (TextArea) data; if (area.getWidgetValue() != null) { Graphics2D g2d = (Graphics2D) g.create(); + FRFont font = FRFont.getInstance(); + float fontsize = (float) (font.getSize() * this.getScale()); BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), area.getWidgetValue() - .toString(), Style.getInstance(FRFont.getInstance()).deriveHorizontalAlignment(Constants.LEFT) + .toString(), Style.getInstance(font.applySize(fontsize)).deriveHorizontalAlignment(Constants.LEFT) .deriveVerticalAlignment(SwingConstants.TOP) .deriveTextStyle(Style.TEXTSTYLE_WRAPTEXT), ScreenResolution.getScreenResolution()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java index 00daae7c7d..8106653e2e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java @@ -67,8 +67,10 @@ public class XTextEditor extends XWrapperedFieldEditor { TextEditor area = (TextEditor) data; if (area.getWidgetValue() != null) { Graphics2D g2d = (Graphics2D) g.create(); + FRFont font = FRFont.getInstance(); + float fontsize = (float) (font.getSize() * this.getScale()); BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), area.getWidgetValue() - .toString(), Style.getInstance(FRFont.getInstance()).deriveHorizontalAlignment(Constants.LEFT) + .toString(), Style.getInstance(font.applySize(fontsize)).deriveHorizontalAlignment(Constants.LEFT) .deriveTextStyle(Style.TEXTSTYLE_SINGLELINE), ScreenResolution.getScreenResolution()); } } From d2f600dabd2bb1fedac40551be0918c350ca51fc Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 13:36:12 +0800 Subject: [PATCH 25/47] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/ipasswordfield/UIPassWordField.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java index 0aad7ee918..2d2f1864da 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java @@ -1,11 +1,12 @@ package com.fr.design.gui.ipasswordfield; +import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.constants.UIConstants; -import javax.swing.*; +import javax.swing.JPasswordField; import javax.swing.text.Document; -import java.awt.*; +import java.awt.Graphics; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -21,26 +22,31 @@ public class UIPassWordField extends JPasswordField { public UIPassWordField() { super(); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text) { super(text); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(int columns) { super(columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text, int columns) { super(text, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(Document doc, String txt, int columns) { super(doc, txt, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } @@ -69,4 +75,4 @@ public class UIPassWordField extends JPasswordField { super.paintBorder(g); } } -} \ No newline at end of file +} From b0fe3f124300f345323d2332a484c8a8073422ea Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 13:49:07 +0800 Subject: [PATCH 26/47] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ipasswordfield/UIPassWordField.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java index 2d2f1864da..ba05141c94 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java @@ -22,35 +22,31 @@ public class UIPassWordField extends JPasswordField { public UIPassWordField() { super(); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text) { super(text); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(int columns) { super(columns); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text, int columns) { super(text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(Document doc, String txt, int columns) { super(doc, txt, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } private void addRollOverListener() { + InputEventBaseOnOS.addBasicEditInputMap(this); this.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { From a069f6ca9b0543ac647fbaccfcec9da88f58a18e Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 13:52:55 +0800 Subject: [PATCH 27/47] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/gui/itextfield/UITextField.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index 98823bee9b..3f8b189081 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -251,4 +251,4 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs this.isBorderPainted = isBorderPainted; } -} \ No newline at end of file +} From 8f360741e38ca85f29b7181b9e50d162b30c08bc Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 14:05:01 +0800 Subject: [PATCH 28/47] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/itextfield/UITextField.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index 3f8b189081..fd77b6f4dc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -9,11 +9,20 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.Constants; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextField; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.Document; -import java.awt.*; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.LayoutManager; +import java.awt.RenderingHints; + /** * @author Jerry @@ -33,36 +42,31 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs public UITextField() { super(); - InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(int columns) { super(columns); - InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(String text, int columns) { super(text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(String text) { super(text); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); } public UITextField(Document doc, String text, int columns) { super(doc, text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } protected void initListener() { + InputEventBaseOnOS.addBasicEditInputMap(this); if (shouldResponseChangeListener()) { getDocument().addDocumentListener(new DocumentListener() { @Override From b43aedba09586c37bf1852d68147c07775348df0 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 29 Jul 2020 14:22:39 +0800 Subject: [PATCH 29/47] =?UTF-8?q?REPORT-36310=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=A8=A1=E6=9D=BF=E5=83=8F=E7=B4=A0?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE=E4=B8=8D=E5=9C=A8=E6=AD=A3=E4=B8=AD?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 508be0327a..431cb07a45 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -151,9 +151,9 @@ public class FormArea extends JComponent implements ScrollRulerComponent { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {f}; - double[] columnSize = {p, f, p, p, p, p, p, p}; + double[] columnSize = {p, f, p, p, p, p, p, f, p}; UILabel tipsPane = new UILabel("form"); - tipsPane.setPreferredSize(new Dimension(200, 0)); + tipsPane.setPreferredSize(new Dimension(375, 0)); widthPane = new UINumberField(); widthPane.setPreferredSize(new Dimension(60, 0)); heightPane = new UINumberField(); @@ -167,6 +167,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel")), new UILabel("x"), heightPane, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel")), + new UILabel(), slidePane}}, rowSize, columnSize, RESIZE_PANE_GAP); this.add(FormRulerLayout.BOTTOM, resizePane); setWidgetsConfig(); From eef74f18a39c2b927fdd27c9c554b9e962682565 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 15:12:13 +0800 Subject: [PATCH 30/47] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ipasswordfield/UIPassWordField.java | 6 +++++- .../main/java/com/fr/design/gui/itextfield/UITextField.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java index ba05141c94..2d2f1864da 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java @@ -22,31 +22,35 @@ public class UIPassWordField extends JPasswordField { public UIPassWordField() { super(); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text) { super(text); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(int columns) { super(columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text, int columns) { super(text, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(Document doc, String txt, int columns) { super(doc, txt, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } private void addRollOverListener() { - InputEventBaseOnOS.addBasicEditInputMap(this); this.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index fd77b6f4dc..09db8974e5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -42,31 +42,35 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs public UITextField() { super(); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(int columns) { super(columns); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(String text, int columns) { super(text, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(String text) { super(text); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(Document doc, String text, int columns) { super(doc, text, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } protected void initListener() { - InputEventBaseOnOS.addBasicEditInputMap(this); if (shouldResponseChangeListener()) { getDocument().addDocumentListener(new DocumentListener() { @Override From a965e07ff90e52597b37d4b605a84de1ed084ae3 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 17:46:59 +0800 Subject: [PATCH 31/47] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85=203.?= =?UTF-8?q?=E5=B0=86=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E5=85=AC=E7=94=A8=E6=93=8D=E4=BD=9C=E6=8A=BD=E5=8F=96=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=E6=94=BE=E5=9C=A8init()=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/ipasswordfield/UIPassWordField.java | 19 +++++++++++-------- .../fr/design/gui/itextfield/UITextField.java | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java index 2d2f1864da..5e595643c0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java @@ -22,30 +22,33 @@ public class UIPassWordField extends JPasswordField { public UIPassWordField() { super(); - InputEventBaseOnOS.addBasicEditInputMap(this); - addRollOverListener(); + init(); } public UIPassWordField(String text) { super(text); - InputEventBaseOnOS.addBasicEditInputMap(this); - addRollOverListener(); + init(); } public UIPassWordField(int columns) { super(columns); - InputEventBaseOnOS.addBasicEditInputMap(this); - addRollOverListener(); + init(); } public UIPassWordField(String text, int columns) { super(text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); - addRollOverListener(); + init(); } public UIPassWordField(Document doc, String txt, int columns) { super(doc, txt, columns); + init(); + } + + /** + * 每个构造方法里都需要做的一些操作 + */ + public void init() { InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index 09db8974e5..10edf9fe00 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -42,30 +42,33 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs public UITextField() { super(); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); + init(); } public UITextField(int columns) { super(columns); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); + init(); } public UITextField(String text, int columns) { super(text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); + init(); } public UITextField(String text) { super(text); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); + init(); } public UITextField(Document doc, String text, int columns) { super(doc, text, columns); + init(); + } + + /** + * 每个构造方法里都需要做的一些操作 + */ + public void init() { InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } From b8f22b901def58d22a472f38ada25b663afcc3b8 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 29 Jul 2020 18:32:43 +0800 Subject: [PATCH 32/47] =?UTF-8?q?REPORT-29562=20=E3=80=90=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E3=80=91=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E4=B8=AD=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5=E5=92=8C=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E4=BA=8B=E4=BB=B6=E6=96=87=E5=AD=97=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/condition/HyperlinkPane.java | 4 +++- .../java/com/fr/design/condition/WidgetHighlightPane.java | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java index 643ad78906..594d2ed9c6 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java @@ -15,6 +15,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -30,6 +31,7 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane { private static final int DIALOG_WIDTH = 700; private static final int DIALOG_HEIGHT = 400; + private static final Dimension WINDOW_CUSTOM_SIZE = new Dimension(720, 600); private Widget widget; private UIComboBox box; @@ -45,8 +48,7 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane Date: Wed, 29 Jul 2020 19:24:19 +0800 Subject: [PATCH 33/47] =?UTF-8?q?REPORT-29562=20=E3=80=90=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E3=80=91=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E4=B8=AD=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5=E5=92=8C=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E4=BA=8B=E4=BB=B6=E6=96=87=E5=AD=97=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=20=E4=BF=AE=E6=94=B9import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/condition/HyperlinkPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java index 594d2ed9c6..1df652a844 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java @@ -15,7 +15,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; import javax.swing.*; -import java.awt.*; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; From 6c14387ba9b266748ee05ae1c1dfce5c497ff84f Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 29 Jul 2020 19:06:33 +0800 Subject: [PATCH 34/47] =?UTF-8?q?REPORT-33604=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=8A=A0=E8=A7=A3=E5=AF=86=E6=8E=A5=E5=8F=A3=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java | 3 ++- designer-base/src/main/java/com/fr/file/FileFILE.java | 3 ++- designer-base/src/main/java/com/fr/file/FileNodeFILE.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java index 67ab8dfb06..54bbd8d533 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.vcs.common; +import com.fr.base.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; @@ -48,7 +49,7 @@ public class VcsCacheFileNodeFile extends FileNodeFILE { ); return envPath.endsWith(".cpt") || envPath.endsWith(".frm") - ? XMLEncryptUtils.decodeInputStream(in) : in; + ? XMLEncryptUtils.decodeInputStream(FineEncryptUtils.decode(in)) : in; } diff --git a/designer-base/src/main/java/com/fr/file/FileFILE.java b/designer-base/src/main/java/com/fr/file/FileFILE.java index c4f58fa1a3..cb330086de 100644 --- a/designer-base/src/main/java/com/fr/file/FileFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileFILE.java @@ -1,5 +1,6 @@ package com.fr.file; +import com.fr.base.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.gui.itree.filetree.FileComparator; import com.fr.design.gui.itree.filetree.FileTreeIcon; @@ -186,7 +187,7 @@ public class FileFILE implements FILE { public InputStream asInputStream() throws Exception { InputStream in = new java.io.FileInputStream(file); return file.getName().endsWith(".cpt") || file.getName().endsWith(".frm") - ? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(in)) : in; + ? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(FineEncryptUtils.decode(in))) : in; } /** diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index 138cfe3456..b40bed658e 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -2,6 +2,7 @@ package com.fr.file; import com.fr.base.BaseUtils; import com.fr.base.FRContext; +import com.fr.base.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.file.NodeAuthProcessor; import com.fr.design.gui.itree.filetree.FileNodeComparator; @@ -388,7 +389,7 @@ public class FileNodeFILE implements FILE { ); return envPath.endsWith(".cpt") || envPath.endsWith(".frm") - ? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(in)) : in; + ? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(FineEncryptUtils.decode(in))) : in; } /** From 383d6fc2316e5bcce2cac1f5e6f5126683433e97 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Thu, 30 Jul 2020 10:14:28 +0800 Subject: [PATCH 35/47] =?UTF-8?q?REPORT-23260=20=E5=B0=86=E5=8E=9F?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E5=85=A8=E9=80=89=E6=A1=86=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=E4=B8=89=E6=80=81=E7=9A=84CheckBox,=E5=B9=B6=E5=9C=A8?= =?UTF-8?q?=E4=B8=89=E6=80=81=E7=9A=84CheckBox=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9B=91=E5=90=AC=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/event/StateChangeListener.java | 9 +++++++++ .../fr/design/file/SaveSomeTemplatePane.java | 2 +- .../itree/checkboxtree/TristateCheckBox.java | 20 +++++++++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/event/StateChangeListener.java diff --git a/designer-base/src/main/java/com/fr/design/event/StateChangeListener.java b/designer-base/src/main/java/com/fr/design/event/StateChangeListener.java new file mode 100644 index 0000000000..9e4e655f31 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/event/StateChangeListener.java @@ -0,0 +1,9 @@ +package com.fr.design.event; + +/** + * @Author: Yuan.Wang + * @Date: 2020/7/29 + */ +public interface StateChangeListener { + public void stateChange(); +} diff --git a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java index f271f23c0e..be92b04730 100644 --- a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java @@ -1 +1 @@ -package com.fr.design.file; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; /** * Author : daisy * Date: 13-8-9 * Time: 下午3:41 */ public class SaveSomeTemplatePane extends BasicPane { private UICheckBox[] templateCheckBoxes = null; private BasicDialog dialog; private JPanel templatesChoosePane; private UIScrollPane scrollPane; private java.util.List> unSavedTemplate = new ArrayList>(); private boolean isAllSaved = false; //该变量用来判断是在关闭其他模板或是关闭设计器的时候,是否需要判断当前模板有没有保存 private boolean isJudgeCurrentEditingTemplate = true; public SaveSomeTemplatePane(boolean isNeedTojudgeCurrent) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); if (this.dialog == null) { this.dialog = this.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { for (int i = 0; i < templateCheckBoxes.length; i++) { if (templateCheckBoxes[i].isSelected()) { saveSelectedTemplate(unSavedTemplate.get(i)); } } isAllSaved = true; } public void doCancel() { isAllSaved = false; } }); } UILabel tip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_The_Source_To_Save")); this.add(tip, BorderLayout.NORTH); templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } private void initTemplatesChoosePane() { templatesChoosePane.setBorder(BorderFactory.createTitledBorder("")); for (int i = 0; i < unSavedTemplate.size(); i++) { templateCheckBoxes[i] = new UICheckBox(unSavedTemplate.get(i).getEditingFILE().getName()); templateCheckBoxes[i].setSelected(true); } final UIList templatesList = new UIList(templateCheckBoxes); templatesList.setModel(new UnSeletedTemplateListDataMode()); templatesList.setCellRenderer(new UnSelectedListCellRender()); templatesList.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { super.mousePressed(e); int index = templatesList.getSelectedIndex(); if (index < 0) { return; } UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(index); checkBox.setSelected(!checkBox.isSelected()); templatesList.repaint(); } }); final UICheckBox filenameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Choose_All")); filenameCheckBox.setSelected(true); filenameCheckBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { boolean isSelected = filenameCheckBox.isSelected(); for (int i = 0; i < templatesList.getModel().getSize(); i++) { UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(i); checkBox.setSelected(isSelected); } templatesList.repaint(); } }); templatesChoosePane.add(filenameCheckBox, BorderLayout.NORTH); templatesChoosePane.add(templatesList, BorderLayout.CENTER); } public boolean showSavePane() { populate(); //如果有未保存的文件 ,则跳出保存对话框,选择要存储的项目 if (!unSavedTemplate.isEmpty()) { dialog.setVisible(true); } else { isAllSaved = true; } return isAllSaved; } public void populate() { java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); JTemplate currentTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); for (int i = 0; i < opendedTemplate.size(); i++) { if (isneedToAdd(opendedTemplate.get(i), currentTemplate)) { unSavedTemplate.add(opendedTemplate.get(i)); } } templateCheckBoxes = new UICheckBox[unSavedTemplate.size()]; initTemplatesChoosePane(); } private boolean isneedToAdd(JTemplate template, JTemplate currentTemplate) { //所有模板都判断是不是保存 if (isJudgeCurrentEditingTemplate) { return !template.isALLSaved(); } //当前编辑的模板不判断是否已经保存 if (ComparatorUtils.equals(template, currentTemplate)) { return false; } else { return !template.isALLSaved(); } } private void saveSelectedTemplate(JTemplate specifiedTemplate) { if (!specifiedTemplate.isSaved()) { specifiedTemplate.stopEditing(); specifiedTemplate.saveTemplate(); } FineLoggerFactory.getLogger().info( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); } public int saveLastOneTemplate() { JTemplate specifiedTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (!specifiedTemplate.isALLSaved()) { specifiedTemplate.stopEditing(); int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION && specifiedTemplate.saveTemplate()) { specifiedTemplate.saveTemplate(); FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); } return returnVal; } return JOptionPane.YES_OPTION; } protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save"); } private class UnSelectedListCellRender extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent(JList list, Object value, int index, final boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); templateCheckBoxes[index] = (UICheckBox) value; templateCheckBoxes[index].setBackground(list.getBackground()); return templateCheckBoxes[index]; } } private class UnSeletedTemplateListDataMode extends AbstractListModel { @Override public int getSize() { return templateCheckBoxes.length; } @Override public UICheckBox getElementAt(int index) { if (index > getSize() - 1 || index < 0) { return null; } return templateCheckBoxes[index]; } } } \ No newline at end of file +package com.fr.design.file; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.StateChangeListener; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; import com.fr.design.gui.itree.checkboxtree.NullTristateCheckBox; import com.fr.design.gui.itree.checkboxtree.TristateCheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; /** * Author : daisy * Date: 13-8-9 * Time: 下午3:41 */ public class SaveSomeTemplatePane extends BasicPane { private UICheckBox[] templateCheckBoxes = null; private BasicDialog dialog; private JPanel templatesChoosePane; private UIScrollPane scrollPane; private java.util.List> unSavedTemplate = new ArrayList>(); private boolean isAllSaved = false; //该变量用来判断是在关闭其他模板或是关闭设计器的时候,是否需要判断当前模板有没有保存 private boolean isJudgeCurrentEditingTemplate = true; public SaveSomeTemplatePane(boolean isNeedTojudgeCurrent) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); if (this.dialog == null) { this.dialog = this.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { for (int i = 0; i < templateCheckBoxes.length; i++) { if (templateCheckBoxes[i].isSelected()) { saveSelectedTemplate(unSavedTemplate.get(i)); } } isAllSaved = true; } public void doCancel() { isAllSaved = false; } }); } UILabel tip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_The_Source_To_Save")); this.add(tip, BorderLayout.NORTH); templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } private void initTemplatesChoosePane() { templatesChoosePane.setBorder(BorderFactory.createTitledBorder("")); for (int i = 0; i < unSavedTemplate.size(); i++) { templateCheckBoxes[i] = new UICheckBox(unSavedTemplate.get(i).getEditingFILE().getName()); templateCheckBoxes[i].setSelected(true); } final UIList templatesList = new UIList(templateCheckBoxes); templatesList.setModel(new UnSeletedTemplateListDataMode()); templatesList.setCellRenderer(new UnSelectedListCellRender()); final TristateCheckBox chooseAllCheckBox = new NullTristateCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Choose_All")); chooseAllCheckBox.setState(TristateCheckBox.SELECTED); //取消chooseAllCheckBox的焦点事件监听,因为默认的焦点事件监听中失焦时会改变chooseAllCheckBox的状态 chooseAllCheckBox.setFocusable(false); chooseAllCheckBox.addStateChangeListener(new StateChangeListener() { @Override public void stateChange() { if (chooseAllCheckBox.getState() == TristateCheckBox.DO_NOT_CARE) { return; } boolean isSelected = chooseAllCheckBox.isSelected(); for (int i = 0; i < templatesList.getModel().getSize(); i++) { UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(i); checkBox.setSelected(isSelected); } templatesList.repaint(); } }); templatesList.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { super.mousePressed(e); int index = templatesList.getSelectedIndex(); if (index < 0) { return; } UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(index); checkBox.setSelected(!checkBox.isSelected()); //根据templateCheckBoxes中的选择情况来更新全选框的状态 int selectedCount = calculateSelectedNum(); if (selectedCount == 0) { chooseAllCheckBox.setState(TristateCheckBox.NOT_SELECTED); } else if (selectedCount == templateCheckBoxes.length) { chooseAllCheckBox.setState(TristateCheckBox.SELECTED); } else { chooseAllCheckBox.setState(TristateCheckBox.DO_NOT_CARE); } templatesList.repaint(); } }); templatesChoosePane.add(chooseAllCheckBox, BorderLayout.NORTH); templatesChoosePane.add(templatesList, BorderLayout.CENTER); } /** * 获取templateCheckBoxes中状态为选中状态的CheckBox数量 * */ private int calculateSelectedNum() { int count = 0; for (UICheckBox checkBox : templateCheckBoxes) { if (checkBox.isSelected()) { count++; } } return count; } public boolean showSavePane() { populate(); //如果有未保存的文件 ,则跳出保存对话框,选择要存储的项目 if (!unSavedTemplate.isEmpty()) { dialog.setVisible(true); } else { isAllSaved = true; } return isAllSaved; } public void populate() { java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); JTemplate currentTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); for (int i = 0; i < opendedTemplate.size(); i++) { if (isneedToAdd(opendedTemplate.get(i), currentTemplate)) { unSavedTemplate.add(opendedTemplate.get(i)); } } templateCheckBoxes = new UICheckBox[unSavedTemplate.size()]; initTemplatesChoosePane(); } private boolean isneedToAdd(JTemplate template, JTemplate currentTemplate) { //所有模板都判断是不是保存 if (isJudgeCurrentEditingTemplate) { return !template.isALLSaved(); } //当前编辑的模板不判断是否已经保存 if (ComparatorUtils.equals(template, currentTemplate)) { return false; } else { return !template.isALLSaved(); } } private void saveSelectedTemplate(JTemplate specifiedTemplate) { if (!specifiedTemplate.isSaved()) { specifiedTemplate.stopEditing(); specifiedTemplate.saveTemplate(); } FineLoggerFactory.getLogger().info( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); } public int saveLastOneTemplate() { JTemplate specifiedTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (!specifiedTemplate.isALLSaved()) { specifiedTemplate.stopEditing(); int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION && specifiedTemplate.saveTemplate()) { specifiedTemplate.saveTemplate(); FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); } return returnVal; } return JOptionPane.YES_OPTION; } protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save"); } private class UnSelectedListCellRender extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent(JList list, Object value, int index, final boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); templateCheckBoxes[index] = (UICheckBox) value; templateCheckBoxes[index].setBackground(list.getBackground()); return templateCheckBoxes[index]; } } private class UnSeletedTemplateListDataMode extends AbstractListModel { @Override public int getSize() { return templateCheckBoxes.length; } @Override public UICheckBox getElementAt(int index) { if (index > getSize() - 1 || index < 0) { return null; } return templateCheckBoxes[index]; } } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/TristateCheckBox.java b/designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/TristateCheckBox.java index a4a59ade24..b821b0731a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/TristateCheckBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/TristateCheckBox.java @@ -1,6 +1,7 @@ package com.fr.design.gui.itree.checkboxtree; import com.fr.design.constants.UIConstants; +import com.fr.design.event.StateChangeListener; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.stable.Constants; @@ -75,6 +76,8 @@ public class TristateCheckBox extends UICheckBox { private final TristateDecorator model; + public StateChangeListener stateChangeListener; + public TristateCheckBox(String text, Icon icon, State initial) { super(text, icon); setUI(new TristateCheckBoxUI()); @@ -83,7 +86,7 @@ public class TristateCheckBox extends UICheckBox { @Override public void mousePressed(MouseEvent e) { grabFocus(); - model.setState(getNextState(model.getState())); + setState(getNextState(model.getState())); } }); // Reset the keyboard action map @@ -92,7 +95,7 @@ public class TristateCheckBox extends UICheckBox { @Override public void actionPerformed(ActionEvent e) { grabFocus(); - model.setState(getNextState(model.getState())); + setState(getNextState(model.getState())); } }); map.put("released", null); @@ -125,12 +128,20 @@ public class TristateCheckBox extends UICheckBox { public void addMouseListener(MouseListener l) { } + public void addStateChangeListener(StateChangeListener stateChangeListener) { + this.stateChangeListener=stateChangeListener; + } + /** * Set the new state to either SELECTED, NOT_SELECTED or * DO_NOT_CARE. If state == null, it is treated as DO_NOT_CARE. */ public void setState(State state) { + State old = getState(); model.setState(state); + if (old != state) { + fireBoxStateChanged(); + } } /** @@ -141,6 +152,11 @@ public class TristateCheckBox extends UICheckBox { return model.getState(); } + public void fireBoxStateChanged() { + if (stateChangeListener != null) { + stateChangeListener.stateChange(); + } + } /** * Exactly which Design Pattern is this? Is it an Adapter, From e33af330cafa8096e1e726fceaa7fa3c33b49fe4 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Thu, 30 Jul 2020 10:35:45 +0800 Subject: [PATCH 36/47] =?UTF-8?q?REPORT-35463=20=E6=B7=BB=E5=8A=A0BUG?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=8D=E9=A6=88=E3=80=81=E6=8A=80=E6=9C=AF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=8F=9C=E5=8D=95=E9=A1=B9=EF=BC=8C=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E5=B8=AE=E5=8A=A9=E8=8F=9C=E5=8D=95=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8A=80=E6=9C=AF=E6=94=AF=E6=8C=81=EF=BC=8C=E9=9F=A9=E6=96=87?= =?UTF-8?q?=E3=80=81=E6=97=A5=E6=96=87=E5=B8=AE=E5=8A=A9=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E5=8F=B0=E6=B9=BE=E7=A4=BE=E5=8C=BA=E8=8F=9C=E5=8D=95BUG=20?= =?UTF-8?q?=E4=B8=8E=E9=9C=80=E6=B1=82=E5=8F=8D=E9=A6=88=E5=90=88=E4=B8=BA?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=8A=80=E6=9C=AF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=8F=9C=E5=8D=95=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/community/BugNeedAction.java | 48 +++++++++++++++++ .../actions/community/TechSupportAction.java | 49 ++++++++++++++++++ .../fr/design/locale/impl/BugNeedMark.java | 29 +++++++++++ .../design/locale/impl/TechSupportMark.java | 30 +++++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 32 +++++++----- .../com/fr/design/images/bbs/support.png | Bin 0 -> 385 bytes 6 files changed, 174 insertions(+), 14 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java create mode 100644 designer-base/src/main/java/com/fr/design/actions/community/TechSupportAction.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/support.png diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java new file mode 100644 index 0000000000..17ee23b530 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java @@ -0,0 +1,48 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.locale.impl.BugNeedMark; +import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +/** + * @Author: Yuan.Wang + * @Date: 2020/7/28 + */ +public class BugNeedAction extends UpdateAction { + public BugNeedAction() { + this.setMenuKeySet(BugAndNeed); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png")); + } + + @Override + public void actionPerformed(ActionEvent e) { + LocaleMark localeMark = LocaleCenter.getMark(BugNeedMark.class); + BrowseUtils.browser(localeMark.getValue()); + } + + public static final MenuKeySet BugAndNeed = new MenuKeySet() { + @Override + public char getMnemonic() { + return 0; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_BugAndNeed"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSupportAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSupportAction.java new file mode 100644 index 0000000000..9c8067138e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSupportAction.java @@ -0,0 +1,49 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.locale.impl.TechSupportMark; +import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +/** + * @Author: Yuan.Wang + * @Date: 2020/7/28 + */ +public class TechSupportAction extends UpdateAction { + public TechSupportAction() { + this.setMenuKeySet(TechSupport); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/support.png")); + } + + @Override + public void actionPerformed(ActionEvent e) { + LocaleMark localeMark = LocaleCenter.getMark(TechSupportMark.class); + String str=localeMark.getValue(); + BrowseUtils.browser(localeMark.getValue()); + } + + public static final MenuKeySet TechSupport = new MenuKeySet() { + @Override + public char getMnemonic() { + return 0; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_TechSupport"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java new file mode 100644 index 0000000000..41822d19cb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java @@ -0,0 +1,29 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @Author: Yuan.Wang + * @Date: 2020/7/29 + */ +public class BugNeedMark implements LocaleMark { + private Map map = new HashMap<>(); + private static final String TW_BUG_AND_NEEDS = CloudCenter.getInstance().acquireUrlByKind("bbs.bug.needs.zh_TW"); + + public BugNeedMark() { + map.put(Locale.TAIWAN, TW_BUG_AND_NEEDS); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? TW_BUG_AND_NEEDS : result; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java new file mode 100644 index 0000000000..6d15764b5f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java @@ -0,0 +1,30 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @Author: Yuan.Wang + * @Date: 2020/7/29 + */ +public class TechSupportMark implements LocaleMark { + private Map map = new HashMap<>(); + private static final String EN_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.en_US"); + private static final String TW_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.zh_TW"); + + public TechSupportMark() { + map.put(Locale.US, EN_TECH_SUPPORT); + map.put(Locale.TAIWAN, TW_TECH_SUPPORT); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? EN_TECH_SUPPORT : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index bc4b85ced8..cc6e0fc488 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -9,15 +9,7 @@ import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; -import com.fr.design.actions.community.BBSAction; -import com.fr.design.actions.community.BugAction; -import com.fr.design.actions.community.CenterAction; -import com.fr.design.actions.community.FacebookFansAction; -import com.fr.design.actions.community.NeedAction; -import com.fr.design.actions.community.QuestionAction; -import com.fr.design.actions.community.SignAction; -import com.fr.design.actions.community.TechSolutionAction; -import com.fr.design.actions.community.VideoAction; +import com.fr.design.actions.community.*; import com.fr.design.actions.file.CloseCurrentTemplateAction; import com.fr.design.actions.file.ExitDesignerAction; import com.fr.design.actions.file.OpenRecentReportMenuDef; @@ -529,9 +521,15 @@ public abstract class ToolBarMenuDock { */ public ShortCut[] createHelpShortCuts() { final java.util.List shortCuts = new ArrayList(); - // 英文,把 video 和帮助文档放到 Help 下面 - if (GeneralContext.getLocale().equals(Locale.US)) { + + Locale locale = GeneralContext.getLocale(); + // 英文,把Video和技术支持放到 Help 下面 + if (locale.equals(Locale.US)) { shortCuts.add(new VideoAction()); + shortCuts.add(new TechSupportAction()); + } + // 英文、韩文、日文,把帮助文档放到 Help 下面 + if (locale.equals(Locale.US) || locale.equals(Locale.KOREA) || locale.equals(Locale.JAPAN)) { shortCuts.add(new TutorialAction()); } //远程不使用更新升级,产品演示 @@ -576,9 +574,15 @@ public abstract class ToolBarMenuDock { shortCuts.add(new TechSolutionAction()); shortCuts.add(SeparatorDef.DEFAULT); - - shortCuts.add(new BugAction()); - shortCuts.add(new NeedAction()); + + //台湾,将BUG和需求合并成一个,同时新增技术支持 + if (GeneralContext.getLocale().equals(Locale.TAIWAN)) { + shortCuts.add(new TechSupportAction()); + shortCuts.add(new BugNeedAction()); + } else { + shortCuts.add(new BugAction()); + shortCuts.add(new NeedAction()); + } shortCuts.add(SeparatorDef.DEFAULT); diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/support.png b/designer-base/src/main/resources/com/fr/design/images/bbs/support.png new file mode 100644 index 0000000000000000000000000000000000000000..a19c313c676f90bf185735978443d6b19c2f95c0 GIT binary patch literal 385 zcmV-{0e=38P)F?|{7< z3nD5>GcfQI2!4PzXY8w-UPBYHaZ+OYy=R}#cL=o=MbWV(8WX_@QwRKgBEqvloMc({ zR+EEKAW0Gvgu_W`X-bGM2H|3VZ?`X2V!?$Mo#u!|4T3PdMS@df@RE1>Qd})}*0+`( z3E`>8^E<^|fnYQmVp%@y^m>CdO+S>Z+c=I7zZZ)+bvjqYZ1yU=YX_J1h5+u{l0_`M z=vaR(v8>g3kj}csOjl6*-|3LfRn--TCw{an?Rzi?9bU}yYBnlljyDHjokDA?q#(Y( zR&3(FX5&iygunX#U%(Af+V#)X)PAF;k!Y&q;Z+A7=3Kw%wrf>=RlrYBQWCe}%8UK= fV3hO|+dB9GN6&QJ`0wdo00000NkvXXu0mjf(9x$| literal 0 HcmV?d00001 From ca6fce530dfb02bbdcf15526ff09a760e5bfa522 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 30 Jul 2020 11:49:44 +0800 Subject: [PATCH 37/47] =?UTF-8?q?REPORT-30708=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=85=8D=E7=BD=AE=E6=A1=86=E4=B8=8D=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E9=85=8D=E7=BD=AE=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/MutilTempalteTabPane.java | 3 ++ .../com/fr/design/file/TemplateTreePane.java | 3 ++ .../fr/design/mainframe/DesignerFrame.java | 2 + .../mainframe/EastRegionContainerPane.java | 42 ++++++++++++++++--- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index e4ab990337..8f7063b82b 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIScrollPopUpMenu; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; @@ -881,6 +882,8 @@ public class MutilTempalteTabPane extends JComponent { */ @Override public void mousePressed(MouseEvent e) { + //切换文件后清空FixedPopupPane面板 + EastRegionContainerPane.getInstance().clearCurrentPopupPane(); //如果在版本管理情况下,不允许切换tab if (DesignerMode.isVcsMode()) { return; diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 93001bde44..f575ecb680 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -11,6 +11,7 @@ import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; @@ -83,6 +84,8 @@ public class TemplateTreePane extends JPanel implements FileOperations { @Override public void mousePressed(MouseEvent evt) { if (evt.getClickCount() == 2) { + //切换文件后清空FixedPopupPane面板 + EastRegionContainerPane.getInstance().clearCurrentPopupPane(); openFile(); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index a31b77650e..3811c4024f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -328,6 +328,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (DesignModeContext.isAuthorityEditing()) { doResize(); } + //刷新FixedPopupPane的位置 + EastRegionContainerPane.getInstance().freshCurrentPopupPane(); } }); this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 35ab552f51..16a1905f3c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -67,6 +67,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private JPanel leftPane; private JPanel rightPane; private FixedPopupPane currentPopupPane; + private UIButton currentButton; private static final int CONTAINER_WIDTH = containerWidth(); private static final int TAB_WIDTH = 38; private static final int TAB_BUTTON_WIDTH = 32; @@ -495,17 +496,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void replaceAuthorityEditionPane(JComponent pane) { propertyItemMap.get(KEY_AUTHORITY_EDITION).replaceContentPane(pane); } - + public JComponent getAuthorityEditionPane() { return propertyItemMap.get(KEY_AUTHORITY_EDITION).getContentPane(); } - + public void replaceConfiguredRolesPane(JComponent pane) { propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane); } - + public void replaceKeyPane(final String key, final JComponent pane) { - + //需要放到 ui 线程中处理 UIUtil.invokeLaterIfNeeded(new Runnable() { @Override @@ -514,11 +515,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } }); } - + public JComponent getConfiguredRolesPane() { return propertyItemMap.get(KEY_CONFIGURED_ROLES).getContentPane(); } - + public void addParameterPane(JComponent paraPane) { propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceHeaderPane(paraPane); } @@ -929,6 +930,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } else { hideCurrentPopupPane(); currentPopupPane = popupPane; + currentButton = button; GUICoreUtils.showPopupMenu(popupPane, button, -popupPane.getPreferredSize().width, 0); } } @@ -990,6 +992,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public void menuSelectionChanged(boolean isIncluded) { + System.out.println("qghdefwqe"); } public Container getContentPane() { @@ -1009,6 +1012,33 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } } + /** + * @Description:刷新currentPopupPane面板位置,当设计器缩放时会调用这个函数 + * @param + * @return: + * @Author: Henry.Wang + * @date: 2020/7/30 11:39 + */ + public void freshCurrentPopupPane() { + hideCurrentPopupPane(); + if (currentPopupPane != null && currentButton != null && currentPopupPane.isVisible()) { + GUICoreUtils.showPopupMenu(currentPopupPane, currentButton, -currentPopupPane.getPreferredSize().width, 0); + } + } + + /** + * @Description:清空currentPopupPane数据,当切换模板时会调用这个函数 + * @param + * @return: + * @Author: Henry.Wang + * @date: 2020/7/30 11:42 + */ + public void clearCurrentPopupPane() { + hideCurrentPopupPane(); + currentPopupPane = null; + currentButton = null; + } + // 弹出属性面板的工具条 private class PopupToolPane extends JPanel { private String title; From 0832c60661db89087d0417b911331c91414521d9 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 30 Jul 2020 11:53:01 +0800 Subject: [PATCH 38/47] =?UTF-8?q?REPORT-30708=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=85=8D=E7=BD=AE=E6=A1=86=E4=B8=8D=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E9=85=8D=E7=BD=AE=E6=8C=89=E9=92=AE=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/EastRegionContainerPane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 16a1905f3c..fdbd7de35d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -992,7 +992,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public void menuSelectionChanged(boolean isIncluded) { - System.out.println("qghdefwqe"); } public Container getContentPane() { @@ -1025,7 +1024,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { GUICoreUtils.showPopupMenu(currentPopupPane, currentButton, -currentPopupPane.getPreferredSize().width, 0); } } - +给i他 /** * @Description:清空currentPopupPane数据,当切换模板时会调用这个函数 * @param From a72f8cef98ccd792253c17b66951d2c9d563f3de Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 30 Jul 2020 11:54:19 +0800 Subject: [PATCH 39/47] =?UTF-8?q?REPORT-30708=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=85=8D=E7=BD=AE=E6=A1=86=E4=B8=8D=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E9=85=8D=E7=BD=AE=E6=8C=89=E9=92=AE=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/EastRegionContainerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index fdbd7de35d..c1b601526b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1024,7 +1024,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { GUICoreUtils.showPopupMenu(currentPopupPane, currentButton, -currentPopupPane.getPreferredSize().width, 0); } } -给i他 + /** * @Description:清空currentPopupPane数据,当切换模板时会调用这个函数 * @param From 85d72a44d9a1c9c378be1b0d1b0f29758b3fec84 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 30 Jul 2020 12:22:49 +0800 Subject: [PATCH 40/47] =?UTF-8?q?REPORT-30708=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=85=8D=E7=BD=AE=E6=A1=86=E4=B8=8D=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E9=85=8D=E7=BD=AE=E6=8C=89=E9=92=AE=20?= =?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 --- .../java/com/fr/design/mainframe/EastRegionContainerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index c1b601526b..1eee94246b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1020,7 +1020,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { */ public void freshCurrentPopupPane() { hideCurrentPopupPane(); - if (currentPopupPane != null && currentButton != null && currentPopupPane.isVisible()) { + if (currentPopupPane != null && currentButton != null) { GUICoreUtils.showPopupMenu(currentPopupPane, currentButton, -currentPopupPane.getPreferredSize().width, 0); } } From 9f8e753b186af15aaacc472f180e3514195646a2 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Thu, 30 Jul 2020 14:27:52 +0800 Subject: [PATCH 41/47] =?UTF-8?q?REPORT-35463=20=E4=BD=BF=E7=94=A8LocaleAc?= =?UTF-8?q?tion=E5=8C=85=E8=A3=85action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/locale/impl/SupportLocaleImpl.java | 107 ++++++++++++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 85 +++++++++++--- 2 files changed, 174 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java index c6c1b1f280..e192336d65 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java @@ -10,6 +10,7 @@ import java.util.Set; * 某些国际化环境支持的操作 * 需要增加/删除支持的语言 统一在这里修改 无须改动业务代码 * 后续有新的不同语言下的差异操作 添加新的枚举 + * * @author Hades * @date 2019/6/24 */ @@ -50,6 +51,112 @@ public enum SupportLocaleImpl implements SupportLocale { set.add(Locale.KOREA); return set; } + }, + + /** + * BUG反馈 + */ + BUG { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.CHINA); + set.add(Locale.US); + set.add(Locale.JAPAN); + set.add(Locale.KOREA); + return set; + } + }, + + /** + * 需求反馈 + */ + NEED { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.CHINA); + set.add(Locale.US); + set.add(Locale.JAPAN); + set.add(Locale.KOREA); + return set; + } + }, + + /** + * BUG需求反馈 + */ + BUG_AND_NEED { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.TAIWAN); + return set; + } + }, + + /** + * 视频 + */ + VIDEO { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.US); + return set; + } + }, + + /** + * 技术支持-帮助菜单下 + */ + TECH_SUPPORT_HELP { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.US); + return set; + } + }, + + /** + * 技术支持-社区菜单下 + */ + TECH_SUPPORT_COMMUNITY { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.TAIWAN); + return set; + } + }, + + /** + * 帮助文档-帮助菜单下 + */ + TUTORIAL_HELP { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.CHINA); + set.add(Locale.TAIWAN); + return set; + } + }, + + /** + * 帮助文档-社区菜单下 + */ + TUTORIAL_COMMUNITY { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.US); + set.add(Locale.KOREA); + set.add(Locale.JAPAN); + return set; + } } + } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index cc6e0fc488..775b03747b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -9,7 +9,17 @@ import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; -import com.fr.design.actions.community.*; +import com.fr.design.actions.community.BBSAction; +import com.fr.design.actions.community.BugAction; +import com.fr.design.actions.community.BugNeedAction; +import com.fr.design.actions.community.CenterAction; +import com.fr.design.actions.community.FacebookFansAction; +import com.fr.design.actions.community.NeedAction; +import com.fr.design.actions.community.QuestionAction; +import com.fr.design.actions.community.SignAction; +import com.fr.design.actions.community.TechSolutionAction; +import com.fr.design.actions.community.TechSupportAction; +import com.fr.design.actions.community.VideoAction; import com.fr.design.actions.file.CloseCurrentTemplateAction; import com.fr.design.actions.file.ExitDesignerAction; import com.fr.design.actions.file.OpenRecentReportMenuDef; @@ -523,15 +533,28 @@ public abstract class ToolBarMenuDock { final java.util.List shortCuts = new ArrayList(); Locale locale = GeneralContext.getLocale(); - // 英文,把Video和技术支持放到 Help 下面 - if (locale.equals(Locale.US)) { - shortCuts.add(new VideoAction()); - shortCuts.add(new TechSupportAction()); - } - // 英文、韩文、日文,把帮助文档放到 Help 下面 - if (locale.equals(Locale.US) || locale.equals(Locale.KOREA) || locale.equals(Locale.JAPAN)) { - shortCuts.add(new TutorialAction()); - } + + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new VideoAction()); + } + }, SupportLocaleImpl.VIDEO); + + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new TutorialAction()); + } + }, SupportLocaleImpl.TUTORIAL_HELP); + + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new TechSupportAction()); + } + }, SupportLocaleImpl.TECH_SUPPORT_HELP); + //远程不使用更新升级,产品演示 if (WorkContext.getCurrent().isLocal()) { shortCuts.add(new WebDemoAction()); @@ -575,14 +598,40 @@ public abstract class ToolBarMenuDock { shortCuts.add(SeparatorDef.DEFAULT); - //台湾,将BUG和需求合并成一个,同时新增技术支持 - if (GeneralContext.getLocale().equals(Locale.TAIWAN)) { - shortCuts.add(new TechSupportAction()); - shortCuts.add(new BugNeedAction()); - } else { - shortCuts.add(new BugAction()); - shortCuts.add(new NeedAction()); - } + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new BugAction()); + } + }, SupportLocaleImpl.BUG); + + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new NeedAction()); + } + }, SupportLocaleImpl.NEED); + + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new BugNeedAction()); + } + }, SupportLocaleImpl.BUG_AND_NEED); + + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new TechSupportAction()); + } + }, SupportLocaleImpl.TECH_SUPPORT_COMMUNITY); + + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new TutorialAction()); + } + }, SupportLocaleImpl.TUTORIAL_COMMUNITY); shortCuts.add(SeparatorDef.DEFAULT); From cc9878b8ff5f92054dad3b9a9f8bcfa90ff884e4 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Thu, 30 Jul 2020 14:39:23 +0800 Subject: [PATCH 42/47] =?UTF-8?q?REPORT-35463=20=E4=BF=AE=E6=94=B9SaveSome?= =?UTF-8?q?TemplatePane=E7=9A=84=E6=8D=A2=E8=A1=8C=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/SaveSomeTemplatePane.java | 245 +++++++++++++++++- 1 file changed, 244 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java index be92b04730..e331d296ef 100644 --- a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java @@ -1 +1,244 @@ -package com.fr.design.file; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.StateChangeListener; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; import com.fr.design.gui.itree.checkboxtree.NullTristateCheckBox; import com.fr.design.gui.itree.checkboxtree.TristateCheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; /** * Author : daisy * Date: 13-8-9 * Time: 下午3:41 */ public class SaveSomeTemplatePane extends BasicPane { private UICheckBox[] templateCheckBoxes = null; private BasicDialog dialog; private JPanel templatesChoosePane; private UIScrollPane scrollPane; private java.util.List> unSavedTemplate = new ArrayList>(); private boolean isAllSaved = false; //该变量用来判断是在关闭其他模板或是关闭设计器的时候,是否需要判断当前模板有没有保存 private boolean isJudgeCurrentEditingTemplate = true; public SaveSomeTemplatePane(boolean isNeedTojudgeCurrent) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); if (this.dialog == null) { this.dialog = this.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { for (int i = 0; i < templateCheckBoxes.length; i++) { if (templateCheckBoxes[i].isSelected()) { saveSelectedTemplate(unSavedTemplate.get(i)); } } isAllSaved = true; } public void doCancel() { isAllSaved = false; } }); } UILabel tip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_The_Source_To_Save")); this.add(tip, BorderLayout.NORTH); templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } private void initTemplatesChoosePane() { templatesChoosePane.setBorder(BorderFactory.createTitledBorder("")); for (int i = 0; i < unSavedTemplate.size(); i++) { templateCheckBoxes[i] = new UICheckBox(unSavedTemplate.get(i).getEditingFILE().getName()); templateCheckBoxes[i].setSelected(true); } final UIList templatesList = new UIList(templateCheckBoxes); templatesList.setModel(new UnSeletedTemplateListDataMode()); templatesList.setCellRenderer(new UnSelectedListCellRender()); final TristateCheckBox chooseAllCheckBox = new NullTristateCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Choose_All")); chooseAllCheckBox.setState(TristateCheckBox.SELECTED); //取消chooseAllCheckBox的焦点事件监听,因为默认的焦点事件监听中失焦时会改变chooseAllCheckBox的状态 chooseAllCheckBox.setFocusable(false); chooseAllCheckBox.addStateChangeListener(new StateChangeListener() { @Override public void stateChange() { if (chooseAllCheckBox.getState() == TristateCheckBox.DO_NOT_CARE) { return; } boolean isSelected = chooseAllCheckBox.isSelected(); for (int i = 0; i < templatesList.getModel().getSize(); i++) { UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(i); checkBox.setSelected(isSelected); } templatesList.repaint(); } }); templatesList.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { super.mousePressed(e); int index = templatesList.getSelectedIndex(); if (index < 0) { return; } UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(index); checkBox.setSelected(!checkBox.isSelected()); //根据templateCheckBoxes中的选择情况来更新全选框的状态 int selectedCount = calculateSelectedNum(); if (selectedCount == 0) { chooseAllCheckBox.setState(TristateCheckBox.NOT_SELECTED); } else if (selectedCount == templateCheckBoxes.length) { chooseAllCheckBox.setState(TristateCheckBox.SELECTED); } else { chooseAllCheckBox.setState(TristateCheckBox.DO_NOT_CARE); } templatesList.repaint(); } }); templatesChoosePane.add(chooseAllCheckBox, BorderLayout.NORTH); templatesChoosePane.add(templatesList, BorderLayout.CENTER); } /** * 获取templateCheckBoxes中状态为选中状态的CheckBox数量 * */ private int calculateSelectedNum() { int count = 0; for (UICheckBox checkBox : templateCheckBoxes) { if (checkBox.isSelected()) { count++; } } return count; } public boolean showSavePane() { populate(); //如果有未保存的文件 ,则跳出保存对话框,选择要存储的项目 if (!unSavedTemplate.isEmpty()) { dialog.setVisible(true); } else { isAllSaved = true; } return isAllSaved; } public void populate() { java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); JTemplate currentTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); for (int i = 0; i < opendedTemplate.size(); i++) { if (isneedToAdd(opendedTemplate.get(i), currentTemplate)) { unSavedTemplate.add(opendedTemplate.get(i)); } } templateCheckBoxes = new UICheckBox[unSavedTemplate.size()]; initTemplatesChoosePane(); } private boolean isneedToAdd(JTemplate template, JTemplate currentTemplate) { //所有模板都判断是不是保存 if (isJudgeCurrentEditingTemplate) { return !template.isALLSaved(); } //当前编辑的模板不判断是否已经保存 if (ComparatorUtils.equals(template, currentTemplate)) { return false; } else { return !template.isALLSaved(); } } private void saveSelectedTemplate(JTemplate specifiedTemplate) { if (!specifiedTemplate.isSaved()) { specifiedTemplate.stopEditing(); specifiedTemplate.saveTemplate(); } FineLoggerFactory.getLogger().info( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); } public int saveLastOneTemplate() { JTemplate specifiedTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (!specifiedTemplate.isALLSaved()) { specifiedTemplate.stopEditing(); int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION && specifiedTemplate.saveTemplate()) { specifiedTemplate.saveTemplate(); FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); } return returnVal; } return JOptionPane.YES_OPTION; } protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save"); } private class UnSelectedListCellRender extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent(JList list, Object value, int index, final boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); templateCheckBoxes[index] = (UICheckBox) value; templateCheckBoxes[index].setBackground(list.getBackground()); return templateCheckBoxes[index]; } } private class UnSeletedTemplateListDataMode extends AbstractListModel { @Override public int getSize() { return templateCheckBoxes.length; } @Override public UICheckBox getElementAt(int index) { if (index > getSize() - 1 || index < 0) { return null; } return templateCheckBoxes[index]; } } } \ No newline at end of file +package com.fr.design.file; + +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.event.StateChangeListener; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ilist.UIList; +import com.fr.design.gui.itree.checkboxtree.NullTristateCheckBox; +import com.fr.design.gui.itree.checkboxtree.TristateCheckBox; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.JTemplate; +import com.fr.general.ComparatorUtils; + +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ProductConstants; + +import javax.swing.*; +import javax.swing.border.EmptyBorder; +import java.awt.*; +import java.awt.event.*; +import java.util.ArrayList; + +/** + * Author : daisy + * Date: 13-8-9 + * Time: 下午3:41 + */ +public class SaveSomeTemplatePane extends BasicPane { + + private UICheckBox[] templateCheckBoxes = null; + private BasicDialog dialog; + private JPanel templatesChoosePane; + private UIScrollPane scrollPane; + private java.util.List> unSavedTemplate = new ArrayList>(); + private boolean isAllSaved = false; + + //该变量用来判断是在关闭其他模板或是关闭设计器的时候,是否需要判断当前模板有没有保存 + private boolean isJudgeCurrentEditingTemplate = true; + + public SaveSomeTemplatePane(boolean isNeedTojudgeCurrent) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + if (this.dialog == null) { + this.dialog = this.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + for (int i = 0; i < templateCheckBoxes.length; i++) { + if (templateCheckBoxes[i].isSelected()) { + saveSelectedTemplate(unSavedTemplate.get(i)); + } + } + isAllSaved = true; + } + + public void doCancel() { + isAllSaved = false; + } + + }); + } + UILabel tip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_The_Source_To_Save")); + this.add(tip, BorderLayout.NORTH); + templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); + this.add(scrollPane, BorderLayout.CENTER); + this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; + } + + private void initTemplatesChoosePane() { + templatesChoosePane.setBorder(BorderFactory.createTitledBorder("")); + for (int i = 0; i < unSavedTemplate.size(); i++) { + templateCheckBoxes[i] = new UICheckBox(unSavedTemplate.get(i).getEditingFILE().getName()); + templateCheckBoxes[i].setSelected(true); + } + + final UIList templatesList = new UIList(templateCheckBoxes); + templatesList.setModel(new UnSeletedTemplateListDataMode()); + templatesList.setCellRenderer(new UnSelectedListCellRender()); + + final TristateCheckBox chooseAllCheckBox = new NullTristateCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Choose_All")); + chooseAllCheckBox.setState(TristateCheckBox.SELECTED); + //取消chooseAllCheckBox的焦点事件监听,因为默认的焦点事件监听中失焦时会改变chooseAllCheckBox的状态 + chooseAllCheckBox.setFocusable(false); + chooseAllCheckBox.addStateChangeListener(new StateChangeListener() { + @Override + public void stateChange() { + if (chooseAllCheckBox.getState() == TristateCheckBox.DO_NOT_CARE) { + return; + } + boolean isSelected = chooseAllCheckBox.isSelected(); + for (int i = 0; i < templatesList.getModel().getSize(); i++) { + UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(i); + checkBox.setSelected(isSelected); + } + templatesList.repaint(); + } + }); + + templatesList.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + int index = templatesList.getSelectedIndex(); + if (index < 0) { + return; + } + UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(index); + checkBox.setSelected(!checkBox.isSelected()); + + //根据templateCheckBoxes中的选择情况来更新全选框的状态 + int selectedCount = calculateSelectedNum(); + if (selectedCount == 0) { + chooseAllCheckBox.setState(TristateCheckBox.NOT_SELECTED); + } else if (selectedCount == templateCheckBoxes.length) { + chooseAllCheckBox.setState(TristateCheckBox.SELECTED); + } else { + chooseAllCheckBox.setState(TristateCheckBox.DO_NOT_CARE); + } + templatesList.repaint(); + } + }); + + templatesChoosePane.add(chooseAllCheckBox, BorderLayout.NORTH); + templatesChoosePane.add(templatesList, BorderLayout.CENTER); + + } + + /** + * 获取templateCheckBoxes中状态为选中状态的CheckBox数量 + * */ + private int calculateSelectedNum() { + int count = 0; + for (UICheckBox checkBox : templateCheckBoxes) { + if (checkBox.isSelected()) { + count++; + } + } + return count; + } + + + public boolean showSavePane() { + populate(); + //如果有未保存的文件 ,则跳出保存对话框,选择要存储的项目 + if (!unSavedTemplate.isEmpty()) { + dialog.setVisible(true); + } else { + isAllSaved = true; + } + return isAllSaved; + } + + public void populate() { + java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); + JTemplate currentTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + for (int i = 0; i < opendedTemplate.size(); i++) { + if (isneedToAdd(opendedTemplate.get(i), currentTemplate)) { + unSavedTemplate.add(opendedTemplate.get(i)); + } + } + templateCheckBoxes = new UICheckBox[unSavedTemplate.size()]; + initTemplatesChoosePane(); + } + + private boolean isneedToAdd(JTemplate template, JTemplate currentTemplate) { + //所有模板都判断是不是保存 + if (isJudgeCurrentEditingTemplate) { + return !template.isALLSaved(); + } + + //当前编辑的模板不判断是否已经保存 + if (ComparatorUtils.equals(template, currentTemplate)) { + return false; + } else { + return !template.isALLSaved(); + } + } + + + private void saveSelectedTemplate(JTemplate specifiedTemplate) { + if (!specifiedTemplate.isSaved()) { + specifiedTemplate.stopEditing(); + specifiedTemplate.saveTemplate(); + } + FineLoggerFactory.getLogger().info( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + } + + + public int saveLastOneTemplate() { + JTemplate specifiedTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + if (!specifiedTemplate.isALLSaved()) { + specifiedTemplate.stopEditing(); + int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); + if (returnVal == JOptionPane.YES_OPTION && specifiedTemplate.saveTemplate()) { + specifiedTemplate.saveTemplate(); + FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + } + return returnVal; + } + return JOptionPane.YES_OPTION; + } + + + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save"); + } + + + private class UnSelectedListCellRender extends DefaultListCellRenderer { + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, final boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + templateCheckBoxes[index] = (UICheckBox) value; + templateCheckBoxes[index].setBackground(list.getBackground()); + return templateCheckBoxes[index]; + } + + } + + + private class UnSeletedTemplateListDataMode extends AbstractListModel { + + @Override + public int getSize() { + return templateCheckBoxes.length; + } + + @Override + public UICheckBox getElementAt(int index) { + if (index > getSize() - 1 || index < 0) { + return null; + } + return templateCheckBoxes[index]; + } + + } + + +} From 90e9cac27a7698e1fb7edeb54cd454fa9bb687b1 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 30 Jul 2020 15:52:35 +0800 Subject: [PATCH 43/47] =?UTF-8?q?REPORT-30708=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=85=8D=E7=BD=AE=E6=A1=86=E4=B8=8D=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E9=85=8D=E7=BD=AE=E6=8C=89=E9=92=AE=20?= =?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 --- .../java/com/fr/design/file/MutilTempalteTabPane.java | 3 --- .../main/java/com/fr/design/file/TemplateTreePane.java | 3 --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 7 ++++++- .../com/fr/design/mainframe/EastRegionContainerPane.java | 8 +++++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 8f7063b82b..e4ab990337 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -10,7 +10,6 @@ import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIScrollPopUpMenu; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; @@ -882,8 +881,6 @@ public class MutilTempalteTabPane extends JComponent { */ @Override public void mousePressed(MouseEvent e) { - //切换文件后清空FixedPopupPane面板 - EastRegionContainerPane.getInstance().clearCurrentPopupPane(); //如果在版本管理情况下,不允许切换tab if (DesignerMode.isVcsMode()) { return; diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index f575ecb680..93001bde44 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -11,7 +11,6 @@ import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; @@ -84,8 +83,6 @@ public class TemplateTreePane extends JPanel implements FileOperations { @Override public void mousePressed(MouseEvent evt) { if (evt.getClickCount() == 2) { - //切换文件后清空FixedPopupPane面板 - EastRegionContainerPane.getInstance().clearCurrentPopupPane(); openFile(); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 3811c4024f..42365dcc57 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -974,6 +974,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @param jt 添加的模板. */ public void addAndActivateJTemplate(JTemplate jt) { + //切换文件后清空FixedPopupPane面板 + EastRegionContainerPane.getInstance().clearCurrentPopupPane(); //释放模板对象 ActionFactory.editorRelease(); if (jt == null || jt.getEditingFILE() == null) { @@ -993,6 +995,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @param jt 模板 */ public void activateJTemplate(JTemplate jt) { + //切换文件后清空FixedPopupPane面板 + EastRegionContainerPane.getInstance().clearCurrentPopupPane(); //释放模板对象 ActionFactory.editorRelease(); if (jt == null || jt.getEditingFILE() == null) { @@ -1103,7 +1107,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @date 2014-10-14-下午6:31:05 */ private void openFile(FILE tplFile) { - + //切换文件后清空FixedPopupPane面板 + EastRegionContainerPane.getInstance().clearCurrentPopupPane(); if (tplFile != null) { int index = HistoryTemplateListCache.getInstance().contains(tplFile); if (index != -1) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 1eee94246b..5d4a240ddb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1019,9 +1019,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { * @date: 2020/7/30 11:39 */ public void freshCurrentPopupPane() { - hideCurrentPopupPane(); - if (currentPopupPane != null && currentButton != null) { - GUICoreUtils.showPopupMenu(currentPopupPane, currentButton, -currentPopupPane.getPreferredSize().width, 0); + if(currentPopupPane.isVisible()){ + hideCurrentPopupPane(); + if (currentPopupPane != null && currentButton != null && !isRightPaneVisible()) { + GUICoreUtils.showPopupMenu(currentPopupPane, currentButton, -currentPopupPane.getPreferredSize().width, 0); + } } } From 11ce97125e0e63b5540acf98c52b5a860c0b32fc Mon Sep 17 00:00:00 2001 From: lucian Date: Thu, 30 Jul 2020 17:04:33 +0800 Subject: [PATCH 44/47] =?UTF-8?q?REPORT-33604=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=8A=A0=E8=A7=A3=E5=AF=86=E6=8E=A5=E5=8F=A3=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java | 2 +- designer-base/src/main/java/com/fr/file/FileFILE.java | 2 +- designer-base/src/main/java/com/fr/file/FileNodeFILE.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java index 54bbd8d533..16062c2936 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.vcs.common; -import com.fr.base.io.FineEncryptUtils; +import com.fr.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; diff --git a/designer-base/src/main/java/com/fr/file/FileFILE.java b/designer-base/src/main/java/com/fr/file/FileFILE.java index cb330086de..fca6835bff 100644 --- a/designer-base/src/main/java/com/fr/file/FileFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileFILE.java @@ -1,6 +1,6 @@ package com.fr.file; -import com.fr.base.io.FineEncryptUtils; +import com.fr.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.gui.itree.filetree.FileComparator; import com.fr.design.gui.itree.filetree.FileTreeIcon; diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index b40bed658e..b033d229b9 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -2,7 +2,7 @@ package com.fr.file; import com.fr.base.BaseUtils; import com.fr.base.FRContext; -import com.fr.base.io.FineEncryptUtils; +import com.fr.io.FineEncryptUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.file.NodeAuthProcessor; import com.fr.design.gui.itree.filetree.FileNodeComparator; From e88620b32ea364690a3e6247f7feadd912fce8da Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Thu, 30 Jul 2020 18:08:33 +0800 Subject: [PATCH 45/47] =?UTF-8?q?REPORT-35463=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=E8=8F=9C=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E5=9C=A8=E5=B8=AE=E5=8A=A9=E8=8F=9C=E5=8D=95=E5=92=8C=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E8=8F=9C=E5=8D=95=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/locale/impl/SupportLocaleImpl.java | 10 +++++----- .../design/mainframe/toolbar/ToolBarMenuDock.java | 14 ++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java index e192336d65..904a6c18b1 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java @@ -138,8 +138,9 @@ public enum SupportLocaleImpl implements SupportLocale { @Override public Set support() { Set set = new HashSet(); - set.add(Locale.CHINA); - set.add(Locale.TAIWAN); + set.add(Locale.US); + set.add(Locale.KOREA); + set.add(Locale.JAPAN); return set; } }, @@ -151,9 +152,8 @@ public enum SupportLocaleImpl implements SupportLocale { @Override public Set support() { Set set = new HashSet(); - set.add(Locale.US); - set.add(Locale.KOREA); - set.add(Locale.JAPAN); + set.add(Locale.CHINA); + set.add(Locale.TAIWAN); return set; } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 775b03747b..c81c6749f8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -592,7 +592,12 @@ public abstract class ToolBarMenuDock { shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(new VideoAction()); - shortCuts.add(new TutorialAction()); + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + shortCuts.add(new TutorialAction()); + } + }, SupportLocaleImpl.TUTORIAL_COMMUNITY); shortCuts.add(new QuestionAction()); shortCuts.add(new TechSolutionAction()); @@ -625,13 +630,6 @@ public abstract class ToolBarMenuDock { shortCuts.add(new TechSupportAction()); } }, SupportLocaleImpl.TECH_SUPPORT_COMMUNITY); - - LocaleCenter.buildAction(new LocaleAction() { - @Override - public void execute() { - shortCuts.add(new TutorialAction()); - } - }, SupportLocaleImpl.TUTORIAL_COMMUNITY); shortCuts.add(SeparatorDef.DEFAULT); From a1db831093e3dfcf7a57ffdcfd4c0261ceaba9d2 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 31 Jul 2020 13:44:46 +0800 Subject: [PATCH 46/47] =?UTF-8?q?REPORT-33518=20=E3=80=9010.0.7=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E4=BB=8E=E5=A4=A7=E6=95=B0=E6=8D=AE=E9=87=8F?= =?UTF-8?q?=E8=A1=A8=E5=8F=96=E6=95=B0=E5=BB=BA=E7=AB=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=EF=BC=8C=E9=A2=84=E8=A7=88=E4=B8=8D=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/DesignTableDataManager.java | 18 ++++++++++++++++-- .../datapane/preview/PreviewTablePane.java | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index f9c9ddab6b..f2b1e8e5b3 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -439,9 +439,14 @@ public abstract class DesignTableDataManager { * @throws Exception 异常 */ public static EmbeddedTableData previewTableDataNeedInputParameters(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean needLoadingBar) throws Exception { - return previewTableData(tableDataSource, tabledata, rowCount, true, needLoadingBar); + return previewTableDataNeedInputParameters(tableDataSource, tabledata, rowCount, needLoadingBar, null); } + public static EmbeddedTableData previewTableDataNeedInputParameters(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean needLoadingBar, AutoProgressBar progressBar) throws Exception { + return previewTableData(tableDataSource, tabledata, rowCount, true, needLoadingBar, progressBar); + } + + /** * 预览不需要参数的数据集 * @@ -478,7 +483,16 @@ public abstract class DesignTableDataManager { * @return */ private static EmbeddedTableData previewTableData(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean isMustInputParameters, boolean needLoadingBar) throws Exception { - final AutoProgressBar loadingBar = PreviewTablePane.getInstance().getProgressBar(); + return previewTableData(tableDataSource, tabledata, rowCount, isMustInputParameters, needLoadingBar, null); + } + + private static EmbeddedTableData previewTableData(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean isMustInputParameters, boolean needLoadingBar, AutoProgressBar progressBar) throws Exception { + final AutoProgressBar loadingBar; + if (progressBar == null) { + loadingBar = PreviewTablePane.getInstance().getProgressBar(); + } else { + loadingBar = progressBar; + } ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tabledata); if (ArrayUtils.isEmpty(parameters)) { parameters = tabledata.getParameters(Calculator.createCalculator()); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 2cd16b4940..8d8e3a48c6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -372,7 +372,7 @@ public class PreviewTablePane extends BasicPane { connectionBar.close(); } TableDataSource dataSource = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget(); - previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true); + previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true, progressBar); // parameterInputDialog // update之后的parameters,转成一个parameterMap,用于预览TableData PreviewTableModel previewModel = new PreviewTableModel(previewTableData.createDataModel(null), (int) maxPreviewNumberField.getValue()); From aba5f269c9b7cd1bc8dff8def89f0670b8fbcc90 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 31 Jul 2020 15:11:17 +0800 Subject: [PATCH 47/47] =?UTF-8?q?REPORT-30708=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E9=85=8D=E7=BD=AE=E6=A1=86=E4=B8=8D=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E9=85=8D=E7=BD=AE=E6=8C=89=E9=92=AE=20npe?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/EastRegionContainerPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 5d4a240ddb..a273828d84 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1019,9 +1019,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { * @date: 2020/7/30 11:39 */ public void freshCurrentPopupPane() { - if(currentPopupPane.isVisible()){ + if (currentPopupPane != null && currentPopupPane.isVisible()) { hideCurrentPopupPane(); - if (currentPopupPane != null && currentButton != null && !isRightPaneVisible()) { + if (currentButton != null && !isRightPaneVisible()) { GUICoreUtils.showPopupMenu(currentPopupPane, currentButton, -currentPopupPane.getPreferredSize().width, 0); } }