diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java index ef9ad44693..fab425fbe7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java +++ b/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 extends return null; } + + @Override + public void paintComponent(Graphics g) { + g.clearRect(0, 0, 517, 532); + paintBackground((Graphics2D) g); + } + + protected abstract void paintBackground(Graphics2D g); } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java index 0fc1944922..1445dab357 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java +++ b/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 { } - @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); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java index f4e23853d1..02d3aa96cf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java +++ b/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