Browse Source

Merge pull request #5650 in DESIGN/design from release/11.0 to feature/x

* commit '8a411d9bca37d3dae547ce4359e64b19cce6a5f7':
  CHART-20517  图表类型编辑之后再重置标题
  CHART-20517  图表类型编辑之后再重置标题
  解决冲突
  解决冲突
  解决冲突
  REPORT-58124 公式编辑器优化:不支持实时计算的功能提示处理 1.修改遍历不支持公式的逻辑
  REPORT-58394 fix:不安装旧版本图表插件 只是不能新建 图表配置面板也是要出来的
  REPORT-57986 只是获取是不是使用全局而不是获取全局开启否
  REPORT-58390 【主题切换】细节定制-决策报表的模板背景-不透明度降低后,缩略图会变暗
  REPORT-58367 【回归测试】聚合报表全选报表块内容,修改跟随主题,配置不生效
  REPORT-58383 【回归测试】聚合报表纸张背景-跟随主题,设计器内配置预览效果不正确
  REPORT-58353 【主题切换】悬浮元素-样式设置为自定义时,不同选项的切换显示
  CHART-20374 && REPORT-57978 【主题切换】细节定制-模板背景-设置图片适应,左上角有奇怪的显示;【11.0】仪表盘标签、轴标签颜色自动控件截断显示
  REPORT-58344 主题样式frm下的图表标题增加提示
  REPORT-57892 公式编辑器优化:实时计算返回结果为日期格式时不正确 1.添加一个object2string
  REPORT-54887 公式编辑器优化一期 1.添加了公式的参数个数和参数类型的校验; 2.添加了实时计算的功能。
research/11.0
superman 3 years ago
parent
commit
90aafddae2
  1. 13
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  2. 5
      designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java
  3. 15
      designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java
  4. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java
  5. 9
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java
  6. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java
  7. 16
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleFormEditPane.java
  8. 36
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStyleFormPane.java
  9. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java
  10. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java
  11. 4
      designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java
  12. 10
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  13. 32
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  14. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java
  15. 9
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

13
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -710,7 +710,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
strategyConfig = StrategyConfigAttrUtils.getStrategyConfig(dsName);
if (useGlobal(getTableData(), strategyConfig, tplPath)) {
if (useGlobal(getTableData(), strategyConfig)) {
//使用全局配置
strategyConfig = StrategyConfigHelper.createStrategyConfig(true);
} else if (getTableData().isShare()) {
@ -722,14 +722,13 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
return strategyConfig;
}
private boolean useGlobal(DBTableData dbTableData, StrategyConfig strategyConfig, String tplPath) {
private boolean useGlobal(DBTableData dbTableData, StrategyConfig strategyConfig) {
//非共享且配置为空或者指定使用全局配置时,检查是否全局开启
if (!dbTableData.isShare() && (strategyConfig == null || strategyConfig.isUseGlobal())) {
//模版里面没有配置,检查模版是否被开启
return StrategyConfigService.isTemplateEnabled(tplPath);
if (strategyConfig == null) {
return !dbTableData.isShare();
} else {
return strategyConfig.isUseGlobal();
}
return false;
}
@Override

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

15
designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java

@ -1,19 +1,20 @@
package com.fr.design.mainframe.theme;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.TemplateThemeConfig;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateThemeConfig;
import com.fr.base.theme.settings.ThemedComponentStyle;
import com.fr.base.theme.settings.ThemedFormBodyStyle;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.theme.edit.ChartStyleFormEditPane;
import com.fr.design.mainframe.theme.edit.ComponentStyleEditPane;
import com.fr.design.mainframe.theme.edit.FormBodyStyleEditPane;
import com.fr.design.mainframe.theme.preview.FormThemePreviewPane;
import javax.swing.JPanel;
import java.awt.Color;
import java.util.List;
import java.awt.Color;
import static com.fr.design.i18n.Toolkit.i18nText;
@ -52,6 +53,14 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane<FormTheme> {
return container;
}
@Override
protected JPanel createChartStyleSettingPane() {
JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane();
chartStyleSettingPane = new ChartStyleFormEditPane();
container.add(chartStyleSettingPane);
return container;
}
@Override
public void onColorSchemeChanged(List<Color> colors) {
super.onColorSchemeChanged(colors);

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

9
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java

@ -8,6 +8,7 @@ import com.fr.log.FineLoggerFactory;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
@ -81,4 +82,12 @@ public abstract class TemplateThemePreviewPane<T extends TemplateTheme> extends
return null;
}
@Override
public void paintComponent(Graphics g) {
g.clearRect(0, 0, 517, 532);
paintBackground((Graphics2D) g);
}
protected abstract void paintBackground(Graphics2D g);
}

6
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java

@ -45,7 +45,7 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
this.chartLabelPane = new ChartLabelStylePane();
this.chartAxisStylePane = new ChartAxisStylePane();
this.chartDataSheetStylePane = new ChartDataSheetStylePane();
this.chartTitleAndBackgroundStylePane = new ChartTitleAndBackgroundStylePane();
this.chartTitleAndBackgroundStylePane = createChartTitleAndBackgroundStylePane();
paneList = new ArrayList<>();
paneList.add(this.chartSeriesStylePane);
paneList.add(this.chartLegendStylePane);
@ -56,6 +56,10 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
return paneList;
}
protected ChartTitleAndBackgroundStylePane createChartTitleAndBackgroundStylePane() {
return new ChartTitleAndBackgroundStylePane();
}
@Override
public void populateBean(ThemedChartStyle ob) {
chartSeriesStylePane.populate(ob);

16
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleFormEditPane.java

@ -0,0 +1,16 @@
package com.fr.design.mainframe.theme.edit;
import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStyleFormPane;
import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStylePane;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-08-30
*/
public class ChartStyleFormEditPane extends ChartStyleEditPane {
protected ChartTitleAndBackgroundStylePane createChartTitleAndBackgroundStylePane() {
return new ChartTitleAndBackgroundStyleFormPane();
}
}

36
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStyleFormPane.java

@ -0,0 +1,36 @@
package com.fr.design.mainframe.theme.edit.chart;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import java.awt.Color;
import java.awt.Component;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-08-30
*/
public class ChartTitleAndBackgroundStyleFormPane extends ChartTitleAndBackgroundStylePane {
private UILabel tooltipLabel;
protected void initComponents() {
super.initComponents();
tooltipLabel = new UILabel("<html>" + Toolkit.i18nText("Fine-Design_Chart_Title_Background_Tooltip") + "</html>");
tooltipLabel.setForeground(new Color(153, 153, 153));
}
protected Component[][] getComponent() {
Component[][] component = super.getComponent();
Component[][] newComponent = new Component[component.length + 2][];
System.arraycopy(component, 0, newComponent, 2, component.length);
newComponent[0] = new Component[]{null, null};
newComponent[1] = new Component[]{tooltipLabel, null};
return newComponent;
}
protected double[] getRows(double p) {
return new double[]{p, p, p, p, p, p, p};
}
}

8
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java

@ -30,7 +30,6 @@ import java.awt.Graphics2D;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;
/**
@ -97,12 +96,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane<FormTheme> {
}
@Override
public void paintComponent(Graphics g) {
paintBackground((Graphics2D) g);
}
private void paintBackground(Graphics2D g2d) {
protected void paintBackground(Graphics2D g2d) {
if (background == null) {
background = ColorBackground.getInstance(Color.WHITE);
}

8
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java

@ -23,7 +23,6 @@ import com.fr.plugin.chart.vanchart.VanChart;
import java.awt.Graphics2D;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;
/**
@ -55,12 +54,9 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
chartPreviewPane.refresh(theme);
repaint();
}
@Override
public void paintComponent(Graphics g) {
paintBackground((Graphics2D) g);
}
private void paintBackground(Graphics2D g2d) {
protected void paintBackground(Graphics2D g2d) {
if (background == null) {
background = ColorBackground.getInstance(Color.WHITE);
}

4
designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java

@ -114,8 +114,10 @@ public abstract class ColorControlWindowWithAuto extends ColorControlWindow {
}
}
@Override
public Dimension getPreferredSize() {
return super.getPreferredSize();
Dimension dimension = super.getPreferredSize();
return new Dimension(dimension.width, dimension.height + BUTTON_HEIGHT);
}
}

10
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -173,8 +173,7 @@ public class ChartTypePane extends AbstractChartAttrPane {
Map<Integer, Map<String, FurtherBasicBeanPane<? extends ChartProvider>>> allChartTypePane,
ActionListener autoButtonListener) {
String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs();
String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDsIncludeDisabled();
for (String id : chartIDs) {
@ -222,6 +221,7 @@ public class ChartTypePane extends AbstractChartAttrPane {
String lastPlotID = chart.getID();
boolean chartTypeChange = false;
try {
AbstractChartTypePane selectedPane = (AbstractChartTypePane) getSelectedPane();
ChartProvider newDefaultChart = (ChartProvider) ChartTypeManager.getInstanceWithCheck().getCharts(selectedPane.getPlotID())[0].clone();
@ -231,13 +231,16 @@ public class ChartTypePane extends AbstractChartAttrPane {
editingCollection.removeNameObject(editingCollection.getSelectedIndex());
editingCollection.addChart(newDefaultChart);
chart = newDefaultChart;
chartTypeChange = true;
}
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
//这一步会替换plot
String id = chart.getID();
((AbstractChartTypePane) getSelectedPane()).updateBean(chart);
if (inForm) {
chartTypeChange = chartTypeChange || !ComparatorUtils.equals(id, chart.getID());
if (inForm && chartTypeChange) {
chart.resetAttrInForm();
}
reLayoutEditPane(chart, lastPlotID);
@ -465,5 +468,6 @@ public class ChartTypePane extends AbstractChartAttrPane {
public void registerChartEditPane(ChartEditPane currentEditPane) {
this.editPane = currentEditPane;
this.inForm = editPane.isInForm();
buttonPane.refreshChartInForm(inForm);
}
}

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.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<UIObserverListener> 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;
}
}

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() {
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++) {

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();
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();
}
}
});
@ -421,7 +420,7 @@ public class ReportStylePane extends BasicPane {
}
}
stateChanged(evt);
CustomFloatStyleSettingPane.this.stateChanged(evt);
}
});

Loading…
Cancel
Save