From 787c8e70b1ffaebf4fb59866c5e035d73a55132b Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 8 Sep 2021 16:52:44 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-59077=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E9=85=8D=E8=89=B2=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=B9=E4=BF=9D=E5=AD=98=E6=8C=89=E9=92=AE=E6=9C=89=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=EF=BC=8C=E5=8F=AF=E8=83=BD=E5=AF=BC=E8=87=B4=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E4=B8=BB=E9=A2=98=E8=A2=AB=E5=88=A0=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 主题配色编辑时需要刷新主题编辑面板以响应配色 变化,刷新是通过populateBean完成的,但同时 该方法会导致保存按钮和名称编辑框的状态被重置。 配色编辑希望更新的实际上只包括扩展色面板以及 下方的自定义编辑面板,如背景/单元格/组件样式 等 【改动思路】 同标题 --- .../mainframe/theme/FormThemeProfilePane.java | 11 ++-------- .../theme/ReportThemeProfilePane.java | 10 ++------- .../theme/TemplateThemeProfilePane.java | 21 +++++++++++-------- 3 files changed, 16 insertions(+), 26 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 ef99423bed..f34f8a27f0 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 @@ -59,17 +59,10 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { } @Override - public void populateBean(FormTheme theme) { - super.populateBean(theme); - - isPopulating = true; - + public void populateBean4CustomEditors(FormTheme theme) { + super.populateBean4CustomEditors(theme); formBodyStyleSettingPane.populateBean(theme.getBodyStyle()); componentStyleSettingPane.populateBean(theme.getComponentStyle()); - - themePreviewPane.refresh(theme); - - isPopulating = false; } @Override 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 5a1bff3c0f..1158a8eb5d 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 @@ -35,15 +35,9 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane extends T theme = updateBean(); FineColorManager.traverse(theme, replaceByColorScheme); - populateBean(theme); - + populateBean4CustomEditors(theme); //图表渐变色 chartStyleSettingPane.populateGradientBar(colors); + + themePreviewPane.refresh(theme); } public void populateBean(T theme) { - try { - this.theme = (T) theme.clone(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + this.theme = theme; isPopulating = true; String name = theme.getName(); @@ -345,14 +342,20 @@ public abstract class TemplateThemeProfilePane extends saveAsButton.setEnabled(!currentIsNewTheme); } - cellStyleSettingPane.populateBean(theme.getCellStyleList()); colorListPane.populate(theme.getColorScheme().getColors()); colorListExtendedPane.populate(colorListPane.update()); - chartStyleSettingPane.populateBean(theme.getChartStyle()); + + populateBean4CustomEditors(theme); + themePreviewPane.refresh(theme); isPopulating = false; } + protected void populateBean4CustomEditors(T theme) { + cellStyleSettingPane.populateBean(theme.getCellStyleList()); + chartStyleSettingPane.populateBean(theme.getChartStyle()); + } + public T updateBean() { if (theme == null) { theme = config.createNewTheme();