Browse Source

REPORT-22806 模板自适应下块还是有叠盖 转专人服务-Winnie

bugfix/10.0
kerry 5 years ago
parent
commit
ce10940140
  1. 9
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
  2. 24
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java
  3. 5
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  4. 5
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java

9
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java

@ -38,7 +38,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
public HoverPainter getPainter() {
return painter;
}
/**
* 是否能在指定位置添加组件
* @param creator 组件
@ -240,7 +240,8 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
updateCreatorBackBound();
LayoutUtils.layoutRootContainer(container);
}else{
fixAbsolute(creator, x, y);
//添加到其父组件布局中的时候,要用其父组件布局添加
container.getLayoutAdapter().addBean(creator, x, y);
if (creator.shouldScaleCreator() || creator.hasTitleStyle()) {
addParentCreator(creator);
} else {
@ -303,7 +304,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
XWAbsoluteLayout layout = (XWAbsoluteLayout) container;
layout.updateBoundsWidget(creator);
}
/**
* 调整组件大小到合适尺寸位置
* @param creator 组件
@ -338,4 +339,4 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
XWAbsoluteLayout xwAbsoluteLayout = (XWAbsoluteLayout) container;
return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout);
}
}
}

24
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java

@ -593,26 +593,26 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter {
switch (position) {
case COMP_TOP:
dim.width = maxWidth;
dim.height = maxHeight / 2;
finalY = yL + dim.height;
finalH = maxHeight - dim.height;
dim.height = maxHeight / 2 - actualVal / 2;
finalY = yL + dim.height + actualVal;
finalH = maxHeight - dim.height - actualVal;
break;
case COMP_BOTTOM:
dim.height = maxHeight / 2;
dim.height = maxHeight / 2 - actualVal / 2;
dim.width = maxWidth;
finalH = maxHeight - dim.height;
yL = yL + finalH;
finalH = maxHeight - dim.height - actualVal;
yL = yL + finalH + actualVal;
break;
case COMP_LEFT:
dim.width = maxWidth / 2;
dim.width = maxWidth / 2 - actualVal / 2;
dim.height = maxHeight;
finalX = xL + dim.width;
finalW = maxWidth - dim.width;
finalX = xL + dim.width + actualVal;
finalW = maxWidth - dim.width - actualVal;
break;
default:
finalW = maxWidth / 2;
xL = xL + finalW;
dim.width = maxWidth - finalW;
finalW = maxWidth / 2 - actualVal / 2;
xL = xL + finalW + actualVal;
dim.width = maxWidth - finalW - actualVal;
dim.height = maxHeight;
}
if (isCalculateChildPos) {

5
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -10,6 +10,7 @@ import com.fr.design.designer.beans.painters.FRFitLayoutPainter;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.cardlayout.XWCardLayout;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
@ -150,7 +151,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
//布局控件要先判断是不是可编辑
XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator) comp).getTopLayout();
if (topLayout != null && !isMatchEdge && !topLayout.isEditable()) {
if (topLayout != null && !isMatchEdge && !topLayout.isEditable() && !topLayout.acceptType(XWAbsoluteLayout.class)) {
return false;
}
@ -1221,4 +1222,4 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
public ConstraintsGroupModel getLayoutConstraints(XCreator creator) {
return new FRFitLayoutConstraints((XWFitLayout) container, creator);
}
}
}

5
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java

@ -74,7 +74,8 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter {
XWTabFitLayout tabLayout = (XWTabFitLayout) backUpContainer;
y = adjustY(y, tabLayout);
}
addComp(creator, x, y);
//这时候应该要用计算后的父fit布局添加
this.container.getLayoutAdapter().addBean(creator, x, y);
((XWidgetCreator) creator).recalculateChildrenSize();
return true;
}
@ -102,4 +103,4 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter {
return ComponentUtils.getRelativeBounds(mainLayout);
}
}
}

Loading…
Cancel
Save