From be7653fc5c91bd8ee79d135de42bebe46abb93d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 4 Nov 2020 10:18:04 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-41858=20=E8=A2=AB=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=8C=89=E9=92=AE=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../predefined/ui/PredefinedStyleBlock.java | 1 + .../ui/preview/PredefinedStylePreviewPane.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java index 89c35b9a9f..67b369a6c9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java @@ -96,6 +96,7 @@ public class PredefinedStyleBlock extends JPanel { private void initPane(boolean supportEdit) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); PredefinedStylePreviewPane content = new PredefinedStylePreviewPane(0.387, 0.384); + content.setParent(this); content.setPreferredSize(new Dimension(200, 180)); UILabel label = new UILabel(previewObject.getStyleName()); label.setToolTipText(previewObject.getStyleName()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java index b876d723f9..5d03d0e2fb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java @@ -39,6 +39,8 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen private int COLUMN_CHART_WIDTH = 517; private int COLUMN_CHART_HEIGHT = 300; + private JPanel parent; + public PredefinedStylePreviewPane() { this(1.0, 1.0); } @@ -53,6 +55,10 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen this.add(this.elementCasePreview); } + public void setParent(JPanel parent) { + this.parent = parent; + } + private JPanel initChartPreViewPane() { columnChartPane = new ChartPreStylePreView(initVanColumnChart()); columnChartPane.setPreferredSize(new Dimension(COLUMN_CHART_WIDTH, COLUMN_CHART_HEIGHT)); @@ -142,6 +148,10 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implemen @Override public void callback() { - this.repaint(); + if (parent != null) { + parent.repaint(); + } else { + this.repaint(); + } } }