Browse Source

MOBILE-29339 两个横向布局块中间无法插入新报表块

feature/big-screen
hades 4 years ago
parent
commit
5910f0a3e4
  1. 18
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

18
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<FormWidgetOptionProvider> 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;

Loading…
Cancel
Save