From ca8aa8309431931bf1219b82483480f8ab38c2ba Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 14 Sep 2021 15:41:24 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-57551=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=8C=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E4=B8=8Bbody=E8=83=8C=E6=99=AF=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=EF=BC=8C=E7=94=BB=E5=B8=83=E4=B8=AD=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AE=9E=E6=97=B6=E6=98=BE=E7=A4=BA=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 重命名组件样式预览效果的相关方法 【改动思路】 同标题 --- .../designer/creator/XBorderStyleWidgetCreator.java | 8 ++++---- .../com/fr/design/designer/creator/XChartEditor.java | 6 +++--- .../com/fr/design/designer/creator/XElementCase.java | 6 +++--- .../fr/design/designer/creator/XLayoutContainer.java | 6 +++--- .../design/designer/creator/XWAbsoluteBodyLayout.java | 8 ++++---- .../fr/design/designer/creator/XWAbsoluteLayout.java | 2 +- .../com/fr/design/designer/creator/XWTitleLayout.java | 6 +++--- .../designer/creator/cardlayout/XWCardLayout.java | 10 +++++----- .../creator/cardlayout/XWCardMainBorderLayout.java | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java index 395647db3b..8ed5395e04 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java @@ -91,12 +91,12 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ super.addToWrapper(parentPanel, width, minHeight); // REPORT-53175: 新创建的图表组件默认显示标题 since 10.0.18 // 将当前对象添加到父容器后,初始化默认样式的效果 - initStyle(); + refreshStylePreviewEffect(); } - protected void initStyle() { + public void refreshStylePreviewEffect() { BorderPacker style = toData().getBorderStyle(); - initBorderAndBackgroundStyle(); + refreshBorderAndBackgroundStylePreviewEffect(); if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { initTitleStyle(style); } else { @@ -107,7 +107,7 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ reshuffleBorderAndBackgroundPaintingEffectIfTitleExists(); } - protected void initBorderAndBackgroundStyle() { + public void refreshBorderAndBackgroundStylePreviewEffect() { BorderPacker style = toData().getBorderStyle(); LineBorder DEFAULT_LINE_BORDER = (LineBorder) DEFALUTBORDER; diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index c5f9305c36..020dac0630 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -122,7 +122,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator { @Override public void propertyChange() { - initStyle(); + refreshStylePreviewEffect(); } }), }; @@ -165,7 +165,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator { @Override protected void initXCreatorProperties() { super.initXCreatorProperties(); - initBorderAndBackgroundStyle(); + refreshBorderAndBackgroundStylePreviewEffect(); BaseChartCollection collection = ((BaseChartEditor) data).getChartCollection(); isRefreshing = true; ((MiddleChartComponent) designerEditor.getEditorTarget()).populate(collection); @@ -345,7 +345,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator { * data属性改变触发其他操作 */ public void firePropertyChange() { - initStyle(); + refreshStylePreviewEffect(); } @Override diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index aeaae876c1..6094ab49e3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -58,7 +58,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme super.initXCreatorProperties(); // 报表块初始化时要加载对应的borderStyle - initBorderAndBackgroundStyle(); + refreshBorderAndBackgroundStylePreviewEffect(); } /** @@ -94,7 +94,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme @Override public void propertyChange() { - initStyle(); + refreshStylePreviewEffect(); } }), new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) @@ -344,7 +344,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme * */ public void firePropertyChange() { - initStyle(); + refreshStylePreviewEffect(); } /** diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java b/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java index d4bd11bbb2..ebd4956601 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java @@ -77,7 +77,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme @Override public void propertyChange() { - initStyle(); + refreshStylePreviewEffect(); } }), new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) @@ -120,7 +120,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme @Override protected void initXCreatorProperties() { super.initXCreatorProperties(); - initBorderAndBackgroundStyle(); + refreshBorderAndBackgroundStylePreviewEffect(); this.initLayoutManager(); this.convert(); } @@ -549,7 +549,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme * */ public void firePropertyChange(){ - initStyle(); + refreshStylePreviewEffect(); } /** diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index aa5612c09f..b00f6710bf 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -78,7 +78,7 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { @Override public void propertyChange() { - initStyle(); + XWAbsoluteBodyLayout.this.refreshStylePreviewEffect(); } }) }; @@ -105,8 +105,8 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { } @Override - protected void initStyle() { - initBorderAndBackgroundStyle(); + public void refreshStylePreviewEffect() { + refreshBorderAndBackgroundStylePreviewEffect(); } /** @@ -114,7 +114,7 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { * */ public void firePropertyChange(){ - initStyle(); + this.refreshStylePreviewEffect(); } @Override diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 74c18a910e..f249a651e1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -305,7 +305,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { } @Override - protected void initStyle() { + public void refreshStylePreviewEffect() { // do nothing } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java index 1628b6cdd2..b2ef84edc6 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java @@ -63,7 +63,7 @@ public class XWTitleLayout extends DedicateLayoutContainer { } @Override - protected void initBorderAndBackgroundStyle() { + public void refreshBorderAndBackgroundStylePreviewEffect() { setBorder(null); setBorderImage4Painting(null, 0.0); setBackground4Painting(null, 0.0); @@ -76,7 +76,7 @@ public class XWTitleLayout extends DedicateLayoutContainer { // 初始化后(如打开旧模版),需要重新调整组件/标题/边框的显示效果 XCreator xCreator = getBodyCreator(); if (xCreator instanceof XBorderStyleWidgetCreator) { - ((XBorderStyleWidgetCreator) xCreator).initStyle(); + ((XBorderStyleWidgetCreator) xCreator).refreshStylePreviewEffect(); } } @@ -237,7 +237,7 @@ public class XWTitleLayout extends DedicateLayoutContainer { } // 刷新时重置下样式 if (bodyCreator != null) { - bodyCreator.initStyle(); + bodyCreator.refreshStylePreviewEffect(); } isRefreshing = false; } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java index 1d564ec6c1..b784187e77 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java @@ -160,7 +160,7 @@ public class XWCardLayout extends XLayoutContainer { */ @Override protected XLayoutContainer getCreatorWrapper(String widgetName) { - initStyle(); + refreshStylePreviewEffect(); Dimension dimension = new Dimension(); //主结构是一个borderlayout, 标签部分是north, card部分为center WCardMainBorderLayout border = new WCardMainBorderLayout(); @@ -389,7 +389,7 @@ public class XWCardLayout extends XLayoutContainer { @Override public void propertyChange() { - initStyle(); + refreshStylePreviewEffect(); } }) }; @@ -397,10 +397,10 @@ public class XWCardLayout extends XLayoutContainer { //初始化样式 @Override - protected void initStyle() { + public void refreshStylePreviewEffect() { BorderPacker style = toData().getBorderStyle(); initBorderTitleStyle(style); - initBorderAndBackgroundStyle(); + refreshBorderAndBackgroundStylePreviewEffect(); clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)); } @@ -479,7 +479,7 @@ public class XWCardLayout extends XLayoutContainer { */ @Override public void firePropertyChange() { - initStyle(); + refreshStylePreviewEffect(); } public void resetTabBackground(TemplateStyle templateStyle) { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index bf660cf5ec..fdc01be1e9 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -405,7 +405,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout { public void firePropertyChange(){ XWCardLayout cardLayout = this.getCardPart(); if (cardLayout != null && cardLayout.toData() != null) { - cardLayout.initStyle(); + cardLayout.refreshStylePreviewEffect(); } }