Browse Source

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

* commit '90049f4f3a7bbf672754ca3f79db12797d4e02ae':
  REPORT-58211【主题切换】单元格样式的背景渐变色,右边按钮不好点
  REPORT-58705【主题切换】最近使用的颜色还保留主题色坐标,导致颜色不一致
  CHART-20498 主题配色控件选中逻辑
  REPORT-58200 初次安装的10.0设计器,用户目录下会生成.finereport80缓存文件
  REPORT-58799【回归测试】模版缺失插件提示无法关闭
research/11.0
superman 3 years ago
parent
commit
956237595c
  1. 3
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java
  4. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java
  5. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java
  6. 39
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java
  7. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/CornerPreviewCell.java
  8. 1
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  9. 5
      designer-base/src/main/java/com/fr/design/style/color/ColorCell.java
  10. 13
      designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java
  11. 4
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  12. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  13. 3
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

3
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -403,9 +403,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
File envHome = new File(userHome + File.separator + "." + ProductConstants.APP_NAME + version); File envHome = new File(userHome + File.separator + "." + ProductConstants.APP_NAME + version);
if (!envHome.exists()) {
StableUtils.mkdirs(envHome);
}
return envHome.getAbsolutePath(); return envHome.getAbsolutePath();
} }

2
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

@ -71,7 +71,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
public static final int PREVIEW_PANE_WIDTH = LEFT_TITLE_PANE_WIDTH - 10; public static final int PREVIEW_PANE_WIDTH = LEFT_TITLE_PANE_WIDTH - 10;
public static final int PREVIEW_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT - TITLE_BORDER_FONT - 16; public static final int PREVIEW_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT - TITLE_BORDER_FONT - 16;
public static final int RIGHT_PANE_WIDTH = 352; public static final int RIGHT_PANE_WIDTH = 362;
public static final int RIGHT_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT; public static final int RIGHT_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT;
public static final int COLOR_SCHEME_TITLE_PANE_WIDTH = 298; public static final int COLOR_SCHEME_TITLE_PANE_WIDTH = 298;
public static final int COLOR_SCHEME_TITLE_PANE_HEIGHT = 174 + TITLE_BORDER_FONT / 2; public static final int COLOR_SCHEME_TITLE_PANE_HEIGHT = 174 + TITLE_BORDER_FONT / 2;

2
designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeProfileDialog.java

@ -24,7 +24,7 @@ public class TemplateThemeProfileDialog<T extends TemplateTheme> extends Templat
private static final int PADDING_VERTICAL = 4; private static final int PADDING_VERTICAL = 4;
public static TemplateThemeProfilePane<? extends TemplateTheme> currentVisibleProfilePane; public static TemplateThemeProfilePane<? extends TemplateTheme> currentVisibleProfilePane;
public static final int CONTENT_WIDTH = 1000; public static final int CONTENT_WIDTH = 1010;
public static final int CONTENT_HEIGHT = 542; public static final int CONTENT_HEIGHT = 542;
public TemplateThemeProfileDialog(Window parent, TemplateThemeProfilePane<T> profilePane) { public TemplateThemeProfileDialog(Window parent, TemplateThemeProfilePane<T> profilePane) {

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

@ -22,6 +22,7 @@ import com.fr.plugin.chart.vanchart.VanChart;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
@ -40,11 +41,12 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
public ReportThemePreviewPane() { public ReportThemePreviewPane() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
chartPreviewPane = new ChartPreviewPane(); chartPreviewPane = new ChartPreviewPane();
chartPreviewPane.setPreferredSize(new Dimension(615, 237));
chartPreviewPane.populate(initColumnChart()); chartPreviewPane.populate(initColumnChart());
chartPreviewPane.setCallbackEvent(this); chartPreviewPane.setCallbackEvent(this);
reportPreviewPane = new ECReportPreviewPane(); reportPreviewPane = new ECReportPreviewPane();
this.add(chartPreviewPane, BorderLayout.CENTER); this.add(reportPreviewPane, BorderLayout.CENTER);
this.add(reportPreviewPane, BorderLayout.SOUTH); this.add(chartPreviewPane, BorderLayout.SOUTH);
} }
@Override @Override

3
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java

@ -11,6 +11,9 @@ import com.fr.design.mainframe.theme.preview.ecpreview.cell.AbstractPreviewCell;
import java.util.List; import java.util.List;
public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements ThemePreviewed<TemplateTheme> { public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements ThemePreviewed<TemplateTheme> {
protected Style getReportBigTitleStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList.getUse4BigTitle());
}
protected Style getReportHeaderStyle(ThemedCellStyleList cellStyleList) { protected Style getReportHeaderStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList.getUse4Header()); return getCellStyle(cellStyleList.getUse4Header());
} }

39
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.theme.preview.ecpreview;
import com.fr.base.theme.ReportTheme; import com.fr.base.theme.ReportTheme;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyleList; import com.fr.base.theme.settings.ThemedCellStyleList;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.theme.preview.ThemePreviewed; import com.fr.design.mainframe.theme.preview.ThemePreviewed;
import com.fr.design.mainframe.theme.preview.UINoOpaquePanel; import com.fr.design.mainframe.theme.preview.UINoOpaquePanel;
@ -21,6 +22,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreviewed<ReportTheme> { public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreviewed<ReportTheme> {
private List<AbstractPreviewCell> headerTitleCellList = new ArrayList<>();
private List<AbstractPreviewCell> headerCellList = new ArrayList<>(); private List<AbstractPreviewCell> headerCellList = new ArrayList<>();
private List<AbstractPreviewCell> titleCellList = new ArrayList<>(); private List<AbstractPreviewCell> titleCellList = new ArrayList<>();
private List<AbstractPreviewCell> contentCellList = new ArrayList<>(); private List<AbstractPreviewCell> contentCellList = new ArrayList<>();
@ -56,20 +58,26 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
private JPanel createNorthPane() { private JPanel createNorthPane() {
JPanel northPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{"产品", "数据", "统计维度"}, new Point2D[]{new Point(132, 75), new Point(189, 53)}); AbstractPreviewCell bigTitleCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Big_Title"));
cornerCell.setPreferredSize(new Dimension(189, 75)); bigTitleCell.setPreferredSize(new Dimension(615, 46));
headerTitleCellList.add(bigTitleCell);
northPane.add(bigTitleCell, BorderLayout.NORTH);
CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Product"),
Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Data"), Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Statistical_Dimension")},
new Point2D[]{new Point(159, 71), new Point(226, 49)});
cornerCell.setPreferredSize(new Dimension(226, 71));
headerCellList.add(cornerCell); headerCellList.add(cornerCell);
northPane.add(cornerCell, BorderLayout.WEST); northPane.add(cornerCell, BorderLayout.WEST);
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
northPane.add(centerPane, BorderLayout.CENTER); northPane.add(centerPane, BorderLayout.CENTER);
PreviewCell cell = new PreviewCell("按地区统计"); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Statistical_By_Area"));
titleCellList.add(cell); titleCellList.add(cell);
cell.setPreferredSize(new Dimension(308, 38)); cell.setPreferredSize(new Dimension(308, 38));
centerPane.add(cell, BorderLayout.NORTH); centerPane.add(cell, BorderLayout.NORTH);
JPanel eastSouthPane = new UINoOpaquePanel(new GridLayout()); JPanel eastSouthPane = new UINoOpaquePanel(new GridLayout());
PreviewCell cell1 = new PreviewCell("华东"); PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_East_China"));
PreviewCell cell2 = new PreviewCell("华南"); PreviewCell cell2 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_South_China"));
PreviewCell cell3 = new PreviewCell("小计"); PreviewCell cell3 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Subtotal"));
headerCellList.add(cell1); headerCellList.add(cell1);
headerCellList.add(cell2); headerCellList.add(cell2);
headerCellList.add(cell3); headerCellList.add(cell3);
@ -84,24 +92,24 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
JPanel westPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); JPanel westPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
centerPane.add(westPane, BorderLayout.WEST); centerPane.add(westPane, BorderLayout.WEST);
PreviewCell cell1 = new PreviewCell("饮料"); PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Drink"));
titleCellList.add(cell1); titleCellList.add(cell1);
cell1.setPreferredSize(new Dimension(94, 183)); cell1.setPreferredSize(new Dimension(112, 153));
westPane.add(cell1, BorderLayout.WEST); westPane.add(cell1, BorderLayout.WEST);
JPanel gridPane = new UINoOpaquePanel(new GridLayout(6, 1)); JPanel gridPane = new UINoOpaquePanel(new GridLayout(5, 1));
for (int i = 0; i < 6; i++) { for (int i = 0; i < 5; i++) {
PreviewCell cell = new PreviewCell("苹果汁"); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Apple_Juice"));
cell.setPreferredSize(new Dimension(95, 31)); cell.setPreferredSize(new Dimension(114, 31));
headerCellList.add(cell); headerCellList.add(cell);
gridPane.add(cell); gridPane.add(cell);
} }
westPane.add(gridPane, BorderLayout.CENTER); westPane.add(gridPane, BorderLayout.CENTER);
JPanel innerCenterPane = new UINoOpaquePanel(new GridLayout(6, 3)); JPanel innerCenterPane = new UINoOpaquePanel(new GridLayout(5, 3));
centerPane.add(innerCenterPane, BorderLayout.CENTER); centerPane.add(innerCenterPane, BorderLayout.CENTER);
for (int i = 0; i < 18; i++) { for (int i = 0; i < 15; i++) {
PreviewCell cell = new PreviewCell("35600"); PreviewCell cell = new PreviewCell("35600");
cell.setPreferredSize(new Dimension(102, 31)); cell.setPreferredSize(new Dimension(123, 31));
if ((i + 1) % 3 == 0) { if ((i + 1) % 3 == 0) {
highLightCellList.add(cell); highLightCellList.add(cell);
} else { } else {
@ -117,6 +125,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
@Override @Override
public void refresh(TemplateTheme theme) { public void refresh(TemplateTheme theme) {
ThemedCellStyleList cellStyleConfig = theme.getCellStyleList(); ThemedCellStyleList cellStyleConfig = theme.getCellStyleList();
refresh(headerTitleCellList, getReportBigTitleStyle(cellStyleConfig));
refresh(headerCellList, getReportHeaderStyle(cellStyleConfig)); refresh(headerCellList, getReportHeaderStyle(cellStyleConfig));
refresh(contentCellList, getMainContentStyle(cellStyleConfig)); refresh(contentCellList, getMainContentStyle(cellStyleConfig));
refresh(titleCellList, getSmallTitleStyle(cellStyleConfig)); refresh(titleCellList, getSmallTitleStyle(cellStyleConfig));

4
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/CornerPreviewCell.java

@ -21,8 +21,8 @@ public class CornerPreviewCell extends AbstractPreviewCell {
FRFont frFont = style.getFRFont(); FRFont frFont = style.getFRFont();
g2d.setPaint(frFont.getForeground()); g2d.setPaint(frFont.getForeground());
g2d.drawString(values[0], 23, 53); g2d.drawString(values[0], 23, 53);
GraphDrawHelper.drawRotatedString(g2d, values[1], 104, 50, 30); GraphDrawHelper.drawRotatedString(g2d, values[1], 128, 50, 30);
g2d.drawString(values[2], 128, 23); g2d.drawString(values[2], 150, 23);
//画分割线 //画分割线
for (int i = 0; i < point2DS.length; i++) { for (int i = 0; i < point2DS.length; i++) {
g2d.draw(new Line2D.Double(0, 0, point2DS[i].getX(), point2DS[i].getY())); //画线 g2d.draw(new Line2D.Double(0, 0, point2DS[i].getX(), point2DS[i].getY())); //画线

1
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java

@ -146,6 +146,7 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver,
return false; return false;
} }
}; };
colorPane.setColor(getColor());
colorPane.addChangeListener(new ChangeListener() { colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
hidePopupMenu(); hidePopupMenu();

5
designer-base/src/main/java/com/fr/design/style/color/ColorCell.java

@ -10,6 +10,7 @@ import java.awt.event.MouseEvent;
import javax.swing.JComponent; import javax.swing.JComponent;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -100,6 +101,10 @@ public class ColorCell extends JComponent implements ColorSelectable {
if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) { if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) {
colorSelectable.setColor(this.getColor()); colorSelectable.setColor(this.getColor());
colorSelectable.colorSetted(this); colorSelectable.colorSetted(this);
if (this.getColor() != null) {
int rgb = this.getColor().getRGB();
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(new Color(rgb));
}
} }
if (e != null) { if (e != null) {

13
designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java

@ -62,19 +62,28 @@ public abstract class ColorControlWindow extends JPopupMenu {
} }
protected void initSelectionPopupPane(boolean isSupportTransparent) { protected void initSelectionPopupPane(boolean isSupportTransparent) {
selectionPopupPane = new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor()); selectionPopupPane = createColorSelectionPopupPane(isSupportTransparent);
this.add(selectionPopupPane, BorderLayout.CENTER); this.add(selectionPopupPane, BorderLayout.CENTER);
} }
protected ColorSelectionPopupPane createColorSelectionPopupPane(boolean isSupportTransparent) {
return new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor());
}
protected boolean supportThemeColor(){ protected boolean supportThemeColor(){
return true; return true;
} }
class ColorSelectionPopupPane extends NewColorSelectPane { protected class ColorSelectionPopupPane extends NewColorSelectPane {
private static final long serialVersionUID = 7822856562329146354L; private static final long serialVersionUID = 7822856562329146354L;
public ColorSelectionPopupPane(boolean isSupportTransparent, boolean isSupportThemeColor) { public ColorSelectionPopupPane(boolean isSupportTransparent, boolean isSupportThemeColor) {
this(isSupportTransparent, isSupportThemeColor, null);
}
public ColorSelectionPopupPane(boolean isSupportTransparent, boolean isSupportThemeColor, Color color) {
super(isSupportTransparent, isSupportThemeColor); super(isSupportTransparent, isSupportThemeColor);
this.setColor(color);
this.addChangeListener(new ChangeListener() { this.addChangeListener(new ChangeListener() {
@Override @Override

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

@ -332,9 +332,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
changeListener.stateChanged(evt); changeListener.stateChanged(evt);
} }
} }
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color.getColor());
}
this.repaint(); this.repaint();
} }

5
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -370,6 +370,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
ColorRecButton.this.repaint(); ColorRecButton.this.repaint();
} }
@Override
protected ColorSelectionPopupPane createColorSelectionPopupPane(boolean isSupportTransparent) {
return new ColorSelectionPopupPane(isSupportTransparent, supportThemeColor(), ColorRecButton.this.color);
}
}; };
} }

3
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

@ -27,6 +27,7 @@ import com.fr.third.guava.cache.CacheBuilder;
import com.fr.third.guava.collect.Multimap; import com.fr.third.guava.collect.Multimap;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import javax.swing.SwingUtilities;
import java.time.Duration; import java.time.Duration;
import java.util.Collection; import java.util.Collection;
import java.util.Map; import java.util.Map;
@ -183,7 +184,7 @@ public class DesignerAppUtils {
// 试图获取多行读取错误提示并缓存待处理列表 // 试图获取多行读取错误提示并缓存待处理列表
String detail = dealWithErrorDetailMultiLineAndCache(path); String detail = dealWithErrorDetailMultiLineAndCache(path);
if (detail.length() > 0) { if (detail.length() > 0) {
UIUtil.invokeLaterIfNeeded(() -> { SwingUtilities.invokeLater(() -> {
if (WorkContext.getCurrent().isLocal()) { if (WorkContext.getCurrent().isLocal()) {
UIExpandDialog.Builder() UIExpandDialog.Builder()
.owner(DesignerContext.getDesignerFrame()) .owner(DesignerContext.getDesignerFrame())

Loading…
Cancel
Save