Browse Source

REPORT-65049 【主题边框】悬浮元素的跟随主题单元格样式显示,出现两种样式重叠的效果

【问题原因】
1. 单独使用CellStylePreviewPane单元格样式预览面板时,需要CellStylePreviewPane在样式切换
时清理画布并重绘
2. 在CellRectangleStylePreviewPane使用CellStylePreviewPane时,也需要清理画布并重绘,
但此时的清理是CellRectangleStylePreviewPane完成。CellStylePreviewPane不清理画布,否则会
导致表示透明的马赛克图片不显示.

【改动思路】
CellStylePreviewPane增加一个是否自动清理画布的控制变量
bugfix/11.0
Starryi 3 years ago
parent
commit
ed43a05a67
  1. 2
      designer-base/src/main/java/com/fr/design/cell/CellRectangleStylePreviewPane.java
  2. 8
      designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java
  3. 3
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

2
designer-base/src/main/java/com/fr/design/cell/CellRectangleStylePreviewPane.java

@ -46,7 +46,7 @@ public class CellRectangleStylePreviewPane extends JPanel {
for (int r = 0; r < ROW_COUNT; r++) {
for (int c = 0; c < COLUMN_COUNT; c++) {
CellStylePreviewPane pane = new CellStylePreviewPane();
CellStylePreviewPane pane = new CellStylePreviewPane(false);
TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance(c, r);
int flags = CellBorderSourceFlag.INVALID_BORDER_SOURCE;
if (supportInnerBorder) {

8
designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java

@ -33,7 +33,10 @@ public class CellStylePreviewPane extends JPanel {
private String paintText = "Report";
private Style style = Style.DEFAULT_STYLE;
public CellStylePreviewPane() {
private final boolean autoClearCanvas;
public CellStylePreviewPane(boolean autoClearCanvas) {
this.autoClearCanvas = autoClearCanvas;
setPreferredSize(new Dimension(0, 0));
}
@ -55,6 +58,9 @@ public class CellStylePreviewPane extends JPanel {
@Override
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
if (autoClearCanvas) {
g2d.clearRect(0, 0, getWidth(), getHeight());
}
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

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

@ -53,6 +53,7 @@ import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
@ -78,7 +79,7 @@ public class ReportStylePane extends BasicPane {
setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
previewArea = new CellStylePreviewPane();
previewArea = new CellStylePreviewPane(true);
followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS);
followingThemeButtonGroup.setAutoFireStateChanged(false);
customStylePane = new CustomFloatStyleSettingPane();

Loading…
Cancel
Save