From c2c669a7c64649fa4f662c3847c59f6cc19ce3e4 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 15 Sep 2021 11:43:12 +0800 Subject: [PATCH] =?UTF-8?q?CHART-20522=20&&=20REPORT-59010=20final?= =?UTF-8?q?=E4=BC=A0=E4=B8=80=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/theme/TemplateThemeProfilePane.java | 4 +++- .../java/com/fr/design/style/color/ColorSelectDialog.java | 5 ++++- .../java/com/fr/design/designer/creator/XCreatorUtils.java | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) 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 74c4c4cec..7096d804c 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 @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme; +import com.fr.base.theme.FineColorFlushUtils; import com.fr.base.theme.FineColorManager; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; @@ -319,13 +320,14 @@ public abstract class TemplateThemeProfilePane extends colorListExtendedPane.populate(colors); FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); T theme = updateBean(); - + FineColorFlushUtils.replaceCacheObject(theme, replaceByColorScheme); FineColorManager.traverse(theme, replaceByColorScheme); populateBean4CustomEditors(theme); //图表渐变色 chartStyleSettingPane.populateGradientBar(colors); themePreviewPane.refresh(theme); + this.repaint(); } public void populateBean(T theme) { diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java index 56bc9aa65..23dcf8cc3 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java @@ -1,6 +1,7 @@ package com.fr.design.style.color; import com.fr.base.chart.BaseChartCollection; +import com.fr.design.DesignerEnvManager; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.utils.gui.GUICoreUtils; @@ -101,7 +102,9 @@ public class ColorSelectDialog extends MiddleChartDialog{ ok.setActionCommand("OK"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - seletePane.setColor(okListener.getColor()); + Color color = okListener.getColor(); + seletePane.setColor(color); + DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color); doOK(); } }); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 6e44ad196..7f571ce9e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -3,6 +3,8 @@ */ package com.fr.design.designer.creator; +import com.fr.base.theme.FineColorFlushUtils; +import com.fr.base.theme.FineColorGather; import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateTheme; @@ -377,8 +379,7 @@ public class XCreatorUtils { } public static void setupTemplateTheme(XCreator container, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) { - FineColorManager.traverse(container.toData(), new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible)); - + FineColorGather colorGather = new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible); Form.traversalWidget(container.toData(), new WidgetGather() { @Override public void dealWith(Widget widget) { @@ -391,5 +392,7 @@ public class XCreatorUtils { return true; } }, TemplateThemeAware.class); + FineColorFlushUtils.replaceCacheObject(container.toData(), colorGather); + FineColorManager.traverse(container.toData(), colorGather); } } \ No newline at end of file