From 932e839430c56b3b204cf1405d20114cd72d93b8 Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 1 Sep 2021 13:54:32 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-58595=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E4=B8=BB=E9=A2=98=E8=89=B2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E6=A8=A1=E6=9D=BF=E9=A2=84=E8=A7=88=E7=9A=84?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E6=B2=A1=E6=9C=89=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 使用主题单元格样式时也需要重置CSS 2. 当主题色修改时主题编辑界面的数据只遍历一次,以提高联动效率 3. 修复主题单元格样式预览列表中边框不明显的问题 【改动思路】 同上 --- .../mainframe/theme/FormThemeProfilePane.java | 17 ----------------- .../mainframe/theme/ReportThemeProfilePane.java | 11 ----------- .../theme/TemplateThemeProfilePane.java | 16 ++++++++++------ .../theme/edit/CellStyleListEditPane.java | 7 +++++++ .../style/ThemedCellStyleListPane.java | 2 -- 5 files changed, 17 insertions(+), 36 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java index 83179edda..ef99423be 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.theme; -import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemedComponentStyle; @@ -13,8 +12,6 @@ import com.fr.design.mainframe.theme.edit.FormBodyStyleEditPane; import com.fr.design.mainframe.theme.preview.FormThemePreviewPane; import javax.swing.JPanel; -import java.util.List; -import java.awt.Color; import static com.fr.design.i18n.Toolkit.i18nText; @@ -61,20 +58,6 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { return container; } - @Override - public void onColorSchemeChanged(List colors) { - super.onColorSchemeChanged(colors); - FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); - - ThemedFormBodyStyle formBodyStyle = formBodyStyleSettingPane.updateBean(); - FineColorManager.traverse(formBodyStyle, replaceByColorScheme); - formBodyStyleSettingPane.populateBean(formBodyStyle); - - ThemedComponentStyle componentStyle = componentStyleSettingPane.updateBean(); - FineColorManager.traverse(componentStyle, replaceByColorScheme); - componentStyleSettingPane.populateBean(componentStyle); - } - @Override public void populateBean(FormTheme theme) { super.populateBean(theme); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java index 091262b58..59f3ace8c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java @@ -39,17 +39,6 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane colors) { - super.onColorSchemeChanged(colors); - - FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); - - ThemedReportBodyStyle bodyStyle = reportBodyStyleSettingPane.updateBean(); - FineColorManager.traverse(bodyStyle, replaceByColorScheme); - reportBodyStyleSettingPane.populateBean(bodyStyle); - } - @Override public void populateBean(ReportTheme theme) { super.populateBean(theme); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index 0abd6a7bc..807ade691 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -90,6 +90,8 @@ public abstract class TemplateThemeProfilePane extends private UIButton saveButton = new UIButton(); private UIButton saveAsButton = new UIButton(); + private boolean refreshingThemedColor = false; + private boolean currentIsNewTheme; private T theme; @@ -265,8 +267,13 @@ public abstract class TemplateThemeProfilePane extends colorListPane.addColorChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { + if (refreshingThemedColor) { + return; + } List colors = colorListPane.update(); + refreshingThemedColor = true; onColorSchemeChanged(colors); + refreshingThemedColor = false; } }); @@ -310,13 +317,10 @@ public abstract class TemplateThemeProfilePane extends public void onColorSchemeChanged(List colors) { colorListExtendedPane.populate(colors); FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); - ThemedCellStyleList cellStyle = cellStyleSettingPane.updateBean(); - FineColorManager.traverse(cellStyle, replaceByColorScheme); + T theme = updateBean(); - ThemedChartStyle themedChartStyle = chartStyleSettingPane.updateBean(); - FineColorManager.traverse(themedChartStyle, replaceByColorScheme); - chartStyleSettingPane.populateBean(themedChartStyle); - chartStyleSettingPane.populateGradientBar(colors); + FineColorManager.traverse(theme, replaceByColorScheme); + populateBean(theme); } public void populateBean(T theme) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java index e0e42b8b4..df3e2b07a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java @@ -173,6 +173,8 @@ public class CellStyleListEditPane extends JListControlPane { return; } + int oldSelectedIndex = getSelectedIndex(); + List nameObjectList = new ArrayList<>(); List cellStyleList = ob.getCellStyleList(); @@ -185,6 +187,11 @@ public class CellStyleListEditPane extends JListControlPane { populate(nameObjectArray); + int newSelectedIndex = oldSelectedIndex; + if (newSelectedIndex >= nameObjectArray.length) { + newSelectedIndex = 0; + } + setSelectedIndex(newSelectedIndex); } public ThemedCellStyleList updateBean() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java index 65da02e98..570d0d88d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java @@ -181,8 +181,6 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane imp Graphics2D g2d = (Graphics2D) g; int resolution = ScreenResolution.getScreenResolution(); - g.clipRect(0, 0, getWidth() - 3, getHeight() - 3); - if (style == Style.DEFAULT_STYLE) { // 如果是默认的style,就只写"Report"上去 Style.paintContent(g2d, paintText, style, getWidth() - 3, getHeight() - 3, resolution);