From dbf47dc902b9cec2c60a00e3dcb7c3555003dfdd Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 Nov 2020 17:34:55 +0800 Subject: [PATCH 01/54] =?UTF-8?q?REPORT-43280=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=8E=A7=E4=BB=B6=E9=80=89=E4=B8=8D=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/beans/models/StateModel.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java index c5150baa5..5045e1387 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java @@ -301,12 +301,14 @@ public class StateModel { Rectangle bounds = createCurrentBounds(x, y); // 有参数面板时 要考虑下参数面板的高度影响 - int yOffset = 0; - XLayoutContainer paramComponent = designer.getParaComponent(); - if (paramComponent != null) { - yOffset = paramComponent.getHeight(); + if (!designer.isFormParaDesigner()) { + int yOffset = 0; + XLayoutContainer paramComponent = designer.getParaComponent(); + if (paramComponent != null) { + yOffset = paramComponent.getHeight(); + } + bounds.y = Math.max(bounds.y - yOffset, 0); } - bounds.y = Math.max(bounds.y - yOffset, 0); if ((x != currentX) || (y != currentY)) { ArrayList creators = getHotspotCreators(bounds, designer.getRootComponent()); From 56f45d13b066d528cde6d0c3fedb52bd230b58e1 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Nov 2020 10:20:37 +0800 Subject: [PATCH 02/54] =?UTF-8?q?REPORT-32205=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=A4=9A=E5=B1=8F=E4=BD=BF=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/utils/gui/GUICoreUtils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 9f5c7fbaa..e6b276437 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -298,7 +298,11 @@ public final class GUICoreUtils { * @param win the current window august:现在要考虑左边日志模板的影响 */ public static void centerWindow(Window win) { - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + // Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小 + // getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标 + Rectangle rectangle = win.getGraphicsConfiguration().getBounds(); + + Dimension screenSize = rectangle.getSize(); Dimension winSize = win.getSize(); @@ -308,7 +312,7 @@ public final class GUICoreUtils { if (winSize.width > screenSize.width) { winSize.width = screenSize.width; } - win.setLocation((screenSize.width - winSize.width) / 2, (screenSize.height - winSize.height) / 2 - WINDOW_GAP); + win.setLocation(rectangle.x + (screenSize.width - winSize.width) / 2, rectangle.y + (screenSize.height - winSize.height) / 2 - WINDOW_GAP); } /** From 4943a82057fd8a67a06bd14e377a012217f97142 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 13 Nov 2020 11:52:56 +0800 Subject: [PATCH 03/54] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20bugfix?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=E6=89=93=E5=8C=85=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3580cbae0..617b9d0fa 100644 --- a/build.gradle +++ b/build.gradle @@ -72,7 +72,9 @@ allprojects { implementation 'com.fr.datasource:fine-datasource:' + frVersion implementation 'com.fr.decision:fine-decision:' + frVersion implementation 'com.fr.schedule:fine-schedule:' + frVersion - implementation 'com.fr.report:fine-report-engine:' + frDevVersion + implementation 'com.fr.report:engine-report:' + frDevVersion + implementation 'com.fr.report:engine-chart:' + frDevVersion + implementation 'com.fr.report:engine-i18n:' + frDevVersion implementation 'com.fr.design:design-i18n:' + frDevVersion testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1' From bddf7c69e8a8507695ec4c71dfb390fdfdfe4cd3 Mon Sep 17 00:00:00 2001 From: pengda Date: Thu, 19 Nov 2020 16:10:55 +0800 Subject: [PATCH 04/54] =?UTF-8?q?REPORT-42734=20&&=20REPORT-42730=20?= =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8block=E5=9D=97=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/poly/PolyBlockProperPane.java | 4 +++ .../com/fr/poly/PolyBlockProperTable.java | 29 ++++++++++++++++++- .../main/java/com/fr/poly/PolyDesigner.java | 3 ++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java index f6803a90f..316e86c28 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java @@ -40,6 +40,10 @@ public class PolyBlockProperPane extends DockingView { polyBlockProperTable.populate(designer); } + public void update(){ + polyBlockProperTable.update(); + } + @Override public String getViewTitle() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Property_Table"); diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java index 452b4d7f6..6ffcb004f 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java @@ -4,9 +4,12 @@ import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.widget.BasicPropertyPane; import com.fr.design.widget.WidgetBoundsPaneFactory; +import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.poly.group.PolyBoundsGroup; import com.fr.report.poly.TemplateBlock; @@ -104,7 +107,12 @@ public class PolyBlockProperTable extends JPanel { if (isPopulating || block == null) { return; } - block.setBlockName(blockPropertyPane.getWidgetNameField().getText()); + if (blockPropertyPane.getWidgetNameField() != null) { + String toSetWidgetName = blockPropertyPane.getWidgetNameField().getText(); + if (isBlockNameValid(toSetWidgetName, block.getBlockName())) { + block.setBlockName(toSetWidgetName); + } + } PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); boundsgroup.setValue(x.getValue(), 0, 1); boundsgroup.setValue(y.getValue(), 1, 1); @@ -112,4 +120,23 @@ public class PolyBlockProperTable extends JPanel { boundsgroup.setValue(height.getValue(), 3, 1); firePropertyEdit(); } + + /** + *校验一下要设置的名称,不能为空,不能重名 + * + */ + private boolean isBlockNameValid(String toSetWidgetName, String currentWidgetName) { + if (toSetWidgetName == null || toSetWidgetName.isEmpty()) { + blockPropertyPane.getWidgetNameField().setText(currentWidgetName); + return false; + } + for (int i = 0; i < this.designer.getTarget().getBlockCount(); i++) { + if (!ComparatorUtils.equals(currentWidgetName, toSetWidgetName) && ComparatorUtils.equals(toSetWidgetName, this.designer.getTarget().getBlock(i).getBlockName())) { + blockPropertyPane.getWidgetNameField().setText(currentWidgetName); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png")); + return false; + } + } + return true; + } } diff --git a/designer-realize/src/main/java/com/fr/poly/PolyDesigner.java b/designer-realize/src/main/java/com/fr/poly/PolyDesigner.java index 99d9b77b4..437cb8ea1 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyDesigner.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyDesigner.java @@ -623,6 +623,9 @@ public class PolyDesigner extends ReportComponent Date: Thu, 19 Nov 2020 17:06:26 +0800 Subject: [PATCH 05/54] =?UTF-8?q?REPORT-43814=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E6=8F=92=E4=BB=B6=E5=9C=A8=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E4=B8=A4=E9=81=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 73d5d0bb1..94271ace9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -145,7 +145,11 @@ public abstract class JTemplate> } private void initAndStartPlugin() { - initPluginPane(); + // 启动设计器的时候不加载插件内容,插件引擎监听会加载一次 + boolean init = (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isDesignerOpened()) || DesignerEnvManager.getEnvManager().isEmbedServerLazyStartup(); + if (init) { + initPluginPane(); + } startListenPlugin(); } From 06388472a5d968a33f539854f568fca4eeae022d Mon Sep 17 00:00:00 2001 From: pengda Date: Fri, 20 Nov 2020 09:18:13 +0800 Subject: [PATCH 06/54] =?UTF-8?q?REPORT-42734=20&&=20REPORT-42730=20?= =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8block=E5=9D=97=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/poly/PolyBlockProperTable.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java index 6ffcb004f..cd98e6622 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java @@ -1,5 +1,6 @@ package com.fr.poly; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.foldablepane.UIExpandablePane; @@ -12,9 +13,12 @@ import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; import com.fr.poly.group.PolyBoundsGroup; import com.fr.report.poly.TemplateBlock; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Container; +import javax.swing.BorderFactory; +import javax.swing.JPanel; -import javax.swing.*; -import java.awt.*; public class PolyBlockProperTable extends JPanel { private PolyDesigner designer; @@ -133,7 +137,7 @@ public class PolyBlockProperTable extends JPanel { for (int i = 0; i < this.designer.getTarget().getBlockCount(); i++) { if (!ComparatorUtils.equals(currentWidgetName, toSetWidgetName) && ComparatorUtils.equals(toSetWidgetName, this.designer.getTarget().getBlock(i).getBlockName())) { blockPropertyPane.getWidgetNameField().setText(currentWidgetName); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png")); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), FineJOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png")); return false; } } From 82e54b8700a5b5973ea5f1e9366a7c39b11ce050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 20 Nov 2020 15:29:07 +0800 Subject: [PATCH 07/54] =?UTF-8?q?=09CHART-16939=20=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=A0=87=E7=AD=BE=E5=AE=BD=E9=AB=98=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/component/VanChartTooltipContentPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index cc04d9c51..b5f03a728 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -270,7 +270,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Fri, 20 Nov 2020 17:02:10 +0800 Subject: [PATCH 08/54] =?UTF-8?q?MOBILE-27967=20=E3=80=90=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E3=80=91tab=E6=A0=B7=E5=BC=8F=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=AE=BE=E7=BD=AE=E4=BB=A5=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=9B=9E=E6=A0=87=E5=87=86=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E8=87=AA=E5=AE=9A=E4=B9=89=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=AA=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/MobileTemplateStyleDefinePane.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java index 6dc2da5e9..ae8cbeb3a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java @@ -44,6 +44,7 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane 标准 + if (custom.getSelectedIndex() == 0) { + customTempStyle = getCustomMobileTemplateStyle(); + } + // 标准 -> 自定义 + if (custom.getSelectedIndex() == 1 && customTempStyle != null) { + populateBean(customTempStyle); + } boolean isCustom = custom.getSelectedIndex() == 1; centerPane.setVisible(isCustom); updatePreviewPane(); @@ -182,8 +191,24 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane Date: Fri, 20 Nov 2020 17:13:38 +0800 Subject: [PATCH 09/54] =?UTF-8?q?REPORT-41512=20=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E8=BF=87=E7=A8=8B=E8=BF=94=E5=9B=9E=E5=A4=9A=E4=B8=AA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=9C=A8fr=E4=B8=AD=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E8=BF=94=E5=9B=9E=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/ProcedureDataPane.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java index b138f4e58..d0bc499a2 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java @@ -5,6 +5,7 @@ import com.fr.base.StoreProcedureParameter; import com.fr.data.core.db.TableProcedure; import com.fr.data.impl.Connection; import com.fr.data.impl.NameDatabaseConnection; +import com.fr.data.impl.storeproc.ProcedureDataModel; import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.operator.DataOperator; import com.fr.design.actions.UpdateAction; @@ -29,13 +30,19 @@ import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ToolBarDef; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.ConnectionConfig; - -import com.fr.script.Calculator; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JPanel; +import javax.swing.JSplitPane; +import javax.swing.JToolBar; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -273,7 +280,8 @@ public class ProcedureDataPane extends AbstractTableDataPane imp protected Void doInBackground() throws Exception { DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); sp.setCalculating(true); - sp.creatDataModel(Calculator.createCalculator()); + ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false); + sp.refreshDataModelListAndResultNames(dataModels); return null; } From 8c462edfddfe614315ad84f4a450d42d8c34a0b9 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 23 Nov 2020 09:55:30 +0800 Subject: [PATCH 10/54] =?UTF-8?q?REPORT-43516=20=E3=80=90=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E4=BC=98=E5=8C=96=E3=80=91=E9=A1=B5=E9=9D=A2=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=8E=E9=87=8D=E5=A4=8D=E4=B8=8E=E5=86=BB=E7=BB=93?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=9B=BE=E6=A0=87=E4=BC=98=E5=8C=96=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=AE=BE=E7=BD=AE=E5=92=8C=E9=87=8D=E5=A4=8D=E4=B8=8E?= =?UTF-8?q?=E5=86=BB=E7=BB=93=E8=AE=BE=E7=BD=AE=E7=9A=84=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=BA=86=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E3=80=91=E6=9B=B4=E6=8D=A2=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E4=B8=8E=E5=86=BB=E7=BB=93=E8=AE=BE=E7=BD=AE=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/images/m_file/repeatAndFrozen.png | Bin 0 -> 233 bytes .../actions/report/ReportPageAttrAction.java | 4 ++-- .../java/com/fr/start/preload/ImagePreLoader.java | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png b/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png new file mode 100644 index 0000000000000000000000000000000000000000..adc5428a7dc046443c015e18c5df47ceb2b0dc33 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6-FJY5_^ zECkmEIr23q@Gw7SuIcKm`2O-<>yhO@n3qfv+O(tj0bgEn_U^`GC9_!TB4ctMavrq* zp~lq3r+dnD+3W-rY4@amC%reExqsruCU3NAjA3+`clC%?V~A56bEH1Y hrW12kvHW?L-}llnWZHV6$w0R Date: Mon, 23 Nov 2020 19:03:48 +0800 Subject: [PATCH 11/54] =?UTF-8?q?CHART-16853=20=E5=A4=84=E7=90=86=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartRichEditorPane.java | 13 ++ .../com/fr/design/editor/rich_editor.html | 19 +-- .../com/fr/design/editor/script/editor.js | 2 +- .../fr/design/editor/script/editor.model.js | 6 +- .../com/fr/design/editor/script/enums.js | 15 +++ .../com/fr/design/editor/script/i18n.js | 123 ++++++++++++++++++ 6 files changed, 157 insertions(+), 21 deletions(-) create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/enums.js create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java index 1ccc146c1..4d5509c88 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -1,7 +1,9 @@ package com.fr.van.chart.designer.component; import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.DesignerEnvManager; import com.fr.design.ui.ModernUIPane; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.type.TextAlign; @@ -63,6 +65,11 @@ public class VanChartRichEditorPane { browser = event.getBrowser(); browser.getCacheStorage().clearCache(); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/fineui.min.js")); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/design/editor/script/i18n.js")); + browser.executeJavaScript(generateTransformI18nJS()); + browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/materials.min.js")); + JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); ns.asObject().setProperty(variable, model); } @@ -110,6 +117,12 @@ public class VanChartRichEditorPane { return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams, align); } + public static String generateTransformI18nJS() { + String language = DesignerEnvManager.getEnvManager().getLanguage().toString(); + + return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());"; + } + public static class RichEditorModel { private String content = StringUtils.EMPTY; private boolean auto = true; diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index 07fbb3ec7..e6c769f0a 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -5,26 +5,9 @@ - - - + diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index bb5370e4f..f3e053679 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -52,7 +52,7 @@ type: "bi.htape", items: [{ type: "bi.label", - text: "字体样式: ", + text: BI.i18nText("BI-Design_Font_Style") + ": ", textAlign: "left", width: 70 }, { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js index f430fea6c..c901fd31e 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js @@ -17,8 +17,9 @@ fontStyleItems: function () { return [{ type: "bi.single_select_radio_item", - text: "自动", + text: BI.i18nText("BI-Basic_Auto"), hgap: 5, + width: 50, logic: { dynamic: true }, @@ -26,8 +27,9 @@ selected: this.options.isAuto }, { type: "bi.single_select_radio_item", - text: "自定义", + text: BI.i18nText("BI-Basic_Custom"), hgap: 5, + width: 60, logic: { dynamic: true }, diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js b/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js new file mode 100644 index 000000000..461625ebc --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/enums.js @@ -0,0 +1,15 @@ +window.BICst = window.BICst || {}; +BICst.RICH_TEXT_INFO = { + DATA_ID: "data-id", + DATA_NAME: "data-name", + DATA_FULL_NAME: "data-full-name", + DATA_ORIGIN_ID: "data-origin-id", + DATA_ORIGIN_NAME: "data-origin-name", + DATA_ORIGIN_FULL_NAME: "data-origin-full-name", + DATA_IS_INSERT_PARAM: "data-is-insert-param", + DATA_IS_MISSING_FIELD: "data-is-missing-field", + DATA_UN_VALID: "data-unvalid", + NAME: "name", + ALT: "alt", + SRC: "src" +}; \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js new file mode 100644 index 000000000..95b4585c9 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js @@ -0,0 +1,123 @@ +!(function () { + + var chinese = { + "BI-Design_Font_Style": "字体样式", + "BI-Font_Size": "字号", + "BI-Basic_Auto": "自动", + "BI-Basic_Custom": "自定义", + "BI-Basic_Default": "默认", + "BI-Basic_Sim_Hei": "黑体", + "BI-Basic_Sim_Sun": "宋体", + "BI-Basic_Fang_Song": "仿宋", + "BI-Basic_Kai_Ti": "楷体", + "BI-Basic_Bold": "加粗", + "BI-Basic_Italic": "斜体", + "BI-Basic_Underline": "下划线", + "BI-Basic_Font_Color": "文字颜色", + "BI-Word_Align_Left": "文字居左", + "BI-Word_Align_Center": "文字居中", + "BI-Word_Align_Right": "文字居右" + }; + + var taiwan = { + "BI-Design_Font_Style": "字體樣式", + "BI-Font_Size": "字號", + "BI-Basic_Auto": "自動", + "BI-Basic_Custom": "自定義", + "BI-Basic_Default": "默認", + "BI-Basic_Sim_Hei": "黑體", + "BI-Basic_Sim_Sun": "宋體", + "BI-Basic_Fang_Song": "仿宋", + "BI-Basic_Kai_Ti": "楷體", + "BI-Basic_Bold": "加粗", + "BI-Basic_Italic": "斜體", + "BI-Basic_Underline": "下劃線", + "BI-Basic_Font_Color": "文字顏色", + "BI-Word_Align_Left": "文字居左", + "BI-Word_Align_Center": "文字居中", + "BI-Word_Align_Right": "文字居右" + }; + + var english = { + "BI-Design_Font_Style": "Font style", + "BI-Font_Size": "Font size", + "BI-Basic_Auto": "auto", + "BI-Basic_Custom": "custom", + "BI-Basic_Default": "default", + "BI-Basic_Sim_Hei": "Sim_Hei", + "BI-Basic_Sim_Sun": "Sim_Sun", + "BI-Basic_Fang_Song": "Fang_Song", + "BI-Basic_Kai_Ti": "Kai_Ti", + "BI-Basic_Bold": "Bold", + "BI-Basic_Italic": "Italic", + "BI-Basic_Underline": "UnderLine", + "BI-Basic_Font_Color": "Font Color", + "BI-Word_Align_Left": "Align Left", + "BI-Word_Align_Center": "Align Center", + "BI-Word_Align_Right": "Align Right" + }; + + var japanese = { + "BI-Design_Font_Style": "フォントスタイル", + "BI-Font_Size": "フォントサイズ", + "BI-Basic_Auto": "自動", + "BI-Basic_Custom": "カスタマイズ", + "BI-Basic_Default": "デフォルト", + "BI-Basic_Sim_Hei": "黒い体", + "BI-Basic_Sim_Sun": "ソンティ", + "BI-Basic_Fang_Song": "イミテーションソング", + "BI-Basic_Kai_Ti": "イタリック", + "BI-Basic_Bold": "大胆な", + "BI-Basic_Italic": "イタリック", + "BI-Basic_Underline": "アンダースコア", + "BI-Basic_Font_Color": "テキストの色", + "BI-Word_Align_Left": "左のテキスト", + "BI-Word_Align_Center": "テキスト中心", + "BI-Word_Align_Right": "右のテキスト" + }; + + var korean = { + "BI-Design_Font_Style": "글꼴 스타일", + "BI-Font_Size": "글꼴 크기", + "BI-Basic_Auto": "자동적 인", + "BI-Basic_Custom": "맞춤 설정", + "BI-Basic_Default": "기본", + "BI-Basic_Sim_Hei": "블랙 바디", + "BI-Basic_Sim_Sun": "송티", + "BI-Basic_Fang_Song": "모조 노래", + "BI-Basic_Kai_Ti": "기울임 꼴", + "BI-Basic_Bold": "굵게", + "BI-Basic_Italic": "이탤릭체", + "BI-Basic_Underline": "밑줄", + "BI-Basic_Font_Color": "텍스트 색상", + "BI-Word_Align_Left": "왼쪽 텍스트", + "BI-Word_Align_Center": "텍스트 중심", + "BI-Word_Align_Right": "오른쪽 텍스트" + }; + + function transformI18n(language) { + var BI = window.BI; + + if (BI == null) { + return; + } + + if (language == null) { + BI.addI18n(chinese); + } + + if (language.indexOf('zh_TW') > -1) { + BI.addI18n(taiwan); + } else if (language.indexOf('en_US') > -1) { + BI.addI18n(english); + } else if (language.indexOf('ja_JP') > -1) { + BI.addI18n(japanese); + } else if (language.indexOf('ko_KR') > -1) { + BI.addI18n(korean); + } else { + BI.addI18n(chinese); + } + } + + window.transformI18n = transformI18n; +}()); \ No newline at end of file From 38e53e5163b4fd5303058a60324974d03650ca4c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 23 Nov 2020 19:15:39 +0800 Subject: [PATCH 12/54] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/component/VanChartRichEditorPane.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java index 4d5509c88..6f308ad43 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -13,6 +13,7 @@ import com.teamdev.jxbrowser.chromium.JSValue; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.util.Locale; import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -118,7 +119,13 @@ public class VanChartRichEditorPane { } public static String generateTransformI18nJS() { - String language = DesignerEnvManager.getEnvManager().getLanguage().toString(); + String language = "zh_CN"; + + Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); + + if (locale != null) { + language = locale.toString(); + } return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());"; } From 40663f225c826dd4504ba4ab765f8eb37fc428b0 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 24 Nov 2020 09:50:05 +0800 Subject: [PATCH 13/54] =?UTF-8?q?KERNEL-6188=20DatabaseConnectionPane?= =?UTF-8?q?=E4=B8=AD=E7=9A=84SwingWorker=E9=97=AE=E9=A2=98=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=9C=A8Swingwork?= =?UTF-8?q?er=E7=9A=84doInBackground=E4=B8=AD=E6=9B=B4=E6=96=B0UI=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=87=BA=E7=8E=B0=E5=8D=A1=E6=AD=BB=E7=AD=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E3=80=91=E5=B0=86doInBackground=E4=B8=AD=E4=B8=8EUI?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E7=9A=84=E9=83=A8=E5=88=86=E7=A7=BB=E5=88=B0?= =?UTF-8?q?done=E6=96=B9=E6=B3=95=E4=B8=AD=EF=BC=8C=E5=9C=A8EDT=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E5=A4=84=E7=90=86UI=EF=BC=8C=E6=AF=94=E8=BE=83?= =?UTF-8?q?=E5=AE=89=E5=85=A8=EF=BC=9B=E5=8F=A6=E5=A4=96=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=86dialog.show()=E8=BF=87=E6=97=B6=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=92=8C=E4=B8=80=E4=BA=9B=E5=AF=BC=E5=8C=85=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../connect/DatabaseConnectionPane.java | 68 +++++++++++++------ 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index fc666f15f..3ef5aa8f8 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -3,6 +3,7 @@ */ package com.fr.design.data.datapane.connect; +import com.fr.data.impl.Connection; import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.operator.DataOperator; @@ -10,6 +11,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.utils.gui.GUICoreUtils; @@ -19,12 +21,24 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.UIManager; +import java.awt.BorderLayout; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutionException; /** * Database Connection pane. @@ -48,9 +62,9 @@ public abstract class DatabaseConnectionPane map = new HashMap<>(); + map.put("database", database); + map.put("connect", connect); + return map; + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } + return null; + } + + @Override + protected void done() { + try { + Map map = (Map) get(); + Connection database = (Connection) map.get("database"); + boolean connect = (boolean) map.get("connect"); okButton.setEnabled(true); message.setText(database.connectMessage(connect)); if (connect) { uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); - message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully")); + message.setText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully")); }else{ uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); - message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Failed")); + message.setText(Toolkit.i18nText("Fine-Design_Basic_Connection_Failed")); } - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } - return null; } }; @@ -158,18 +188,18 @@ public abstract class DatabaseConnectionPane Date: Tue, 24 Nov 2020 10:18:04 +0800 Subject: [PATCH 14/54] =?UTF-8?q?KERNEL-6188=20=E4=BF=AE=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E4=B8=8BdoInBackground()=E6=96=B9=E6=B3=95=E4=B8=8Edone()?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B9=8B=E9=97=B4=E4=BC=A0=E9=80=92=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=9A=84=E7=B1=BB=E5=9E=8B=EF=BC=8C=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/connect/DatabaseConnectionPane.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index 3ef5aa8f8..b90fc7f37 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -131,16 +131,13 @@ public abstract class DatabaseConnectionPane connectionThread = new SwingWorker<>() { @Override - protected Object doInBackground() throws Exception { + protected Boolean doInBackground() throws Exception { try { Connection database = DatabaseConnectionPane.this.updateBean(); - boolean connect = DataOperator.getInstance().testConnection(database); - Map map = new HashMap<>(); - map.put("database", database); - map.put("connect", connect); - return map; + // 返回连接结果 + return DataOperator.getInstance().testConnection(database); } catch (Exception exp) { FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } @@ -150,11 +147,8 @@ public abstract class DatabaseConnectionPane map = (Map) get(); - Connection database = (Connection) map.get("database"); - boolean connect = (boolean) map.get("connect"); + boolean connect = get(); okButton.setEnabled(true); - message.setText(database.connectMessage(connect)); if (connect) { uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); message.setText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully")); From f549b55ca174954c8e4965fce74e531ed51ddb98 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 24 Nov 2020 10:22:36 +0800 Subject: [PATCH 15/54] =?UTF-8?q?KERNEL-6188=20=E5=8E=BB=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E7=9A=84try-catch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/DatabaseConnectionPane.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index b90fc7f37..e3ee4cdb9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -134,14 +134,9 @@ public abstract class DatabaseConnectionPane connectionThread = new SwingWorker<>() { @Override protected Boolean doInBackground() throws Exception { - try { - Connection database = DatabaseConnectionPane.this.updateBean(); - // 返回连接结果 - return DataOperator.getInstance().testConnection(database); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } - return null; + Connection database = DatabaseConnectionPane.this.updateBean(); + // 返回连接结果 + return DataOperator.getInstance().testConnection(database); } @Override From fbee3b92776c2d04579bc719229d1ad827d33818 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 24 Nov 2020 10:35:44 +0800 Subject: [PATCH 16/54] =?UTF-8?q?KERNEL-6188=20=E8=A1=A5=E5=85=85=E6=B3=9B?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/connect/DatabaseConnectionPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index e3ee4cdb9..f6bfdd29a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -131,7 +131,7 @@ public abstract class DatabaseConnectionPane connectionThread = new SwingWorker<>() { + final SwingWorker connectionThread = new SwingWorker() { @Override protected Boolean doInBackground() throws Exception { Connection database = DatabaseConnectionPane.this.updateBean(); From a68e220df22bcbd31e0843e563ae53405d7d427e Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 30 Nov 2020 11:53:55 +0800 Subject: [PATCH 17/54] =?UTF-8?q?REPORT-44051=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=90=AB=E6=95=B0=E6=8D=AE=E9=9B=86=E5=A4=9A?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=9D=BF=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 2 +- .../src/main/java/com/fr/design/mainframe/FormDesigner.java | 5 +++-- .../main/java/com/fr/design/mainframe/FormModelAdapter.java | 4 ++-- .../java/com/fr/design/mainframe/WorkBookModelAdapter.java | 3 ++- .../java/com/fr/design/parameter/ParameterDefinitePane.java | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 73d5d0bb1..6c6de287e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -136,9 +136,9 @@ public abstract class JTemplate> this.editingFILE = file; this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder()); + designModel = createDesignModel(); addCenterPane(); this.undoState = createUndoState(); - designModel = createDesignModel(); consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); initAndStartPlugin(); 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 62c89b9ca..1d4fad8e3 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 @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.Parameter; import com.fr.base.ScreenResolution; import com.fr.base.vcs.DesignerMode; +import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; @@ -204,7 +205,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection */ public void populateParameterPropertyPane() { //参数 - setParameterArray(getNoRepeatParas(getTarget().getParameters())); + setParameterArray(DesignModelAdapter.getCurrentModelAdapter().getParameters()); refreshParameter(); //容器 ParameterPropertyPane.getInstance().populateBean(this); @@ -728,7 +729,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { FormDesigner.this.fireTargetModified(); if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { - setParameterArray(getNoRepeatParas(getTarget().getParameters())); + setParameterArray(getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters())); refreshParameter(); } } else { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java b/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java index abe0c97e8..efc7ff2b0 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java @@ -36,10 +36,10 @@ public class FormModelAdapter extends DesignModelAdapter> * 参数改变. */ public void parameterChanged() { - //实时更新参数 - jTemplate.populateParameter(); // 更新缓存的参数 updateCachedParameter(); + //实时更新参数 + jTemplate.populateParameter(); } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java index fff25486d..1a4f20c3d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java @@ -66,9 +66,10 @@ public class WorkBookModelAdapter extends DesignModelAdapter Date: Mon, 30 Nov 2020 15:08:04 +0800 Subject: [PATCH 18/54] =?UTF-8?q?REPORT-42913=20=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E7=94=B5=E8=84=91=E5=88=86=E8=BE=A8=E7=8E=87=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=B8=A2=E5=A4=B1=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=9A=84=E4=BD=8D=E7=BD=AE=E4=B8=8E=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E9=83=BD=E8=B7=9Fparent.getHeight()=20-=20toolPaneY?= =?UTF-8?q?=E6=9C=89=E5=85=B3=EF=BC=8C=E8=80=8C=E5=9C=A8Windows=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=85=88=E6=8A=8A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=9D=A2=E6=9D=BF=E7=9A=84=E9=AB=98=E5=BA=A6=E8=B0=83?= =?UTF-8?q?=E7=9A=84=E6=AF=94=E8=BE=83=E5=B0=8F=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E5=87=8F=E5=B0=8F=E5=88=86=E8=BE=A8=E7=8E=87=E6=88=96=E8=80=85?= =?UTF-8?q?=E8=B0=83=E5=A4=A7dpi=E4=BD=BF=E6=95=B4=E4=B8=AA=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=94=BE=E5=A4=A7=E6=97=B6=EF=BC=8Cparent.getHeight()?= =?UTF-8?q?=E4=BC=9A=E5=87=8F=E5=B0=8F=EF=BC=8C=E8=80=8CtoolPaneY=E5=9C=A8?= =?UTF-8?q?=E8=BF=99=E7=A7=8D=E6=93=8D=E4=BD=9C=E4=B8=8B=E6=98=AF=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E5=8F=98=E7=9A=84=EF=BC=8C=E6=AD=A4=E6=97=B6toolPaneY?= =?UTF-8?q?=E4=BC=9A=E6=8E=A5=E8=BF=91=E7=94=9A=E8=87=B3=E5=A4=A7=E4=BA=8E?= =?UTF-8?q?parent.getHeight()=EF=BC=8C=E5=AF=BC=E8=87=B4=E4=BA=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E9=9D=A2=E6=9D=BF=E7=9A=84=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=BD=8D=E4=BA=8E=E6=95=B4=E4=B8=AA=E5=B1=8F=E5=B9=95=E4=B9=8B?= =?UTF-8?q?=E5=A4=96=EF=BC=8C=E5=B9=B6=E4=B8=94=E9=AB=98=E5=BA=A6=E4=B8=BA?= =?UTF-8?q?=E8=B4=9F=EF=BC=8C=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=87=BA=E6=9D=A5?= =?UTF-8?q?=EF=BC=8C=E8=A1=A8=E7=8E=B0=E4=B8=BA=E4=B8=A2=E5=A4=B1=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E7=94=A8?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=88=90=E5=91=98=E5=8F=98=E9=87=8FparentHei?= =?UTF-8?q?ght=E5=AD=98=E5=82=A8=E7=88=B6=E5=AE=B9=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E9=AB=98=E5=BA=A6parent.getHeight()=EF=BC=8C=E5=9C=A8layoutCon?= =?UTF-8?q?tainer()=E6=96=B9=E6=B3=95=E4=B8=AD=E5=A2=9E=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=88=A4=E6=96=AD=EF=BC=8C=E5=BD=93=E5=8F=91=E7=8E=B0?= =?UTF-8?q?=E7=88=B6=E5=AE=B9=E5=99=A8=E9=AB=98=E5=BA=A6=E6=9C=89=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E6=97=B6=EF=BC=8C=E5=8F=8A=E6=97=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?toolPaneY=E7=9A=84=E5=A4=A7=E5=B0=8F=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=9D=A2=E6=9D=BF=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icontainer/UIResizableContainer.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 0a8529abf..4f4ac9e3b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -45,6 +45,7 @@ public class UIResizableContainer extends JPanel { private boolean isLeftRightDragEnabled = true; private boolean isDownPaneVisible = true ; private int paraHeight; + private int parentHeight = -1; public UIResizableContainer(int direction) { this(new JPanel(), new JPanel(), direction); @@ -207,7 +208,8 @@ public class UIResizableContainer extends JPanel { if (verticalToolPane == null || downPane == null) { return; } - + // REPORT-42913 如果用户修改了分辨率或者dpi,可能造成toolPaneY大于parent.getHeight,整个downPane将丢失,因此这里调整下toolPaneY + adjustToolPaneY(parent); if (direction == Constants.RIGHT) { if(isDownPaneVisible){ upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); @@ -236,6 +238,18 @@ public class UIResizableContainer extends JPanel { } } + private void adjustToolPaneY(Container parent) { + if (parentHeight == -1) { + // 初始化下parentheight,存一下当前的父容器height + parentHeight = parent.getHeight(); + } else if (parentHeight != parent.getHeight()) { + // parentHeight与父容器height不等时,代表用户调整分辨率或者dpi了,此时调整toolPaneY + toolPaneY = toolPaneY * parent.getHeight() / parentHeight; + toolPaneY = Math.min(toolPaneY, (parent.getHeight() - toolPaneHeight)); + parentHeight = parent.getHeight(); + } + } + @Override public void addLayoutComponent(String name, Component comp) { } @@ -540,4 +554,4 @@ public class UIResizableContainer extends JPanel { jf.setSize(500, 500); jf.setVisible(true); } -} \ No newline at end of file +} From 57440714a88276e5b27217e54f457f443788f501 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 1 Dec 2020 09:56:41 +0800 Subject: [PATCH 19/54] =?UTF-8?q?REPORT-42913=20=E4=B8=BA=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=8A=E4=B8=80=E6=AC=A1=E5=85=B3=E9=97=AD=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E6=97=B6upPane=E9=AB=98=E5=BA=A6=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E4=B8=AA=E5=88=A4=E6=96=AD=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8DupPane=E9=AB=98=E5=BA=A6=E8=B6=85=E8=BF=87=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E6=80=BB=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/icontainer/UIResizableContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 4f4ac9e3b..35bf403dd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -164,7 +164,7 @@ public class UIResizableContainer extends JPanel { * @param toolPaneY */ public void setLastToolPaneY(int toolPaneY) { - this.toolPaneY = toolPaneY; + this.toolPaneY = Math.min(toolPaneY, (getHeight() - toolPaneHeight)); } /** From 57d997f141b5ceee335d84120a2a2c87502be75c Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 1 Dec 2020 10:03:09 +0800 Subject: [PATCH 20/54] =?UTF-8?q?REPORT-42913=20=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E6=83=B3=E5=A4=9A=E4=BA=86=EF=BC=8C=E8=BF=99=E4=B8=AA=E5=9C=A8?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=9A=84=E6=97=B6=E5=80=99=E8=BF=98=E6=B2=A1?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=B8=B2=E6=9F=93=E6=95=B4=E4=B8=AA=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E7=9A=84=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=AD=A4=E6=97=B6?= =?UTF-8?q?=E6=8B=BF=E4=B8=8D=E5=88=B0=E7=88=B6=E5=AE=B9=E5=99=A8=E9=AB=98?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/icontainer/UIResizableContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 35bf403dd..4f4ac9e3b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -164,7 +164,7 @@ public class UIResizableContainer extends JPanel { * @param toolPaneY */ public void setLastToolPaneY(int toolPaneY) { - this.toolPaneY = Math.min(toolPaneY, (getHeight() - toolPaneHeight)); + this.toolPaneY = toolPaneY; } /** From 896c16005d94044730388c6d48847ce1596967b0 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 1 Dec 2020 15:05:03 +0800 Subject: [PATCH 21/54] =?UTF-8?q?REPORT-42237=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E5=88=B0release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XChartEditor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index c002bceb3..a6a29339e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -14,6 +14,7 @@ import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.CoverReportPane; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.HelpDialogManager; @@ -267,6 +268,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator { if (this != (XCreator) designer.getRootComponent()) { ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); + if (isEditing) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); + } } } HelpDialogManager.getInstance().setPane(coverPanel); From 4bb6e7b7bd0e0b430f27ca312bf8495f90ea997e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 1 Dec 2020 23:30:09 +0800 Subject: [PATCH 22/54] =?UTF-8?q?CHART-17118=20=E8=AF=95=E7=AE=A1=E5=9E=8B?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=A0=87=E7=AD=BE=E5=B7=A6=E5=8F=B3?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=A2=9E=E5=8A=A0=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/label/VanChartGaugeLabelDetailPane.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index 17910d38a..86d140f1d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -195,8 +195,14 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } private TwoTuple getAlignNamesAndValues() { - String[] names = new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow"), Toolkit.i18nText("Fine-Design_Chart_Align_Left"), Toolkit.i18nText("Fine-Design_Chart_Align_Right")}; - Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.RIGHT}; + String[] names = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Follow"), + Toolkit.i18nText("Fine-Design_Chart_Align_Left"), + Toolkit.i18nText("Fine-Design_Chart_StyleAlignment_Center"), + Toolkit.i18nText("Fine-Design_Chart_Align_Right") + }; + + Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.CENTER, Constants.RIGHT}; return new TwoTuple<>(names, values); } From 0de544a588455af588e45f702fcd2785b1521f59 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 2 Dec 2020 19:16:19 +0800 Subject: [PATCH 23/54] =?UTF-8?q?REPORT-43795=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=8B=96=E6=8B=BD=E7=BB=84=E4=BB=B6=E6=9C=89=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=8F=AF=E4=BB=A5=E9=80=9A?= =?UTF-8?q?=E8=BF=87body=E6=8B=96=E5=85=A5=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 6 +----- .../com/fr/design/designer/beans/models/StateModel.java | 9 +++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index d05200592..6c6de287e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -145,11 +145,7 @@ public abstract class JTemplate> } private void initAndStartPlugin() { - // 启动设计器的时候不加载插件内容,插件引擎监听会加载一次 - boolean init = (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isDesignerOpened()) || DesignerEnvManager.getEnvManager().isEmbedServerLazyStartup(); - if (init) { - initPluginPane(); - } + initPluginPane(); startListenPlugin(); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java index 5045e1387..85a328032 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java @@ -4,6 +4,7 @@ import com.fr.design.beans.location.Absorptionline; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.HoverPainter; import com.fr.design.designer.beans.LayoutAdapter; +import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Location; @@ -136,6 +137,14 @@ public class StateModel { private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) { LayoutAdapter adapter = container.getLayoutAdapter(); Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container); + // 判断是否能把控件从表单布局中拖拽到参数面板中 + if (adapter instanceof FRParameterLayoutAdapter) { + for (XCreator xCreator : selectionModel.getSelection().getSelectedCreators()) { + if (!xCreator.canEnterIntoParaPane()) { + return false; + } + } + } if (selectionModel.getSelection().size() == 1) { return adapter.addBean(selectionModel.getSelection().getSelectedCreator(), mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, From 9717e6af3b6548bce6c36af64b0d7c936f74400f Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 3 Dec 2020 10:20:49 +0800 Subject: [PATCH 24/54] =?UTF-8?q?REPORT-44390=20alpha-fine=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E4=B8=8D=E5=B1=95=E7=A4=BA=E8=AF=A6=E7=BB=86=E5=86=85?= =?UTF-8?q?=E5=AE=B9=EF=BC=8C=E5=8F=AA=E6=98=BE=E7=A4=BA=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D=E7=9A=84=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9C=89=E5=8F=98=E5=8C=96=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C=E9=87=8C=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E6=A1=A3=E8=AF=A6=E6=83=85=E7=9A=84key?= =?UTF-8?q?=E5=80=BC=E4=B9=9F=E5=8F=98=E5=8C=96=E4=BA=86(summary=20?= =?UTF-8?q?=E2=86=92=20content)=EF=BC=8C=E7=84=B6=E5=90=8E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=BF=87=E7=A8=8B=E4=B8=AD=E5=8F=91=E7=8E=B0"?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=B8=B8=E7=94=A8"=E4=B9=9F=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E6=98=BE=E7=A4=BA=E6=96=87=E6=A1=A3=E8=AF=A6=E6=83=85?= =?UTF-8?q?=EF=BC=8C=E5=9B=A0=E4=B8=BA=E4=BF=9D=E5=AD=98=E5=88=B0=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E7=9A=84=E6=97=B6=E5=80=99=E8=BD=ACjson=E7=9A=84key?= =?UTF-8?q?=E5=80=BC=E9=94=99=E4=BA=86=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86key=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E7=8E=B0=E5=9C=A8=E4=BD=BF=E7=94=A8=E7=9A=84"content"?= =?UTF-8?q?=EF=BC=8C=E7=84=B6=E5=90=8E=E4=B8=BA=E4=BA=86=E8=AE=A9=E8=AF=BB?= =?UTF-8?q?=E5=92=8C=E5=86=99=E7=9A=84key=E4=BF=9D=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E8=87=B4=EF=BC=8C=E7=BB=9F=E4=B8=80=E7=94=A8DocumentModel?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=B8=B8=E9=87=8F?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/cell/model/DocumentModel.java | 7 ++++++- .../search/manager/impl/DocumentSearchManager.java | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java index 2c608537c..e83b4be76 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java @@ -19,6 +19,11 @@ public class DocumentModel extends AlphaCellModel { private String informationUrl; private int documentId; + public static final String TITLE = "title"; + public static final String CONTENT = "content"; + public static final String DID = "did"; + public static final String SEARCHCOUNT = "searchcount"; + public DocumentModel(String name, String content, int documentId) { super(name, content, CellType.DOCUMENT); this.documentId = documentId; @@ -43,7 +48,7 @@ public class DocumentModel extends AlphaCellModel { public JSONObject modelToJson() { JSONObject object = JSONObject.create(); JSONObject modelObject = JSONObject.create(); - modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount()); + modelObject.put(TITLE, getName()).put(CONTENT, getContent()).put(DID, getDocumentId()).put(SEARCHCOUNT, getSearchCount()); object.put("result", modelObject).put("cellType", getType().getTypeValue()); return object; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index be3ac4f1b..0b4953083 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -43,10 +43,10 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { * @return */ public static DocumentModel getModelFromCloud(JSONObject object) { - String name = object.optString("title"); - String content = object.optString("summary"); - int documentId = object.optInt("did"); - int searchCount = object.optInt("searchCount"); + String name = object.optString(DocumentModel.TITLE); + String content = object.optString(DocumentModel.CONTENT); + int documentId = object.optInt(DocumentModel.DID); + int searchCount = object.optInt(DocumentModel.SEARCHCOUNT); return new DocumentModel(name, content, documentId, searchCount); } From 72e819a9e6449861157979bfae6c17886dc0450a Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 3 Dec 2020 15:04:57 +0800 Subject: [PATCH 25/54] =?UTF-8?q?REPORT-44583=20=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E9=9B=86=E6=88=90-=E8=BF=9C=E7=A8=8B-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=92=8C=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=9C=A8=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=94=B5=E8=84=91=E4=B8=8A=EF=BC=8C=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../env/RemoteDesignerWorkspaceInfo.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index f9de1cfa4..96069b435 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -25,13 +25,19 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { private static final String HOST_NAME = "127.0.0.1"; private static final String LOCAL_HOTS_NAME = "localhost"; private static final String QUOTATION = ":"; - private static final String PORT = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); + private static String port = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); static { - FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); + initFilerSet(port); + } + + private static void initFilerSet(String newPort) { + FILTER_SET.clear(); + FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH); + port = newPort; } private String name; @@ -164,6 +170,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { @Override public boolean checkValid() { boolean result = false; + String newPort = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); + if (!ComparatorUtils.equals(port, newPort)) { + // 使用过程中 更改了内置服务器端口 重新初始化下 + initFilerSet(newPort); + } if (FILTER_SET.contains(connection.getUrl())) { FineLoggerFactory.getLogger().error("url is same with local designer"); return result; From 71646c4285253314688aefac0ff88a7a6cada6d4 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 3 Dec 2020 15:12:31 +0800 Subject: [PATCH 26/54] =?UTF-8?q?REPORT-43864=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7-=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=B8=A2=E5=A4=B1=EF=BC=8C=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=A4=A7=E9=87=8F=E9=87=8D=E5=A4=8D=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/App.java | 11 +++++++++++ .../com/fr/design/mainframe/JTemplateFactory.java | 2 +- .../main/java/com/fr/design/mainframe/app/CptApp.java | 8 +++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/App.java b/designer-base/src/main/java/com/fr/design/mainframe/App.java index 3cae10f6b..c941df8af 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/App.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/App.java @@ -41,4 +41,15 @@ public interface App extends Mutable, Aftermath { * @return 报表 */ T asIOFile(FILE tplFile); + + + /** + * 输出workbook等对象 + * @param tplFile 文件 + * @param needCheck 是否需要check + * @return + */ + default T asIOFile(FILE tplFile, boolean needCheck) { + return asIOFile(tplFile); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java index 8019cc178..678b9bf84 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java @@ -56,7 +56,7 @@ public final class JTemplateFactory { String[] defaultAppExtensions = app.defaultExtensions(); for (String defaultAppExtension : defaultAppExtensions) { if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { - BaseBook bb = app.asIOFile(file); + BaseBook bb = app.asIOFile(file, false); if (bb != null) { return (T) bb; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java index cb6fb8d3e..adadab36d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java @@ -42,7 +42,11 @@ class CptApp extends AbstractWorkBookApp { @Override public WorkBook asIOFile(FILE file) { + return asIOFile(file, true); + } + @Override + public WorkBook asIOFile(FILE file, boolean needCheck) { if (XMLEncryptUtils.isCptEncoded() && !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { if (!new DecodeDialog(file).isPwdRight()) { @@ -67,7 +71,9 @@ class CptApp extends AbstractWorkBookApp { } catch (Exception exp) { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp); } - checkNameStyle(namestyle); + if (needCheck) { + checkNameStyle(namestyle); + } return tpl; } From 1189e110dd5f3c2efed4a9df7e89948d6b5013b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 3 Dec 2020 17:24:24 +0800 Subject: [PATCH 27/54] =?UTF-8?q?CHART-17120=20=E5=A2=9E=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=BB=91=E5=8A=A8=E6=9D=A1=E7=81=B5=E6=95=8F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/condition/ConditionAttributesPane.java | 9 +++++++-- .../SeriesCondition/DataSeriesConditionPane.java | 10 +++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java index 6ca4ed680..5d6ee4e5a 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java @@ -14,10 +14,10 @@ import javax.swing.BoxLayout; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JScrollPane; -import java.awt.Dimension; import java.util.Iterator; -import java.util.Map; import java.util.LinkedHashMap; +import java.util.Map; +import java.awt.Dimension; @Open public abstract class ConditionAttributesPane extends BasicBeanPane { @@ -69,7 +69,12 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { selectedItemScrollPane.setViewportView(selectedItemPane); selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT)); + dealScrollPane(selectedItemScrollPane); propertyChangePane.add(selectedItemScrollPane); + } + + protected void dealScrollPane(JScrollPane scrollPane){ + } public void updateBean(T ob) { diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java index 90982ded5..aa8c9e46c 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java @@ -15,9 +15,10 @@ import com.fr.log.FineLoggerFactory; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.JScrollPane; +import java.util.Iterator; import java.awt.BorderLayout; import java.awt.Dimension; -import java.util.Iterator; /** * Created by IntelliJ IDEA. @@ -27,6 +28,9 @@ import java.util.Iterator; * Time : 上午9:16 */ public class DataSeriesConditionPane extends ConditionAttributesPane { + + private static final int SCROLL_BAR_UNIT_INCREMENT = 16; + protected Plot plot; public DataSeriesConditionPane(Plot plot) { @@ -43,6 +47,10 @@ public class DataSeriesConditionPane extends ConditionAttributesPane Date: Mon, 7 Dec 2020 10:00:04 +0800 Subject: [PATCH 28/54] =?UTF-8?q?REPORT-44390=20alpha-fine=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E4=B8=8D=E5=B1=95=E7=A4=BA=E8=AF=A6=E7=BB=86=E5=86=85?= =?UTF-8?q?=E5=AE=B9=EF=BC=8C=E5=8F=AA=E6=98=BE=E7=A4=BA=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E6=9C=AC=E5=9C=B0=E5=B8=B8=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E6=AF=94=E5=A6=82=E7=94=A8=E6=88=B7=E6=90=9C=E7=B4=A2"?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=A1=AB=E6=8A=A5"=EF=BC=8C=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D=E8=A2=AB=E8=A7=A3=E6=9E=90=E6=88=90=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D=E7=BB=84=EF=BC=8C=E9=81=8D=E5=8E=86=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D=E7=BB=84=E5=8E=BB=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=EF=BC=8C=E4=BD=86=E6=98=AF=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E7=9A=84=E9=80=BB=E8=BE=91=E9=87=8C=E4=BC=9A=E5=B0=86?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E9=9B=86=E5=85=88=E6=B8=85=E7=A9=BA=E7=84=B6?= =?UTF-8?q?=E5=90=8E=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84=EF=BC=8C=E7=84=B6?= =?UTF-8?q?=E5=90=8E=E6=8A=8A=E8=BF=99=E4=B8=AA=E8=BF=94=E5=9B=9E=E7=9A=84?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=8F=88=E8=B5=8B=E5=80=BC=E7=BB=99=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E9=9B=86=E5=90=88=EF=BC=8C=E8=BF=99=E4=BC=9A=E4=B8=8D?= =?UTF-8?q?=E6=96=AD=E5=88=B7=E6=96=B0=E7=BB=93=E6=9E=9C=E9=9B=86=E5=90=88?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E5=8F=AA=E6=98=AF=E5=85=B3=E9=94=AE=E8=AF=8D=E7=BB=84=E4=B8=AD?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA=E5=85=83=E7=B4=A0=E7=9A=84?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=9C=A8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=9A=84=E9=80=BB=E8=BE=91=E9=87=8C=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E6=B8=85=E7=A9=BA=E7=BB=93=E6=9E=9C=E9=9B=86=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=8E=BB=E6=8E=89=EF=BC=8C=E6=94=BE=E5=88=B0?= =?UTF-8?q?=E6=9B=B4=E4=B8=8A=E5=B1=82=E7=9A=84=E9=81=8D=E5=8E=86=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=EF=BC=8C=E8=BF=99=E6=A0=B7=E5=B0=B1=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E6=AF=8F=E4=B8=80=E6=AC=A1=E9=81=8D=E5=8E=86=E5=B0=B1=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E7=BB=93=E6=9E=9C=E9=9B=86=EF=BC=8C=E8=80=8C=E6=98=AF?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=AF=8F=E4=B8=80=E6=AC=A1=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=89=8D=E6=B8=85=E7=A9=BA=E7=BB=93=E6=9E=9C=E9=9B=86=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=E4=B9=9F=E6=97=A0=E9=A1=BB=E8=B5=8B?= =?UTF-8?q?=E5=80=BC=E7=BB=99=E7=BB=93=E6=9E=9C=E9=9B=86=EF=BC=8C=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E5=9C=A8=E6=90=9C=E7=B4=A2=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E6=B7=BB=E5=8A=A0=E5=88=B0=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/impl/RecentSearchManager.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 72a485977..3c7de497a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -45,9 +45,9 @@ import java.util.List; */ public class RecentSearchManager implements AlphaFineSearchProvider { private static final int MAX_SIZE = 100; - + private static final RecentSearchManager INSTANCE = new RecentSearchManager(); - + private IndexReader indexReader = null; //索引存储路径 private String path = ProductConstants.getEnvHome() + File.separator + "searchIndex"; @@ -58,18 +58,18 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer); private IndexWriter indexWriter = null; private SearchResult recentModelList = new SearchResult(); - + public static RecentSearchManager getInstance() { - + return INSTANCE; } @Override public SearchResult getLessSearchResult(String[] searchText) { - + this.recentModelList = new SearchResult(); SearchResult modelList = new SearchResult(); for (String aSearchText : searchText) { - recentModelList = getRecentModelList(aSearchText); + getRecentModelList(aSearchText); } if (recentModelList != null && recentModelList.size() > 0) { modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest"))); @@ -86,7 +86,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { public SearchResult getMoreSearchResult(String searchText) { return new SearchResult(); } - + private synchronized SearchResult getRecentModelList(String searchText) { return searchBySort(searchText); } @@ -161,7 +161,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { * 按序搜索 */ private synchronized SearchResult searchBySort(String key) { - recentModelList = new SearchResult(); try { initReader(); @@ -175,7 +174,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { Query query = new TermQuery(term); TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey); ScoreDoc[] scores = docs.scoreDocs; - this.recentModelList = new SearchResult(); //遍历结果 for (ScoreDoc scoreDoc : scores) { Document document = searcher.doc(scoreDoc.doc); From 58f85e4b10626e0ab1516d9bd37686df6b0b9327 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 7 Dec 2020 11:14:19 +0800 Subject: [PATCH 29/54] =?UTF-8?q?CHART-17231=20=E9=BB=98=E8=AE=A4=E4=B8=8D?= =?UTF-8?q?=E9=80=89=E4=B8=AD=20=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/extended/chart/UIComboBoxWithNone.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index f20675066..e44214833 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -2,6 +2,8 @@ package com.fr.extended.chart; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.i18n.Toolkit; +import com.fr.general.GeneralUtils; +import com.fr.stable.StringUtils; import java.util.List; @@ -17,6 +19,11 @@ public class UIComboBoxWithNone extends UIComboBox { public UIComboBoxWithNone() { super(); addDefaultItem(); + setDefaultSelectedItem(); + } + + protected void setDefaultSelectedItem() { + setSelectedItem(null); } @Override @@ -43,7 +50,9 @@ public class UIComboBoxWithNone extends UIComboBox { //找不到的都选中无。中文的无 英文下是none。 //改正:找不到的且anObject不是null的 全部选中无。 - if (getSelectedIndex() == -1 && anObject != null) { + //改正:找不到的且anObject不是null的且anObject不是空字符串的 全部选中无。 + if (getSelectedIndex() == -1 && StringUtils.isNotEmpty(GeneralUtils.objectToString(anObject))) { + //进到if的anObject一定是某个国际化环境下的无 super.setSelectedItem(getDefaultLocaleString()); } } From ee32c3b9fef5eb8ba1021b4a83d84e3f75e915bb Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 7 Dec 2020 11:15:23 +0800 Subject: [PATCH 30/54] update --- .../src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index e44214833..0459cd710 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -52,7 +52,6 @@ public class UIComboBoxWithNone extends UIComboBox { //改正:找不到的且anObject不是null的 全部选中无。 //改正:找不到的且anObject不是null的且anObject不是空字符串的 全部选中无。 if (getSelectedIndex() == -1 && StringUtils.isNotEmpty(GeneralUtils.objectToString(anObject))) { - //进到if的anObject一定是某个国际化环境下的无 super.setSelectedItem(getDefaultLocaleString()); } } From 63779ffdcf6c8470218c2718f7345341eb672c09 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 7 Dec 2020 11:15:43 +0800 Subject: [PATCH 31/54] =?UTF-8?q?REPORT-44390=20alpha-fine=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E4=B8=8D=E5=B1=95=E7=A4=BA=E8=AF=A6=E7=BB=86=E5=86=85?= =?UTF-8?q?=E5=AE=B9=EF=BC=8C=E5=8F=AA=E6=98=BE=E7=A4=BA=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=20=E6=94=B9=E5=8A=A8=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=8B=E6=96=B9=E6=B3=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/impl/RecentSearchManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 3c7de497a..d9b93fb55 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -69,7 +69,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { this.recentModelList = new SearchResult(); SearchResult modelList = new SearchResult(); for (String aSearchText : searchText) { - getRecentModelList(aSearchText); + addToRecentModelList(aSearchText); } if (recentModelList != null && recentModelList.size() > 0) { modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest"))); @@ -87,8 +87,12 @@ public class RecentSearchManager implements AlphaFineSearchProvider { return new SearchResult(); } - private synchronized SearchResult getRecentModelList(String searchText) { - return searchBySort(searchText); + /** + * 将单次遍历的关键词的搜索结果添加到结果集中 + * @param searchText + */ + private synchronized void addToRecentModelList(String searchText) { + searchBySort(searchText); } public List getRecentModelList() { From a9a98b2d0ca30a28a821b67b7c818f1e9c391ff7 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 7 Dec 2020 19:51:53 +0800 Subject: [PATCH 32/54] =?UTF-8?q?REPORT-44784=20=E5=A4=8D=E5=88=B6tab?= =?UTF-8?q?=E5=9D=97=E4=B8=AD=E7=9A=84=E5=9B=BE=E8=A1=A8=E5=9D=97=E5=88=B0?= =?UTF-8?q?=E5=86=B3=E5=AE=9A=E7=94=BB=E5=B8=83=E5=9D=97=E4=B8=AD=20?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AFh5=E6=9F=A5=E7=9C=8B=E4=B8=8D?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=9C=89=E5=B1=95=E5=BC=80=E6=94=B6=E8=B5=B7?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/designer/mobile/ChartEditorDefinePane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 371fcde7a..35f3ccbb1 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -176,8 +176,10 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { this.functionalWhenUnactivatedCheckBox.setSelected(!isFunctionalWhenUnactivated); this.bindListeners2Widgets(); this.addAttributeChangeListener(changeListener); - + // 直接return时 也要处理下相应数据 + MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle(); if (!FormDesignerUtils.isAppRelayout(designer) || isInAbsoluteLayout()) { + fix(style); return; } @@ -199,8 +201,6 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { } } }); - - MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle(); this.mobileCollapsedStyleEditor.setStyle(style); fix(style); this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); From 0ff4a5e35910d7665975276eb249b4fa94506fd9 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 8 Dec 2020 11:41:09 +0800 Subject: [PATCH 33/54] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index 0459cd710..65e7bbb43 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -23,7 +23,7 @@ public class UIComboBoxWithNone extends UIComboBox { } protected void setDefaultSelectedItem() { - setSelectedItem(null); + setSelectedItem(StringUtils.EMPTY); } @Override From bcec9ee2b0eb5426f6d61f197daa8c7f4adf23ae Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Wed, 9 Dec 2020 10:02:54 +0800 Subject: [PATCH 34/54] =?UTF-8?q?REPORT-42381=20=E5=88=A0=E9=99=A4tab?= =?UTF-8?q?=E9=A1=B5=E4=B9=8B=E5=90=8E=E9=80=89=E4=B8=ADbody=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/cardlayout/XCardSwitchButton.java | 1 + 1 file changed, 1 insertion(+) 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 1c335efa6..18bab5528 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 @@ -160,6 +160,7 @@ public class XCardSwitchButton extends XButton { return; } deleteCard(this, index); + selectionModel.setSelectedCreator(designer.getRootComponent()); designer.fireTargetModified(); LayoutUtils.layoutRootContainer(designer.getRootComponent()); FormHierarchyTreePane.getInstance().refreshRoot(); From 4d72891715cb1083904987b729f8a48ebcea3bfd Mon Sep 17 00:00:00 2001 From: Lanlan Date: Wed, 9 Dec 2020 17:37:59 +0800 Subject: [PATCH 35/54] =?UTF-8?q?REPORT-44988=20.FineReport100=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E6=9C=89=E5=BE=88=E5=A4=9A=E6=AE=8B=E7=95=99=E7=9A=84?= =?UTF-8?q?=E5=9F=8B=E7=82=B9=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messagecollect/impl/AbstractSendDataToCloud.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java index 77f370d9d..21a46c2b5 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java @@ -126,9 +126,9 @@ public abstract class AbstractSendDataToCloud implements XMLable { } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - return; + } finally { + fileEntityBuilder.deleteFileAndZipFile(file, pathName); } - fileEntityBuilder.deleteFileAndZipFile(file, pathName); } From 3635104837bebc08d2ef6483ae19ab70d08e044c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 9 Dec 2020 18:24:04 +0800 Subject: [PATCH 36/54] =?UTF-8?q?CHART-17315=20=E6=A0=87=E7=AD=BE=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E8=83=8C=E6=99=AF=E9=9D=A2=E6=9D=BF=E5=9C=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E5=A2=9E=E5=8A=A0check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java | 1 + .../chart/designer/style/label/VanChartPlotLabelDetailPane.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java index b2b287087..7d8cad96d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java @@ -73,5 +73,6 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa public void update(AttrLabelDetail detail) { super.update(detail); checkOrientationEnable(detail); + checkOrientation(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 3047e608f..5a8af100d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -334,7 +334,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { checkPositionEnabled(); } - private void checkOrientation() { + protected void checkOrientation() { if (orientation != null && borderPaneWithTitle != null && backgroundPaneWithTitle != null) { boolean horizontal = orientation.getSelectedIndex() == HORIZONTAL_INDEX; From 7062ebb60864a99b031747d2e282cd0ce98b74db Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 9 Dec 2020 19:46:08 +0800 Subject: [PATCH 37/54] =?UTF-8?q?CHART-17340=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E7=BB=84=E4=BB=B6=E5=A2=9E=E5=8A=A0=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/script/i18n.js | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js index 95b4585c9..35acc1ffa 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js @@ -16,7 +16,10 @@ "BI-Basic_Font_Color": "文字颜色", "BI-Word_Align_Left": "文字居左", "BI-Word_Align_Center": "文字居中", - "BI-Word_Align_Right": "文字居右" + "BI-Word_Align_Right": "文字居右", + "BI-Basic_Cancel": "取消", + "BI-Basic_Save": "保存", + "BI-Basic_More": "更多" }; var taiwan = { @@ -35,7 +38,10 @@ "BI-Basic_Font_Color": "文字顏色", "BI-Word_Align_Left": "文字居左", "BI-Word_Align_Center": "文字居中", - "BI-Word_Align_Right": "文字居右" + "BI-Word_Align_Right": "文字居右", + "BI-Basic_Cancel": "取消", + "BI-Basic_Save": "保存", + "BI-Basic_More": "更多" }; var english = { @@ -54,7 +60,10 @@ "BI-Basic_Font_Color": "Font Color", "BI-Word_Align_Left": "Align Left", "BI-Word_Align_Center": "Align Center", - "BI-Word_Align_Right": "Align Right" + "BI-Word_Align_Right": "Align Right", + "BI-Basic_Cancel": "Cancel", + "BI-Basic_Save": "Save", + "BI-Basic_More": "More" }; var japanese = { @@ -73,7 +82,10 @@ "BI-Basic_Font_Color": "テキストの色", "BI-Word_Align_Left": "左のテキスト", "BI-Word_Align_Center": "テキスト中心", - "BI-Word_Align_Right": "右のテキスト" + "BI-Word_Align_Right": "右のテキスト", + "BI-Basic_Cancel": "キャンセル", + "BI-Basic_Save": "セーブ", + "BI-Basic_More": "もっと" }; var korean = { @@ -92,7 +104,10 @@ "BI-Basic_Font_Color": "텍스트 색상", "BI-Word_Align_Left": "왼쪽 텍스트", "BI-Word_Align_Center": "텍스트 중심", - "BI-Word_Align_Right": "오른쪽 텍스트" + "BI-Word_Align_Right": "오른쪽 텍스트", + "BI-Basic_Cancel": "취소", + "BI-Basic_Save": "저장", + "BI-Basic_More": "더" }; function transformI18n(language) { From 0ecd214c014ba5532628510c3993f2f4dff69b75 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 9 Dec 2020 21:17:44 +0800 Subject: [PATCH 38/54] =?UTF-8?q?REPORT-44714=20=E3=80=9010.0.12=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AE=B0=E5=BD=95=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A4=B1=E6=95=88=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=AE=9E=E9=99=85=E4=B8=8A?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=96=87=E4=BB=B6=E7=9A=84=E5=AD=98=E5=8F=96?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E6=AD=A4=E5=89=8D=E7=BC=93=E5=AD=98=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E8=AE=B0=E5=BD=95=E7=9A=84=E6=98=AF=E4=B8=8A?= =?UTF-8?q?=E5=AD=90=E9=9D=A2=E6=9D=BF=E7=9A=84=E9=AB=98=E5=BA=A6=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E5=9C=A8=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E6=89=93=E5=BC=80=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C=E7=88=B6?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E7=9A=84=E9=AB=98=E5=BA=A6=E4=BC=9A=E5=8F=98?= =?UTF-8?q?=E5=8C=96(=E4=B8=94=E6=9C=89=E6=97=B6=E5=80=99=E5=8F=98?= =?UTF-8?q?=E4=B8=BA=E8=B4=9F=E6=95=B0)=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=BA=86=E5=85=B3=E9=97=AD=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=89=8D?= =?UTF-8?q?=EF=BC=8C=E4=B8=8A=E5=AD=90=E9=9D=A2=E6=9D=BF=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E4=BA=8E=E7=88=B6=E5=AE=B9=E5=99=A8=E9=AB=98=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E6=AF=94=E4=BE=8B=E4=B8=8E=E6=89=93=E5=BC=80=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=B9=8B=E5=90=8E=E7=9A=84=E6=AF=94=E4=BE=8B=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=EF=BC=8C=E8=A7=86=E8=A7=89=E4=B8=8A=E5=B0=B1=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E4=BA=86=E9=9D=A2=E6=9D=BF=E9=AB=98=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E5=81=8F=E5=B7=AE=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E5=B0=86=E4=B9=8B=E5=89=8D=E7=9A=84=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E4=BF=AE=E6=94=B9=E4=B8=BA=EF=BC=8C=E5=9C=A8=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E9=AB=98=E5=BA=A6=E5=8F=91=E7=94=9F=E5=8F=98=E5=8C=96?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=A0=B9=E6=8D=AE=E4=B8=8A=E5=AD=90=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=8D=A0=E5=AE=B9=E5=99=A8=E9=AB=98=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E6=AF=94=E4=BE=8B=E5=8E=BB=E8=B0=83=E6=95=B4=E4=B8=8A=E5=AD=90?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=9A=84=E9=AB=98=E5=BA=A6=EF=BC=8C=E4=B8=94?= =?UTF-8?q?=E5=B0=86=E7=BC=93=E5=AD=98=E6=96=87=E4=BB=B6=E4=B8=AD=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E4=B8=8A=E5=AD=90=E9=9D=A2=E6=9D=BF=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=AD=98=E5=82=A8=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 27 ++++++------- .../gui/icontainer/UIResizableContainer.java | 38 +++++++++++++------ .../fr/design/mainframe/DesignerFrame.java | 4 +- .../mainframe/WestRegionContainerPane.java | 16 ++++---- 4 files changed, 49 insertions(+), 36 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index c6488d330..8d7c53645 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -141,8 +141,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private int eastRegionToolPaneY = 300; private int eastRegionContainerWidth = 260; - private int westRegionToolPaneY = 300; private int westRegionContainerWidth = 240; + private double westRegionToolPaneYRate = 0.5; private String encryptionKey; private String jdkHome; @@ -440,14 +440,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.lastOpenFilePath = lastOpenFilePath; } - /** - * 得到西面板的上下子面板的高度区分 - * + * 获取东面板的上子面板的高度占容器总高度的比例 * @return */ - public int getLastWestRegionToolPaneY() { - return this.westRegionToolPaneY; + public double getLastWestRegionToolPaneYRate() { + return westRegionToolPaneYRate; } /** @@ -460,12 +458,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } /** - * 设置西面板的上下子面板的高度区分 - * - * @param toolPaneY + * 设置关闭设计器前,东面板的上子面板的高度占容器总高度的比例 + * @param westRegionToolPaneYRate */ - public void setLastWestRegionToolPaneY(int toolPaneY) { - this.westRegionToolPaneY = toolPaneY; + public void setLastWestRegionToolPaneYRate(double westRegionToolPaneYRate) { + this.westRegionToolPaneYRate = westRegionToolPaneYRate; } /** @@ -1610,8 +1607,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private void readLastWestRegionLayout(XMLableReader reader) { String tmpVal; - if ((tmpVal = reader.getAttrAsString("toolPaneY", null)) != null) { - this.setLastWestRegionToolPaneY(Integer.parseInt(tmpVal)); + if ((tmpVal = reader.getAttrAsString("toolPaneYRate", null)) != null) { + this.setLastWestRegionToolPaneYRate(Double.parseDouble(tmpVal)); } if ((tmpVal = reader.getAttrAsString("containerWidth", null)) != null) { this.setLastWestRegionContainerWidth(Integer.parseInt(tmpVal)); @@ -1934,8 +1931,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private void writeLastWestRegionLayout(XMLPrintWriter writer) { writer.startTAG("LastWestRegionLayout"); - if (this.getLastWestRegionToolPaneY() >= 0) { - writer.attr("toolPaneY ", this.getLastWestRegionToolPaneY()); + if (this.getLastWestRegionToolPaneYRate() >= 0) { + writer.attr("toolPaneYRate", this.getLastWestRegionToolPaneYRate()); } if (this.getLastWestRegionContainerWidth() >= 0) { writer.attr("containerWidth", this.getLastWestRegionContainerWidth()); diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 4f4ac9e3b..cc1067eb7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -1,12 +1,10 @@ package com.fr.design.gui.icontainer; -import com.fr.base.BaseUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.stable.collections.utils.MathUtils; import javax.swing.*; import java.awt.*; @@ -46,6 +44,7 @@ public class UIResizableContainer extends JPanel { private boolean isDownPaneVisible = true ; private int paraHeight; private int parentHeight = -1; + private double toolPaneYRate; public UIResizableContainer(int direction) { this(new JPanel(), new JPanel(), direction); @@ -159,12 +158,19 @@ public class UIResizableContainer extends JPanel { } /** - * 设置关闭设计器前最后一次上下子面板的高度 - * - * @param toolPaneY + * 获取上子面板高度占容器总高度的比例 + * @return + */ + public double getToolPaneYRate() { + return toolPaneYRate; + } + + /** + * 设置关闭设计器前最新的上子面板的高度比例 + * @param toolPaneYRate */ - public void setLastToolPaneY(int toolPaneY) { - this.toolPaneY = toolPaneY; + public void setLastToolPaneYRate(double toolPaneYRate) { + this.toolPaneYRate = toolPaneYRate; } /** @@ -242,12 +248,12 @@ public class UIResizableContainer extends JPanel { if (parentHeight == -1) { // 初始化下parentheight,存一下当前的父容器height parentHeight = parent.getHeight(); - } else if (parentHeight != parent.getHeight()) { - // parentHeight与父容器height不等时,代表用户调整分辨率或者dpi了,此时调整toolPaneY - toolPaneY = toolPaneY * parent.getHeight() / parentHeight; - toolPaneY = Math.min(toolPaneY, (parent.getHeight() - toolPaneHeight)); + } else if (parentHeight != parent.getHeight() && parent.getHeight() > 0) { + // parentHeight与父容器height不等时,代表用户调整分辨率或者dpi或者容器高度发生变化了,此时调整toolPaneY + toolPaneY = Math.min((int) (parent.getHeight() * toolPaneYRate), (parent.getHeight() - toolPaneHeight)); parentHeight = parent.getHeight(); } + System.out.println("toolPaneY:" + toolPaneY + ", rate:" + toolPaneYRate); } @Override @@ -371,6 +377,7 @@ public class UIResizableContainer extends JPanel { toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y; toolPaneY = toolPaneY < 0 ? 0 : toolPaneY; toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight() : toolPaneY - getParameterPaneHeight(); + adjustToolPaneYRate(); refreshContainer(); } }); @@ -392,8 +399,10 @@ public class UIResizableContainer extends JPanel { public void mouseClicked(MouseEvent e) { if (e.getX() <= ARROW_RANGE) { toolPaneY = 0; + UIResizableContainer.this.adjustToolPaneYRate(); } else if (e.getX() >= getWidth() - ARROW_RANGE) { toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight(); + UIResizableContainer.this.adjustToolPaneYRate(); } else { return; } @@ -554,4 +563,11 @@ public class UIResizableContainer extends JPanel { jf.setSize(500, 500); jf.setVisible(true); } + + /** + * 当toolPaneY发生变化时,也需要调整toolPaneYRate + */ + private void adjustToolPaneYRate() { + this.toolPaneYRate = ((double) toolPaneY) / this.getHeight(); + } } 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 490b4e7e9..a5eafa0c0 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 @@ -1170,8 +1170,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); } - DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY( - WestRegionContainerPane.getInstance().getToolPaneY()); + DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneYRate( + WestRegionContainerPane.getInstance().getToolPaneYRate()); DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth( WestRegionContainerPane.getInstance().getContainerWidth()); DesignerEnvManager.getEnvManager().setLastEastRegionToolPaneY( diff --git a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java index 23c642dbd..358fba411 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java @@ -24,7 +24,7 @@ public class WestRegionContainerPane extends UIResizableContainer { public static final WestRegionContainerPane getInstance() { if (THIS == null) { THIS = new WestRegionContainerPane(); - THIS.setLastToolPaneY(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneY()); + THIS.setLastToolPaneYRate(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneYRate()); THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth()); } return THIS; @@ -32,11 +32,11 @@ public class WestRegionContainerPane extends UIResizableContainer { public WestRegionContainerPane() { super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT); - + setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); - + GeneralContext.listenPluginRunningChanged(new PluginEventListener(TableDataTreePane.PLUGIN_LISTENER_PRIORITY - 1) { - + @Override public void on(PluginEvent event) { @@ -47,15 +47,15 @@ public class WestRegionContainerPane extends UIResizableContainer { } } }, new PluginFilter() { - + @Override public boolean accept(PluginContext context) { - + return context.contain(PluginModule.ExtraDesign); } }); - + setContainerWidth(165); setBackground(UIConstants.TREE_BACKGROUND); } -} \ No newline at end of file +} From e575d3a4ef9eb28b0b938a1777b72db774b8e0f3 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 10 Dec 2020 09:00:43 +0800 Subject: [PATCH 39/54] =?UTF-8?q?REPORT-44714=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/icontainer/UIResizableContainer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index cc1067eb7..b48950485 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -253,7 +253,6 @@ public class UIResizableContainer extends JPanel { toolPaneY = Math.min((int) (parent.getHeight() * toolPaneYRate), (parent.getHeight() - toolPaneHeight)); parentHeight = parent.getHeight(); } - System.out.println("toolPaneY:" + toolPaneY + ", rate:" + toolPaneYRate); } @Override From 51289b43fafb456cc498ca4dd74624511fcb5ce7 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 10 Dec 2020 09:06:42 +0800 Subject: [PATCH 40/54] =?UTF-8?q?REPORT-44714=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 8d7c53645..44c0eba84 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -441,7 +441,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } /** - * 获取东面板的上子面板的高度占容器总高度的比例 + * 获取西面板的上子面板的高度占容器总高度的比例 * @return */ public double getLastWestRegionToolPaneYRate() { @@ -458,7 +458,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } /** - * 设置关闭设计器前,东面板的上子面板的高度占容器总高度的比例 + * 设置关闭设计器前,西面板的上子面板的高度占容器总高度的比例 * @param westRegionToolPaneYRate */ public void setLastWestRegionToolPaneYRate(double westRegionToolPaneYRate) { From a90b445d79b8ed8769608dfdd83769ae4653e915 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 10 Dec 2020 11:25:17 +0800 Subject: [PATCH 41/54] =?UTF-8?q?CHART-17340=20=E8=A1=A5=E5=85=85=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=9B=BD=E9=99=85=E5=8C=96=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/script/i18n.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js index 35acc1ffa..205117f3c 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js @@ -19,7 +19,9 @@ "BI-Word_Align_Right": "文字居右", "BI-Basic_Cancel": "取消", "BI-Basic_Save": "保存", - "BI-Basic_More": "更多" + "BI-Basic_More": "更多", + "BI-Custom_Color": "自定义颜色", + "BI-Transparent_Color": "透明" }; var taiwan = { @@ -41,7 +43,9 @@ "BI-Word_Align_Right": "文字居右", "BI-Basic_Cancel": "取消", "BI-Basic_Save": "保存", - "BI-Basic_More": "更多" + "BI-Basic_More": "更多", + "BI-Custom_Color": "自定義顏色", + "BI-Transparent_Color": "透明" }; var english = { @@ -63,7 +67,9 @@ "BI-Word_Align_Right": "Align Right", "BI-Basic_Cancel": "Cancel", "BI-Basic_Save": "Save", - "BI-Basic_More": "More" + "BI-Basic_More": "More", + "BI-Custom_Color": "Custom Color", + "BI-Transparent_Color": "Transparent Color" }; var japanese = { @@ -85,7 +91,9 @@ "BI-Word_Align_Right": "右のテキスト", "BI-Basic_Cancel": "キャンセル", "BI-Basic_Save": "セーブ", - "BI-Basic_More": "もっと" + "BI-Basic_More": "もっと", + "BI-Custom_Color": "カスタムカラー", + "BI-Transparent_Color": "トランスペアレント" }; var korean = { @@ -107,7 +115,9 @@ "BI-Word_Align_Right": "오른쪽 텍스트", "BI-Basic_Cancel": "취소", "BI-Basic_Save": "저장", - "BI-Basic_More": "더" + "BI-Basic_More": "더", + "BI-Custom_Color": "맞춤 색상", + "BI-Transparent_Color": "투명한" }; function transformI18n(language) { From 9b71b1241e286783ef08517f345a01bcfeda9392 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 10 Dec 2020 13:08:15 +0800 Subject: [PATCH 42/54] =?UTF-8?q?REPORT-44961=20=E3=80=9010.0.12=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E9=99=84=E4=BB=B6=E6=A8=A1=E6=9D=BF=E6=89=93?= =?UTF-8?q?=E5=BC=80=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8D=A1=E6=AD=BB=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E5=B8=83=E5=B1=80=E5=8F=91=E7=94=9F=E5=8F=98=E5=8C=96?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E5=B8=A6=E6=9C=89=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E7=9A=84?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8E=A7=E4=BB=B6=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E5=8E=BB?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E8=8E=B7=E5=8F=96=E5=AD=97=E6=AE=B5=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E5=BD=93=E7=B3=BB=E7=BB=9F=E4=B8=AD=E6=9C=89?= =?UTF-8?q?=E5=90=8C=E5=90=8D=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E6=97=A0=E6=B3=95=E8=BF=9E=E6=8E=A5=E5=88=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E5=81=87=E6=AD=BB=E3=80=82=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=BF=99=E4=B8=AA=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E7=9A=84=E5=90=8D=E5=AD=97=EF=BC=8C=E9=82=A3=E4=B9=88?= =?UTF-8?q?=E4=BC=9A=E7=9B=B4=E6=8E=A5=E6=8A=A5=E9=94=99=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E5=81=87=E6=AD=BB=E3=80=82=E4=B8=BB=E8=A6=81=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=95=B0=E6=8D=AE=E7=9A=84=E6=93=8D=E4=BD=9C=E6=98=AF?= =?UTF-8?q?=E8=80=97=E6=97=B6=E6=93=8D=E4=BD=9C=EF=BC=8C=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=9C=A8UI=E7=BA=BF=E7=A8=8B=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E8=80=97=E6=97=B6=E6=93=8D=E4=BD=9C=E3=80=82=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=96=B9=E6=A1=88=E3=80=91=E4=B8=BB=E8=A6=81?= =?UTF-8?q?=E5=88=86=E4=B8=BA=E4=B8=A4=E9=83=A8=E5=88=86=EF=BC=8C=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=98=AF=E5=B0=86=E5=8E=9F=E6=9C=AC=E7=9A=84tdChange(?= =?UTF-8?q?)=E6=96=B9=E6=B3=95=E4=B8=AD=E7=9A=84=E8=80=97=E6=97=B6?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=94=BE=E5=88=B0SwingWorker=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E4=BD=9C=E7=BA=BF=E7=A8=8B=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E8=BF=99=E6=A0=B7=E7=9A=84=E8=AF=9D=E5=8D=B3=E4=BD=BF=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B9=9F=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E9=98=BB=E5=A1=9E=E7=9B=B4=E5=88=B0=E9=87=8D?= =?UTF-8?q?=E8=BF=9E=E8=B6=85=E6=97=B6=EF=BC=9B=E7=AC=AC=E4=BA=8C=E6=98=AF?= =?UTF-8?q?=E5=BA=94=E4=BA=A7=E5=93=81=E7=9A=84=E8=A6=81=E6=B1=82=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E9=80=89=E4=B8=AD=E6=8E=A7=E4=BB=B6=E5=B0=B1=E4=BC=9A?= =?UTF-8?q?=E5=8E=BB=E8=AF=B7=E6=B1=82=E8=BF=9E=E6=8E=A5=E5=B9=B6=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=B1=9E=E4=BA=8E=E5=BD=93=E5=89=8D=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=88=97=E5=90=8D=E8=BF=99=E9=83=A8=E5=88=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E6=97=81=E8=BE=B9?= =?UTF-8?q?=E7=9A=84button=EF=BC=8CshowDictPane=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=89=8D=E4=BC=9A=E5=8E=BB=E8=AF=B7=E6=B1=82=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/AbstractTableDataWrapper.java | 40 ++++----- .../AccessibleDictionaryEditor.java | 3 +- .../design/present/dict/DictionaryPane.java | 4 + .../present/dict/TableDataDictPane.java | 85 ++++++++++++------- 4 files changed, 83 insertions(+), 49 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index 82022bea6..ceb0bd8b6 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -7,6 +7,7 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; @@ -35,18 +36,18 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 获取数据集的所有列名list - * + * * @return 数据集的所有列名list - * + * * * @date 2014-11-24-下午3:51:41 - * + * */ public List calculateColumnNameList() { if(columnNameList != null){ return columnNameList; } - + DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); TableDataSource tds = adapter == null ? null : adapter.getBook(); String[] colNames = tabledata.getColumnNames(tds); @@ -56,13 +57,14 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { } else if (ArrayUtils.isNotEmpty(colNamesInCache)) { return toColumnNameList(colNamesInCache); } - + EmbeddedTableData embeddedTableData = null; try { embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false); } catch (Exception e) { if (e.getMessage()!=null) { - DesignUtils.errorMessage(e.getMessage()); + // 这个弹窗可能会成为数据字典页面的二级弹窗,所以修改下父窗口避免出现mac下的二级弹窗问题 + FineJOptionPane.showMessageDialog(null, e.getMessage()); } } columnNameList = DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); @@ -78,12 +80,12 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 生成子节点 - * + * * @return 生成子节点 - * + * * * @date 2014-11-24-下午3:51:17 - * + * */ public ExpandMutableTreeNode[] load() { List namelist = calculateColumnNameList(); @@ -97,10 +99,10 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 预览数据集 - * + * * * @date 2014-11-24-下午3:50:20 - * + * */ public void previewData() { PreviewTablePane.previewTableData(tabledata); @@ -108,30 +110,30 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 预览数据集,带有显示值和实际值的标记结果 - * + * * @param keyIndex 实际值 * @param valueIndex 显示值 - * + * * * @date 2014-11-24-下午3:50:20 - * + * */ public void previewData(final int keyIndex,final int valueIndex){ PreviewTablePane.previewTableData(tabledata, keyIndex, valueIndex); } @Override public String getTableDataName(){ - return name; + return name; } /** * 获取数据集的面板 - * + * * @return 数据集面板 - * + * * * @date 2014-11-24-下午3:50:00 - * + * */ public AbstractTableDataPane creatTableDataPane() { return TableDataFactory.creatTableDataPane(tabledata, name); @@ -143,4 +145,4 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { && ComparatorUtils.equals(this.tabledata, ((AbstractTableDataWrapper) obj).getTableData()); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java index c2195512a..f194e6d91 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java @@ -21,6 +21,7 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { protected void showEditorPane() { if (dictPane == null) { dictPane = new DictionaryPane(); + dictPane.getTableDataDictPane().setNeedTableDataChange(true); } BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this)); @@ -58,4 +59,4 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { public Dictionary updateBean() { return (Dictionary) this.getValue(); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index e50ed86b9..3966510fe 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -83,4 +83,8 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr public void registerDSChangeListener() { tableDataDictPane.registerDSChangeListener(); } + + public TableDataDictPane getTableDataDictPane() { + return tableDataDictPane; + } } diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index 3c08c1c9d..055b93fae 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -32,6 +32,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -41,7 +42,9 @@ import javax.swing.event.ChangeListener; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ExecutionException; /** * 数据字典的数据查询面板 @@ -60,6 +63,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane private DoubleDeckValueEditorPane valueDictPane; private ItemListener itemListener; private UIObserverListener uiObserverListener; + private FormulaEditor formulaEditor1 = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); + private boolean needTableDataChange = false; public TableDataDictPane() { initBasicComponets(); @@ -67,6 +72,10 @@ public class TableDataDictPane extends FurtherBasicBeanPane iniListener(); } + public void setNeedTableDataChange(boolean needTableDataChange) { + this.needTableDataChange = needTableDataChange; + } + public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -83,7 +92,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane tableDataNameComboBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { - tdChange(e); + tdChange(e, needTableDataChange); } } }); @@ -153,44 +162,62 @@ public class TableDataDictPane extends FurtherBasicBeanPane return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dic_Data_Query"); } - private void tdChange(final ItemEvent e) { + private void tdChange(final ItemEvent e, boolean needTableDataChange) { TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); if (tableDataWrappe == null) { return; } - - List namelist = tableDataWrappe.calculateColumnNameList(); - String[] columnNames = null; - if (!namelist.isEmpty()) { - columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); - } else { - columnNames = new String[]{""}; + if (itemListener != null) { + itemListener.itemStateChanged(e); + formulaEditor1.addChangeListener(event -> { + itemListener.itemStateChanged(e); + }); + } + if (needTableDataChange) { + changeColumnsName(); } - ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); - columnNameEditor1.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor1.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + } - FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); - formulaEditor.setEnabled(true); - formulaEditor.addChangeListener(new ChangeListener() { + private void changeColumnsName() { + TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); + SwingWorker, Object> worker = new SwingWorker, Object>() { + @Override + protected List doInBackground() throws Exception { + if (tableDataWrappe == null) { + return new ArrayList<>(); + } + return tableDataWrappe.calculateColumnNameList(); + } @Override - public void stateChanged(ChangeEvent ee) { - if (itemListener != null) { - itemListener.itemStateChanged(e); + protected void done() { + try { + List namelist = get(); + String[] columnNames = null; + if (!namelist.isEmpty()) { + columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); + } else { + columnNames = new String[]{""}; + } + ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); + columnNameEditor1.addItemListener(itemListener); + ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); + columnIndexEditor1.addItemListener(itemListener); + keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + + formulaEditor1.setEnabled(true); + + ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); + columnNameEditor2.addItemListener(itemListener); + ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); + columnIndexEditor2.addItemListener(itemListener); + valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, formulaEditor1}, columnNames[0]); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage()); } } - }); - ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); - columnNameEditor2.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor2.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, formulaEditor}, columnNames[0]); - if (itemListener != null) { - itemListener.itemStateChanged(e); - } + }; + worker.execute(); } @Override From 10056986e7dabf39361d320b5e4fdea888ef0a85 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 10 Dec 2020 18:04:43 +0800 Subject: [PATCH 43/54] =?UTF-8?q?REPORT-45095=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E6=8F=90=E4=BA=A4=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=90=8E?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=AD=97=E6=AE=B5=EF=BC=8C=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../write/submit/DBManipulationPane.java | 1749 +++++++++-------- .../submit/SmartInsertDBManipulationPane.java | 6 +- 2 files changed, 898 insertions(+), 857 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index ccf01dd5e..1e1ab1f72 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -53,7 +53,6 @@ import javax.swing.BorderFactory; import javax.swing.DefaultCellEditor; import javax.swing.DefaultComboBoxModel; import javax.swing.Icon; -import javax.swing.JFrame; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -74,6 +73,7 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.Image; +import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; @@ -92,136 +92,133 @@ public class DBManipulationPane extends BasicBeanPane { private static final Image ICODS_IMAGE = BaseUtils.readImage("/com/fr/web/core/css/images/icons.png"); private static final Icon HEIP_ICON = BaseUtils.createIcon(ICODS_IMAGE, 193, 1, 14, 14); private static final int DEFAULT_RETURN_VALUE = 4; - public KeyColumnNameValueTable keyColumnValuesTable; - private UIComboBox columnsComboBox; // 用于编辑ColumnName的Editor + public KeyColumnNameValueTable keyColumnValuesTable; + private UIComboBox columnsComboBox; // 用于编辑ColumnName的Editor private UICheckBox UpdateCheckBox; private JPanel checkBoxUpdatePane; - /* - * 记录当前选取的DS & Table对应的ColumnName[] - * alex:以前每当tableNameComboBox改变就刷新columnsComboBox,这样每输入一个文字就会刷一遍,很不好 - */ - private ColumnName[] currentColumnNames = null; + /* + * 记录当前选取的DS & Table对应的ColumnName[] + * alex:以前每当tableNameComboBox改变就刷新columnsComboBox,这样每输入一个文字就会刷一遍,很不好 + */ + private ColumnName[] currentColumnNames = null; - // 支持公式输入的数据表选择面板 - private ChoosePaneSupportFormula chooseTable; + // 支持公式输入的数据表选择面板 + private ChoosePaneSupportFormula chooseTable; - private UIComboBox dmlConfigComboBox = null; + private UIComboBox dmlConfigComboBox = null; - // 提交事件 - private NameSubmitJob[] jobs = null; + // 提交事件 + private NameSubmitJob[] jobs = null; - // 提交条件 - private Condition condition = null; + // 提交条件 + private Condition condition = null; - private JTree conditionsTree; + private JTree conditionsTree; - private Editor[] v_Types; + private Editor[] v_Types; - protected JavaScriptActionPane parentPane; + protected JavaScriptActionPane parentPane; - private int keyColumnWidth = 100; - private int resizeColumnCount = 4; - private int btnWidth = 110; - private int btnHeight = 20; private String subMitName; - private static final String[] DML_CONFIG_TYPES = new String[] { + private static final String[] DML_CONFIG_TYPES = new String[]{ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Smart_Submit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Delete_Submit"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Insert_Submit"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Insert_Submit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_Update_Submit")}; - /** - * 无单元格。没有智能添加单元格等按钮 - * 有单元格的参见其子类SmartInsertDBManipulationPane - */ - public DBManipulationPane() { - this(ValueEditorPaneFactory.extendedCellGroupEditors()); - } + /** + * 无单元格。没有智能添加单元格等按钮 + * 有单元格的参见其子类SmartInsertDBManipulationPane + */ + public DBManipulationPane() { + this(ValueEditorPaneFactory.extendedCellGroupEditors()); + } - public DBManipulationPane(Editor[] v_Types) { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.v_Types = v_Types; + public DBManipulationPane(Editor[] v_Types) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.v_Types = v_Types; - JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.add(northPane, BorderLayout.NORTH); + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.add(northPane, BorderLayout.NORTH); - dmlConfigComboBox = new UIComboBox(DML_CONFIG_TYPES); + dmlConfigComboBox = new UIComboBox(DML_CONFIG_TYPES); - JPanel typePane = GUICoreUtils.createFlowPane(new Component[] { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type") + ":"), dmlConfigComboBox }, - FlowLayout.LEFT, 10); - typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))); - northPane.add(typePane, BorderLayout.NORTH); + JPanel typePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type") + ":"), dmlConfigComboBox}, + FlowLayout.LEFT, 10); + typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))); + northPane.add(typePane, BorderLayout.NORTH); - chooseTable = new ChoosePaneSupportFormula(); - chooseTable.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table"))); - chooseTable.setTableNameComboBoxPopSize(160, 320); + chooseTable = new ChoosePaneSupportFormula(); + chooseTable.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table"))); + chooseTable.setTableNameComboBoxPopSize(160, 320); - northPane.add(chooseTable, BorderLayout.CENTER); + northPane.add(chooseTable, BorderLayout.CENTER); - // peter:编辑的TablePane - JPanel editTablePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.add(editTablePane, BorderLayout.CENTER); - editTablePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))); + // peter:编辑的TablePane + JPanel editTablePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.add(editTablePane, BorderLayout.CENTER); + editTablePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))); - keyColumnValuesTable = new KeyColumnNameValueTable(); - editTablePane.add(new JScrollPane(this.keyColumnValuesTable), BorderLayout.CENTER); - keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - keyColumnValuesTable.setPreferredScrollableViewportSize(new Dimension(280, 180)); - keyColumnValuesTable.setShowHorizontalLines(true); + keyColumnValuesTable = new KeyColumnNameValueTable(); + editTablePane.add(new JScrollPane(this.keyColumnValuesTable), BorderLayout.CENTER); + keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + keyColumnValuesTable.setPreferredScrollableViewportSize(new Dimension(280, 180)); + keyColumnValuesTable.setShowHorizontalLines(true); - initJTableColumn(); + initJTableColumn(); - addButtons(editTablePane); + addButtons(editTablePane); - addBottomPane(); + addBottomPane(); - addListeners(); - } + addListeners(); + } - public void setSubMitName(String subMitName){ + public void setSubMitName(String subMitName) { this.subMitName = subMitName; } - public String getSubMitName(){ + public String getSubMitName() { return this.subMitName; } - private void addButtons(JPanel editTablePane) { - // alex:添加操作按钮 - UpdateAction[] actions = this.getActions(); - if (actions != null && actions.length > 0) { - JPanel controlBtnPane = new JPanel(new GridLayout(actions.length + 1, 1, 4, 4)); - editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.EAST); + private void addButtons(JPanel editTablePane) { + // alex:添加操作按钮 + UpdateAction[] actions = this.getActions(); + if (actions != null && actions.length > 0) { + JPanel controlBtnPane = new JPanel(new GridLayout(actions.length + 1, 1, 4, 4)); + editTablePane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), BorderLayout.EAST); - for (int i = 0; i < actions.length; i++) { - controlBtnPane.add(new UIButton(actions[i])); - } + for (UpdateAction action : actions) { + controlBtnPane.add(new UIButton(action)); + } checkBoxUpdatePane = new JPanel(new BorderLayout(0, 0)); - checkBoxUpdatePane.setPreferredSize(new Dimension(120,20)); + checkBoxUpdatePane.setPreferredSize(new Dimension(120, 20)); controlBtnPane.add(checkBoxUpdatePane); UpdateCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_NotChange_Unmodified")); - UIButton helpButton = new UIButton(HEIP_ICON); + UIButton helpButton = new UIButton(HEIP_ICON); helpButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Help")); helpButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - FormatExplanationPane formatExplanation = new FormatExplanationPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Help"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Help"), 12f); + FormatExplanationPane formatExplanation = new FormatExplanationPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Help"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Help"), 12f); BasicDialog dlg = formatExplanation.showMediumWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), - new DialogActionAdapter(){}); + new DialogActionAdapter() { + }); dlg.setVisible(true); } }); helpButton.set4ToolbarButton(); - checkBoxUpdatePane.add(UpdateCheckBox,BorderLayout.WEST); - checkBoxUpdatePane.add(helpButton,BorderLayout.EAST); - } - } - - protected void updateUpdateCheckBoxEnable(){ - KeyColumnTableModel model = (KeyColumnTableModel)keyColumnValuesTable.getModel(); - if (model.getRowCount() == 0){ + checkBoxUpdatePane.add(UpdateCheckBox, BorderLayout.WEST); + checkBoxUpdatePane.add(helpButton, BorderLayout.EAST); + } + } + + protected void updateUpdateCheckBoxEnable() { + KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); + if (model.getRowCount() == 0) { setUpdateCheckBoxEnable(false); UpdateCheckBox.setSelected(true); return; @@ -230,9 +227,8 @@ public class DBManipulationPane extends BasicBeanPane { for (int i = 0; i < model.getRowCount(); i++) { columnObjects.add(model.getKeyColumnNameValue(i).cv.getObj()); } - for (int i = 0;i < columnObjects.size();i++){ - Object ob = columnObjects.get(i) ; - if (!( ob instanceof ColumnRow || ob instanceof ColumnRowGroup)){ + for (Object ob : columnObjects) { + if (!(ob instanceof ColumnRow || ob instanceof ColumnRowGroup)) { setUpdateCheckBoxEnable(false); UpdateCheckBox.setSelected(false); return; @@ -241,236 +237,241 @@ public class DBManipulationPane extends BasicBeanPane { setUpdateCheckBoxEnable(true); } - private void setUpdateCheckBoxEnable( boolean b){ + private void setUpdateCheckBoxEnable(boolean b) { UpdateCheckBox.setEnabled(b); } - private void addBottomPane() { - JPanel eventPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - eventPane.add(addEventButton()); + private void addBottomPane() { + JPanel eventPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + eventPane.add(addEventButton()); - JPanel conditionPane = this.createConditionPane(); + JPanel conditionPane = this.createConditionPane(); - JPanel btPane =new JPanel( FRGUIPaneFactory.createBorderLayout()); - btPane.add(eventPane,BorderLayout.CENTER); - btPane.add(conditionPane,BorderLayout.NORTH); - this.add(btPane, BorderLayout.SOUTH); - } + JPanel btPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); + btPane.add(eventPane, BorderLayout.CENTER); + btPane.add(conditionPane, BorderLayout.NORTH); + this.add(btPane, BorderLayout.SOUTH); + } - private UIButton addEventButton() { - UIButton addSubmitEventButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Event")); - addSubmitEventButton.addActionListener(new ActionListener() { + private UIButton addEventButton() { + UIButton addSubmitEventButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Event")); + addSubmitEventButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - final SubmitJobListPane jobsPane = createSubmitJobListPane(); + @Override + public void actionPerformed(ActionEvent e) { + final SubmitJobListPane jobsPane = createSubmitJobListPane(); - jobsPane.populate(jobs); - BasicDialog dialog = jobsPane.showWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { - @Override - public void doOk() { - super.doOk(); - jobs = jobsPane.updateDBManipulation(); - } - }); - dialog.setVisible(true); - } + jobsPane.populate(jobs); + BasicDialog dialog = jobsPane.showWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { + @Override + public void doOk() { + super.doOk(); + jobs = jobsPane.updateDBManipulation(); + } + }); + dialog.setVisible(true); + } - }); - return addSubmitEventButton; - } + }); + return addSubmitEventButton; + } - private JPanel createConditionPane() { - JPanel conditionPane = new JPanel(); - conditionPane.setPreferredSize(createConditionPanePreferredSize()); + private JPanel createConditionPane() { + JPanel conditionPane = new JPanel(); + conditionPane.setPreferredSize(createConditionPanePreferredSize()); setBorderAndLayout(conditionPane); - conditionsTree = new JTree(new DefaultTreeModel(new ExpandMutableTreeNode())); - conditionsTree.setRootVisible(false); - conditionsTree.setShowsRootHandles(true); - conditionsTree.setBackground(UIConstants.NORMAL_BACKGROUND); - conditionsTree.setForeground(UIConstants.NORMAL_BACKGROUND); - DefaultTreeCellRenderer cr = (DefaultTreeCellRenderer) conditionsTree.getCellRenderer(); - cr.setForeground(UIConstants.NORMAL_BACKGROUND); - JScrollPane jp = new JScrollPane(conditionsTree); - addComponent(conditionPane,jp); - - UIButton addSubmitConditionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition")); - addSubmitConditionButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - final DSColumnLiteConditionPane conditionPane = new DSColumnLiteConditionPane() { - @Override - protected boolean isNeedDoWithCondition(Condition liteCondition) { - return liteCondition != null; - } - }; - String[] columns = chooseTable.currentColumnNames(); - if (columns != null && columns.length > 0) { - conditionPane.populateColumns(chooseTable.currentColumnNames()); - } - - conditionPane.populateBean(condition); - BasicDialog dialog = conditionPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { - @Override - public void doOk() { - super.doOk(); - condition = conditionPane.updateBean(); - refreshConditionList(); - } - }); - dialog.setVisible(true); - } - }); - - JPanel controlBtnPane = new JPanel(new GridLayout(1, 1, 4, 4)); + conditionsTree = new JTree(new DefaultTreeModel(new ExpandMutableTreeNode())); + conditionsTree.setRootVisible(false); + conditionsTree.setShowsRootHandles(true); + conditionsTree.setBackground(UIConstants.NORMAL_BACKGROUND); + conditionsTree.setForeground(UIConstants.NORMAL_BACKGROUND); + DefaultTreeCellRenderer cr = (DefaultTreeCellRenderer) conditionsTree.getCellRenderer(); + cr.setForeground(UIConstants.NORMAL_BACKGROUND); + JScrollPane jp = new JScrollPane(conditionsTree); + addComponent(conditionPane, jp); + + UIButton addSubmitConditionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition")); + addSubmitConditionButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + final DSColumnLiteConditionPane conditionPane = new DSColumnLiteConditionPane() { + @Override + protected boolean isNeedDoWithCondition(Condition liteCondition) { + return liteCondition != null; + } + }; + String[] columns = chooseTable.currentColumnNames(); + if (columns != null && columns.length > 0) { + conditionPane.populateColumns(chooseTable.currentColumnNames()); + } + + conditionPane.populateBean(condition); + BasicDialog dialog = conditionPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + super.doOk(); + condition = conditionPane.updateBean(); + refreshConditionList(); + } + }); + dialog.setVisible(true); + } + }); + + JPanel controlBtnPane = new JPanel(new GridLayout(1, 1, 4, 4)); controlBtnPane.setPreferredSize(createControlBtnPanePreferredSize()); - conditionPane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH),setControlBtnPanePosition()); - controlBtnPane.add(addSubmitConditionButton); + conditionPane.add(GUICoreUtils.createBorderPane(controlBtnPane, BorderLayout.NORTH), setControlBtnPanePosition()); + controlBtnPane.add(addSubmitConditionButton); - return conditionPane; - } + return conditionPane; + } - protected void setBorderAndLayout(JPanel jPanel){ + protected void setBorderAndLayout(JPanel jPanel) { jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); jPanel.setBorder(BorderFactory.createTitledBorder( - new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition"))); + new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition"))); } - protected void addComponent(JPanel mainPane,JScrollPane addPane){ - mainPane.add(addPane,BorderLayout.CENTER); + protected void addComponent(JPanel mainPane, JScrollPane addPane) { + mainPane.add(addPane, BorderLayout.CENTER); } - protected Dimension createConditionPanePreferredSize(){ + protected Dimension createConditionPanePreferredSize() { return new Dimension(454, 80); } - protected Dimension createControlBtnPanePreferredSize(){ + protected Dimension createControlBtnPanePreferredSize() { return new Dimension(110, 20); } - protected String setControlBtnPanePosition(){ - return BorderLayout.EAST; + protected String setControlBtnPanePosition() { + return BorderLayout.EAST; } - private void refreshConditionList() { - DefaultTreeModel defaultTreeModel = (DefaultTreeModel) conditionsTree.getModel(); - ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) defaultTreeModel.getRoot(); - rootTreeNode.setUserObject(new JoinCondition(DataConstants.AND, new ListCondition())); - rootTreeNode.removeAllChildren(); - Condition liteCondition = this.condition == null ? new ListCondition() : this.condition; - if (liteCondition instanceof ListCondition) { - ListCondition listCondition = (ListCondition) liteCondition; - int joinConditionCount = listCondition.getJoinConditionCount(); - for (int i = 0; i < joinConditionCount; i++) { - addLiteConditionToListCondition(rootTreeNode, listCondition.getJoinCondition(i)); - } - } else { - ExpandMutableTreeNode newTreeNode = new ExpandMutableTreeNode(new JoinCondition(DataConstants.AND, liteCondition)); - rootTreeNode.add(newTreeNode); - } - defaultTreeModel.reload(rootTreeNode); - rootTreeNode.expandCurrentTreeNode(conditionsTree); - } - - private void addLiteConditionToListCondition(ExpandMutableTreeNode parentTreeNode, JoinCondition joinCondition) { - ExpandMutableTreeNode newTreeNode = new ExpandMutableTreeNode(joinCondition); - parentTreeNode.add(newTreeNode); - Condition liteCondition = joinCondition.getCondition(); - if (liteCondition instanceof ListCondition) { - ListCondition listCondition = (ListCondition) liteCondition; - int joinConditionCount = listCondition.getJoinConditionCount(); - for (int i = 0; i < joinConditionCount; i++) { - addLiteConditionToListCondition(newTreeNode, listCondition.getJoinCondition(i)); - } - } - } - - private void addListeners() { - dmlConfigComboBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { - Object ob = e.getItem(); - if ((ComparatorUtils.equals(ob, DML_CONFIG_TYPES[0])) || ComparatorUtils.equals(ob, DML_CONFIG_TYPES[3])) { - checkBoxUpdatePane.setVisible(true); - } else if ((ComparatorUtils.equals(ob, DML_CONFIG_TYPES[1])) || ComparatorUtils.equals(ob, DML_CONFIG_TYPES[2])) { - checkBoxUpdatePane.setVisible(false); - } - } - } - }); - - /* - * 当DS & Table改变时要刷新ColumnsComboBox.model,不能用ItemListener, - * 因为tableNameComboBox是可以编辑的,每写一个文字就要连,太频繁了 - * 也不能在tableNameComboBox.focusLost事件时,好像没用 - */ - keyColumnValuesTable.addFocusListener(new FocusAdapter() { - - public void focusGained(FocusEvent e) { - refreshColumnsComboBox(); - } - - }); - } - - protected UpdateAction[] getActions() { - return new UpdateAction[] { new SmartAddFieldsAction(), new AddFieldAction(), new RemoveFieldAction() }; - } - - protected SubmitJobListPane createSubmitJobListPane() { - return new SubmitJobListPane(); - } - - public void setParentJavaScriptActionPane(JavaScriptActionPane jsPane) { - this.parentPane = jsPane; - } - - @Override - protected String title4PopupWindow() { - return "DB"; - } - - protected class SmartAddFieldsAction extends UpdateAction { - public SmartAddFieldsAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields")); - } - - public void actionPerformed(ActionEvent evt) { - - BasicPane bPane = new BasicPane() { - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields"); - } - }; - bPane.setLayout(FRGUIPaneFactory.createBorderLayout()); - - final CheckBoxList list = new CheckBoxList(currentColumnNames(), CheckBoxList.SelectedState.ALL, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Chart_Field_Name")) { - public String value2Text(Object value) { - if (value instanceof ColumnName) { - return ((ColumnName)value).name; - } - - return super.value2Text(value); - } - }; - bPane.add(new JScrollPane(list), BorderLayout.CENTER); - - BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { - public void doOk() { - addFields(list); + private void refreshConditionList() { + DefaultTreeModel defaultTreeModel = (DefaultTreeModel) conditionsTree.getModel(); + ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) defaultTreeModel.getRoot(); + rootTreeNode.setUserObject(new JoinCondition(DataConstants.AND, new ListCondition())); + rootTreeNode.removeAllChildren(); + Condition liteCondition = this.condition == null ? new ListCondition() : this.condition; + if (liteCondition instanceof ListCondition) { + ListCondition listCondition = (ListCondition) liteCondition; + int joinConditionCount = listCondition.getJoinConditionCount(); + for (int i = 0; i < joinConditionCount; i++) { + addLiteConditionToListCondition(rootTreeNode, listCondition.getJoinCondition(i)); + } + } else { + ExpandMutableTreeNode newTreeNode = new ExpandMutableTreeNode(new JoinCondition(DataConstants.AND, liteCondition)); + rootTreeNode.add(newTreeNode); + } + defaultTreeModel.reload(rootTreeNode); + rootTreeNode.expandCurrentTreeNode(conditionsTree); + } + + private void addLiteConditionToListCondition(ExpandMutableTreeNode parentTreeNode, JoinCondition joinCondition) { + ExpandMutableTreeNode newTreeNode = new ExpandMutableTreeNode(joinCondition); + parentTreeNode.add(newTreeNode); + Condition liteCondition = joinCondition.getCondition(); + if (liteCondition instanceof ListCondition) { + ListCondition listCondition = (ListCondition) liteCondition; + int joinConditionCount = listCondition.getJoinConditionCount(); + for (int i = 0; i < joinConditionCount; i++) { + addLiteConditionToListCondition(newTreeNode, listCondition.getJoinCondition(i)); + } + } + } + + private void addListeners() { + dmlConfigComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + Object ob = e.getItem(); + if ((ComparatorUtils.equals(ob, DML_CONFIG_TYPES[0])) || ComparatorUtils.equals(ob, DML_CONFIG_TYPES[3])) { + checkBoxUpdatePane.setVisible(true); + } else if ((ComparatorUtils.equals(ob, DML_CONFIG_TYPES[1])) || ComparatorUtils.equals(ob, DML_CONFIG_TYPES[2])) { + checkBoxUpdatePane.setVisible(false); + } + } + } + }); + + /* + * 当DS & Table改变时要刷新ColumnsComboBox.model,不能用ItemListener, + * 因为tableNameComboBox是可以编辑的,每写一个文字就要连,太频繁了 + * 也不能在tableNameComboBox.focusLost事件时,好像没用 + */ + keyColumnValuesTable.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(FocusEvent e) { + refreshColumnsComboBox(); + } + + }); + } + + protected UpdateAction[] getActions() { + return new UpdateAction[]{new SmartAddFieldsAction(), new AddFieldAction(), new RemoveFieldAction()}; + } + + protected SubmitJobListPane createSubmitJobListPane() { + return new SubmitJobListPane(); + } + + public void setParentJavaScriptActionPane(JavaScriptActionPane jsPane) { + this.parentPane = jsPane; + } + + @Override + protected String title4PopupWindow() { + return "DB"; + } + + protected class SmartAddFieldsAction extends UpdateAction { + public SmartAddFieldsAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + + BasicPane bPane = new BasicPane() { + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Smart_Add_Fields"); + } + }; + bPane.setLayout(FRGUIPaneFactory.createBorderLayout()); + + final CheckBoxList list = new CheckBoxList(currentColumnNames(), CheckBoxList.SelectedState.ALL, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Chart_Field_Name")) { + @Override + public String value2Text(Object value) { + if (value instanceof ColumnName) { + return ((ColumnName) value).name; + } + + return super.value2Text(value); + } + }; + bPane.add(new JScrollPane(list), BorderLayout.CENTER); + + BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { + @Override + public void doOk() { + addFields(list); updateUpdateCheckBoxEnable(); - } - }); - dlg.setVisible(true); - } - } - - private void addFields (CheckBoxList list) { - KeyColumnTableModel model = (KeyColumnTableModel)keyColumnValuesTable.getModel(); + } + }); + dlg.setVisible(true); + } + } + + private void addFields(CheckBoxList list) { + KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); List keyColumnNameValueList = new ArrayList(); keyColumnNameValueList.clear(); for (int i = 0; i < model.getRowCount(); i++) { @@ -481,28 +482,28 @@ public class DBManipulationPane extends BasicBeanPane { // Richie:用了存储新的KeyColumnNameValue的List. List newKeyColumnNameValueList = new ArrayList(); if (!keyColumnNameValueList.isEmpty()) { - for (int i = 0; i < selected.length; i++) { + for (Object o : selected) { // Richie:先填上空的. - newKeyColumnNameValueList.add(new KeyColumnNameValue(false, (ColumnName)selected[i], new ColumnValue(""), false)); + newKeyColumnNameValueList.add(new KeyColumnNameValue(false, (ColumnName) o, new ColumnValue(""), false)); } } // Richie:初始化 int returnValue = DEFAULT_RETURN_VALUE; int coverNumber = 0; - if (!keyColumnNameValueList.isEmpty()) { - //如果存在先前项,设置状态为5 - returnValue = 5 ; - } + if (!keyColumnNameValueList.isEmpty()) { + //如果存在先前项,设置状态为5 + returnValue = 5; + } for (int i = 0; i < selected.length; i++) { if (returnValue == 0 || returnValue == 3) { break; } - for (int j = 0; j < keyColumnNameValueList.size(); j++) { - if (ComparatorUtils.equals(selected[i], keyColumnNameValueList.get(j).cn)) { - Object[] options = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Covered_All"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Yes"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_None") }; + for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { + if (ComparatorUtils.equals(selected[i], keyColumnNameValue.cn)) { + Object[] options = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Covered_All"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Yes"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_None")}; returnValue = JOptionPane.showOptionDialog(DBManipulationPane.this, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_Tips", keyColumnNameValueList.get(j).cn.name), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cover_Tips", keyColumnNameValue.cn.name), "", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]); // Richie:全部覆盖 if (returnValue == 0) { @@ -514,7 +515,7 @@ public class DBManipulationPane extends BasicBeanPane { } else if (returnValue == 2) { coverNumber = i; newKeyColumnNameValueList.remove(i); - newKeyColumnNameValueList.add(i, keyColumnNameValueList.get(j)); + newKeyColumnNameValueList.add(i, keyColumnNameValue); // Richie:全部不覆盖 } else if (returnValue == 3) { coverNumber = i; @@ -526,7 +527,7 @@ public class DBManipulationPane extends BasicBeanPane { checkTableModel(returnValue, coverNumber, model, selected, keyColumnNameValueList, newKeyColumnNameValueList); } - private void checkTableModel (int returnValue, int coverNumber, KeyColumnTableModel model, Object[] selected, List keyColumnNameValueList, List newKeyColumnNameValueList) { + private void checkTableModel(int returnValue, int coverNumber, KeyColumnTableModel model, Object[] selected, List keyColumnNameValueList, List newKeyColumnNameValueList) { if (returnValue == 0) { model.removeAllKeyColumnNameValue(); // Richie:全部覆盖,按selected的长度添加默认的行 @@ -538,10 +539,10 @@ public class DBManipulationPane extends BasicBeanPane { model.removeAllKeyColumnNameValue(); // Richie:全部不覆盖,已经存在的就保留,不存在的添加默认行 for (int i = coverNumber; i < selected.length; i++) { - for (int j = 0; j < keyColumnNameValueList.size(); j++) { - if (ComparatorUtils.equals(selected[i], keyColumnNameValueList.get(j).cn)) { + for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { + if (ComparatorUtils.equals(selected[i], keyColumnNameValue.cn)) { newKeyColumnNameValueList.remove(i); - newKeyColumnNameValueList.add(i, keyColumnNameValueList.get(j)); + newKeyColumnNameValueList.add(i, keyColumnNameValue); } } @@ -552,610 +553,650 @@ public class DBManipulationPane extends BasicBeanPane { } } else if (returnValue == 1 || returnValue == 2) { - for (int i = 0; i < selected.length; i++) { - model.addKeyColumnNameValue(newKeyColumnNameValueList.get(i)); - } - } else if (returnValue == 5){ - //新选项和原来没有重复项的情况,产品确认:只做全量增加,原有的清除 - for (int i = 0; i < selected.length; i++) { - model.addKeyColumnNameValue(newKeyColumnNameValueList.get(i)); - } - } + for (int i = 0; i < selected.length; i++) { + model.addKeyColumnNameValue(newKeyColumnNameValueList.get(i)); + } + } else if (returnValue == 5) { + //新选项和原来没有重复项的情况,产品确认:只做全量增加,原有的清除 + for (int i = 0; i < selected.length; i++) { + model.addKeyColumnNameValue(newKeyColumnNameValueList.get(i)); + } + } // Richie:初始化 if (keyColumnNameValueList.isEmpty()) { model.removeAllKeyColumnNameValue(); - for (int i = 0; i < selected.length; i++) { - model.addKeyColumnNameValue(new KeyColumnNameValue(false, (ColumnName)selected[i], new ColumnValue(""), false)); + for (Object o : selected) { + model.addKeyColumnNameValue(new KeyColumnNameValue(false, (ColumnName) o, new ColumnValue(""), false)); } } - + model.fireTableDataChanged(); keyColumnValuesTable.validate(); } - protected class AddFieldAction extends UpdateAction { - public AddFieldAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Add_Field")); - } + protected class AddFieldAction extends UpdateAction { + public AddFieldAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Add_Field")); + } - public void actionPerformed(ActionEvent e) { + @Override + public void actionPerformed(ActionEvent e) { - KeyColumnTableModel model = (KeyColumnTableModel)keyColumnValuesTable.getModel(); + KeyColumnTableModel model = (KeyColumnTableModel) keyColumnValuesTable.getModel(); - model.addKeyColumnNameValue(new KeyColumnNameValue(false, new ColumnName(""), new ColumnValue(""), false)); + model.addKeyColumnNameValue(new KeyColumnNameValue(false, new ColumnName(""), new ColumnValue(""), false)); updateUpdateCheckBoxEnable(); - model.fireTableDataChanged(); - - keyColumnValuesTable.getSelectionModel().setSelectionInterval(model.getRowCount() - 1, model.getRowCount() - 1); - } - } - - protected class RemoveFieldAction extends UpdateAction { - public RemoveFieldAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Remove_Field")); - } - - public void actionPerformed(ActionEvent evt) { - // DBManipulationPane target = this.getDBManipulationPane(); - - int[] selectedRows = keyColumnValuesTable.getSelectedRows(); - if (selectedRows == null || selectedRows.length == 0) { - return; - } - - int returnVal = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(DBManipulationPane.this), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_sure_remove_item") + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Remove"), JOptionPane.OK_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE); - if (returnVal == JOptionPane.OK_OPTION) { - KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel)keyColumnValuesTable.getModel(); - - // 把selectedRows从小到大排个序,先删大的再删小的 - java.util.Arrays.sort(selectedRows); - for (int i = selectedRows.length - 1; i >= 0; i--) { - keyColumnNameValueTableModel.removeKeyColumnNameValue(selectedRows[i]); - } + model.fireTableDataChanged(); + + keyColumnValuesTable.getSelectionModel().setSelectionInterval(model.getRowCount() - 1, model.getRowCount() - 1); + } + } + + protected class RemoveFieldAction extends UpdateAction { + public RemoveFieldAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_Remove_Field")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + // DBManipulationPane target = this.getDBManipulationPane(); + + int[] selectedRows = keyColumnValuesTable.getSelectedRows(); + if (selectedRows == null || selectedRows.length == 0) { + return; + } + + int returnVal = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(DBManipulationPane.this), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_sure_remove_item") + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Remove"), JOptionPane.OK_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE); + if (returnVal == JOptionPane.OK_OPTION) { + KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel) keyColumnValuesTable.getModel(); + + // 把selectedRows从小到大排个序,先删大的再删小的 + java.util.Arrays.sort(selectedRows); + for (int i = selectedRows.length - 1; i >= 0; i--) { + keyColumnNameValueTableModel.removeKeyColumnNameValue(selectedRows[i]); + } updateUpdateCheckBoxEnable(); - keyColumnNameValueTableModel.fireTableDataChanged(); - - // select other one. - if (keyColumnNameValueTableModel.getRowCount() > selectedRows[0]) { - keyColumnValuesTable.getSelectionModel().setSelectionInterval(selectedRows[0], selectedRows[0]); - } else if (keyColumnNameValueTableModel.getRowCount() > 0) { - keyColumnValuesTable.getSelectionModel().setSelectionInterval(0, 0); - } - } - } - } - - /* - * 刷新columnsComboBox - */ - private void refreshColumnsComboBox() { - DefaultComboBoxModel model = (DefaultComboBoxModel)this.columnsComboBox.getModel(); - model.removeAllElements(); - - ColumnName[] columnNames = currentColumnNames(); - for (int i = 0; i < columnNames.length; i++) { - model.addElement(columnNames[i]); - } - } - - // 得到当前的ColumnName[] - private ColumnName[] currentColumnNames() { - // ben:清除原有的 - if (currentColumnNames != null) { - currentColumnNames = null; - } - String[] colNames = this.chooseTable.currentColumnNames(); - int len = colNames.length; - currentColumnNames = new ColumnName[len]; - for (int i = 0; i < len; i++) { - currentColumnNames[i] = new ColumnName(colNames[i]); - } - return currentColumnNames; - } - - /* - * 设置JTable的Column - */ - private void initJTableColumn() { - TableColumn column0 = this.keyColumnValuesTable.getColumnModel().getColumn(0); - column0.setMaxWidth(50); - - TableColumn column1 = this.keyColumnValuesTable.getColumnModel().getColumn(1); - column1.setCellRenderer(new ColumnNameTableCellRenderer()); - - TableColumn column2 = this.keyColumnValuesTable.getColumnModel().getColumn(2); - column2.setCellRenderer(new ColumnValueTableCellRenderer()); - - // 设置column1的editor - columnsComboBox = new UIComboBox(new DefaultComboBoxModel()); - columnsComboBox.setRenderer(new UIComboBoxRenderer() { - - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof ColumnName) { - this.setText(((ColumnName)value).name); - } - - return this; - } - - }); - column1.setCellEditor(new DefaultCellEditor(columnsComboBox) { - public boolean stopCellEditing() { - if (super.stopCellEditing()) { - return true; - } - - return false; - } - }); - ((DefaultCellEditor)column1.getCellEditor()).setClickCountToStart(2); - - //设置Column 2的Editor - column2.setCellEditor(new ColumnValueEditor()); - } - - public void populateBean(DBManipulation dbManipulation) { - if (dbManipulation == null) { - dbManipulation = new DBManipulation(); - } + keyColumnNameValueTableModel.fireTableDataChanged(); + + // select other one. + if (keyColumnNameValueTableModel.getRowCount() > selectedRows[0]) { + keyColumnValuesTable.getSelectionModel().setSelectionInterval(selectedRows[0], selectedRows[0]); + } else if (keyColumnNameValueTableModel.getRowCount() > 0) { + keyColumnValuesTable.getSelectionModel().setSelectionInterval(0, 0); + } + } + } + } + + /* + * 刷新columnsComboBox + */ + private void refreshColumnsComboBox() { + DefaultComboBoxModel model = (DefaultComboBoxModel) this.columnsComboBox.getModel(); + model.removeAllElements(); + + ColumnName[] columnNames = currentColumnNames(); + for (ColumnName columnName : columnNames) { + model.addElement(columnName); + } + } + + // 得到当前的ColumnName[] + private ColumnName[] currentColumnNames() { + // ben:清除原有的 + if (currentColumnNames != null) { + currentColumnNames = null; + } + String[] colNames = this.chooseTable.currentColumnNames(); + int len = colNames.length; + currentColumnNames = new ColumnName[len]; + for (int i = 0; i < len; i++) { + currentColumnNames[i] = new ColumnName(colNames[i]); + } + return currentColumnNames; + } + + /* + * 设置JTable的Column + */ + private void initJTableColumn() { + TableColumn column0 = this.keyColumnValuesTable.getColumnModel().getColumn(0); + column0.setMaxWidth(50); + + TableColumn column1 = this.keyColumnValuesTable.getColumnModel().getColumn(1); + column1.setCellRenderer(new ColumnNameTableCellRenderer()); + + TableColumn column2 = this.keyColumnValuesTable.getColumnModel().getColumn(2); + column2.setCellRenderer(new ColumnValueTableCellRenderer()); + + // 设置column1的editor + columnsComboBox = new UIComboBox(new DefaultComboBoxModel()); + columnsComboBox.setRenderer(new UIComboBoxRenderer() { + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + + if (value instanceof ColumnName) { + this.setText(((ColumnName) value).name); + } + + return this; + } + + }); + column1.setCellEditor(new DefaultCellEditor(columnsComboBox) { + @Override + public boolean stopCellEditing() { + return super.stopCellEditing(); + } + }); + ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2); + + //设置Column 2的Editor + column2.setCellEditor(new ColumnValueEditor(DBManipulationPane.this)); + } + + @Override + public void populateBean(DBManipulation dbManipulation) { + if (dbManipulation == null) { + dbManipulation = new DBManipulation(); + } subMitName = dbManipulation.getName(); - DMLConfig dmlConfig = dbManipulation.getDmlConfig(); - - if (dmlConfig != null) { - if (dmlConfig instanceof IntelliDMLConfig) { - dmlConfigComboBox.setSelectedIndex(0); - } else if (dmlConfig instanceof DeleteConfig) { - dmlConfigComboBox.setSelectedIndex(1); - } else if (dmlConfig instanceof InsertConfig) { - dmlConfigComboBox.setSelectedIndex(2); - } else if (dmlConfig instanceof UpdateConfig) { - dmlConfigComboBox.setSelectedIndex(3); - } else { - dmlConfigComboBox.setSelectedIndex(0); - } - jobs = new NameSubmitJob[dmlConfig.getSubmitJobCount()]; - for (int i = 0; i < jobs.length; i++) { - jobs[i] = dmlConfig.getNameSubmitJob(i); - } - condition = dmlConfig.getCondition(); + DMLConfig dmlConfig = dbManipulation.getDmlConfig(); + + if (dmlConfig != null) { + if (dmlConfig instanceof IntelliDMLConfig) { + dmlConfigComboBox.setSelectedIndex(0); + } else if (dmlConfig instanceof DeleteConfig) { + dmlConfigComboBox.setSelectedIndex(1); + } else if (dmlConfig instanceof InsertConfig) { + dmlConfigComboBox.setSelectedIndex(2); + } else if (dmlConfig instanceof UpdateConfig) { + dmlConfigComboBox.setSelectedIndex(3); + } else { + dmlConfigComboBox.setSelectedIndex(0); + } + jobs = new NameSubmitJob[dmlConfig.getSubmitJobCount()]; + for (int i = 0; i < jobs.length; i++) { + jobs[i] = dmlConfig.getNameSubmitJob(i); + } + condition = dmlConfig.getCondition(); UpdateCheckBox.setSelected(dmlConfig.isUpdateSelected()); - } else { - jobs = null; - condition = null; - dmlConfigComboBox.setSelectedIndex(0); + } else { + jobs = null; + condition = null; + dmlConfigComboBox.setSelectedIndex(0); UpdateCheckBox.setSelected(false); - } + } - String schema = null; - String tableName = null; + String schema = null; + String tableName = null; Table table = null; - if (dmlConfig != null && dmlConfig.getOriTable() != null) { + if (dmlConfig != null && dmlConfig.getOriTable() != null) { table = dmlConfig.getOriTable(); if (table != null) { schema = table.getSchema(); tableName = table.getName(); } } - chooseTable.populateBean(new DataBaseItems(dbManipulation.getDBName(), schema, tableName)); + chooseTable.populateBean(new DataBaseItems(dbManipulation.getDBName(), schema, tableName)); - populateKeyColumnValueTable(dmlConfig); + populateKeyColumnValueTable(dmlConfig); updateUpdateCheckBoxEnable(); - refreshConditionList(); - } - - private void populateKeyColumnValueTable(DMLConfig dmlConfig) { - KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel)this.keyColumnValuesTable.getModel(); - keyColumnNameValueTableModel.removeAllKeyColumnNameValue(); - - if (dmlConfig != null) { - boolean acceptPara = false; - for (int i = 0; i < v_Types.length; i++) { - if (v_Types[i].accept(new Parameter())) { - acceptPara = true; - break; - } - } - for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) { - ColumnConfig column = dmlConfig.getColumnConfig(i); - String columnName = column.getColumnName(); - if (!acceptPara && column.getColumnValue() instanceof Parameter) { - // 表单中,将以前的参数转换为公式 - column.setColumnValue(BaseFormula.createFormulaBuilder().build(((Parameter)column.getColumnValue()).getName())); - } - - KeyColumnNameValue newColumnNameValue = new KeyColumnNameValue(column.isKey(), new ColumnName(columnName), new ColumnValue(column.getColumnValue()), - column.isSkipUnmodified()); - keyColumnNameValueTableModel.addKeyColumnNameValue(newColumnNameValue); - } - } - keyColumnNameValueTableModel.fireTableDataChanged(); - - // 选择第一个 - if (keyColumnNameValueTableModel.getRowCount() > 0) { - keyColumnValuesTable.getSelectionModel().setSelectionInterval(0, 0); - } - } - - public DBManipulation updateBean() { - DataBaseItems para = chooseTable.updateBean(true); - DBManipulation dbMani = new DBManipulation(); - dbMani.setName(subMitName); - dbMani.setDBName(para.getDatabaseName()); + refreshConditionList(); + } + + private void populateKeyColumnValueTable(DMLConfig dmlConfig) { + KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel) this.keyColumnValuesTable.getModel(); + keyColumnNameValueTableModel.removeAllKeyColumnNameValue(); + + if (dmlConfig != null) { + boolean acceptPara = false; + for (int i = 0; i < v_Types.length; i++) { + if (v_Types[i].accept(new Parameter())) { + acceptPara = true; + break; + } + } + for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) { + ColumnConfig column = dmlConfig.getColumnConfig(i); + String columnName = column.getColumnName(); + if (!acceptPara && column.getColumnValue() instanceof Parameter) { + // 表单中,将以前的参数转换为公式 + column.setColumnValue(BaseFormula.createFormulaBuilder().build(((Parameter) column.getColumnValue()).getName())); + } + + KeyColumnNameValue newColumnNameValue = new KeyColumnNameValue(column.isKey(), new ColumnName(columnName), new ColumnValue(column.getColumnValue()), + column.isSkipUnmodified()); + keyColumnNameValueTableModel.addKeyColumnNameValue(newColumnNameValue); + } + } + keyColumnNameValueTableModel.fireTableDataChanged(); + + // 选择第一个 + if (keyColumnNameValueTableModel.getRowCount() > 0) { + keyColumnValuesTable.getSelectionModel().setSelectionInterval(0, 0); + } + } - DMLConfig dmlConfig = new IntelliDMLConfig(); - if (dmlConfigComboBox.getSelectedIndex() == 1) { - dmlConfig = new DeleteConfig(); - } else if (dmlConfigComboBox.getSelectedIndex() == 2) { - dmlConfig = new InsertConfig(); - } else if (dmlConfigComboBox.getSelectedIndex() == 3) { - dmlConfig = new UpdateConfig(); - } + @Override + public DBManipulation updateBean() { + DataBaseItems para = chooseTable.updateBean(true); + DBManipulation dbMani = new DBManipulation(); + dbMani.setName(subMitName); + dbMani.setDBName(para.getDatabaseName()); + + DMLConfig dmlConfig = new IntelliDMLConfig(); + if (dmlConfigComboBox.getSelectedIndex() == 1) { + dmlConfig = new DeleteConfig(); + } else if (dmlConfigComboBox.getSelectedIndex() == 2) { + dmlConfig = new InsertConfig(); + } else if (dmlConfigComboBox.getSelectedIndex() == 3) { + dmlConfig = new UpdateConfig(); + } - dbMani.setDmlConfig(dmlConfig); + dbMani.setDmlConfig(dmlConfig); - dmlConfig.setTable(new Table(para.getSchemaName(), para.getTableName())); + dmlConfig.setTable(new Table(para.getSchemaName(), para.getTableName())); - KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel)this.keyColumnValuesTable.getModel(); - int rowCount = keyColumnNameValueTableModel.keyColumnNameValueList.size(); - for (int i = 0; i < rowCount; i++) { - KeyColumnNameValue newKeyColumnNameValue = keyColumnNameValueTableModel.keyColumnNameValueList.get(i); - // peter:先添加key column name. + KeyColumnTableModel keyColumnNameValueTableModel = (KeyColumnTableModel) this.keyColumnValuesTable.getModel(); + int rowCount = keyColumnNameValueTableModel.keyColumnNameValueList.size(); + for (int i = 0; i < rowCount; i++) { + KeyColumnNameValue newKeyColumnNameValue = keyColumnNameValueTableModel.keyColumnNameValueList.get(i); + // peter:先添加key column name. - dmlConfig.addColumnConfig(new ColumnConfig(newKeyColumnNameValue.cn.name, newKeyColumnNameValue.cv.obj, newKeyColumnNameValue.isKey,false)); - } + dmlConfig.addColumnConfig(new ColumnConfig(newKeyColumnNameValue.cn.name, newKeyColumnNameValue.cv.obj, newKeyColumnNameValue.isKey, false)); + } dmlConfig.setUpdateSelected(UpdateCheckBox.isSelected()); - if (jobs != null) { - for (int i = 0; i < jobs.length; i++) { - dmlConfig.addSubmitJob(jobs[i]); - } - } - dmlConfig.setCondition(condition); - - return dbMani; - } - - protected class ValuePane extends BasicBeanPane { - ValueEditorPane vPane; - - public ValuePane() { - this(v_Types); - } - - public ValuePane(Editor[] types) { - vPane = new ValueEditorPane(types); - this.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 45)); - this.add(vPane); - vPane.setPreferredSize(new Dimension(220, 25)); - } - - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Values_Editor"); - } - - public void populateBean(Object object) { - vPane.populate(object); - } - - @Override - public Object updateBean() { - return vPane.update(); - } - - } - - /* - * alex:ColumnValue的编辑器,弹出对话框来编辑...个人觉得不大好 - */ - protected class ColumnValueEditor extends AbstractCellEditor implements TableCellEditor { - /** The Swing component being edited. */ - private UILabel textLabel; - private ValuePane vPane; - private BasicDialog vPaneDLG; - - protected ColumnValueEditor() { - this(v_Types); - } - - protected ColumnValueEditor(Editor[] types) { - textLabel = new UILabel(); - textLabel.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - vPaneDLG.setAlwaysOnTop(true); - vPaneDLG.setVisible(true); - - } - }); - - vPane = new ValuePane(types); - vPaneDLG = vPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { - public void doOk() { - fireEditingStopped(); // Make the renderer - // reappear. + if (jobs != null) { + for (NameSubmitJob job : jobs) { + dmlConfig.addSubmitJob(job); + } + } + dmlConfig.setCondition(condition); + + return dbMani; + } + + protected class ValuePane extends BasicBeanPane { + ValueEditorPane vPane; + + public ValuePane() { + this(v_Types); + } + + public ValuePane(Editor[] types) { + vPane = new ValueEditorPane(types); + this.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 45)); + this.add(vPane); + vPane.setPreferredSize(new Dimension(220, 25)); + } + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Values_Editor"); + } + + @Override + public void populateBean(Object object) { + vPane.populate(object); + } + + @Override + public Object updateBean() { + return vPane.update(); + } + + } + + /* + * alex:ColumnValue的编辑器,弹出对话框来编辑...个人觉得不大好 + */ + protected class ColumnValueEditor extends AbstractCellEditor implements TableCellEditor { + /** + * The Swing component being edited. + */ + private final UILabel textLabel; + private final ValuePane vPane; + private final BasicDialog vPaneDLG; + private Component parent; + + /** + * 列值编辑器 + * + * @param parent 父组件,通过指定父组件启动下一级子窗口 + */ + protected ColumnValueEditor(Component parent) { + this(v_Types, parent); + } + + @Deprecated + protected ColumnValueEditor() { + this(v_Types, null); + } + + /** + * 列值编辑器 + * + * @param types 编辑器类型 + * @param parent 父组件,通过指定父组件启动下一级子窗口 + */ + protected ColumnValueEditor(Editor[] types, Component parent) { + textLabel = new UILabel(); + textLabel.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + vPaneDLG.setVisible(true); + } + }); + + vPane = new ValuePane(types); + Window window = parent == null + ? DesignerContext.getDesignerFrame() + : SwingUtilities.getWindowAncestor(parent); + vPaneDLG = vPane.showSmallWindow(window, new DialogActionAdapter() { + @Override + public void doOk() { + fireEditingStopped(); // Make the renderer + // reappear. updateUpdateCheckBoxEnable(); - } - - public void doCancel() { - fireEditingCanceled(); - } - }); - } - - /* - * 双击以编辑 - */ - public boolean isCellEditable(EventObject anEvent) { - if (anEvent instanceof MouseEvent) { - return ((MouseEvent)anEvent).getClickCount() >= 2; - } - return true; - } - - public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { - if (value instanceof ColumnValue) { - vPane.populateBean(((ColumnValue)value).obj); - - if (((ColumnValue)value).obj != null) { - textLabel.setText(((ColumnValue)value).obj.toString()); - } else { - textLabel.setText(""); - } - } - - return textLabel; - } - - public Object getCellEditorValue() { - return new ColumnValue(vPane.updateBean()); - } - } - - public static class ColumnName { - public String name; - - public ColumnName(String name) { - this.name = name; - } - - public boolean equals(Object obj) { - if (!(obj instanceof ColumnName)) { - return false; - } - - return ComparatorUtils.equals(this.name, ((ColumnName)obj).name); - } - - @Override - protected ColumnName clone() throws CloneNotSupportedException { - return new ColumnName(name); - } - } - - public static class ColumnValue { - public Object obj; - - public ColumnValue(Object obj) { - this.obj = obj; - } - - public Object getObj(){ + } + + @Override + public void doCancel() { + fireEditingCanceled(); + } + }); + } + + /* + * 双击以编辑 + */ + @Override + public boolean isCellEditable(EventObject anEvent) { + if (anEvent instanceof MouseEvent) { + return ((MouseEvent) anEvent).getClickCount() >= 2; + } + return true; + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + if (value instanceof ColumnValue) { + vPane.populateBean(((ColumnValue) value).obj); + + if (((ColumnValue) value).obj != null) { + textLabel.setText(((ColumnValue) value).obj.toString()); + } else { + textLabel.setText(""); + } + } + + return textLabel; + } + + @Override + public Object getCellEditorValue() { + return new ColumnValue(vPane.updateBean()); + } + } + + public static class ColumnName { + public String name; + + public ColumnName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ColumnName)) { + return false; + } + + return ComparatorUtils.equals(this.name, ((ColumnName) obj).name); + } + + @Override + protected ColumnName clone() throws CloneNotSupportedException { + return new ColumnName(name); + } + } + + public static class ColumnValue { + public Object obj; + + public ColumnValue(Object obj) { + this.obj = obj; + } + + public Object getObj() { return obj; } - public boolean equals(Object obj) { - if (!(obj instanceof ColumnValue)) { - return false; - } + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ColumnValue)) { + return false; + } - return ComparatorUtils.equals(this.obj, ((ColumnValue)obj).obj); - } + return ComparatorUtils.equals(this.obj, ((ColumnValue) obj).obj); + } - @Override - protected ColumnValue clone() throws CloneNotSupportedException { - return new ColumnValue(obj); - } - } + @Override + protected ColumnValue clone() throws CloneNotSupportedException { + return new ColumnValue(obj); + } + } - protected static class KeyColumnNameValueTable extends JTable { + protected static class KeyColumnNameValueTable extends JTable { - public KeyColumnNameValueTable() { - super(new KeyColumnValueTableModel(null)); - } + public KeyColumnNameValueTable() { + super(new KeyColumnValueTableModel(null)); + } - public KeyColumnTableModel getTableModel4SmartAddCell() { - KeyColumnTableModel clonedTableModel = null; - try { - //智能添加的时候修改clone的配置,不修改原配置,点击确认后覆盖原配置 - clonedTableModel = ((KeyColumnValueTableModel) this.getModel()).clone(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - return new KeyColumnValueTableModel(clonedTableModel); - } + public KeyColumnTableModel getTableModel4SmartAddCell() { + KeyColumnTableModel clonedTableModel = null; + try { + //智能添加的时候修改clone的配置,不修改原配置,点击确认后覆盖原配置 + clonedTableModel = ((KeyColumnValueTableModel) this.getModel()).clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return new KeyColumnValueTableModel(clonedTableModel); + } - } + } - protected abstract static class KeyColumnTableModel extends AbstractTableModel { + protected abstract static class KeyColumnTableModel extends AbstractTableModel { public static final String RAW_KEY = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_RWA_Key"); public static final String COLUMN = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Column"); - public static final String VALUE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"); - - public static final String[] COLUMN_NAMES = new String[]{RAW_KEY, COLUMN, VALUE}; - - protected List keyColumnNameValueList = new ArrayList<>(); - - public KeyColumnTableModel(KeyColumnTableModel model) { - if (model != null) { - this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); - } - } - - public String getColumnName(int col) { - return COLUMN_NAMES[col]; - } - - public int getColumnCount() { - return COLUMN_NAMES.length; - } - - public int getRowCount() { - return keyColumnNameValueList.size(); - } - - public void addKeyColumnNameValue(KeyColumnNameValue keyColumnNameValue) { - this.keyColumnNameValueList.add(keyColumnNameValue); - } - - public void removeKeyColumnNameValue(int index) { - this.keyColumnNameValueList.remove(index); - } - - public KeyColumnNameValue getKeyColumnNameValue(int index) { - return this.keyColumnNameValueList.get(index); - } - - public void removeAllKeyColumnNameValue() { - this.keyColumnNameValueList.clear(); - } - - public void refreshNameValueList(KeyColumnTableModel model) { - if (model != null) { - this.keyColumnNameValueList.clear(); - this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); - } - } - } - - protected static class KeyColumnValueTableModel extends KeyColumnTableModel implements Cloneable{ - - public KeyColumnValueTableModel(KeyColumnTableModel model) { - super(model); - } - - public Object getValueAt(int row, int col) { - KeyColumnNameValue knv = keyColumnNameValueList.get(row); - - switch (col) { - case 0: - return knv.isKey; - case 1: - return knv.cn; - case 2: - return knv.cv; - } - return null; - } - - public void setValueAt(Object value, int row, int col) { - KeyColumnNameValue knv = keyColumnNameValueList.get(row); - - if (col == 0 && value instanceof Boolean) { - knv.isKey = ((Boolean)value).booleanValue(); - } else if (col == 1 && value instanceof ColumnName) { - knv.cn = (ColumnName)value; - } else if (col == 2 && value instanceof ColumnValue) { - knv.cv = (ColumnValue)value; - } - } - - public Class getColumnClass(int c) { - switch (c) { - case 0: - return Boolean.class; - case 1: - return ColumnName.class; - case 2: - return ColumnValue.class; - } - return String.class; - } - - public boolean isCellEditable(int row, int col) { - return true; - } - - @Override - protected KeyColumnValueTableModel clone() throws CloneNotSupportedException { - KeyColumnValueTableModel cloned = (KeyColumnValueTableModel) super.clone(); - cloned.keyColumnNameValueList = new ArrayList<>(); - for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { - cloned.keyColumnNameValueList.add(keyColumnNameValue.clone()); - } - return cloned; - } - } - - - - public static class KeyColumnNameValue { - private boolean isKey = false; - private ColumnName cn; - public ColumnValue cv; - - public KeyColumnNameValue(boolean isKey, ColumnName cn, ColumnValue cv, boolean skip) { - this.isKey = isKey; - this.cn = cn; - this.cv = cv; - } - - /** - * 字符串 - * - * @return 字符串z - */ - public String toString() { - return (isKey ? "* " : "") + cn + ":" + cv; - } - - @Override - protected KeyColumnNameValue clone() throws CloneNotSupportedException { - return new KeyColumnNameValue(isKey, cn.clone(), cv.clone(), false); - } - } - - /* - * ColumnNameTableCellRenderer - */ - public class ColumnNameTableCellRenderer extends DefaultTableCellRenderer { - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - - if (value instanceof ColumnName) { - this.setText(((ColumnName)value).name); - } - - return this; - } - } - - /* - * ColumnValueTableCellRenderer - */ - private class ColumnValueTableCellRenderer extends DefaultTableCellRenderer { - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - - if (value instanceof ColumnValue) { - if (((ColumnValue)value).obj != null) { - if (((ColumnValue)value).obj instanceof Date) { - this.setText(DateUtils.DATEFORMAT2.format(((ColumnValue)value).obj)); - } else { - this.setText(((ColumnValue)value).obj.toString()); - } - } else { - this.setText(""); - } - } - - return this; - } - } + public static final String VALUE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"); + + public static final String[] COLUMN_NAMES = new String[]{RAW_KEY, COLUMN, VALUE}; + + protected List keyColumnNameValueList = new ArrayList<>(); + + public KeyColumnTableModel(KeyColumnTableModel model) { + if (model != null) { + this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); + } + } + + @Override + public String getColumnName(int col) { + return COLUMN_NAMES[col]; + } + + @Override + public int getColumnCount() { + return COLUMN_NAMES.length; + } + + @Override + public int getRowCount() { + return keyColumnNameValueList.size(); + } + + public void addKeyColumnNameValue(KeyColumnNameValue keyColumnNameValue) { + this.keyColumnNameValueList.add(keyColumnNameValue); + } + + public void removeKeyColumnNameValue(int index) { + this.keyColumnNameValueList.remove(index); + } + + public KeyColumnNameValue getKeyColumnNameValue(int index) { + return this.keyColumnNameValueList.get(index); + } + + public void removeAllKeyColumnNameValue() { + this.keyColumnNameValueList.clear(); + } + + public void refreshNameValueList(KeyColumnTableModel model) { + if (model != null) { + this.keyColumnNameValueList.clear(); + this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); + } + } + } + + protected static class KeyColumnValueTableModel extends KeyColumnTableModel implements Cloneable { + + public KeyColumnValueTableModel(KeyColumnTableModel model) { + super(model); + } + + @Override + public Object getValueAt(int row, int col) { + KeyColumnNameValue knv = keyColumnNameValueList.get(row); + + switch (col) { + case 0: + return knv.isKey; + case 1: + return knv.cn; + case 2: + return knv.cv; + } + return null; + } + + @Override + public void setValueAt(Object value, int row, int col) { + KeyColumnNameValue knv = keyColumnNameValueList.get(row); + + if (col == 0 && value instanceof Boolean) { + knv.isKey = ((Boolean) value).booleanValue(); + } else if (col == 1 && value instanceof ColumnName) { + knv.cn = (ColumnName) value; + } else if (col == 2 && value instanceof ColumnValue) { + knv.cv = (ColumnValue) value; + } + } + + @Override + public Class getColumnClass(int c) { + switch (c) { + case 0: + return Boolean.class; + case 1: + return ColumnName.class; + case 2: + return ColumnValue.class; + } + return String.class; + } + + @Override + public boolean isCellEditable(int row, int col) { + return true; + } + + @Override + protected KeyColumnValueTableModel clone() throws CloneNotSupportedException { + KeyColumnValueTableModel cloned = (KeyColumnValueTableModel) super.clone(); + cloned.keyColumnNameValueList = new ArrayList<>(); + for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { + cloned.keyColumnNameValueList.add(keyColumnNameValue.clone()); + } + return cloned; + } + } + + + public static class KeyColumnNameValue { + private boolean isKey = false; + private ColumnName cn; + public ColumnValue cv; + + public KeyColumnNameValue(boolean isKey, ColumnName cn, ColumnValue cv, boolean skip) { + this.isKey = isKey; + this.cn = cn; + this.cv = cv; + } + + /** + * 字符串 + * + * @return 字符串z + */ + @Override + public String toString() { + return (isKey ? "* " : "") + cn + ":" + cv; + } + + @Override + protected KeyColumnNameValue clone() throws CloneNotSupportedException { + return new KeyColumnNameValue(isKey, cn.clone(), cv.clone(), false); + } + } + + /* + * ColumnNameTableCellRenderer + */ + public static class ColumnNameTableCellRenderer extends DefaultTableCellRenderer { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + + if (value instanceof ColumnName) { + this.setText(((ColumnName) value).name); + } + + return this; + } + } + + /* + * ColumnValueTableCellRenderer + */ + private static class ColumnValueTableCellRenderer extends DefaultTableCellRenderer { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + + if (value instanceof ColumnValue) { + if (((ColumnValue) value).obj != null) { + if (((ColumnValue) value).obj instanceof Date) { + this.setText(DateUtils.DATEFORMAT2.format(((ColumnValue) value).obj)); + } else { + this.setText(((ColumnValue) value).obj.toString()); + } + } else { + this.setText(""); + } + } + + return this; + } + } } diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index a430faeec..4c283cd71 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -356,7 +356,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { if (isCellGroup) { column2.setCellRenderer(new ColumnRowGroupCellRenderer2()); - column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor())); + column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor(), this)); } else { column2.setCellRenderer(new SelectedColumnValueTableCellRenderer()); } @@ -456,7 +456,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { newAdd.clear(); for (int i = 0; i < cs; i++) { for (int j = 0; j < rs; j++) { - TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j ); + TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j); if (cellElement != null && ((i + c) != 0 || (r + j) != 0)) { String value = cellElement.toString(); if (!newAdd.contains(value) && !allColumnRow.contains(value)) { @@ -512,7 +512,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { private SmartJTablePaneAction a = new AbstractSmartJTablePaneAction(this, SmartInsertDBManipulationPane.this) { @Override public void doOk() { - ((KeyColumnTableModel)keyColumnValuesTable.getModel()).refreshNameValueList((KeyColumnTableModel)model); + ((KeyColumnTableModel) keyColumnValuesTable.getModel()).refreshNameValueList((KeyColumnTableModel) model); } @Override From 329b58d8b8bb9c312b22fbacf9a28e36cc845bdd Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 11:16:31 +0800 Subject: [PATCH 44/54] =?UTF-8?q?REPORT-44714=20=E3=80=9010.0.12=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AE=B0=E5=BD=95=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A4=B1=E6=95=88=20=E4=B8=8E=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=B2=9F=E9=80=9A=E5=90=8E=EF=BC=8C=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=A1=88=E4=B8=BA=EF=BC=8C=E5=BD=93?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E4=BA=86=E8=B6=B3=E4=BB=A5=E9=80=A0=E6=88=90?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=9D=A2=E6=9D=BF=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E5=AE=B9=E5=99=A8=E9=AB=98=E5=BA=A6=E5=8F=98=E5=8C=96?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=87=B3=E5=B0=91=E4=BF=9D=E8=AF=81=E6=B0=B4?= =?UTF-8?q?=E5=B9=B3=E6=8B=96=E6=8B=BD=E9=9D=A2=E6=9D=BF=E4=B8=8D=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 45 ++++++++++--------- .../gui/icontainer/UIResizableContainer.java | 32 +++---------- .../fr/design/mainframe/DesignerFrame.java | 4 +- .../mainframe/WestRegionContainerPane.java | 2 +- 4 files changed, 34 insertions(+), 49 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 44c0eba84..83f8133d7 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -141,8 +141,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private int eastRegionToolPaneY = 300; private int eastRegionContainerWidth = 260; + private int westRegionToolPaneY = 300; private int westRegionContainerWidth = 240; - private double westRegionToolPaneYRate = 0.5; private String encryptionKey; private String jdkHome; @@ -240,7 +240,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String installHome = StableUtils.getInstallHome(); //这里不判断路径是.的情况,放在checkValid方法里面,重新选 if (installHome != null) { - String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); + String name = Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); String envPath = designerEnvManager.getDefaultenvPath(installHome); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); designerEnvManager.setCurEnvName(name); @@ -304,8 +304,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH); String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log"); - if (!new java.io.File(fileName).exists()) { - StableUtils.makesureFileExist(new java.io.File(fileName)); + if (!new File(fileName).exists()) { + StableUtils.makesureFileExist(new File(fileName)); } Handler handler = new FileHandler(fileName, true); @@ -440,12 +440,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.lastOpenFilePath = lastOpenFilePath; } + /** - * 获取西面板的上子面板的高度占容器总高度的比例 + * 得到西面板的上下子面板的高度区分 + * * @return */ - public double getLastWestRegionToolPaneYRate() { - return westRegionToolPaneYRate; + public int getLastWestRegionToolPaneY() { + return this.westRegionToolPaneY; } /** @@ -458,11 +460,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } /** - * 设置关闭设计器前,西面板的上子面板的高度占容器总高度的比例 - * @param westRegionToolPaneYRate + * 设置西面板的上下子面板的高度区分 + * + * @param toolPaneY */ - public void setLastWestRegionToolPaneYRate(double westRegionToolPaneYRate) { - this.westRegionToolPaneYRate = westRegionToolPaneYRate; + public void setLastWestRegionToolPaneY(int toolPaneY) { + this.westRegionToolPaneY = toolPaneY; } /** @@ -526,7 +529,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { return env; } } - String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); + String name = Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath); this.putEnv(name, newDefaultEnv); return newDefaultEnv; @@ -549,7 +552,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } } } - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); + return Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); } @@ -1607,8 +1610,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private void readLastWestRegionLayout(XMLableReader reader) { String tmpVal; - if ((tmpVal = reader.getAttrAsString("toolPaneYRate", null)) != null) { - this.setLastWestRegionToolPaneYRate(Double.parseDouble(tmpVal)); + if ((tmpVal = reader.getAttrAsString("toolPaneY", null)) != null) { + this.setLastWestRegionToolPaneY(Integer.parseInt(tmpVal)); } if ((tmpVal = reader.getAttrAsString("containerWidth", null)) != null) { this.setLastWestRegionContainerWidth(Integer.parseInt(tmpVal)); @@ -1640,7 +1643,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) { // marks:兼容6.1的 // marks:设置默认的目录. - String curReportServerName = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); + String curReportServerName = Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal); this.putEnv(curReportServerName, reportServer); @@ -1931,8 +1934,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private void writeLastWestRegionLayout(XMLPrintWriter writer) { writer.startTAG("LastWestRegionLayout"); - if (this.getLastWestRegionToolPaneYRate() >= 0) { - writer.attr("toolPaneYRate", this.getLastWestRegionToolPaneYRate()); + if (this.getLastWestRegionToolPaneY() >= 0) { + writer.attr("toolPaneY ", this.getLastWestRegionToolPaneY()); } if (this.getLastWestRegionContainerWidth() >= 0) { writer.attr("containerWidth", this.getLastWestRegionContainerWidth()); @@ -2060,9 +2063,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { Self; public void handle(Throwable throwable) { ErrorDialog dialog = new ErrorDialog(null, - Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - throwable.getMessage()) { + Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + throwable.getMessage()) { @Override protected void okEvent() { dispose(); diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index b48950485..f3f45768f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -44,7 +44,6 @@ public class UIResizableContainer extends JPanel { private boolean isDownPaneVisible = true ; private int paraHeight; private int parentHeight = -1; - private double toolPaneYRate; public UIResizableContainer(int direction) { this(new JPanel(), new JPanel(), direction); @@ -157,20 +156,12 @@ public class UIResizableContainer extends JPanel { return this.toolPaneY; } - /** - * 获取上子面板高度占容器总高度的比例 - * @return - */ - public double getToolPaneYRate() { - return toolPaneYRate; - } - /** * 设置关闭设计器前最新的上子面板的高度比例 - * @param toolPaneYRate + * @param toolPaneY */ - public void setLastToolPaneYRate(double toolPaneYRate) { - this.toolPaneYRate = toolPaneYRate; + public void setLastToolPaneY(int toolPaneY) { + this.toolPaneY = toolPaneY; } /** @@ -248,9 +239,10 @@ public class UIResizableContainer extends JPanel { if (parentHeight == -1) { // 初始化下parentheight,存一下当前的父容器height parentHeight = parent.getHeight(); - } else if (parentHeight != parent.getHeight() && parent.getHeight() > 0) { - // parentHeight与父容器height不等时,代表用户调整分辨率或者dpi或者容器高度发生变化了,此时调整toolPaneY - toolPaneY = Math.min((int) (parent.getHeight() * toolPaneYRate), (parent.getHeight() - toolPaneHeight)); + } + if (parentHeight != parent.getHeight() && (parent.getHeight() - toolPaneHeight) >= 0) { + // 调整toolPaneY,保证至少水平的拖拽条horizontToolPane不丢失 + toolPaneY = Math.min(toolPaneY, parent.getHeight() - toolPaneHeight); parentHeight = parent.getHeight(); } } @@ -376,7 +368,6 @@ public class UIResizableContainer extends JPanel { toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y; toolPaneY = toolPaneY < 0 ? 0 : toolPaneY; toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight() : toolPaneY - getParameterPaneHeight(); - adjustToolPaneYRate(); refreshContainer(); } }); @@ -398,10 +389,8 @@ public class UIResizableContainer extends JPanel { public void mouseClicked(MouseEvent e) { if (e.getX() <= ARROW_RANGE) { toolPaneY = 0; - UIResizableContainer.this.adjustToolPaneYRate(); } else if (e.getX() >= getWidth() - ARROW_RANGE) { toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight(); - UIResizableContainer.this.adjustToolPaneYRate(); } else { return; } @@ -562,11 +551,4 @@ public class UIResizableContainer extends JPanel { jf.setSize(500, 500); jf.setVisible(true); } - - /** - * 当toolPaneY发生变化时,也需要调整toolPaneYRate - */ - private void adjustToolPaneYRate() { - this.toolPaneYRate = ((double) toolPaneY) / this.getHeight(); - } } 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 a5eafa0c0..490b4e7e9 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 @@ -1170,8 +1170,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); } - DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneYRate( - WestRegionContainerPane.getInstance().getToolPaneYRate()); + DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY( + WestRegionContainerPane.getInstance().getToolPaneY()); DesignerEnvManager.getEnvManager().setLastWestRegionContainerWidth( WestRegionContainerPane.getInstance().getContainerWidth()); DesignerEnvManager.getEnvManager().setLastEastRegionToolPaneY( diff --git a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java index 358fba411..004fbd55a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java @@ -24,7 +24,7 @@ public class WestRegionContainerPane extends UIResizableContainer { public static final WestRegionContainerPane getInstance() { if (THIS == null) { THIS = new WestRegionContainerPane(); - THIS.setLastToolPaneYRate(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneYRate()); + THIS.setLastToolPaneY(DesignerEnvManager.getEnvManager().getLastWestRegionToolPaneY()); THIS.setLastContainerWidth(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth()); } return THIS; From ff0ded7b125833d461601b16c696a3f84ea80f44 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 11:36:12 +0800 Subject: [PATCH 45/54] =?UTF-8?q?REPORT-44714=20=E3=80=9010.0.12=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AE=B0=E5=BD=95=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A4=B1=E6=95=88=20=E5=B0=86=E5=AF=B9?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=96=87=E4=BB=B6=E7=9A=84=E8=AF=AF=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E5=9B=9E=E9=80=80=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 83f8133d7..791d679b3 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -2063,9 +2063,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { Self; public void handle(Throwable throwable) { ErrorDialog dialog = new ErrorDialog(null, - Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - throwable.getMessage()) { + Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + throwable.getMessage()) { @Override protected void okEvent() { dispose(); From 8c138328e230149c1643abb9addac9afb824cd53 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 11 Dec 2020 16:09:10 +0800 Subject: [PATCH 46/54] =?UTF-8?q?REPORT-45095=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F&=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../write/submit/DBManipulationPane.java | 45 +++++++------------ .../submit/SmartInsertDBManipulationPane.java | 2 +- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 1e1ab1f72..46b11d2a8 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -697,7 +697,7 @@ public class DBManipulationPane extends BasicBeanPane { ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2); //设置Column 2的Editor - column2.setCellEditor(new ColumnValueEditor(DBManipulationPane.this)); + column2.setCellEditor(new ColumnValueEditor()); } @Override @@ -864,43 +864,19 @@ public class DBManipulationPane extends BasicBeanPane { */ private final UILabel textLabel; private final ValuePane vPane; - private final BasicDialog vPaneDLG; - private Component parent; - /** - * 列值编辑器 - * - * @param parent 父组件,通过指定父组件启动下一级子窗口 - */ - protected ColumnValueEditor(Component parent) { - this(v_Types, parent); - } - - @Deprecated protected ColumnValueEditor() { - this(v_Types, null); + this(v_Types); } /** * 列值编辑器 * - * @param types 编辑器类型 - * @param parent 父组件,通过指定父组件启动下一级子窗口 + * @param types 编辑器类型 */ - protected ColumnValueEditor(Editor[] types, Component parent) { + protected ColumnValueEditor(Editor[] types) { textLabel = new UILabel(); - textLabel.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent e) { - vPaneDLG.setVisible(true); - } - }); - - vPane = new ValuePane(types); - Window window = parent == null - ? DesignerContext.getDesignerFrame() - : SwingUtilities.getWindowAncestor(parent); - vPaneDLG = vPane.showSmallWindow(window, new DialogActionAdapter() { + DialogActionAdapter adapter = new DialogActionAdapter() { @Override public void doOk() { fireEditingStopped(); // Make the renderer @@ -912,7 +888,18 @@ public class DBManipulationPane extends BasicBeanPane { public void doCancel() { fireEditingCanceled(); } + }; + textLabel.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + Window window = e.getComponent() == null + ? DesignerContext.getDesignerFrame() + : SwingUtilities.getWindowAncestor(e.getComponent()); + vPane.showSmallWindow(window, adapter) + .setVisible(true); + } }); + vPane = new ValuePane(types); } /* diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 4c283cd71..d306bb179 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -356,7 +356,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { if (isCellGroup) { column2.setCellRenderer(new ColumnRowGroupCellRenderer2()); - column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor(), this)); + column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor())); } else { column2.setCellRenderer(new SelectedColumnValueTableCellRenderer()); } From 21c4355bcbbce04172e455397e2d7914d0784efb Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 17:27:36 +0800 Subject: [PATCH 47/54] =?UTF-8?q?REPORT-44961=20=E3=80=9010.0.12=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E9=99=84=E4=BB=B6=E6=A8=A1=E6=9D=BF=E6=89=93?= =?UTF-8?q?=E5=BC=80=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8D=A1=E6=AD=BB=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E5=B8=83=E5=B1=80=E5=8F=91=E7=94=9F=E5=8F=98=E5=8C=96?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E5=B8=A6=E6=9C=89=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E7=9A=84?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=8E=A7=E4=BB=B6=EF=BC=8C=E5=9C=A8=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E5=8E=BB=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E8=8E=B7=E5=8F=96=E5=AD=97=E6=AE=B5=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E7=B3=BB=E7=BB=9F=E4=B8=AD=E6=9C=89=E5=90=8C?= =?UTF-8?q?=E5=90=8D=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=BF=9E=E6=8E=A5=E5=88=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E4=BC=9A=E5=8F=91?= =?UTF-8?q?=E7=94=9F=E5=81=87=E6=AD=BB=E3=80=82=E5=A6=82=E6=9E=9C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=BF=99=E4=B8=AA=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E7=9A=84=E5=90=8D=E5=AD=97=EF=BC=8C=E9=82=A3=E4=B9=88=E4=BC=9A?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=8A=A5=E9=94=99=E4=B8=8D=E4=BC=9A=E5=81=87?= =?UTF-8?q?=E6=AD=BB=E3=80=82=E4=B8=BB=E8=A6=81=E8=BF=98=E6=98=AF=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E6=93=8D=E4=BD=9C=E6=98=AF=E8=80=97?= =?UTF-8?q?=E6=97=B6=E6=93=8D=E4=BD=9C=EF=BC=8C=E4=B8=8D=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E5=9C=A8UI=E7=BA=BF=E7=A8=8B=E8=BF=9B=E8=A1=8C=E8=80=97?= =?UTF-8?q?=E6=97=B6=E6=93=8D=E4=BD=9C=E3=80=82=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E4=B8=BB=E8=A6=81=E5=88=86?= =?UTF-8?q?=E4=B8=BA=E4=B8=A4=E9=83=A8=E5=88=86=EF=BC=8C=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=98=AF=E5=B0=86=E5=8E=9F=E6=9C=AC=E7=9A=84tdChange()?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=AD=E7=9A=84=E8=80=97=E6=97=B6=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=94=BE=E5=88=B0SwingWorker=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=BA=BF=E7=A8=8B=E4=B8=AD=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E6=A0=B7=E7=9A=84=E8=AF=9D=E5=8D=B3=E4=BD=BF=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5=EF=BC=8C?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B9=9F=E4=B8=8D=E4=BC=9A=E4=B8=80?= =?UTF-8?q?=E7=9B=B4=E9=98=BB=E5=A1=9E=E7=9B=B4=E5=88=B0=E9=87=8D=E8=BF=9E?= =?UTF-8?q?=E8=B6=85=E6=97=B6=EF=BC=9B=E7=AC=AC=E4=BA=8C=E6=98=AF=E5=BA=94?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E7=9A=84=E8=A6=81=E6=B1=82=EF=BC=8C=E5=B0=86?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=8E=A7=E4=BB=B6=E5=B0=B1=E4=BC=9A=E5=8E=BB?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=BF=9E=E6=8E=A5=E5=B9=B6=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=B1=9E=E4=BA=8E=E5=BD=93=E5=89=8D=E6=8E=A7=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=88=97=E5=90=8D=E8=BF=99=E9=83=A8=E5=88=86=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=94=A8=E6=88=B7=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E6=97=81=E8=BE=B9=E7=9A=84?= =?UTF-8?q?button=E7=9A=84=E6=97=B6=E5=80=99=E6=89=8D=E4=BC=9A=E5=8E=BB?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=BF=9E=E6=8E=A5=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E5=BD=93=E5=89=8D=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=88=97=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccessibleDictionaryEditor.java | 3 +- .../design/present/dict/DictionaryPane.java | 4 + .../present/dict/TableDataDictPane.java | 103 +++++++++++------- 3 files changed, 71 insertions(+), 39 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java index c2195512a..6be31c526 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java @@ -21,6 +21,7 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { protected void showEditorPane() { if (dictPane == null) { dictPane = new DictionaryPane(); + dictPane.setNeedTableDataChange(true); } BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this)); @@ -58,4 +59,4 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { public Dictionary updateBean() { return (Dictionary) this.getValue(); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index e50ed86b9..f74138be5 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -83,4 +83,8 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr public void registerDSChangeListener() { tableDataDictPane.registerDSChangeListener(); } + + public void setNeedTableDataChange(boolean needTableDataChange) { + tableDataDictPane.setNeedTableDataChange(needTableDataChange); + } } diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index 3c08c1c9d..53801293a 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -31,17 +31,20 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; - +import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ExecutionException; /** * 数据字典的数据查询面板 @@ -60,6 +63,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane private DoubleDeckValueEditorPane valueDictPane; private ItemListener itemListener; private UIObserverListener uiObserverListener; + private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); + private boolean needTableDataChange = false; public TableDataDictPane() { initBasicComponets(); @@ -67,6 +72,14 @@ public class TableDataDictPane extends FurtherBasicBeanPane iniListener(); } + /** + * 设置为true后,一旦触发TableDataComboBox的itemChange,就会通过数据连接,更换当前数据字典的列名List + * @param needTableDataChange + */ + public void setNeedTableDataChange(boolean needTableDataChange) { + this.needTableDataChange = needTableDataChange; + } + public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -80,11 +93,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane private void initBasicComponets() { tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); - tableDataNameComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { - tdChange(e); - } + tableDataNameComboBox.addItemListener(e -> { + if (e.getStateChange() == ItemEvent.SELECTED) { + tdChange(e, needTableDataChange); } }); // keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); @@ -153,44 +164,60 @@ public class TableDataDictPane extends FurtherBasicBeanPane return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dic_Data_Query"); } - private void tdChange(final ItemEvent e) { + private void tdChange(final ItemEvent e, boolean needTableDataChange) { TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); if (tableDataWrappe == null) { return; } - - List namelist = tableDataWrappe.calculateColumnNameList(); - String[] columnNames = null; - if (!namelist.isEmpty()) { - columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); - } else { - columnNames = new String[]{""}; + if (itemListener != null) { + itemListener.itemStateChanged(e); + localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); } - ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); - columnNameEditor1.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor1.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + if (needTableDataChange) { + changeColumnsName(); + } + } - FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); - formulaEditor.setEnabled(true); - formulaEditor.addChangeListener(new ChangeListener() { + private void changeColumnsName() { + TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); + SwingWorker, Object> worker = new SwingWorker, Object>() { + @Override + protected List doInBackground() { + if (tableDataWrappe == null) { + return new ArrayList<>(); + } + return tableDataWrappe.calculateColumnNameList(); + } @Override - public void stateChanged(ChangeEvent ee) { - if (itemListener != null) { - itemListener.itemStateChanged(e); + protected void done() { + try { + List namelist = get(); + String[] columnNames = null; + if (!namelist.isEmpty()) { + columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); + } else { + columnNames = new String[]{""}; + } + ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); + columnNameEditor1.addItemListener(itemListener); + ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); + columnIndexEditor1.addItemListener(itemListener); + keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + + localFormulaEditor.setEnabled(true); + + ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); + columnNameEditor2.addItemListener(itemListener); + ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); + columnIndexEditor2.addItemListener(itemListener); + valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, localFormulaEditor}, columnNames[0]); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - }); - ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); - columnNameEditor2.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor2.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, formulaEditor}, columnNames[0]); - if (itemListener != null) { - itemListener.itemStateChanged(e); - } + }; + worker.execute(); } @Override From b7987f61f8e4f436620e58f33caf0e427b4dc31f Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 17:31:18 +0800 Subject: [PATCH 48/54] =?UTF-8?q?REPORT-44961=20=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E9=87=8C=E5=85=88=E4=B8=8D=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/wrapper/AbstractTableDataWrapper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index ceb0bd8b6..3f1068d01 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -63,8 +63,7 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false); } catch (Exception e) { if (e.getMessage()!=null) { - // 这个弹窗可能会成为数据字典页面的二级弹窗,所以修改下父窗口避免出现mac下的二级弹窗问题 - FineJOptionPane.showMessageDialog(null, e.getMessage()); + DesignUtils.errorMessage(e.getMessage()); } } columnNameList = DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); From f531d4cf4d83406c8329fa6db7dce2fc44a3ce28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 14 Dec 2020 10:50:51 +0800 Subject: [PATCH 49/54] =?UTF-8?q?CHART-17393=20=E8=BE=B9=E6=A1=86=E5=92=8C?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E9=9A=90=E8=97=8F=E5=90=8E=E5=8D=A0=E7=94=A8?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/label/VanChartPlotLabelDetailPane.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 5a8af100d..546648963 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -122,8 +122,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return new Component[][]{ new Component[]{dataLabelContentPane, null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, - new Component[]{createLabelBorderPane(), null}, - new Component[]{createLabelBackgroundPane(), null} + new Component[]{createBorderAndBackgroundPane(), null}, }; } @@ -138,6 +137,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { }; } + private JPanel createBorderAndBackgroundPane() { + JPanel jPanel = new JPanel(); + jPanel.setLayout(new BorderLayout(0, 5)); + jPanel.add(createLabelBorderPane(), BorderLayout.NORTH); + jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER); + return jPanel; + } + private JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); From fbf2036d5d8a1d1cadcb099f4dc98225ddeee126 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 14 Dec 2020 11:02:24 +0800 Subject: [PATCH 50/54] =?UTF-8?q?REPORT-44961=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=8F=98=E9=87=8F=E5=90=8D=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E5=8E=BB=E6=97=A0=E7=94=A8=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/AbstractTableDataWrapper.java | 1 - .../present/dict/TableDataDictPane.java | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index 3f1068d01..be993fa68 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -7,7 +7,6 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index 53801293a..098280bc5 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -197,21 +197,24 @@ public class TableDataDictPane extends FurtherBasicBeanPane if (!namelist.isEmpty()) { columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); } else { - columnNames = new String[]{""}; + columnNames = new String[]{StringUtils.EMPTY}; } - ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); - columnNameEditor1.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor1.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + // 实际值列名 + ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames); + actualColumnNameEditor.addItemListener(itemListener); + // 实际值列序号 + ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length); + actualColumnIndexEditor.addItemListener(itemListener); + keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]); localFormulaEditor.setEnabled(true); - - ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); - columnNameEditor2.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor2.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, localFormulaEditor}, columnNames[0]); + // 显示值列名 + ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames); + displayColumnNameEditor.addItemListener(itemListener); + // 显示值列序号 + ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length); + displayColumnIndexEditor.addItemListener(itemListener); + valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, localFormulaEditor}, columnNames[0]); } catch (InterruptedException | ExecutionException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } From f99aac406bc05b05fa2369b111fe969276c44d1b Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 14 Dec 2020 11:12:24 +0800 Subject: [PATCH 51/54] =?UTF-8?q?REPORT-44961=20=E4=B8=BA=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E5=B1=9E=E6=80=A7-=E5=BD=A2=E6=80=81-?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E4=B8=AD=E7=9A=84Dictionar?= =?UTF-8?q?yPane=E4=B9=9F=E8=AE=BE=E7=BD=AEneedChangeTableData=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E4=B8=BAtrue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/present/DictPresentPane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java index cba37ea19..85f027217 100644 --- a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java @@ -10,7 +10,7 @@ import com.fr.design.present.dict.DictionaryPane; /** - * + * * @author zhou * @since 2012-5-31上午10:54:20 */ @@ -19,6 +19,7 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public DictPresentPane() { dictionaryPane = new DictionaryPane(); + dictionaryPane.setNeedTableDataChange(true); this.setLayout(new BorderLayout()); this.add(dictionaryPane, BorderLayout.CENTER); } @@ -42,7 +43,7 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public boolean accept(Object ob) { return ob instanceof DictPresent; } - + public void addTabChangeListener(ItemListener l){ dictionaryPane.addTabChangeListener(l); } @@ -55,4 +56,4 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public void registerDSChangeListener() { dictionaryPane.registerDSChangeListener(); } -} \ No newline at end of file +} From bc9a93d903fa1fc49f141dfbdd0ef06c2d25bed8 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 14 Dec 2020 14:41:00 +0800 Subject: [PATCH 52/54] =?UTF-8?q?REPORT-44961=20=E6=8A=8ATableDataDictPane?= =?UTF-8?q?=E4=B8=AD=E7=9A=84needTableDataChange=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BAtrue=EF=BC=8C=E5=9C=A8CheckBoxGroupD?= =?UTF-8?q?efinePane=E4=B8=AD=E5=88=9B=E5=BB=BADictionaryPane=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=BC=A0=E5=85=A5=E4=B8=80=E4=B8=AAfalse?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E6=A0=B7=E5=B0=B1=E4=B8=8D=E4=BC=9A=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E5=85=B6=E5=AE=83=E4=BD=BF=E7=94=A8=E4=BA=86Dictionar?= =?UTF-8?q?yPane=E7=9A=84=E5=9C=B0=E6=96=B9=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../accessibles/AccessibleDictionaryEditor.java | 1 - .../java/com/fr/design/present/DictPresentPane.java | 1 - .../com/fr/design/present/dict/DictionaryPane.java | 11 +++++++---- .../fr/design/present/dict/TableDataDictPane.java | 12 ++++++++---- .../widget/ui/designer/CheckBoxGroupDefinePane.java | 4 ++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java index 6be31c526..3edf47b05 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java @@ -21,7 +21,6 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { protected void showEditorPane() { if (dictPane == null) { dictPane = new DictionaryPane(); - dictPane.setNeedTableDataChange(true); } BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this)); diff --git a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java index 85f027217..82cf70372 100644 --- a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java @@ -19,7 +19,6 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public DictPresentPane() { dictionaryPane = new DictionaryPane(); - dictionaryPane.setNeedTableDataChange(true); this.setLayout(new BorderLayout()); this.add(dictionaryPane, BorderLayout.CENTER); } diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index f74138be5..3f42732f1 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -24,6 +24,13 @@ import java.util.List; public class DictionaryPane extends UIComboBoxPane implements DataCreatorUI, Prepare4DataSourceChange { private TableDataDictPane tableDataDictPane; + public DictionaryPane() { + } + + public DictionaryPane(boolean needTableDataChange) { + this.tableDataDictPane.setNeedTableDataChange(needTableDataChange); + } + @Override protected void initLayout() { this.setLayout(new BorderLayout(0, 4)); @@ -83,8 +90,4 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr public void registerDSChangeListener() { tableDataDictPane.registerDSChangeListener(); } - - public void setNeedTableDataChange(boolean needTableDataChange) { - tableDataDictPane.setNeedTableDataChange(needTableDataChange); - } } diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index 098280bc5..5eb6c2873 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -64,7 +64,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane private ItemListener itemListener; private UIObserverListener uiObserverListener; private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); - private boolean needTableDataChange = false; + private boolean needTableDataChange = true; public TableDataDictPane() { initBasicComponets(); @@ -95,7 +95,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); tableDataNameComboBox.addItemListener(e -> { if (e.getStateChange() == ItemEvent.SELECTED) { - tdChange(e, needTableDataChange); + tdChange(e); } }); // keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); @@ -164,7 +164,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dic_Data_Query"); } - private void tdChange(final ItemEvent e, boolean needTableDataChange) { + private void tdChange(final ItemEvent e) { TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); if (tableDataWrappe == null) { return; @@ -173,7 +173,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane itemListener.itemStateChanged(e); localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); } - if (needTableDataChange) { + if (isNeedTableDataChange()) { changeColumnsName(); } } @@ -404,4 +404,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane public void registerDSChangeListener() { tableDataNameComboBox.registerGlobalDSChangeListener(); } + + public boolean isNeedTableDataChange() { + return needTableDataChange; + } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java index 19a61a631..022afc610 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java @@ -29,9 +29,9 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane Date: Tue, 15 Dec 2020 16:55:27 +0800 Subject: [PATCH 53/54] =?UTF-8?q?CHART-17429=20=20=20=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E8=BD=B4=E9=87=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=E6=97=B6?= =?UTF-8?q?=E5=80=99=E9=87=8D=E7=BD=AEhtml=E9=A1=B5=E9=9D=A2=E7=9B=91?= =?UTF-8?q?=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java index 1a4fccf58..cd6c4fcf6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java @@ -176,6 +176,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { gaugeStyle = gaugePlot.getGaugeStyle(); reLayoutPane(false); parent.initAllListeners(); + setParentPane(parent); } populateBean(gaugePlot.getGaugeAxis()); } From eaeffb57140b57bdcb0ed2edee5b37dd927f46bb Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 16 Dec 2020 17:51:56 +0800 Subject: [PATCH 54/54] =?UTF-8?q?CHART-17231=20=E9=BB=98=E8=AE=A4=E4=B8=8D?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E4=BB=BB=E4=BD=95=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/extended/chart/UIComboBoxWithNone.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index 65e7bbb43..9c6636fd7 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -23,7 +23,11 @@ public class UIComboBoxWithNone extends UIComboBox { } protected void setDefaultSelectedItem() { - setSelectedItem(StringUtils.EMPTY); + // JComboBox.setSelectedItem(o) + // if(o!=null)寻找o对应的下拉选项 如果找不到 还是选中之前选中的 + // 所以空字符串 不是选中空 是选中上次选中的 + // 所以这边 可以写setSelectedItem(null) or setSelectedIndex(-1) + setSelectedIndex(-1); } @Override