From 5910f0a3e42805e32d85503a183242fdc8860e87 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 18 Sep 2020 17:59:49 +0800 Subject: [PATCH] =?UTF-8?q?MOBILE-29339=20=E4=B8=A4=E4=B8=AA=E6=A8=AA?= =?UTF-8?q?=E5=90=91=E5=B8=83=E5=B1=80=E5=9D=97=E4=B8=AD=E9=97=B4=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=8F=92=E5=85=A5=E6=96=B0=E6=8A=A5=E8=A1=A8=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapters/layout/FRFitLayoutAdapter.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index dfb4d9409..24c3a19db 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -3,6 +3,7 @@ */ package com.fr.design.designer.beans.adapters.layout; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.GroupModel; import com.fr.design.designer.beans.ConstraintsGroupModel; import com.fr.design.designer.beans.HoverPainter; @@ -18,6 +19,7 @@ import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FRFitLayoutConstraints; import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel; +import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.container.WAbsoluteLayout; @@ -32,6 +34,7 @@ import java.awt.Dimension; import java.awt.Rectangle; import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * 自适应布局的容器适配器 @@ -161,7 +164,8 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { //布局控件要先判断是不是可编辑 XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator) comp).getTopLayout(); - if (topLayout != null && !isMatchEdge && !topLayout.isEditable() && !topLayout.acceptType(XWAbsoluteLayout.class)) { + boolean access = topLayout != null && !isMatchEdge && !topLayout.isEditable() && !topLayout.acceptType(XWAbsoluteLayout.class) && !isExtraContainer(comp); + if (access) { return false; } @@ -178,6 +182,18 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { return y > upHeight && y < downHeight ? horizonValid : verticalValid; } + private boolean isExtraContainer(Component comp) { + if (container != null) { + Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), comp.getClass())) { + return true; + } + } + } + return false; + } + // 间隔区域 private boolean checkInterval(Component comp) { return container.getComponentCount() > 0 && comp == container;