From 24346ebc9a48fba0d02d6b65e36f4a4ce9722be7 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 30 Aug 2021 17:01:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-58353=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E6=82=AC=E6=B5=AE=E5=85=83=E7=B4=A0?= =?UTF-8?q?-=E6=A0=B7=E5=BC=8F=E8=AE=BE=E7=BD=AE=E4=B8=BA=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=90=8C=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E7=9A=84=E5=88=87=E6=8D=A2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 方法循环调用了,导致Tab页无法切换 【改动思路】 同上 --- .../src/main/java/com/fr/design/report/ReportStylePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java index e65e25949..1e0537e03 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java @@ -421,7 +421,7 @@ public class ReportStylePane extends BasicPane { } } - stateChanged(evt); + CustomFloatStyleSettingPane.this.stateChanged(evt); } }); From ebdba76f2e9283c7ff9d99e28f7b6d07d09f8f6e Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 30 Aug 2021 17:16:05 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-58383=20=E3=80=90=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E3=80=91=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E7=BA=B8=E5=BC=A0=E8=83=8C=E6=99=AF-=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=86=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A2=84=E8=A7=88=E6=95=88=E6=9E=9C=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 FollowingThemePane只返回了表单模版所使用的主题,导致其 无法获取报表模版使用的主题 【改动思路】 同上 --- .../java/com/fr/design/gui/style/FollowingThemePane.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java index c7c1da0ef..55f4612a2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java @@ -114,10 +114,7 @@ public class FollowingThemePane extends BasicPane implements UIObserver { public TemplateTheme getUsingTheme() { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (template != null) { - TemplateTheme theme = template.getTemplateTheme(); - if (theme instanceof FormTheme) { - return theme; - } + return template.getTemplateTheme(); } return null; } From a68141128895795264e099f342a5cf66e4763190 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 30 Aug 2021 18:27:45 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-58367=20=E3=80=90=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E3=80=91=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=85=A8=E9=80=89=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E9=85=8D=E7=BD=AE=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 交互优化变动: 单元格样式从自定义切换到跟随主题时,自动选中主题的默认样式, 且使用改样式设置单元格 【改动思路】 同上 --- .../cell/settingpane/style/StylePane.java | 32 ++++++++++++++++--- .../style/ThemedCellStyleListPane.java | 5 +-- .../com/fr/design/report/ReportStylePane.java | 7 ++-- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java index 59bc73d57..93bf52397 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java @@ -4,6 +4,8 @@ import com.fr.base.NameStyle; import com.fr.base.Style; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -24,8 +26,10 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; -public class StylePane extends BasicPane { +public class StylePane extends BasicPane implements UIObserver { public static final String[] FOLLOWING_THEME_STRING_ARRAYS = new String[]{ Toolkit.i18nText("Fine-Design_Style_Follow_Theme"), Toolkit.i18nText("Fine-Design_Style_Not_Follow_Theme"), @@ -40,6 +44,8 @@ public class StylePane extends BasicPane { private JPanel contentPane; + private final List observerListeners = new ArrayList<>(); + public StylePane() { followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS); customStylePane = new CustomStylePane(); @@ -67,7 +73,7 @@ public class StylePane extends BasicPane { int selectedIndex = followingThemeButtonGroup.getSelectedIndex(); cardLayout.show(contentPane, FOLLOWING_THEME_STRING_ARRAYS[selectedIndex]); if (selectedIndex == 1) { - // 对于同一个单元格,跟随主题切换到自定义,若跟随主题面板有选中项,则自定义中的配置与其保持一致,否则自定义中配置保持不变 + // 对于同一个单元格,跟随主题切换到自定义,自定义中的配置与其保持一致 NameStyle lastSelectedNameStyle = themedCellStyleListPane.updateBean(); if (lastSelectedNameStyle != null) { Style lastSelectedRealStyle = lastSelectedNameStyle.getRealStyle(); @@ -81,10 +87,11 @@ public class StylePane extends BasicPane { } } } else { - // 对于同一个单元格,自定义切换到跟随主题,跟随主题应当清除选中项,即没有选中任何主题中的单元格样式, - // 因为还未选中,所以自定义中的配置保持不变,此时若用户切换会自定义,配置应当与之前一样 - themedCellStyleListPane.populateBean(null); + // 对于同一个单元格,自定义切换到跟随主题,跟随主题选中"默认"样式,并使用默认样式设置选中的单元格 + themedCellStyleListPane.reset(); } + + fireStateChanged(); } }); @@ -205,4 +212,19 @@ public class StylePane extends BasicPane { } } + private void fireStateChanged() { + for (UIObserverListener listener: observerListeners) { + listener.doChange(); + } + } + + @Override + public void registerChangeListener(UIObserverListener listener) { + observerListeners.add(listener); + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } } \ No newline at end of file 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 59a61e2d1..65da02e98 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 @@ -77,14 +77,15 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane imp * 重置 */ public void reset() { - + refreshBeanElement(); + styleList.setSelectedIndex(0); } @Override public void populateBean(NameStyle ob) { refreshBeanElement(); if (ob == null) { - styleList.setSelectedIndex(-1); + styleList.setSelectedIndex(0); return; } for (int i = 0; i < defaultListModel.getSize(); i++) { diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java index 1e0537e03..caf919b29 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java @@ -135,7 +135,7 @@ public class ReportStylePane extends BasicPane { int selectedIndex = followingThemeButtonGroup.getSelectedIndex(); cardLayout.show(contentPane, FOLLOWING_THEME_STRING_ARRAYS[selectedIndex]); if (selectedIndex == 1) { - // 对于同一个单元格,跟随主题切换到自定义,若跟随主题面板有选中项,则自定义中的配置与其保持一致,否则自定义中配置保持不变 + // 对于同一个单元格,跟随主题切换到自定义,自定义中的配置与其保持一致 NameStyle lastSelectedNameStyle = themedCellStyleListPane.updateBean(); if (lastSelectedNameStyle != null) { Style lastSelectedRealStyle = lastSelectedNameStyle.getRealStyle(); @@ -149,9 +149,8 @@ public class ReportStylePane extends BasicPane { } } } else { - // 对于同一个单元格,自定义切换到跟随主题,跟随主题应当清除选中项,即没有选中任何主题中的单元格样式, - // 因为还未选中,所以自定义中的配置保持不变,此时若用户切换会自定义,配置应当与之前一样 - themedCellStyleListPane.populateBean(null); + // 对于同一个单元格,自定义切换到跟随主题,跟随主题选中"默认"样式,并使用默认样式设置选中的单元格 + themedCellStyleListPane.reset(); } } }); From 0da7995ab60828a2bab2aa0d10ce8c6558a3bcd9 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 30 Aug 2021 19:51:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-58390=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E7=BB=86=E8=8A=82=E5=AE=9A=E5=88=B6?= =?UTF-8?q?-=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E8=83=8C=E6=99=AF-=E4=B8=8D=E9=80=8F=E6=98=8E?= =?UTF-8?q?=E5=BA=A6=E9=99=8D=E4=BD=8E=E5=90=8E=EF=BC=8C=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E4=BC=9A=E5=8F=98=E6=9A=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 缩略图改为手动绘制后,不存在这个问题了,不过还是给个默认的 白色背景 【改动思路】 同上 --- .../com/fr/design/mainframe/theme/TemplateThemeBlock.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java index d014199f3..e00bc445c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java @@ -211,6 +211,11 @@ public class TemplateThemeBlock extends JPanel { public void paint(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D) g; + Color oldColor = g2d.getColor(); + g2d.setColor(Color.WHITE); + g2d.fillRect(0, 0, getWidth(), getHeight()); + g2d.setColor(oldColor); + paintCenterImage(g2d, thumbnail != null ? thumbnail : LOADING_IMAGE); }