Browse Source

Pull request #5635: REPORT-58353 & REPORT-58383 & REPORT-58367 & REPORT-58390

Merge in DESIGN/design from ~STARRYI/design:release/11.0 to release/11.0

* commit '0da7995ab60828a2bab2aa0d10ce8c6558a3bcd9':
  REPORT-58390 【主题切换】细节定制-决策报表的模板背景-不透明度降低后,缩略图会变暗
  REPORT-58367 【回归测试】聚合报表全选报表块内容,修改跟随主题,配置不生效
  REPORT-58383 【回归测试】聚合报表纸张背景-跟随主题,设计器内配置预览效果不正确
  REPORT-58353 【主题切换】悬浮元素-样式设置为自定义时,不同选项的切换显示
fix-lag
starryi 3 years ago
parent
commit
2d6e2f9b26
  1. 5
      designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java
  2. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java
  3. 32
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  4. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java
  5. 9
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

5
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() { public TemplateTheme getUsingTheme() {
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) { if (template != null) {
TemplateTheme theme = template.getTemplateTheme(); return template.getTemplateTheme();
if (theme instanceof FormTheme) {
return theme;
}
} }
return null; return null;
} }

5
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java

@ -211,6 +211,11 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
public void paint(Graphics g) { public void paint(Graphics g) {
super.paint(g); super.paint(g);
Graphics2D g2d = (Graphics2D) 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); paintCenterImage(g2d, thumbnail != null ? thumbnail : LOADING_IMAGE);
} }

32
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.base.Style;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; 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.ibutton.UIButtonGroup;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -24,8 +26,10 @@ import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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[]{ public static final String[] FOLLOWING_THEME_STRING_ARRAYS = new String[]{
Toolkit.i18nText("Fine-Design_Style_Follow_Theme"), Toolkit.i18nText("Fine-Design_Style_Follow_Theme"),
Toolkit.i18nText("Fine-Design_Style_Not_Follow_Theme"), Toolkit.i18nText("Fine-Design_Style_Not_Follow_Theme"),
@ -40,6 +44,8 @@ public class StylePane extends BasicPane {
private JPanel contentPane; private JPanel contentPane;
private final List<UIObserverListener> observerListeners = new ArrayList<>();
public StylePane() { public StylePane() {
followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS); followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS);
customStylePane = new CustomStylePane(); customStylePane = new CustomStylePane();
@ -67,7 +73,7 @@ public class StylePane extends BasicPane {
int selectedIndex = followingThemeButtonGroup.getSelectedIndex(); int selectedIndex = followingThemeButtonGroup.getSelectedIndex();
cardLayout.show(contentPane, FOLLOWING_THEME_STRING_ARRAYS[selectedIndex]); cardLayout.show(contentPane, FOLLOWING_THEME_STRING_ARRAYS[selectedIndex]);
if (selectedIndex == 1) { if (selectedIndex == 1) {
// 对于同一个单元格,跟随主题切换到自定义,若跟随主题面板有选中项,则自定义中的配置与其保持一致,否则自定义中配置保持不变 // 对于同一个单元格,跟随主题切换到自定义,自定义中的配置与其保持一致
NameStyle lastSelectedNameStyle = themedCellStyleListPane.updateBean(); NameStyle lastSelectedNameStyle = themedCellStyleListPane.updateBean();
if (lastSelectedNameStyle != null) { if (lastSelectedNameStyle != null) {
Style lastSelectedRealStyle = lastSelectedNameStyle.getRealStyle(); Style lastSelectedRealStyle = lastSelectedNameStyle.getRealStyle();
@ -81,10 +87,11 @@ public class StylePane extends BasicPane {
} }
} }
} else { } else {
// 对于同一个单元格,自定义切换到跟随主题,跟随主题应当清除选中项,即没有选中任何主题中的单元格样式, // 对于同一个单元格,自定义切换到跟随主题,跟随主题选中"默认"样式,并使用默认样式设置选中的单元格
// 因为还未选中,所以自定义中的配置保持不变,此时若用户切换会自定义,配置应当与之前一样 themedCellStyleListPane.reset();
themedCellStyleListPane.populateBean(null);
} }
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;
}
} }

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java

@ -77,14 +77,15 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane<NameStyle> imp
* 重置 * 重置
*/ */
public void reset() { public void reset() {
refreshBeanElement();
styleList.setSelectedIndex(0);
} }
@Override @Override
public void populateBean(NameStyle ob) { public void populateBean(NameStyle ob) {
refreshBeanElement(); refreshBeanElement();
if (ob == null) { if (ob == null) {
styleList.setSelectedIndex(-1); styleList.setSelectedIndex(0);
return; return;
} }
for (int i = 0; i < defaultListModel.getSize(); i++) { for (int i = 0; i < defaultListModel.getSize(); i++) {

9
designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

@ -135,7 +135,7 @@ public class ReportStylePane extends BasicPane {
int selectedIndex = followingThemeButtonGroup.getSelectedIndex(); int selectedIndex = followingThemeButtonGroup.getSelectedIndex();
cardLayout.show(contentPane, FOLLOWING_THEME_STRING_ARRAYS[selectedIndex]); cardLayout.show(contentPane, FOLLOWING_THEME_STRING_ARRAYS[selectedIndex]);
if (selectedIndex == 1) { if (selectedIndex == 1) {
// 对于同一个单元格,跟随主题切换到自定义,若跟随主题面板有选中项,则自定义中的配置与其保持一致,否则自定义中配置保持不变 // 对于同一个单元格,跟随主题切换到自定义,自定义中的配置与其保持一致
NameStyle lastSelectedNameStyle = themedCellStyleListPane.updateBean(); NameStyle lastSelectedNameStyle = themedCellStyleListPane.updateBean();
if (lastSelectedNameStyle != null) { if (lastSelectedNameStyle != null) {
Style lastSelectedRealStyle = lastSelectedNameStyle.getRealStyle(); Style lastSelectedRealStyle = lastSelectedNameStyle.getRealStyle();
@ -149,9 +149,8 @@ public class ReportStylePane extends BasicPane {
} }
} }
} else { } else {
// 对于同一个单元格,自定义切换到跟随主题,跟随主题应当清除选中项,即没有选中任何主题中的单元格样式, // 对于同一个单元格,自定义切换到跟随主题,跟随主题选中"默认"样式,并使用默认样式设置选中的单元格
// 因为还未选中,所以自定义中的配置保持不变,此时若用户切换会自定义,配置应当与之前一样 themedCellStyleListPane.reset();
themedCellStyleListPane.populateBean(null);
} }
} }
}); });
@ -421,7 +420,7 @@ public class ReportStylePane extends BasicPane {
} }
} }
stateChanged(evt); CustomFloatStyleSettingPane.this.stateChanged(evt);
} }
}); });

Loading…
Cancel
Save