From 568cf34dc65fa13e4efe4d2f2ab8c377732c7827 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 24 Nov 2021 18:37:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-63305=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=88=B6=E5=AE=B9=E5=99=A8=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=AF=B9=E6=8B=93=E5=B1=95=E7=9A=84=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=85=BC=E5=AE=B9=E5=A4=84=E7=90=86=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XCreatorUtils.java | 26 +++++++++++++++++++ .../widget/ui/FormSingleWidgetCardPane.java | 7 ++--- .../designer/component/WidgetBoundPane.java | 10 ++----- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 2f797efa4..6445e001b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -57,6 +57,7 @@ import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTitleLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout; +import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.invoke.Reflect; @@ -68,6 +69,7 @@ import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nonnull; +import java.util.Set; import org.jetbrains.annotations.Nullable; import javax.swing.Icon; @@ -375,4 +377,28 @@ public class XCreatorUtils { return xCreator; } + + public static boolean isExtraContainer(XCreator creator) { + Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() + && ComparatorUtils.equals(provider.appearanceForWidget(), provider.appearanceForWidget()) + && ComparatorUtils.equals(provider.classForWidget(), creator.toData().getClass())) { + return true; + } + } + return false; + } + + public static XLayoutContainer getParent(XCreator source) { + if (source.acceptType(XWCardTagLayout.class) ) { + return (XLayoutContainer)source.getParent(); + } + XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source); + boolean accept = (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) && !isExtraContainer(source); + if (accept) { + container = null; + } + return container; + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java index 1fd1a3527..491b42b2b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java @@ -67,12 +67,9 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { initDefinePane(); } + @Deprecated public XLayoutContainer getParent(XCreator source) { - XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source); - if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) { - container = null; - } - return container; + return XCreatorUtils.getParent(source); } public WidgetBoundPane createWidgetBoundPane(XCreator xCreator) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index aee83889e..f711eb157 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -61,15 +61,9 @@ public class WidgetBoundPane extends BasicPane { initBoundPane(); } + @Deprecated public XLayoutContainer getParent(XCreator source) { - if(source.acceptType(XWCardTagLayout.class)){ - return (XLayoutContainer)source.getParent(); - } - XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source); - if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) { - container = null; - } - return container; + return XCreatorUtils.getParent(source); } public void initBoundPane() { From 8de9339eceaf774fe0f497b6845a82daa8b98762 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 25 Nov 2021 11:37:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CHART-22038=20=E5=86=B3=E7=AD=96=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E5=AE=89=E8=A3=85ECharts=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=9D=97=E6=8F=92=E5=85=A5=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E4=B8=8D=E6=98=BE=E7=A4=BAecharts=E7=9A=84?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormParaWidgetPane.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index 09e02ac67..be752777b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -7,6 +7,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.gui.chart.ChartXMLTag; import com.fr.design.gui.core.FormWidgetOption; @@ -19,6 +20,7 @@ import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.module.DesignModuleFactory; +import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.Widget; @@ -99,6 +101,15 @@ public class FormParaWidgetPane extends JPanel { synchronized (FormParaWidgetPane.class) { THIS = null; } + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template != null && !template.isJWorkBook()) { + DesignerContext.getDesignerFrame().resetToolkitByPlus(template); + } + } + }); } }, new PluginFilter() {