Browse Source

CHART-21593 【主题获取】生成跟随主题的组件后,拖到其他主题的模板中,图表还是跟随主题

【问题原因】
处理新添加组件中的图表主题样式

【改动思路】
同上
new-design
Starryi 3 years ago
parent
commit
022ae69f07
  1. 9
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

9
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -3,6 +3,7 @@
*/
package com.fr.design.designer.creator;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.theme.FineColorFlushUtils;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
@ -86,6 +87,7 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
import java.awt.Container;
import java.awt.Dimension;
import java.util.List;
/**
* XCreator的相关处理
@ -384,7 +386,12 @@ public class XCreatorUtils {
public static void setupTemplateTheme(XCreator container, final boolean forceFollowingTheme, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) {
FineColorGather colorGather = new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible);
Form.traversalWidget(container.toData(), new WidgetGather() {
Widget root = container.toData();
List<BaseChartCollection> chartCollections = root.getChartCollections();
for (BaseChartCollection chartCollection: chartCollections) {
chartCollection.onTemplateUsingThemeChange(currentTemplateUsingTheme, compatible);
}
Form.traversalWidget(root, new WidgetGather() {
@Override
public void dealWith(Widget widget) {
TemplateThemeAware<FormTheme> themedWidget = (TemplateThemeAware) widget;

Loading…
Cancel
Save