From 18c54e860643006865d3ea19690577b17a6bc502 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 4 Nov 2021 21:05:08 +0800 Subject: [PATCH 01/18] =?UTF-8?q?REPORT-61410=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=A2=84=E8=A7=88=E6=97=B6=E5=8F=AF=E5=A4=8D=E5=88=B6?= =?UTF-8?q?-=E8=A1=A8=E5=A4=B4=E5=A4=8D=E5=88=B6=E9=97=AE=E9=A2=98=20&&=20?= =?UTF-8?q?REPORT-61409=20=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E5=A4=8D=E5=88=B6-=E8=B5=8B=E5=80=BC?= =?UTF-8?q?=E7=A9=BA=E5=80=BC=E6=97=B6=E6=98=BE=E7=A4=BA=E6=88=90Null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/CopyableJTable.java | 51 ++++++++++++------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java index eb8d188a1..a452a4d37 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java @@ -106,6 +106,7 @@ public class CopyableJTable extends SortableJTable { self.updateEndPoint(-1, column); self.refreshTable(); } + self.requestFocusInWindow(); } private int getColumn(MouseEvent e) { @@ -249,26 +250,9 @@ public class CopyableJTable extends SortableJTable { FineLoggerFactory.getLogger().info("copy cell value"); java.util.List> table = new ArrayList<>(); if ((startRow != endRow || startCol != endCol) && Math.min(startCol, endCol) > -1) { - for (int i = Math.min(startRow, endRow); i <= Math.max(startRow, endRow); i++) { - table.add(new ArrayList<>()); - for (int j = Math.min(startCol, endCol); j <= Math.max(startCol, endCol); j++) { - Object text = this.getTableValue(i, j); - table.get(table.size() - 1).add(text); - } - } + copyAreaData(table); } else if (pointList.size() > 0) { - Collections.sort(pointList, Comparator.comparing(Point::getX).thenComparing(Point::getY)); - int startRow = pointList.get(0).x; - int currentRow = startRow; - table.add(new ArrayList<>()); - for (Point point : pointList) { - while (currentRow < point.x) { - table.add(new ArrayList<>()); - currentRow++; - } - Object text = this.getTableValue(point.x, point.y); - table.get(table.size() - 1).add(text); - } + copyPointsData(table); } Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard(); @@ -276,6 +260,35 @@ public class CopyableJTable extends SortableJTable { clip.setContents(tText, null); } + private void copyAreaData(java.util.List> table) { + for (int i = Math.min(startRow, endRow); i <= Math.max(startRow, endRow); i++) { + table.add(new ArrayList<>()); + for (int j = Math.min(startCol, endCol); j <= Math.max(startCol, endCol); j++) { + Object text = this.getTableValue(i, j); + if (text != null) { + table.get(table.size() - 1).add(text); + } + } + } + } + + private void copyPointsData(java.util.List> table) { + Collections.sort(pointList, Comparator.comparing(Point::getX).thenComparing(Point::getY)); + int startRow = pointList.get(0).x; + int currentRow = startRow; + table.add(new ArrayList<>()); + for (Point point : pointList) { + while (currentRow < point.x) { + table.add(new ArrayList<>()); + currentRow++; + } + Object text = this.getTableValue(point.x, point.y); + if (text != null) { + table.get(table.size() - 1).add(text); + } + } + } + private Object getTableValue(int row, int col) { Object value = null; if (col > -1) { From 290226dbfc0ee5934e8b95ae72c4f83d5091cf26 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 9 Nov 2021 18:39:41 +0800 Subject: [PATCH 02/18] REPORT-61736 release/11.0->final/11.0 --- .../com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java index 452deb5c8..fc4b8e368 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java @@ -163,6 +163,8 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { try { latch.await(); } catch (InterruptedException ignore) { + } finally { + setShowDialogState(false); } return selectedFiles.length > 0 ? JFileChooser.APPROVE_OPTION : JFileChooser.CANCEL_OPTION; } From 18865d49d7f4759d98fbbc2a5fcfe13ecee06b52 Mon Sep 17 00:00:00 2001 From: shine Date: Fri, 5 Nov 2021 16:57:54 +0800 Subject: [PATCH 03/18] =?UTF-8?q?CHART-21737=20fix:=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=AD=E7=9A=84=E5=9B=BE=E8=A1=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=20=E8=AE=BE=E7=BD=AE=E7=AC=AC=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/component/VanChartFillStylePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java index 42e33b89c..3f7374c34 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java @@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerBean; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.predefined.ui.detail.ColorFillStylePane; import com.fr.design.utils.gui.GUICoreUtils; @@ -63,7 +64,7 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe } public void updateBean(AttrFillStyle attrFillStyle) { - if (getStyleSelectBox().getSelectedIndex() == 0) { + if (getStyleSelectBox().getSelectedIndex() == 0 && ChartEditContext.supportTheme()) { attrFillStyle.setThemed(true); return; } From eeac554bd4713f870722c338c7327983827aca1e Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 8 Nov 2021 14:46:51 +0800 Subject: [PATCH 04/18] =?UTF-8?q?CHART-21570=20=E9=80=82=E9=85=8D11.0=20?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF=E4=B8=AD=E7=9A=84cpt?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20=E4=B8=8D=E6=94=AF=E6=8C=81=E8=B7=9F?= =?UTF-8?q?=E9=9A=8F=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/gui/AdjustWorkBookDefaultStyleUtils.java | 11 +++++++++++ .../mainframe/cell/settingpane/style/StylePane.java | 6 +++++- .../java/com/fr/design/report/ReportStylePane.java | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java index abae997e3..aa2178ece 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java @@ -43,4 +43,15 @@ public class AdjustWorkBookDefaultStyleUtils { return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color; } + /** + * cpt模板是否支持跟随主题选项 + * 单元格样式 + * 悬浮元素样式 + * 纸张背景入口大屏模板屏蔽掉了 忽略 + * @return 大屏模板中cpt组件不支持 + */ + public static boolean supportTheme() { + return !DesignModeContext.isDuchampMode(); + } + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java index bad6e6b6a..84c0c12b4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java @@ -13,6 +13,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; @@ -38,6 +39,7 @@ public class StylePane extends BasicPane implements UIObserver { public static final int DEFAULT_SELECTED_INDEX = 0; private final UIButtonGroup followingThemeButtonGroup; + private JPanel followingThemePane; private final CustomStylePane customStylePane; private final ThemedCellStyleListPane themedCellStyleListPane; private final CardLayout cardLayout; @@ -64,7 +66,7 @@ public class StylePane extends BasicPane implements UIObserver { private void initializePane() { setLayout(new BorderLayout(0, IntervalConstants.INTERVAL_L1)); - add(createFollowingThemePane(), BorderLayout.NORTH); + add(followingThemePane = createFollowingThemePane(), BorderLayout.NORTH); contentPane = createTabbedContentPane(); add(contentPane, BorderLayout.CENTER); } @@ -226,6 +228,8 @@ public class StylePane extends BasicPane implements UIObserver { setSelectedIndex(1); customStylePane.populateBean(style); } + //单元格配置界面是单例 所以直接在populate的时候把跟随主题的按钮组设置不可见 + followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme()); } private void fireStateChanged() { diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java index fc4b5a116..e16af5e3d 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java @@ -27,6 +27,7 @@ import com.fr.design.style.BorderUtils; import com.fr.design.style.FRFontPane; import com.fr.design.style.FormatPane; import com.fr.design.style.background.BackgroundPane; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.general.FRFont; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; @@ -66,6 +67,7 @@ public class ReportStylePane extends BasicPane { private final CellStylePreviewPane previewArea; private final UIButtonGroup followingThemeButtonGroup; + private JPanel followingThemePane; private final CustomFloatStyleSettingPane customStylePane; private final ThemedFloatStyleSettingPane themedFloatStyleSettingPane; private final CardLayout cardLayout; @@ -106,7 +108,7 @@ public class ReportStylePane extends BasicPane { add(createPreviewPane(), BorderLayout.NORTH); JPanel settingContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); - JPanel followingThemePane = createFollowingThemePane(); + followingThemePane = createFollowingThemePane(); followingThemePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0)); settingContainer.add(followingThemePane, BorderLayout.NORTH); settingContainer.add(contentPane, BorderLayout.CENTER); @@ -319,6 +321,8 @@ public class ReportStylePane extends BasicPane { setSelectedIndex(1); customStylePane.populateBean(style); } + + followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme()); } public void updatePreviewArea() { From 83f0dd7f00bd94646fe53fc1be80f39b923b414c Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 8 Nov 2021 15:00:24 +0800 Subject: [PATCH 05/18] =?UTF-8?q?CHART-21570=20=E5=A4=A7=E5=B1=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=20cpt=E7=BB=84=E4=BB=B6=E4=B8=AD=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E4=B9=9F=E4=B8=8D=E6=94=AF=E6=8C=81=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/mode/ChartEditContext.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java index 56345aeda..51fe2f816 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.chart.mode; import com.fr.common.annotations.Open; +import com.fr.design.base.mode.DesignModeContext; /** * @author shine @@ -27,9 +28,9 @@ public class ChartEditContext { /** * 是否支持 主题样式 设置 * - * @return duchamp大屏模板模式 不支持 + * @return duchamp大屏模板模式 不支持 图表组件&cpt组件中的图表 都不支持 */ public static boolean supportTheme() { - return !duchampMode(); + return !DesignModeContext.isDuchampMode(); } } From cf0ae930be36c5034b896b4eaefcdd2ebdb51453 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 8 Nov 2021 19:56:48 +0800 Subject: [PATCH 06/18] =?UTF-8?q?CHART-21570=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=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chart/ChartTypePane.java | 10 ++++++++-- .../type/AbstractVanChartTypePane.java | 4 ++++ .../chart/map/designer/type/GisLayerPane.java | 19 +++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) 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 d31cd3208..0337fff44 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 @@ -11,8 +11,10 @@ import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.vanchart.VanChart; import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; @@ -23,10 +25,10 @@ import javax.swing.JSplitPane; import javax.swing.ListCellRenderer; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; import java.awt.Color; import java.awt.Component; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent { private static final long serialVersionUID = -1175602484968520546L; @@ -153,6 +155,10 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven } } + if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { + ((VanChart) chart4Update).setThemeAutoCustom(); + } + update(chart4Update); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 9cf916554..04f48c732 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -24,6 +24,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.Background; import com.fr.js.NameJavaScriptGroup; import com.fr.log.FineLoggerFactory; @@ -152,6 +153,9 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane { refreshZoomLevel(); @@ -236,9 +237,19 @@ public class GisLayerPane extends JPanel implements UIObserver { } public void resetGisLayer(VanChartMapPlot mapPlot) { - GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer(); - mapPlot.setGisLayer(defaultGisLayer); - populate(defaultGisLayer); + + if (ChartEditContext.supportTheme()) { + GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer(); + mapPlot.setGisLayer(defaultGisLayer); + populate(defaultGisLayer); + } else { + GaoDeGisType gaoDeGisType = mapPlot.getDefaultGisLayerType(); + + mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API); + mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName()); + mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType); + populate(mapPlot.getGisLayer()); + } } public void populate(GisLayer layer) { From fc40344d1d6321ea3835b74840517e5348e593f3 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 8 Nov 2021 19:59:14 +0800 Subject: [PATCH 07/18] update --- .../src/main/java/com/fr/design/chart/ChartTypePane.java | 2 +- .../fr/van/chart/designer/type/AbstractVanChartTypePane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 0337fff44..968117156 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 @@ -156,7 +156,7 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven } if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { - ((VanChart) chart4Update).setThemeAutoCustom(); + ((VanChart) chart4Update).setAutoThemeCustom(); } update(chart4Update); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 04f48c732..3456dd0be 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -154,7 +154,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane Date: Tue, 9 Nov 2021 14:23:13 +0800 Subject: [PATCH 08/18] =?UTF-8?q?CHART-21805=20fix:cpt=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=9B=BE=E8=A1=A8=20=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E4=B8=AD=E6=9C=89=E7=9A=84=E5=B1=9E=E6=80=A7=20=E4=B8=8D?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E5=B1=9E=E6=80=A7=20=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=88=90=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/chart/ChartTypePane.java | 3 +++ 1 file changed, 3 insertions(+) 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 968117156..748a64069 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 @@ -156,6 +156,9 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven } if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { + //主题中有的属性 不跟随属性 全部设置成自定义 + ((VanChart) chart4Update).setThemeCustom(); + //主题中没有的 根据主题深浅色自动 的属性 全部设置成自定义 ((VanChart) chart4Update).setAutoThemeCustom(); } From 1cecadcf284bab1d7a2b22a7432058f143f4e572 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 9 Nov 2021 20:45:26 +0800 Subject: [PATCH 09/18] =?UTF-8?q?CHART-21570=20fix:fvs.cpt.chart=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/chart/ChartTypePane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 748a64069..ffa1d5002 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 @@ -156,10 +156,10 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven } if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) { - //主题中有的属性 不跟随属性 全部设置成自定义 + //主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义 ((VanChart) chart4Update).setThemeCustom(); - //主题中没有的 根据主题深浅色自动 的属性 全部设置成自定义 - ((VanChart) chart4Update).setAutoThemeCustom(); +// //主题中没有的 根据主题深浅色自动 的属性 默认自动 +// ((VanChart) chart4Update).setAutoThemeCustom(); } update(chart4Update); From 9e8e2ea32b53d36ec63b874f6bdc8e7c7e21f103 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 9 Nov 2021 21:01:17 +0800 Subject: [PATCH 10/18] =?UTF-8?q?CHART-21570=20fix:fvs.cpt.chart=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../type/AbstractVanChartTypePane.java | 6 +++--- .../chart/map/designer/type/GisLayerPane.java | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 3456dd0be..72c3c8e03 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -153,9 +153,9 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane Date: Tue, 9 Nov 2021 21:02:26 +0800 Subject: [PATCH 11/18] =?UTF-8?q?CHART-21570=20fix:fvs.cpt.chart=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/van/chart/map/designer/type/GisLayerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java index 43a770bea..5d0a6c21f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java @@ -85,7 +85,7 @@ public class GisLayerPane extends JPanel implements UIObserver { private JPanel createGISLayerPane() { gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"), Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); - gisButton.setSelectedIndex(ChartEditContext.supportTheme() ? 0 : 1); + gisButton.setSelectedIndex(0); gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems()); gisButton.addActionListener(event -> { refreshZoomLevel(); From c9acbb95a809c218384ad81696a0db864a5b7c1c Mon Sep 17 00:00:00 2001 From: xiqiu Date: Wed, 10 Nov 2021 10:42:51 +0800 Subject: [PATCH 12/18] =?UTF-8?q?REPORT-53615=20=20=20=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A9=B1=E5=8A=A8=E7=AE=A1=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/JDBCDefPane.java | 266 ++++++++++++++---- 1 file changed, 215 insertions(+), 51 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 0da46965b..25ecfcb34 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -1,10 +1,13 @@ package com.fr.design.data.datapane.connect; import com.fr.base.GraphHelper; +import com.fr.data.driver.DriverLoader; +import com.fr.data.driver.config.DriverLoaderConfig; import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icombobox.UIComboBoxUI; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; @@ -21,6 +24,8 @@ import com.fr.general.ComparatorUtils; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; +import com.fr.third.guava.collect.HashBiMap; +import com.fr.workspace.WorkContext; import javax.swing.BorderFactory; import javax.swing.JFileChooser; @@ -28,6 +33,8 @@ import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import javax.swing.plaf.ComboBoxUI; +import javax.swing.plaf.basic.ComboPopup; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -45,6 +52,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -101,8 +109,60 @@ public class JDBCDefPane extends JPanel { private JDBCDatabaseConnection jdbcDatabase; private boolean needRefresh = true; + private UIComboBox driverManageBox; + private ActionLabel driverManageLabel; + private UIComboBox driverLoaderBox; + ActionListener driverManageListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + boolean selectSelfDefine = isSelfDefine(); + driverManageLabel.setVisible(selectSelfDefine); + driverLoaderBox.setVisible(selectSelfDefine); + driverComboBox.setVisible(!selectSelfDefine); + // 选中自定义的话,将odbc的屏蔽,选中默认的话,重新触发一次driverComboBox的事件 + if (selectSelfDefine) { + odbcTipsLink.setVisible(false); + } else { + driverComboBox.setSelectedItem(driverComboBox.getSelectedItem()); + } + } + }; + ActionListener dbtypeActionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + + urlTextField.setText(StringUtils.EMPTY); + driverComboBox.removeAllItems(); + driverManageBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Default")); + if (driverLoaderBox.getItemCount() > 0) { + driverLoaderBox.setSelectedIndex(0); + } + if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), StringUtils.EMPTY)) { + driverComboBox.setSelectedItem(StringUtils.EMPTY); + return; + } + + DriverURLName[] dus = jdbcMap.get(dbtypeComboBox.getSelectedItem()); + for (int i = 0, len = dus.length; i < len; i++) { + driverComboBox.addItem(dus[i].getDriver()); + if (i == 0) { + driverComboBox.setSelectedItem(dus[i].getDriver()); + urlTextField.setText(dus[i].getURL()); + } + } + // 更改数据库类型后 数据库名称置空和之前逻辑保持一致 + if (needRefresh) { + jdbcDatabase.setDatabase(StringUtils.EMPTY); + } + changePane(dbtypeComboBox.getSelectedItem()); + JDBCConnectionDef.getInstance().setConnection((String) dbtypeComboBox.getSelectedItem(), jdbcDatabase); + DatabaseConnectionPane.JDBC.getAdvancedAttrPane().populate(jdbcDatabase); + } + }; + private HashBiMap nameAndRepresent; public JDBCDefPane() { + initMap(); this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); JPanel innerthis = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); @@ -115,7 +175,15 @@ public class JDBCDefPane extends JPanel { } dbtypeComboBox.addActionListener(dbtypeActionListener); dbtypeComboBox.setMaximumRowCount(10); - + driverLoaderBox = new SpecialUIComboBox(); + refreshDriverLoader(); + driverLoaderBox.setPreferredSize(new Dimension(200, driverLoaderBox.getPreferredSize().height)); + driverLoaderBox.setEditable(false); + driverManageBox = new UIComboBox(); + refreshDriverManage(true); + driverManageBox.setEditable(false); + driverManageBox.addActionListener(driverManageListener); + driverLoaderBox.setVisible(isSelfDefine()); driverComboBox = new UIComboBox(); driverComboBox.setEditable(true); driverComboBox.addActionListener(driverListener); @@ -163,9 +231,33 @@ public class JDBCDefPane extends JPanel { BrowseUtils.browser(url); } }); + driverManageLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Driver_Manage_Add_Driver")) { + @Override + public void paintComponent(Graphics _gfx) { + super.paintComponent(_gfx); + _gfx.setColor(Color.blue); + _gfx.drawLine(0, this.getHeight() - 1, GraphHelper.getWidth(this.getText()), this.getHeight() - 1); + } + }; + driverManageLabel.setPreferredSize(new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Driver_Manage_Add_Driver")), driverManageLabel.getPreferredSize().height)); + driverManageLabel.setVisible(isSelfDefine()); + driverManageLabel.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + String url = CloudCenter.getInstance().acquireUrlByKind("driver.add.help"); + BrowseUtils.browser(url); + } + }); + + odbcTipsPane.add(driverManageLabel); + odbcTipsPane.add(odbcTipsLink); JPanel driverComboBoxAndTips = new JPanel(new BorderLayout()); - driverComboBoxAndTips.add(driverComboBox, BorderLayout.WEST); + JPanel normalFlowInnerContainer_s_pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(0, 5, 0); + normalFlowInnerContainer_s_pane.add(driverManageBox); + normalFlowInnerContainer_s_pane.add(driverComboBox); + normalFlowInnerContainer_s_pane.add(driverLoaderBox); + driverComboBoxAndTips.add(normalFlowInnerContainer_s_pane, BorderLayout.WEST); driverComboBoxAndTips.add(odbcTipsPane, BorderLayout.CENTER); JPanel hostPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); @@ -225,7 +317,71 @@ public class JDBCDefPane extends JPanel { innerthis.add(centerPanel); } + private void refreshDriverLoader() { + Set representSet = nameAndRepresent.values(); + driverLoaderBox.clearBoxItems(); + for (String represent : representSet) { + driverLoaderBox.addItem(represent); + } + } + + private String getRepresent(String driverClass, String driverName) { + return driverClass + "(" + driverName + ")"; + } + + private boolean isSelfDefine() { + return ComparatorUtils.equals(Toolkit.i18nText("Fine-Design_Driver_Manage_Self_Define"), driverManageBox.getSelectedItem()); + } + + private void refreshDriverManage(boolean addSelfDefine) { + driverManageBox.clearBoxItems(); + driverManageBox.addItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Default")); + if (addSelfDefine) { + driverManageBox.addItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Self_Define")); + } + } + + private void initMap() { + Map driverLoaders = DriverLoaderConfig.getInstance().getDriverLoaders(); + nameAndRepresent = getDriverLoaderAndRepresent(driverLoaders); + } + + private HashBiMap getDriverLoaderAndRepresent(Map driverLoaders) { + HashBiMap driverHashBiMap = HashBiMap.create(); + if (WorkContext.getCurrent().isWarDeploy()) { + return driverHashBiMap; + } + // name 是唯一的,name+driver自然也是唯一的 + for (DriverLoader driverLoader : driverLoaders.values()) { + driverHashBiMap.put(driverLoader.getName(), getRepresent(driverLoader.getDriverClass(), driverLoader.getName())); + } + return driverHashBiMap; + } + + + protected JDBCDatabaseConnection getJDBCDatabase() { + return this.jdbcDatabase; + } + + private void changePane(Object dbType) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f, 22}; + if (ComparatorUtils.equals(dbType, OTHER_DB) || ComparatorUtils.equals(dbType, "Access") || ComparatorUtils.equals(dbType, "SQLite")) { + if (this.centerPanel.getComponentCount() != partComponents.length * 2) { + centerPanel.removeAll(); + TableLayoutHelper.addComponent2ResultPane(partComponents, new double[]{p, p, p, p, p}, columnSize, centerPanel); + } + } else if (this.centerPanel.getComponentCount() != allComponents.length * 2) { + centerPanel.removeAll(); + TableLayoutHelper.addComponent2ResultPane(allComponents, new double[]{p, p, p, p, p, p, p, p}, columnSize, centerPanel); + } + } + public void populate(JDBCDatabaseConnection jdbcDatabase) { + // 单例对象,重新打开的时候并不会新建,但是由于driverloaderbox里面需要是动态内容,因此需要进行刷新动作 + initMap(); + refreshDriverLoader(); needRefresh = false; if (jdbcDatabase == null) { jdbcDatabase = new JDBCDatabaseConnection(); @@ -255,7 +411,24 @@ public class JDBCDefPane extends JPanel { this.dbtypeComboBox.setSelectedItem(OTHER_DB); } } - this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); + // jdbcDatabase.getDriverSource() 只会是空或者是有值,但是为了保险起见,还是应该做个处理 + String driverSource = jdbcDatabase.getDriverSource(); + if (driverSource == null) { + driverSource = StringUtils.EMPTY; + } + if (driverSource.isEmpty()) { + refreshDriverManage(!nameAndRepresent.isEmpty()); + this.driverManageBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Default")); + this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); + } else { + refreshDriverManage(true); + this.driverManageBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Self_Define")); + String represent = getRepresent(jdbcDatabase.getDriver(), jdbcDatabase.getDriverSource()); + if (!nameAndRepresent.containsValue(represent)) { + this.driverLoaderBox.addItem(represent); + } + this.driverLoaderBox.setSelectedItem(represent); + } this.urlTextField.setText(jdbcDatabase.getURL()); this.userNameTextField.setText(jdbcDatabase.getUser()); this.passwordTextField.setText(jdbcDatabase.getPassword()); @@ -268,31 +441,10 @@ public class JDBCDefPane extends JPanel { needRefresh = false; } - protected JDBCDatabaseConnection getJDBCDatabase() { - return this.jdbcDatabase; - } - - private void changePane(Object dbType) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f, 22}; - if (ComparatorUtils.equals(dbType, OTHER_DB) || ComparatorUtils.equals(dbType, "Access") || ComparatorUtils.equals(dbType, "SQLite")) { - if (this.centerPanel.getComponentCount() != partComponents.length * 2) { - centerPanel.removeAll(); - TableLayoutHelper.addComponent2ResultPane(partComponents, new double[]{p, p, p, p, p}, columnSize, centerPanel); - } - } else if (this.centerPanel.getComponentCount() != allComponents.length * 2) { - centerPanel.removeAll(); - TableLayoutHelper.addComponent2ResultPane(allComponents, new double[]{p, p, p, p, p, p, p, p}, columnSize, centerPanel); - } - } - public JDBCDatabaseConnection update() { if (jdbcDatabase == null) { jdbcDatabase = new JDBCDatabaseConnection(); } - Object driveItem = this.driverComboBox.getSelectedItem(); - jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString().trim()); jdbcDatabase.setURL(this.urlTextField.getText().trim()); jdbcDatabase.setUser(this.userNameTextField.getText().trim()); jdbcDatabase.setPassword(new String(this.passwordTextField.getPassword()).trim()); @@ -304,36 +456,30 @@ public class JDBCDefPane extends JPanel { jdbcDatabase.setNewCharsetName(EncodeConstants.ENCODING_GBK); jdbcDatabase.setOriginalCharsetName(((String) this.charSetComboBox.getSelectedItem())); } - return jdbcDatabase; - } - - ActionListener dbtypeActionListener = new ActionListener() { - public void actionPerformed(ActionEvent evt) { - - urlTextField.setText(StringUtils.EMPTY); - driverComboBox.removeAllItems(); - if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), StringUtils.EMPTY)) { - driverComboBox.setSelectedItem(StringUtils.EMPTY); - return; - } - - DriverURLName[] dus = jdbcMap.get(dbtypeComboBox.getSelectedItem()); - for (int i = 0, len = dus.length; i < len; i++) { - driverComboBox.addItem(dus[i].getDriver()); - if (i == 0) { - driverComboBox.setSelectedItem(dus[i].getDriver()); - urlTextField.setText(dus[i].getURL()); + String driverLoader = (String) this.driverLoaderBox.getSelectedItem(); + if (driverLoader == null) { + driverLoader = StringUtils.EMPTY; + } + if (isSelfDefine()) { + String[] split = driverLoader.split("\\("); + if (split.length > 1) { + String name = split[1]; + if (name.length() > 0) { + jdbcDatabase.setDriverSource(name.substring(0, name.length() - 1)); + } else { + jdbcDatabase.setDriverSource(StringUtils.EMPTY); } + } else { + jdbcDatabase.setDriverSource(StringUtils.EMPTY); } - // 更改数据库类型后 数据库名称置空和之前逻辑保持一致 - if (needRefresh) { - jdbcDatabase.setDatabase(StringUtils.EMPTY); - } - changePane(dbtypeComboBox.getSelectedItem()); - JDBCConnectionDef.getInstance().setConnection((String) dbtypeComboBox.getSelectedItem(), jdbcDatabase); - DatabaseConnectionPane.JDBC.getAdvancedAttrPane().populate(jdbcDatabase); + jdbcDatabase.setDriver(split[0]); + } else { + Object driveItem = this.driverComboBox.getSelectedItem(); + jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString().trim()); + jdbcDatabase.setDriverSource(StringUtils.EMPTY); } - }; + return jdbcDatabase; + } ActionListener driverListener = new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -579,4 +725,22 @@ public class JDBCDefPane extends JPanel { private String driver; private String url; } + + private static class SpecialUIComboBox extends UIComboBox { + + @Override + public ComboBoxUI getUIComboBoxUI() { + return new SpecialUIComboBoxUI(); + } + } + + private static class SpecialUIComboBoxUI extends UIComboBoxUI { + + @Override + public ComboPopup createPopup() { + return createHorizontalNeverUIComboPopUp(); + } + + } + } From e832cc91c0793dd7c35b31b3e8108a6b32d02b3b Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 10 Nov 2021 12:32:31 +0800 Subject: [PATCH 13/18] =?UTF-8?q?REPORT-61422=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91cpt=E4=B8=BB=E9=A2=98=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E7=9A=84=E9=A2=84=E8=A7=88=E5=9B=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BE=85=E5=8A=A9=E6=96=87=E6=9C=AC=E7=9A=84=E5=9B=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/preview/ReportThemePreviewPane.java | 2 +- .../ecpreview/AbstractECPreviewPane.java | 4 ++++ .../preview/ecpreview/ECPreviewPane.java | 24 ++++++++++++++----- .../ecpreview/ECReportPreviewPane.java | 13 ++++++++++ 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java index 4ceec636d..2033e7072 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java @@ -41,7 +41,7 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane headerCellList = new ArrayList<>(); private final List contentCellList = new ArrayList<>(); private final List highLightCellList = new ArrayList<>(); + private final List assistCellList = new ArrayList<>(); private static final int COL_COUNT = 5; private static final int CONTENT_ROW_COUNT = 2; public ECPreviewPane() { - this.setPreferredSize(new Dimension(517, 147)); + this.setPreferredSize(new Dimension(517, 158)); this.setBorder(BorderFactory.createEmptyBorder(0, 1, 2, 1)); this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel titlePane = new UINoOpaquePanel(new GridLayout()); - this.add(titlePane, BorderLayout.NORTH); + JPanel extCenterPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); + this.add(extCenterPane, BorderLayout.CENTER); + extCenterPane.add(titlePane, BorderLayout.NORTH); for (int i = 0; i < COL_COUNT; i++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); cell.setPreferredSize(new Dimension(103, 36)); @@ -40,22 +43,29 @@ public class ECPreviewPane extends AbstractECPreviewPane { headerCellList.add(cell); } JPanel contentPane = new UINoOpaquePanel(new GridLayout(2, 5, 0, 0)); - this.add(contentPane, BorderLayout.CENTER); + extCenterPane.add(contentPane, BorderLayout.CENTER); for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); - cell.setPreferredSize(new Dimension(103, 33)); + cell.setPreferredSize(new Dimension(103, 30)); contentPane.add(cell); contentCellList.add(cell); } JPanel endPane = new UINoOpaquePanel(new GridLayout()); - this.add(endPane, BorderLayout.SOUTH); + extCenterPane.add(endPane, BorderLayout.SOUTH); for (int i = 0; i < COL_COUNT; i++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); - cell.setPreferredSize(new Dimension(103, 33)); + cell.setPreferredSize(new Dimension(103, 30)); endPane.add(cell); highLightCellList.add(cell); } + + JPanel extSouthPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); + PreviewCell assistCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Assist_Text")); + assistCell.setPreferredSize(new Dimension(123, 30)); + assistCellList.add(assistCell); + extSouthPane.add(assistCell); + this.add(extSouthPane, BorderLayout.SOUTH); } @Override @@ -64,6 +74,8 @@ public class ECPreviewPane extends AbstractECPreviewPane { refresh(headerCellList, getReportHeaderStyle(cellStyleConfig)); refresh(contentCellList, getMainContentStyle(cellStyleConfig)); refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); + refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); + refresh(assistCellList, getAssistMsgStyle(cellStyleConfig)); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java index 885f480b7..432c8b49c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java @@ -27,6 +27,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview private final List titleCellList = new ArrayList<>(); private final List contentCellList = new ArrayList<>(); private final List highLightCellList = new ArrayList<>(); + private final List assistCellList = new ArrayList<>(); private static final int CONTENT_ROW_COUNT = 3; private static final int COL_COUNT = 5; @@ -54,8 +55,10 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel northPane = createNorthPane(); JPanel centerPane = createCenterPane(); + JPanel southPane = createSouthPane(); this.add(northPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); + this.add(southPane, BorderLayout.SOUTH); } private JPanel createNorthPane() { @@ -126,6 +129,15 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview return centerPane; } + private JPanel createSouthPane(){ + JPanel southPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); + PreviewCell assistCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Assist_Text")); + assistCell.setPreferredSize(new Dimension(123, 30)); + assistCellList.add(assistCell); + southPane.add(assistCell, BorderLayout.CENTER); + return southPane; + } + @Override public void refresh(TemplateTheme theme) { ThemedCellStyleList cellStyleConfig = theme.getCellStyleList(); @@ -134,6 +146,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview refresh(contentCellList, getMainContentStyle(cellStyleConfig)); refresh(titleCellList, getSmallTitleStyle(cellStyleConfig)); refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); + refresh(assistCellList, getAssistMsgStyle(cellStyleConfig)); } } } From ad9a3fa276c4a02a7c0dc2aa8c0b76a2a9931c0c Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 10 Nov 2021 14:53:42 +0800 Subject: [PATCH 14/18] =?UTF-8?q?REPORT-62142=20=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=9C=A8json=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=A6=81=E7=94=A8=E5=90=AF=E7=94=A8=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE=E9=9B=86=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 47 +++++++++---------- .../main/java/com/fr/file/StashedFILE.java | 18 ++++++- 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 52fb1bcfa..667592552 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -12,7 +12,6 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JVirtualTemplate; -import com.fr.design.module.DesignModuleFactory; import com.fr.design.ui.util.UIUtil; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; @@ -361,22 +360,30 @@ public class HistoryTemplateListCache implements CallbackEvent { int size = historyList.size(); for (int i = 0; i < size; i++) { JTemplate template = historyList.get(i); - FILE file = template.getEditingFILE(); - try { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - BaseBook target = template.getTarget(); - if (target != null) { - target.export(outputStream); - stashFILEMap.put(i, new StashedFILE(file, outputStream.toByteArray())); - } - // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + FILE file = templateToStashFile(template); + if (file != null) { + stashFILEMap.put(i, file); } } FineLoggerFactory.getLogger().info("Env Change Template Stashed."); } + private FILE templateToStashFile(JTemplate template) { + FILE file = template.getEditingFILE(); + try { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + BaseBook target = template.getTarget(); + if (target != null) { + target.export(outputStream); + return new StashedFILE(file, outputStream.toByteArray(), template.suffix()); + } + // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return null; + } + private boolean checkStash() { try { return stashWorker.get(); @@ -458,18 +465,10 @@ public class HistoryTemplateListCache implements CallbackEvent { FILE file = template.getEditingFILE(); boolean needReload = context == null || needReloadTemplate(context, template); if (needReload) { - try { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - BaseBook target = template.getTarget(); - if (target != null) { - FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); - target.export(outputStream); - FILE stashedFile = new StashedFILE(file, outputStream.toByteArray()); - template.refreshResource(stashedFile); - } - // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + FILE stashFile = templateToStashFile(template); + if (stashFile != null) { + FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); + template.refreshResource(stashFile); } } } diff --git a/designer-base/src/main/java/com/fr/file/StashedFILE.java b/designer-base/src/main/java/com/fr/file/StashedFILE.java index 454433874..860515fba 100644 --- a/designer-base/src/main/java/com/fr/file/StashedFILE.java +++ b/designer-base/src/main/java/com/fr/file/StashedFILE.java @@ -1,5 +1,9 @@ package com.fr.file; +import com.fr.base.io.XMLEncryptUtils; +import com.fr.io.EncryptUtils; +import com.fr.io.FineEncryptUtils; +import com.fr.stable.StringUtils; import javax.swing.Icon; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -11,10 +15,16 @@ public class StashedFILE extends AbstractFILE { private FILE file; private byte[] content; + private String suffix; public StashedFILE(FILE file, byte[] content) { + this(file, content, null); + } + + public StashedFILE(FILE file, byte[] content, String suffix) { this.file = file; this.content = content; + this.suffix = suffix; } @Override @@ -54,7 +64,13 @@ public class StashedFILE extends AbstractFILE { @Override public InputStream asInputStream() throws Exception { - return new ByteArrayInputStream(content); + ByteArrayInputStream in = new ByteArrayInputStream(content); + return needDecode() ? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(FineEncryptUtils.decode(in))) : in; + } + + private boolean needDecode() { + // 仅有cpt支持模板加密 + return StringUtils.isNotEmpty(suffix) && suffix.endsWith(".cpt"); } @Override From 545ab8b4b50ae42d10558b02bf6c2230e493aded Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 10 Nov 2021 15:03:02 +0800 Subject: [PATCH 15/18] =?UTF-8?q?REPORT-62142=20fix=20=E8=A7=A3=E5=AF=86?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=20=E5=85=B3=E6=B3=A8=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E4=B8=A4=E7=A7=8D=E6=A8=A1=E6=9D=BF=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8D=B3=E5=8F=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/file/StashedFILE.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/file/StashedFILE.java b/designer-base/src/main/java/com/fr/file/StashedFILE.java index 860515fba..48f00f95b 100644 --- a/designer-base/src/main/java/com/fr/file/StashedFILE.java +++ b/designer-base/src/main/java/com/fr/file/StashedFILE.java @@ -69,8 +69,7 @@ public class StashedFILE extends AbstractFILE { } private boolean needDecode() { - // 仅有cpt支持模板加密 - return StringUtils.isNotEmpty(suffix) && suffix.endsWith(".cpt"); + return StringUtils.isNotEmpty(suffix) && (suffix.endsWith(".cpt") || suffix.endsWith(".frm")); } @Override From 90817ad82450de63f5a54fa96fa581b40c213b4a Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 10 Nov 2021 15:47:20 +0800 Subject: [PATCH 16/18] =?UTF-8?q?REPORT-62437=20=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=A4=A7=E6=95=B0=E6=8D=AE=E9=9B=86=E5=AF=BC=E5=87=BAexcel?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=90=8E=EF=BC=8C=E8=BF=9C=E7=A8=8B=E5=92=8C?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E4=BA=92=E7=9B=B8=E5=88=87=E6=8D=A2=E6=97=B6?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 1ccc07303..d8bc7fb48 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 @@ -406,8 +406,11 @@ public abstract class JTemplate> } private void setTargetByFile(FILE file) { - this.template = JTemplateFactory.asIOFile(file, this.suffix()); - setTarget(this.template); + T newTemplate = JTemplateFactory.asIOFile(file, this.suffix()); + if (newTemplate != null) { + this.template = newTemplate; + setTarget(this.template); + } } private void addCenterPane() { From 4c56250c782ef501858df40b780b18f6dc48302a Mon Sep 17 00:00:00 2001 From: eason Date: Tue, 9 Nov 2021 10:09:29 +0800 Subject: [PATCH 17/18] =?UTF-8?q?CHART-21786:=E4=B8=8D=E9=99=90=E5=88=B6?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=A0=87=E8=AE=B0=E7=82=B9=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/component/marker/VanChartImageMarkerPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java index d28354bdb..3d6c85f4e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java @@ -31,8 +31,8 @@ public class VanChartImageMarkerPane extends BasicBeanPane { public VanChartImageMarkerPane() { imageBackgroundPane = new ImageBackgroundQuickPane(false); imageBackgroundPane.setPreferredSize(getImageBackgroundPreferredSize(imageBackgroundPane.getPreferredSize())); - width = new UISpinnerWithPx(0, 100, 0.5, 30); - height = new UISpinnerWithPx(0, 100, 0.5, 30); + width = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30); + height = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; From 740c525977aeeaa44ac320ffa911ed07c283f5bc Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 10 Nov 2021 16:31:19 +0800 Subject: [PATCH 18/18] =?UTF-8?q?CHART-21829=20fix:fvs.cpt.chart=20?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=88=87=E6=8D=A2=20=E4=B9=9F=E8=A6=81?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=9B=BE=E8=A1=A8=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/ChartTypeButtonPane.java | 7 +++++++ .../chart/designer/type/AbstractVanChartTypePane.java | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 7260fe581..cadf577eb 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -18,6 +18,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.vanchart.VanChart; @@ -154,6 +155,12 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen addButton.addActionListener((e) -> { String name = getNewChartName(); ChartProvider chart = getChangeStateNewChart(); + if (!ChartEditContext.supportTheme() && chart instanceof VanChart) { + //主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义 + ((VanChart) chart).setThemeCustom(); +// //主题中没有的 根据主题深浅色自动 的属性 默认自动 +// ((VanChart) chart4Update).setAutoThemeCustom(); + } checkInForm(chart); addNewChart(chart, name, editingCollection.getChartCount()); }); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 72c3c8e03..2d7d738fe 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -152,10 +152,13 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane