From 79dbdc48eba1d71d0fe4ebe90eb459ba7741eaa0 Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 22 Sep 2021 15:37:41 +0800 Subject: [PATCH 01/18] =?UTF-8?q?CHART-20939=20design=20fix:=20=E4=B8=89?= =?UTF-8?q?=E7=BB=B4=E7=BB=84=E5=90=88=E5=9C=B0=E5=9B=BE=E6=9C=89=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/ChartTypeInterfaceManager.java | 2 +- .../main/java/com/fr/design/chart/ChartTypePane.java | 2 +- .../fr/design/mainframe/chart/gui/ChartTypePane.java | 11 ++++++++--- .../src/main/java/com/fr/poly/PolyComponentsBar.java | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 8600a8c149..2d54fc8189 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -149,7 +149,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr public static WidgetOption[] initWidgetOption() { - String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); + String[] chartIDs = ChartTypeManager.getInstance().getChartIDs4Create(); ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length]; int index = 0; diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index a5937c1d9d..d31cd32088 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -31,7 +31,7 @@ import java.awt.Component; public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent { private static final long serialVersionUID = -1175602484968520546L; - private String[] chartIDs = ChartTypeManager.getInstanceWithCheck().getAllChartIDs(); + private String[] chartIDs = ChartTypeManager.getInstanceWithCheck().getChartIDs4Create(); private JList mainTypeList = null; private JList iconViewList = null; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 985ee28afa..5635c8b7b4 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -4,6 +4,7 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.DialogActionAdapter; @@ -173,7 +174,7 @@ public class ChartTypePane extends AbstractChartAttrPane { Map>> allChartTypePane, ActionListener autoButtonListener) { - String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDsIncludeDisabled(); + String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); for (String id : chartIDs) { @@ -288,7 +289,9 @@ public class ChartTypePane extends AbstractChartAttrPane { Map.Entry> entry = iterator.next(); String plotID = entry.getKey(); if (ignore || ChartTypeManager.enabledChart(plotID)) { - cards.add(entry.getValue()); + if (ChartTypeManager.getInstance().isShowInDesigner(plotID)) { + cards.add(entry.getValue()); + } } } @@ -310,7 +313,9 @@ public class ChartTypePane extends AbstractChartAttrPane { //第一步就是重构cards cards.clear(); - if (enabledChart) { + if (DesignModeContext.isDuchampMode()) { + addOnePlotIDCards(priority, chartID); + } else if (enabledChart) { if (collection.getChartCount() == 1) { addAllCards(); } else { diff --git a/designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java b/designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java index e443909f20..f459281ba7 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java @@ -46,7 +46,7 @@ public class PolyComponentsBar extends JToolBar { setFloatable(false); setBackground(UIConstants.TOOLBARUI_BACKGROUND); setLayout(FRGUIPaneFactory.create1ColumnGridLayout()); - String[] iDs = ChartTypeManager.getInstance().getAllChartIDs(); + String[] iDs = ChartTypeManager.getInstance().getChartIDs4Create(); int typeLen = iDs.length < MAX_BAR_NUM ? iDs.length : MAX_BAR_NUM; serIcons = new SerIcon[typeLen + 1]; serIcons[0] = new SerIcon( From 0c327207bc40925213ee12bcb96724ba977ac8e0 Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 23 Sep 2021 14:14:28 +0800 Subject: [PATCH 02/18] =?UTF-8?q?CHART-21014=20=E5=A4=A7=E5=B1=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E7=9A=84cpt=E7=BB=84=E4=BB=B6=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E8=BF=98=E6=98=AF=E8=A6=81=E6=9C=89=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=B1=BB=E5=9E=8B=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/chart/gui/ChartTypePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 5635c8b7b4..2eea49f16d 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -19,6 +19,7 @@ import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox; import com.fr.design.mainframe.chart.gui.item.ItemEventType; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.mode.ChartEditContext; +import com.fr.design.mainframe.chart.mode.ChartEditMode; import com.fr.design.module.DesignModuleFactory; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; @@ -313,7 +314,7 @@ public class ChartTypePane extends AbstractChartAttrPane { //第一步就是重构cards cards.clear(); - if (DesignModeContext.isDuchampMode()) { + if (ChartEditContext.duchampMode()) { addOnePlotIDCards(priority, chartID); } else if (enabledChart) { if (collection.getChartCount() == 1) { From 026ecab6ad300ba414aa588294349e39ecf85ffa Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 23 Sep 2021 16:16:52 +0800 Subject: [PATCH 03/18] =?UTF-8?q?CHART-20850=20fix:=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=AD=20=E8=AF=95=E7=AE=A1=E5=9E=8B?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E5=88=87=E6=8D=A2=E4=B8=BA=E6=A8=AA?= =?UTF-8?q?=E5=90=91=E5=90=8E=20=E6=A0=87=E7=AD=BE=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E5=B0=B1=E5=8F=98=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java index d3f997295b..83c9c523d1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java @@ -16,6 +16,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithMaxMin; import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.attr.GaugeDetailStyle; @@ -199,7 +200,9 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane { if (attrLabelDetail == null || attrLabelDetail.getTextAttr() == null) { return; } - attrLabelDetail.getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_LABEL_FONT); + if (!ChartEditContext.duchampMode()) { + attrLabelDetail.getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_LABEL_FONT); + } if (gaugeLayout.getSelectedIndex() == 0) { attrLabel.getAttrLabelDetail().setPosition(Constants.LEFT); attrLabel.getGaugeValueLabelDetail().setPosition(Constants.LEFT); From 2adee772b27b5092297900c75b180bfe9215f80e Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 23 Sep 2021 19:29:23 +0800 Subject: [PATCH 04/18] =?UTF-8?q?CHART-20686=20=E5=A4=A7=E5=B1=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E7=9A=84=E5=9B=BE=E8=A1=A8=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/other/VanChartInteractivePane.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java index 78be16ad55..dc72b90221 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java @@ -471,7 +471,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { } protected Component[][] createToolBarComponents() { - return new Component[][]{ + return ChartEditContext.duchampMode() ? new Component[][]{ + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), isSort}, + new Component[]{null, fullScreenDisplay}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse}, + } : new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), isSort}, new Component[]{null, exportImages}, new Component[]{null, fullScreenDisplay}, @@ -480,7 +484,10 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { } protected Component[][] createToolBarComponentsWithOutSort() { - return new Component[][]{ + return ChartEditContext.duchampMode() ? new Component[][]{ + new Component[]{null, fullScreenDisplay}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse} + } : new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), exportImages}, new Component[]{null, fullScreenDisplay}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse} From 2a967d27f26c8a2371e01b0a2a065e618de2a17e Mon Sep 17 00:00:00 2001 From: shine Date: Sun, 26 Sep 2021 14:07:46 +0800 Subject: [PATCH 05/18] =?UTF-8?q?CHART-20411=20=E9=80=82=E9=85=8D=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E6=A8=A1=E6=9D=BF=E5=8F=A6=E5=AD=98=E4=B8=BA?= 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 +- 1 file changed, 1 insertion(+), 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 d4931763c8..72824b2ea9 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 @@ -1460,7 +1460,7 @@ public abstract class JTemplate> if (editingFILE == null || editingFILE instanceof MemFILE) { return false; } - this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(editingFILE)); + export(); this.editingFILE = editingFILE; return true; } From ac01b5c6fea6d8e88a64ae9c780b1a439c4d2b52 Mon Sep 17 00:00:00 2001 From: shine Date: Sun, 26 Sep 2021 14:08:26 +0800 Subject: [PATCH 06/18] =?UTF-8?q?CHART-20411=20=E9=80=82=E9=85=8D=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E6=A8=A1=E6=9D=BF=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/MutilTempalteTabPane.java | 3 ++- .../java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 87b7f2f25c..047420294a 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -4,6 +4,7 @@ package com.fr.design.file; import com.fr.base.BaseUtils; import com.fr.base.GraphHelper; import com.fr.base.vcs.DesignerMode; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.imenu.UIMenuItem; @@ -753,7 +754,7 @@ public class MutilTempalteTabPane extends JComponent { /** * 关闭掉一个模板之后激活新的待显示模板 */ - private void activePrevTemplateAfterClose() { + public void activePrevTemplateAfterClose() { if (openedTemplate.isEmpty()) { //新建并激活模板 DesignerContext.getDesignerFrame().addAndActivateJTemplate(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 866c2fabea..cfc4483c95 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -408,7 +408,9 @@ public abstract class ToolBarMenuDock { menuDef.addShortCut(new OpenRecentReportMenuDef()); - addCloseCurrentTemplateAction(menuDef); + if (!DesignModeContext.isDuchampMode()) { + addCloseCurrentTemplateAction(menuDef); + } scs = plus.shortcut4FileMenu(); if (!ArrayUtils.isEmpty(scs)) { From 291452a0f52cfe806bee77b85e80af728a6f2bad Mon Sep 17 00:00:00 2001 From: shine Date: Sun, 26 Sep 2021 19:37:38 +0800 Subject: [PATCH 07/18] =?UTF-8?q?CHART-21076=20=E6=B8=85=E6=A5=9A=E7=A3=81?= =?UTF-8?q?=E7=9B=98=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/ui/ModernUIPane.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java index 90d6accf6b..09fa2bbc08 100644 --- a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java +++ b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java @@ -26,6 +26,7 @@ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.File; import java.util.Map; /** @@ -170,6 +171,10 @@ public class ModernUIPane extends BasicPane { public void clearCache() { if (browser != null) { browser.getCacheStorage().clearCache(); + File file = new File(browser.getContext().getCacheDir()); + if (file.exists()) { + file.delete(); + } } } From 77c7a84eecde096651e1822302db51d47f79ed8e Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 27 Sep 2021 09:50:29 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E5=92=8C=E6=8A=BD=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E4=B8=80=E6=A0=B7?= 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 +- 1 file changed, 1 insertion(+), 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 72824b2ea9..ec0387cef1 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 @@ -877,7 +877,7 @@ public abstract class JTemplate> } protected boolean export() throws Exception { - return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(editingFILE)); + return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(getEditingFILE())); } From cc19c999e3fa7c27929d108ca6b75406b1df8f37 Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 27 Sep 2021 13:59:54 +0800 Subject: [PATCH 09/18] =?UTF-8?q?REPORT-59256=20=E5=A1=AB=E6=8A=A5-?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE-?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BC=9A=E5=B8=A6=E5=87=BA=E4=B9=8B=E5=89=8D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=8F=90=E4=BA=A4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/write/submit/CustomJobPane.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java index d07d42b3e2..6e4f2d803f 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java @@ -13,6 +13,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.stable.ListMap; import com.fr.stable.StringUtils; import com.fr.design.utils.gui.GUICoreUtils; @@ -115,7 +116,12 @@ public abstract class CustomJobPane extends BasicBeanPane { @Override public void populateBean(Object ob) { - if (ob instanceof AbstractClassJob) { + if (ob == null) { + // 自定义提交新增时初始化页面 REPORT-59256 + this.classNameTextField.setText(StringUtils.EMPTY); + this.objectProperiesPane.populateBean(new ListMap()); + } + else if (ob instanceof AbstractClassJob) { AbstractClassJob cj = (AbstractClassJob) ob; this.classNameTextField.setText(cj.getClassName()); this.objectProperiesPane.populateBean(cj.getPropertyMap()); From b7fae76db7bc6b074cd53dd88138ad97c6a5e224 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 27 Sep 2021 19:50:41 +0800 Subject: [PATCH 10/18] =?UTF-8?q?CHART-20937=20fix:=E4=B8=8D=E6=96=B0?= =?UTF-8?q?=E5=88=9B=E5=BB=BAeditpane=E4=BD=86=E6=98=AF=E8=A6=81=E9=87=8D?= =?UTF-8?q?=E7=BD=AElastChartCollection=20=E5=90=A6=E5=88=99=E4=B8=8D?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/chart/ChartEditPaneProvider.java | 3 +++ .../main/java/com/fr/design/mainframe/ChartPropertyPane.java | 2 ++ .../java/com/fr/design/mainframe/chart/ChartEditPane.java | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/chart/ChartEditPaneProvider.java b/designer-base/src/main/java/com/fr/design/gui/chart/ChartEditPaneProvider.java index 3003800364..0a3684ba30 100644 --- a/designer-base/src/main/java/com/fr/design/gui/chart/ChartEditPaneProvider.java +++ b/designer-base/src/main/java/com/fr/design/gui/chart/ChartEditPaneProvider.java @@ -16,4 +16,7 @@ public interface ChartEditPaneProvider { default void removeChartEditPaneActionListener(ChartEditPaneActionListener l) { } + default void resetLastChartCollection() { + } + } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java index 90b0e88054..2d4d5fef6c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java @@ -55,6 +55,8 @@ public class ChartPropertyPane extends BaseChartPropertyPane { chartEditPane.setContainer(container); currentID = plotID; resetChartEditPane(); + } else { + chartEditPane.resetLastChartCollection(); } } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index d6acb929a7..70b7130f12 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -118,6 +118,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare this.listenerList.remove(ChartEditPaneActionListener.class, l); } + public void resetLastChartCollection() { + this.lastCollection = null; + } + private void fireAttributeChange(ChartCollection chartCollection) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); From 7ada3e18e010964529dbba1b79422cf0b3d9f313 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 28 Sep 2021 18:03:10 +0800 Subject: [PATCH 11/18] =?UTF-8?q?REPORT-59959=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=93=8D=E4=BD=9C-11?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=88=B6=E4=BD=9C=E7=9A=84=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=A8=A1=E6=9D=BF=EF=BC=8C10=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=8F=AF=E4=BB=A5=E6=89=93=E5=BC=80=EF=BC=9B=E4=BD=86?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E7=9A=8411=E5=81=9A=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=EF=BC=8C=E5=B0=9D=E8=AF=95=E7=94=A810=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=97=B6=E9=83=BD=E4=BC=9A=E6=AD=A3=E5=B8=B8=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=BC=B9=E7=AA=97=E6=89=93=E4=B8=8D=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesktopCardPane.java | 5 +-- .../com/fr/design/mainframe/JTemplate.java | 32 ++++++++++++++++--- .../fr/design/mainframe/OpenFailedPane.java | 10 +++++- .../com/fr/design/worker/open/OpenWorker.java | 26 ++++++++++++--- 4 files changed, 62 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java index 0e26ff3ded..a2c6efcb2b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java @@ -86,7 +86,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener } else if (jt.isOpening()) { showOpenStatus(); } else if (jt.isOpenFailed()) { - showOpenFailedCover(); + showOpenFailedCover(jt.getTemplateOpenFailedTip()); } else { hideCover(); } @@ -115,7 +115,8 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener layeredPane.moveToFront(loadingPane); } - public void showOpenFailedCover() { + public void showOpenFailedCover(String text) { + failedPane.setFailedTip(text); layeredPane.moveToFront(failedPane); } 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 d4931763c8..a4db8e88ff 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 @@ -114,6 +114,8 @@ public abstract class JTemplate> private JComponent centerPane; private DesignModelAdapter designModel; private PreviewProvider previewType; + private String templateOpenFailedTip; + /** * 统计模板制作耗时 * @@ -1051,35 +1053,49 @@ public abstract class JTemplate> /** * 判断是否是新版设计器 * + * @param showTipPane 是否需要展示弹窗 * @return 是返回true */ - public boolean isNewDesigner() { + public boolean isNewDesigner(boolean showTipPane) { String xmlDesignerVersion = getTarget().getXMLDesignerVersion(); if (isLowerThanHBB(xmlDesignerVersion)) { String info = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open-New_Form_Tip"); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); - new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); + if (showTipPane) { + new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); + } return true; } return false; } + public boolean isNewDesigner() { + return isNewDesigner(true); + } + /** * 是否是就版本设计器 * + * @param showTipPane 是否需要展示弹窗 * @return 是就返回true */ - public boolean isOldDesigner() { + public boolean isOldDesigner(boolean showTipPane) { String xmlDesignerVersion = getTarget().getXMLDesignerVersion(); if (isHigherThanCurrent(xmlDesignerVersion)) { String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(xmlDesignerVersion)); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); - new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); + if (showTipPane) { + new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); + } return true; } return false; } + public boolean isOldDesigner() { + return isOldDesigner(true); + } + /** * */ @@ -1628,4 +1644,12 @@ public abstract class JTemplate> public String getRuntimeId() { return runtimeId; } + + public String getTemplateOpenFailedTip() { + return templateOpenFailedTip; + } + + public void setTemplateOpenFailedTip(String templateOpenFailedTip) { + this.templateOpenFailedTip = templateOpenFailedTip; + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/OpenFailedPane.java b/designer-base/src/main/java/com/fr/design/mainframe/OpenFailedPane.java index 132569c236..63ab984da6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/OpenFailedPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/OpenFailedPane.java @@ -24,6 +24,7 @@ public class OpenFailedPane extends JPanel { private UILabel label; private MessageWithLink link; + private String defaultFailedText; public OpenFailedPane() { this.setLayout(new LayoutManager() { @@ -83,11 +84,18 @@ public class OpenFailedPane extends JPanel { }); } }; + this.defaultFailedText = link.getText(); link.setBackground(Color.WHITE); this.add(label); this.add(link); } - + public void setFailedTip(String text) { + if (StringUtils.isEmpty(text)) { + this.link.setText(defaultFailedText); + } else { + this.link.setText(text); + } + } } diff --git a/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java b/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java index 819660a99d..1c03c67594 100644 --- a/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java +++ b/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java @@ -7,12 +7,14 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; +import com.fr.design.utils.DesignUtils; import com.fr.design.worker.WorkerManager; import com.fr.exception.DecryptTemplateException; import com.fr.file.FILE; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; import javax.swing.JOptionPane; import javax.swing.SwingWorker; import javax.swing.UIManager; @@ -51,6 +53,7 @@ public class OpenWorker extends SwingWorker { @Override protected T doInBackground() throws Exception { + TimeUnit.SECONDS.sleep(5); return this.callable.call(); } @@ -61,7 +64,7 @@ public class OpenWorker extends SwingWorker { } catch (CancellationException ignored) { return; } catch (Throwable t) { - processFailed(); + processFailed(StringUtils.EMPTY); Throwable cause = t.getCause(); if (cause instanceof DecryptTemplateException) { FineJOptionPane.showMessageDialog( @@ -91,6 +94,11 @@ public class OpenWorker extends SwingWorker { if (slowly && templateCallable != null) { try { JTemplate book = templateCallable.call(); + if (inValidDesigner(book)) { + String text = Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(book.getTarget().getDesignerVersion())); + processFailed(text); + return; + } FILE tplFile = book.getEditingFILE(); JTemplate currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); // 当前tab页是正在打开的模板 @@ -117,11 +125,21 @@ public class OpenWorker extends SwingWorker { WorkerManager.getInstance().removeWorker(taskName); } - private void processFailed() { + private boolean inValidDesigner(JTemplate jt) { + return jt.isOldDesigner(false) || (!jt.isJWorkBook() && jt.isNewDesigner(false)); + } + + private void processFailed(String text) { this.template.setOpenFailed(true); this.template.setOpening(false); - DesignerContext.getDesignerFrame().getCenterTemplateCardPane().showOpenFailedCover(); - DesignerFrameFileDealerPane.getInstance().stateChange(); + JTemplate currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + // 需要判断当前打开的模板是不是异步执行后失败的模板 是的话立即展示失败后的提示内容 否则只设置下失败的提示内容 + if (ComparatorUtils.equals(currentTemplate.getEditingFILE().getName(), this.template.getName())) { + DesignerContext.getDesignerFrame().getCenterTemplateCardPane().showOpenFailedCover(text); + DesignerFrameFileDealerPane.getInstance().stateChange(); + } else { + this.template.setTemplateOpenFailedTip(text); + } WorkerManager.getInstance().removeWorker(taskName); } From 29835e7d04e224072cfd55d052995fe1244d8cd6 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 28 Sep 2021 19:05:45 +0800 Subject: [PATCH 12/18] =?UTF-8?q?CHART-21222=20=E5=A4=A7=E5=B1=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E7=9A=84=E9=92=BB=E5=8F=96=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E9=92=BB=E5=8F=96=E7=9B=AE=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E8=B6=85=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/other/VanChartDrillMapInteractivePane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java index c439c4d4d9..ce06ca4b6b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java @@ -101,7 +101,12 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith double f = TableLayout.FILL; double[] columnSize = {f}; double[] rowSize = {p, p, p, p, p, p}; - Component[][] components = new Component[][]{ + Component[][] components = ChartEditContext.duchampMode() ? new Component[][]{ + new Component[]{null}, + new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)}, + new Component[]{backgroundPane}, + new Component[]{selectBackgroundPane} + } : new Component[][]{ new Component[]{null}, new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)}, new Component[]{backgroundPane}, From c4f405531ac16339b8efb0aba2e8d19bba1cc591 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 29 Sep 2021 16:16:51 +0800 Subject: [PATCH 13/18] =?UTF-8?q?REPORT-59681=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=8E=A7=E5=88=B6=E6=A8=A1=E6=9D=BF=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/fit/BaseFitAttrPane.java | 228 ++++++++++++++++++ .../fr/design/report/fit/CptFitAttrModel.java | 51 ++++ .../fr/design/report/fit/FitAttrModel.java | 44 ++++ .../fr/design/report/fit/FrmFitAttrModel.java | 53 ++++ .../fit/menupane/ReportFitAttrAction.java | 10 +- .../fit/menupane/TemplateFitAttrPane.java | 104 +++++--- .../AbstractFitAttrModelProvider.java | 18 ++ .../fit/provider/FitAttrModelProvider.java | 11 + .../fr/design/webattr/ServerFitAttrPane.java | 78 ++++++ 9 files changed, 555 insertions(+), 42 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java create mode 100644 designer-base/src/main/java/com/fr/design/report/fit/CptFitAttrModel.java create mode 100644 designer-base/src/main/java/com/fr/design/report/fit/FitAttrModel.java create mode 100644 designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java create mode 100644 designer-base/src/main/java/com/fr/design/report/fit/provider/AbstractFitAttrModelProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/report/fit/provider/FitAttrModelProvider.java create mode 100644 designer-realize/src/main/java/com/fr/design/webattr/ServerFitAttrPane.java diff --git a/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java new file mode 100644 index 0000000000..718ce09bf6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java @@ -0,0 +1,228 @@ +package com.fr.design.report.fit; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.report.fit.menupane.FitPreviewPane; +import com.fr.design.report.fit.menupane.FitRadioGroup; +import com.fr.design.report.fit.menupane.FontRadioGroup; +import com.fr.design.report.fit.provider.FitAttrModelProvider; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; +import com.fr.report.fit.ReportFitAttr; + + +import javax.swing.*; +import javax.swing.border.EmptyBorder; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Set; +import java.util.stream.Collectors; + +import static com.fr.design.i18n.Toolkit.i18nText; + +public abstract class BaseFitAttrPane extends BasicBeanPane { + + protected JPanel contentJPanel; + protected UIComboBox itemChoose; + protected java.util.List fitAttrModelList = new ArrayList<>(); + + public FontRadioGroup fontRadioGroup; + public FitRadioGroup adaptRadioGroup; + public JPanel attrJPanel; + public FitPreviewPane previewJPanel; + public FitAttrModel fitAttrModel; + + + protected BaseFitAttrPane() { + initFitAttrModel(); + } + + private void initFitAttrModel() { + fitAttrModelList.add(new FrmFitAttrModel()); + fitAttrModelList.add(new CptFitAttrModel()); + + Set fitAttrModelProviders = ExtraDesignClassManager.getInstance().getArray(FitAttrModelProvider.XML_TAG); + + for (FitAttrModelProvider fitAttrModelProvider : fitAttrModelProviders) { + fitAttrModelList.add(fitAttrModelProvider); + } + + fitAttrModelList = fitAttrModelList.stream().sorted(Comparator.comparing(FitAttrModel::getPriority).reversed()).collect(Collectors.toList()); + } + + protected void populateModel(FitAttrModel fitAttrModel) { + this.fitAttrModel = fitAttrModel; + if (attrJPanel != null) { + contentJPanel.remove(attrJPanel); + } + if (previewJPanel != null) { + contentJPanel.remove(previewJPanel); + } + + fontRadioGroup = new FontRadioGroup(); + adaptRadioGroup = new FitRadioGroup(); + initAttrJPanel(); + initPreviewJPanel(); + } + + + protected void initAttrJPanel() { + int colCount = fitAttrModel.getFitTypes().length + 1; + Component[][] components = new Component[2][colCount]; + initFitRadioGroup(fontRadioGroup, i18nText("Fine-Designer_Fit-Font"), new String[]{i18nText("Fine-Designer_Fit"), i18nText("Fine-Designer_Fit-No")}, components[0]); + initFitRadioGroup(adaptRadioGroup, fitAttrModel.getFitName(), Arrays.stream(fitAttrModel.getFitTypes()).map(FitType::description).toArray(String[]::new), components[1]); + + double[] rowSize = new double[2]; + double[] columnSize = new double[colCount]; + for (int i = 0; i < rowSize.length; i++) { + rowSize[i] = 20; + } + for (int i = 0; i < columnSize.length; i++) { + if (i == 0) { + columnSize[i] = 80; + } else { + columnSize[i] = 100; + } + } + + attrJPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + attrJPanel.setBorder(new EmptyBorder(0, 100, 10, 100)); + contentJPanel.add(attrJPanel); + } + + private void initFitRadioGroup(FitRadioGroup fitRadioGroup, String name, String[] options, Component[] components) { + components[0] = new UILabel(name); + for (int i = 0; i < options.length; i++) { + + if (options[i] != null) { + UIRadioButton fontFitRadio = new UIRadioButton(options[i]); + fitRadioGroup.add(fontFitRadio); + components[i + 1] = fontFitRadio; + } else { + components[i + 1] = null; + } + } + fitRadioGroup.addActionListener(getPreviewActionListener()); + } + + protected ActionListener getPreviewActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + refreshPreviewJPanel(); + } + }; + } + + protected void refreshPreviewJPanel() { + String previewIndex = getPreviewIndex(); + previewJPanel.refreshPreview(previewIndex, fontRadioGroup.isEnabled()); + } + + protected String getPreviewIndex() { + return getStateInPC(adaptRadioGroup.getSelectRadioIndex()) + "" + fontRadioGroup.getSelectRadioIndex(); + } + + protected void initPreviewJPanel() { + previewJPanel = new FitPreviewPane(); + contentJPanel.add(previewJPanel); + } + + protected int getStateInPC(int index) { + FitType[] fitTypes = fitAttrModel.getFitTypes(); + return fitTypes[index].getState(); + } + + protected int getOptionIndex(int state) { + FitType[] fitTypes = fitAttrModel.getFitTypes(); + for (int i = 0; i < fitTypes.length; i++) { + if (ComparatorUtils.equals(state, fitTypes[i].getState())) { + return i; + } + } + return 0; + } + + + @Override + public void populateBean(ReportFitAttr ob) { + fontRadioGroup.selectIndexButton(ob.isFitFont() ? 0 : 1); + adaptRadioGroup.selectIndexButton(getOptionIndex(ob.fitStateInPC())); + refreshPreviewJPanel(); + } + + @Override + public ReportFitAttr updateBean() { + ReportFitAttr reportFitAttr = new ReportFitAttr(); + reportFitAttr.setFitFont(fontRadioGroup.isFontFit()); + reportFitAttr.setFitStateInPC(getStateInPC(adaptRadioGroup.getSelectRadioIndex())); + return reportFitAttr; + } + + + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + fontRadioGroup.setEnabled(enabled); + adaptRadioGroup.setEnabled(enabled); + refreshPreviewJPanel(); + } + + @Override + protected String title4PopupWindow() { + return i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); + } + + protected abstract String[] getItemNames(); + + protected void initComponents() { + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + contentJPanel = new JPanel(); + contentJPanel.setLayout(FRGUIPaneFactory.createCenterFlowLayout()); + this.add(contentJPanel); + initItemChoose(); + } + + + private void initItemChoose() { + JPanel chooseJPanel = new JPanel(); + chooseJPanel.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); + ItemListener itemListener = getItemListener(); + itemChoose = new UIComboBox(getItemNames()); + itemChoose.addItemListener(itemListener); + UILabel belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); + JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{ + belowSetLabel, itemChoose}, FlowLayout.LEFT, 0, 0); + chooseJPanel.add(buttonPane); + chooseJPanel.setPreferredSize(new Dimension(500, 50)); + JPanel jPanel = new JPanel(); + jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + jPanel.add(chooseJPanel, BorderLayout.WEST); + + contentJPanel.add(jPanel); + } + + + protected abstract ItemListener getItemListener(); + + + public void populate(ReportFitAttr reportFitAttr) { + + } + + protected void refresh() { + validate(); + repaint(); + revalidate(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/report/fit/CptFitAttrModel.java b/designer-base/src/main/java/com/fr/design/report/fit/CptFitAttrModel.java new file mode 100644 index 0000000000..176f2cee1a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/report/fit/CptFitAttrModel.java @@ -0,0 +1,51 @@ +package com.fr.design.report.fit; + + +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.JTemplate; +import com.fr.report.fit.ReportFitAttr; +import com.fr.report.fit.ReportFitConfig; + + +public class CptFitAttrModel implements FitAttrModel { + + @Override + public FitType[] getFitTypes() { + return new FitType[]{ + FitType.HORIZONTAL_FIT, + FitType.DOUBLE_FIT, + FitType.NOT_FIT + }; + } + + @Override + public String getFitName() { + return Toolkit.i18nText("Fine-Designer_Fit-Element"); + } + + + @Override + public String getModelName() { + return Toolkit.i18nText("Fine-Design_Basic_Plain_Report"); + } + + @Override + public ReportFitAttr getGlobalReportFitAttr() { + return ReportFitConfig.getInstance().getCptFitAttr(); + } + + @Override + public void setGlobalReportFitAttr(ReportFitAttr reportFitAttr) { + ReportFitConfig.getInstance().setCptFitAttr(reportFitAttr); + } + + @Override + public int getPriority() { + return 0; + } + + @Override + public boolean isAvailable(JTemplate jTemplate) { + return jTemplate.isJWorkBook(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/report/fit/FitAttrModel.java b/designer-base/src/main/java/com/fr/design/report/fit/FitAttrModel.java new file mode 100644 index 0000000000..1d1ac02f0d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/report/fit/FitAttrModel.java @@ -0,0 +1,44 @@ +package com.fr.design.report.fit; + +import com.fr.design.mainframe.JTemplate; +import com.fr.report.fit.ReportFitAttr; + +public interface FitAttrModel { + /** + * @Description 名称,比如:普通报表、决策报表等 + **/ + String getModelName(); + + /** + * @Description 自适应选项的名称,比如返回:表格 + **/ + String getFitName(); + + /** + * @Description 自适应选项 + **/ + FitType[] getFitTypes(); + + + /** + * @Description 获取全局的自适应属性 + **/ + ReportFitAttr getGlobalReportFitAttr(); + + /** + * @Description 设置全局的自适应属性 + * @param: reportFitAttr + **/ + void setGlobalReportFitAttr(ReportFitAttr reportFitAttr); + + /** + * @Description 优先级 + **/ + int getPriority(); + + /** + * @Description 是否可用 + * @param: jTemplate + **/ + boolean isAvailable(JTemplate jTemplate); +} diff --git a/designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java b/designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java new file mode 100644 index 0000000000..258dfbf49c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java @@ -0,0 +1,53 @@ +package com.fr.design.report.fit; + + +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.JTemplate; +import com.fr.report.fit.ReportFitAttr; +import com.fr.report.fit.ReportFitConfig; + + +public class FrmFitAttrModel implements FitAttrModel { + + + @Override + public String getModelName() { + return Toolkit.i18nText("Fine-Design_Basic_Decision_Report"); + } + + @Override + public String getFitName() { + return Toolkit.i18nText("Fine-Designer_Fit-Element"); + } + + public FitType[] getFitTypes() { + return new FitType[]{ + FitType.DEFAULT, + FitType.HORIZONTAL_FIT, + FitType.DOUBLE_FIT, + FitType.NOT_FIT + }; + } + + @Override + public ReportFitAttr getGlobalReportFitAttr() { + return ReportFitConfig.getInstance().getFrmFitAttr(); + } + + @Override + public void setGlobalReportFitAttr(ReportFitAttr reportFitAttr) { + ReportFitConfig.getInstance().setFrmFitAttr(reportFitAttr); + } + + @Override + public int getPriority() { + return 1; + } + + @Override + public boolean isAvailable(JTemplate jTemplate) { + return !jTemplate.isJWorkBook(); + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index ae0cfd2b65..7f66596a93 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -1,6 +1,5 @@ package com.fr.design.report.fit.menupane; -import com.fr.base.svg.IconUtils; import com.fr.design.actions.JTemplateAction; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; @@ -82,13 +81,8 @@ public class ReportFitAttrAction extends JTemplateAction { } final FitProvider wbTpl = (FitProvider) jwb.getTarget(); ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); - if (jwb.isJWorkBook()) { - final TemplateFitAttrPane attrPane = new TemplateFitAttrPane(); - showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); - } else { - final ReportFitAttrPane attrPane = new ReportFitAttrPane(); - showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); - } + TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(); + showReportFitDialog(fitAttr, jwb, wbTpl, templateFitAttrPane); } private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane attrPane) { diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java index 66673fc5f5..393cbfc711 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java @@ -1,55 +1,91 @@ package com.fr.design.report.fit.menupane; -import com.fr.design.beans.BasicBeanPane; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.report.fit.BaseFitAttrPane; +import com.fr.design.report.fit.FitAttrModel; +import com.fr.general.ComparatorUtils; +import com.fr.report.fit.FitProvider; import com.fr.report.fit.ReportFitAttr; -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; -/** - * Created by 夏翔 on 2016/6/24. - */ -public class TemplateFitAttrPane extends BasicBeanPane { - private TemplateBrowserFitAttrPane attrPane; +public class TemplateFitAttrPane extends BaseFitAttrPane { public TemplateFitAttrPane() { initComponents(); } - private void initComponents() { - this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - attrPane = new TemplateBrowserFitAttrPane(); - this.add(attrPane); + @Override + protected void initComponents() { + super.initComponents(); + for (FitAttrModel fitAttrModel : fitAttrModelList) { + if (fitAttrModel.isAvailable(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) { + populateModel(fitAttrModel); + break; + } + } + } + @Override + public void populateBean(ReportFitAttr reportFitAttr) { + if (reportFitAttr == null) { + itemChoose.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_Using_Server_Report_View_Settings")); + } else { + itemChoose.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_I_Want_To_Set_Single")); + } + populate(reportFitAttr); } - /** - * 展示界面 - * - * @param fitAttr 自适应属性 - */ - public void populateBean(ReportFitAttr fitAttr) { - attrPane.populateBean(fitAttr); + public void populate(ReportFitAttr reportFitAttr) { + if (reportFitAttr == null) { + reportFitAttr = fitAttrModel.getGlobalReportFitAttr(); + } + + super.setEnabled(isTemplateSingleSet()); + super.populateBean(reportFitAttr); } - /** - * 提交数据 - * - * @return 界面上的更新数据 - */ public ReportFitAttr updateBean() { - return attrPane.updateBean(); + if (!isTemplateSingleSet()) { + return null; + } else { + return super.updateBean(); + } + } + + @Override + protected String[] getItemNames() { + return new String[]{Toolkit.i18nText("Fine-Design_Report_Using_Server_Report_View_Settings"), + Toolkit.i18nText("Fine-Design_Report_I_Want_To_Set_Single")}; + } + + @Override + protected ItemListener getItemListener() { + return new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + if(isTemplateSingleSet()){ + JTemplate jwb = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jwb != null) { + FitProvider wbTpl = (FitProvider) jwb.getTarget(); + ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); + populate(fitAttr); + } + }else { + populate(fitAttrModel.getGlobalReportFitAttr()); + } + } + } + }; } - /** - * 标题 - * - * @return 标题 - */ - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Fit_Attr"); + private boolean isTemplateSingleSet() { + return ComparatorUtils.equals(Toolkit.i18nText("Fine-Design_Report_I_Want_To_Set_Single"), itemChoose.getSelectedItem()); } -} +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/report/fit/provider/AbstractFitAttrModelProvider.java b/designer-base/src/main/java/com/fr/design/report/fit/provider/AbstractFitAttrModelProvider.java new file mode 100644 index 0000000000..44d048b7de --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/report/fit/provider/AbstractFitAttrModelProvider.java @@ -0,0 +1,18 @@ +package com.fr.design.report.fit.provider; + +import com.fr.stable.fun.mark.API; + + +@API(level = FitAttrModelProvider.CURRENT_LEVEL) +public abstract class AbstractFitAttrModelProvider implements FitAttrModelProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/report/fit/provider/FitAttrModelProvider.java b/designer-base/src/main/java/com/fr/design/report/fit/provider/FitAttrModelProvider.java new file mode 100644 index 0000000000..88f7335d42 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/report/fit/provider/FitAttrModelProvider.java @@ -0,0 +1,11 @@ +package com.fr.design.report.fit.provider; + + +import com.fr.design.report.fit.FitAttrModel; +import com.fr.stable.fun.mark.Mutable; + + +public interface FitAttrModelProvider extends Mutable, FitAttrModel { + String XML_TAG = "FitAttrModelProvider"; + int CURRENT_LEVEL = 1; +} diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ServerFitAttrPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ServerFitAttrPane.java new file mode 100644 index 0000000000..bbe52ae998 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/webattr/ServerFitAttrPane.java @@ -0,0 +1,78 @@ +package com.fr.design.webattr; + +import com.fr.config.Configuration; +import com.fr.design.report.fit.BaseFitAttrPane; +import com.fr.design.report.fit.FitAttrModel; +import com.fr.general.ComparatorUtils; +import com.fr.report.fit.ReportFitAttr; +import com.fr.report.fit.ReportFitConfig; +import com.fr.transaction.Configurations; +import com.fr.transaction.Worker; + +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + + +public class ServerFitAttrPane extends BaseFitAttrPane { + + public ServerFitAttrPane() { + super(); + initComponents(); + } + + @Override + protected void initComponents() { + super.initComponents(); + populateModel(fitAttrModelList.get(0)); + } + + + @Override + public void populateBean(ReportFitAttr reportFitAttr) { + reportFitAttr = fitAttrModel.getGlobalReportFitAttr(); + super.populateBean(reportFitAttr); + } + + + public ReportFitAttr updateBean() { + ReportFitAttr reportFitAttr = super.updateBean(); + Configurations.update(new Worker() { + @Override + public void run() { + fitAttrModel.setGlobalReportFitAttr(reportFitAttr); + } + + @Override + public Class[] targets() { + return new Class[]{ReportFitConfig.class}; + } + }); + return null; + + } + + @Override + protected String[] getItemNames() { + return fitAttrModelList.stream().map(FitAttrModel::getModelName).toArray(String[]::new); + } + + @Override + protected ItemListener getItemListener() { + ServerFitAttrPane self = this; + return new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + for (FitAttrModel fitAttrModel : fitAttrModelList) { + if (ComparatorUtils.equals(e.getItem(), fitAttrModel.getModelName())) { + self.populateModel(fitAttrModel); + populateBean(null); + refresh(); + } + } + } + } + }; + } +} + From 8edae1949cb668399f4d4341b8e60dafe81b61da Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 29 Sep 2021 16:20:06 +0800 Subject: [PATCH 14/18] =?UTF-8?q?REPORT-59681=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=8E=A7=E5=88=B6=E6=A8=A1=E6=9D=BF=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EditReportServerParameterPane.java | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/EditReportServerParameterPane.java b/designer-realize/src/main/java/com/fr/design/webattr/EditReportServerParameterPane.java index 18d110400c..92885a3b3c 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/EditReportServerParameterPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/EditReportServerParameterPane.java @@ -9,6 +9,7 @@ import com.fr.config.PrintConfig; import com.fr.config.ServerPreferenceConfig; import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.webattr.printsettings.GlobalNativePrintSettingPane; import com.fr.design.webattr.printsettings.PrintSettingPane; @@ -17,6 +18,7 @@ import com.fr.report.web.WebPage; import com.fr.report.web.WebView; import com.fr.report.web.WebWrite; import com.fr.web.attr.ReportWebAttr; +import com.fr.workspace.WorkContext; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -35,18 +37,20 @@ public class EditReportServerParameterPane extends LoadingBasicPane { private WriteToolBarPane writePane; private ReportWebAttr webAttr; private PrintSettingsAttrMark printSettings; - + private WebCssPane cssPane; - + private WebJsPane jsPane; - + private ErrorTemplatePane errorTemplatePane; private PrintSettingPane printSettingPane; + private ServerFitAttrPane serverFitAttrPane; + @Override - protected synchronized void initComponents(JPanel container) { + protected synchronized void initComponents(JPanel container) { JPanel defaultPane = container; defaultPane.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -61,11 +65,14 @@ public class EditReportServerParameterPane extends LoadingBasicPane { tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"), jsPane = new WebJsPane()); tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Error_Handler_Template"), errorTemplatePane = new ErrorTemplatePane()); tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_Setting"), printSettingPane = new PrintSettingPane(new GlobalNativePrintSettingPane())); + if (WorkContext.getCurrent().isRoot()) { + tabbedPane.addTab(Toolkit.i18nText("Fine-Designer_PC_Fit_Attr"), serverFitAttrPane = new ServerFitAttrPane()); + } } - + @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Report_Server_Parameter"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Report_Server_Parameter"); } public void populate(ServerPreferenceConfig reportServerPreferenceConfig) { @@ -78,28 +85,31 @@ public class EditReportServerParameterPane extends LoadingBasicPane { WebPage webPage = webAttr.getWebPage(); WebView webView = webAttr.getWebView(); WebWrite webWrite = webAttr.getWebWrite(); - if(webPage != null){ + if (webPage != null) { pagePane.populateBean(webPage); } - if(webView != null){ + if (webView != null) { viewPane.populateBean(webView); } - if(webWrite != null){ + if (webWrite != null) { writePane.populateBean(webWrite); } cssPane.populate(webAttr); jsPane.populate(webAttr); printSettings = ReportUtils.getPrintSettingsFromServerConfig(); printSettingPane.populate(printSettings); - + this.errorTemplatePane.populateBean(reportServerPreferenceConfig.getErrorTemplate()); + if (serverFitAttrPane != null) { + serverFitAttrPane.populateBean(null); + } } /** * Update. */ public void update(ServerPreferenceConfig reportServerPreferenceConfig) { - ReportWebAttr webAttr = ((ReportWebAttr)ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); + ReportWebAttr webAttr = ((ReportWebAttr) ConfigManager.getProviderInstance().getGlobalAttribute(ReportWebAttr.class)); webAttr.setWebPage(pagePane.updateBean()); webAttr.setWebView(viewPane.updateBean()); webAttr.setWebWrite(writePane.updateBean()); @@ -110,5 +120,8 @@ public class EditReportServerParameterPane extends LoadingBasicPane { PrintConfig.getInstance().setPrintSettings(printSettings); reportServerPreferenceConfig.setErrorTemplate(this.errorTemplatePane.updateBean()); + if (serverFitAttrPane != null) { + serverFitAttrPane.updateBean(); + } } } From b5296e5251015737e03cefaad67e2e195bcd5799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 29 Sep 2021 17:01:12 +0800 Subject: [PATCH 15/18] =?UTF-8?q?REPORT-60134=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?-=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/xpane/LayoutStylePane.java | 47 +++++++++++++------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java index 453bd5e0da..1d521cd6f0 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java @@ -22,6 +22,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.backgroundpane.GradientBackgroundQuickPane; +import com.fr.design.widget.FRWidgetFactory; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.WidgetTitle; import com.fr.general.Background; @@ -30,11 +31,23 @@ import com.fr.general.IOUtils; import com.fr.general.act.TitlePacker; import com.fr.stable.Constants; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JPanel; import javax.swing.border.LineBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BasicStroke; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Stroke; /** * @author Starryi @@ -145,16 +158,16 @@ public class LayoutStylePane extends BasicBeanPane { double[] rowSize = supportCornerRadius ? new double[] {p, p, p, p} : new double[]{p, p, p}; double[] columnSize = {SETTING_LABEL_WIDTH, f}; - UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style")); + UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style")); Font font = uiLabel.getFont().deriveFont(Font.BOLD); uiLabel.setFont(font); uiLabel.setForeground(new Color(143, 143, 146)); JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ {uiLabel, null}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), borderStyleCombo}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), createBorderLayoutNorthPaneWithComponent(borderStyleCombo)}, {this.borderLineAndImagePane, null}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner}, }, rowSize, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); @@ -180,7 +193,7 @@ public class LayoutStylePane extends BasicBeanPane { this.backgroundPane, this.backgroundOpacityPane); - UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Body_Content")); + UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Body_Content")); Font font = uiLabel.getFont().deriveFont(Font.BOLD); uiLabel.setFont(font); uiLabel.setForeground(new Color(143, 143, 146)); @@ -297,11 +310,11 @@ public class LayoutStylePane extends BasicBeanPane { double[] columnSize = {SETTING_LABEL_WIDTH, f}; final JPanel bottomPane = TableLayoutHelper.createCommonTableLayoutPane( new JComponent[][]{ - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), titleTextPane}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), titleFontFamilyComboBox}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), titleTextPane}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), createBorderLayoutNorthPaneWithComponent(titleFontFamilyComboBox)}, {null, createTitleFontButtonPane()}, {titleInsetImagePane, null}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Text_Align")), titleAlignPane}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Text_Align")), titleAlignPane}, {this.createTitleBackgroundAndOpacityPane(), null}, }, rowSize, columnSize, IntervalConstants.INTERVAL_L1); @@ -312,9 +325,9 @@ public class LayoutStylePane extends BasicBeanPane { titleVisibleCheckbox.setSelected(false); visibleComposedPane.add(titleVisibleCheckbox, BorderLayout.WEST); - visibleComposedPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Visible")), BorderLayout.CENTER); + visibleComposedPane.add(FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Visible")), BorderLayout.CENTER); - UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title")); + UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title")); Font font = uiLabel.getFont().deriveFont(Font.BOLD); uiLabel.setFont(font); uiLabel.setForeground(new Color(143, 143, 146)); @@ -339,6 +352,12 @@ public class LayoutStylePane extends BasicBeanPane { return container; } + private JPanel createBorderLayoutNorthPaneWithComponent(JComponent content) { + JPanel jPanel = new JPanel(new BorderLayout()); + jPanel.add(content, BorderLayout.NORTH); + return jPanel; + } + protected JPanel createTitleFontButtonPane(){ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -511,8 +530,8 @@ public class LayoutStylePane extends BasicBeanPane { // 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐 JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - backgroundLabelPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); - backgroundLabelPane.add(new UILabel(name), BorderLayout.NORTH); + backgroundLabelPane.setBorder(BorderFactory.createEmptyBorder(7, 0, 0, 0)); + backgroundLabelPane.add(FRWidgetFactory.createLineWrapLabel(name), BorderLayout.NORTH); JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane( new JComponent[][]{ @@ -522,7 +541,7 @@ public class LayoutStylePane extends BasicBeanPane { JPanel opacityComposedPane = TableLayoutHelper.createGapTableLayoutPane( new JComponent[][]{ - {new UILabel(""), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))}, + {new UILabel(""), FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))}, {new UILabel(""), opacityPane} }, new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); From 6cfbdf33a2b5dcf31f5e420b43202585ed002a4d Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 29 Sep 2021 17:10:44 +0800 Subject: [PATCH 16/18] =?UTF-8?q?REPORT-50201=20=E8=BF=9C=E7=A8=8Baf?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A8=A1=E6=9D=BF=EF=BC=8C=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=8F=B3=E4=BE=A7=E5=8A=A0=E8=BD=BD=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index e7612c0010..8006917611 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -32,19 +32,17 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.RecentSearchManager import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager; import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager; import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManager; -import com.fr.form.main.Form; -import com.fr.form.main.FormIO; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpClient; -import com.fr.io.TemplateWorkBookIO; -import com.fr.io.exporter.ImageExporter; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; -import com.fr.main.impl.WorkBook; import com.fr.stable.CodeUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; +import com.fr.workspace.WorkContext; +import com.fr.workspace.server.exporter.LocalExportOperator; +import com.fr.workspace.server.exporter.TemplateExportOperator; import javax.imageio.ImageIO; import javax.swing.BorderFactory; import javax.swing.DefaultListModel; @@ -601,14 +599,15 @@ public class AlphaFineDialog extends UIDialog { checkWorker(); this.showWorker = new SwingWorker() { @Override - protected BufferedImage doInBackground() { - Form form = null; + protected BufferedImage doInBackground() throws Exception { + byte[] bytes = null; try { - form = FormIO.readForm(fileName); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + bytes = WorkContext.getCurrent().get(TemplateExportOperator.class).exportFormAsImageData(fileName); + } catch (Exception ignored) { + // 兼容下老版本 + bytes = new LocalExportOperator().exportFormAsImageData(fileName); } - return FormIO.exportFormAsImage(form); + return TemplateExportOperator.byteDataToIamge(bytes); } @Override @@ -631,15 +630,15 @@ public class AlphaFineDialog extends UIDialog { checkWorker(); this.showWorker = new SwingWorker() { @Override - protected BufferedImage doInBackground() { - WorkBook workBook = null; + protected BufferedImage doInBackground() throws Exception { + byte[] bytes = null; try { - workBook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(fileName); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + bytes = WorkContext.getCurrent().get(TemplateExportOperator.class).exportWorkBookAsImageData(fileName); + } catch (Exception ignored) { + // 兼容下老版本 + bytes = new LocalExportOperator().exportWorkBookAsImageData(fileName); } - BufferedImage bufferedImage = new ImageExporter().exportToImage(workBook); - return bufferedImage; + return TemplateExportOperator.byteDataToIamge(bytes); } @Override From 25f5999d450e06a472edfa5db935e76ddc5f5347 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 29 Sep 2021 17:32:26 +0800 Subject: [PATCH 17/18] =?UTF-8?q?REPORT-50201=20fix=20=E6=8B=BC=E5=86=99?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/component/AlphaFineDialog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 8006917611..47c2e6c7e6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -607,7 +607,7 @@ public class AlphaFineDialog extends UIDialog { // 兼容下老版本 bytes = new LocalExportOperator().exportFormAsImageData(fileName); } - return TemplateExportOperator.byteDataToIamge(bytes); + return TemplateExportOperator.byteDataToImage(bytes); } @Override @@ -638,7 +638,7 @@ public class AlphaFineDialog extends UIDialog { // 兼容下老版本 bytes = new LocalExportOperator().exportWorkBookAsImageData(fileName); } - return TemplateExportOperator.byteDataToIamge(bytes); + return TemplateExportOperator.byteDataToImage(bytes); } @Override From 5034de4cb7cdabdbda27d9c1ac398f7652ceae71 Mon Sep 17 00:00:00 2001 From: eason Date: Fri, 8 Oct 2021 10:32:50 +0800 Subject: [PATCH 18/18] =?UTF-8?q?fix:=E5=85=BC=E5=AE=B9=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84cpt=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/report/fit/menupane/ReportFitAttrAction.java | 2 +- .../design/report/fit/menupane/TemplateFitAttrPane.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index 7f66596a93..c0e257739a 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -81,7 +81,7 @@ public class ReportFitAttrAction extends JTemplateAction { } final FitProvider wbTpl = (FitProvider) jwb.getTarget(); ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); - TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(); + TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(jwb); showReportFitDialog(fitAttr, jwb, wbTpl, templateFitAttrPane); } diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java index 393cbfc711..8854b0ee92 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java @@ -1,6 +1,5 @@ package com.fr.design.report.fit.menupane; -import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; import com.fr.design.report.fit.BaseFitAttrPane; @@ -15,7 +14,10 @@ import java.awt.event.ItemListener; public class TemplateFitAttrPane extends BaseFitAttrPane { - public TemplateFitAttrPane() { + private JTemplate jwb; + + public TemplateFitAttrPane(JTemplate jwb) { + this.jwb = jwb; initComponents(); } @@ -23,7 +25,7 @@ public class TemplateFitAttrPane extends BaseFitAttrPane { protected void initComponents() { super.initComponents(); for (FitAttrModel fitAttrModel : fitAttrModelList) { - if (fitAttrModel.isAvailable(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) { + if (fitAttrModel.isAvailable(jwb)) { populateModel(fitAttrModel); break; } @@ -71,7 +73,6 @@ public class TemplateFitAttrPane extends BaseFitAttrPane { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { if(isTemplateSingleSet()){ - JTemplate jwb = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jwb != null) { FitProvider wbTpl = (FitProvider) jwb.getTarget(); ReportFitAttr fitAttr = wbTpl.getReportFitAttr();