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);