Browse Source

Merge pull request #1255 in DESIGN/design from ~KERRY/design_10.0:bugfix/10.0 to bugfix/10.0

* commit 'ce109401409f58408962371e4f7e9cc85003dfcf':
  REPORT-22806	 模板自适应下块还是有叠盖 转专人服务-Winnie
bugfix/10.0
kerry 5 years ago
parent
commit
163a18140f
  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() { public HoverPainter getPainter() {
return painter; return painter;
} }
/** /**
* 是否能在指定位置添加组件 * 是否能在指定位置添加组件
* @param creator 组件 * @param creator 组件
@ -240,7 +240,8 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
updateCreatorBackBound(); updateCreatorBackBound();
LayoutUtils.layoutRootContainer(container); LayoutUtils.layoutRootContainer(container);
}else{ }else{
fixAbsolute(creator, x, y); //添加到其父组件布局中的时候,要用其父组件布局添加
container.getLayoutAdapter().addBean(creator, x, y);
if (creator.shouldScaleCreator() || creator.hasTitleStyle()) { if (creator.shouldScaleCreator() || creator.hasTitleStyle()) {
addParentCreator(creator); addParentCreator(creator);
} else { } else {
@ -303,7 +304,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
XWAbsoluteLayout layout = (XWAbsoluteLayout) container; XWAbsoluteLayout layout = (XWAbsoluteLayout) container;
layout.updateBoundsWidget(creator); layout.updateBoundsWidget(creator);
} }
/** /**
* 调整组件大小到合适尺寸位置 * 调整组件大小到合适尺寸位置
* @param creator 组件 * @param creator 组件
@ -338,4 +339,4 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
XWAbsoluteLayout xwAbsoluteLayout = (XWAbsoluteLayout) container; XWAbsoluteLayout xwAbsoluteLayout = (XWAbsoluteLayout) container;
return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout); 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) { switch (position) {
case COMP_TOP: case COMP_TOP:
dim.width = maxWidth; dim.width = maxWidth;
dim.height = maxHeight / 2; dim.height = maxHeight / 2 - actualVal / 2;
finalY = yL + dim.height; finalY = yL + dim.height + actualVal;
finalH = maxHeight - dim.height; finalH = maxHeight - dim.height - actualVal;
break; break;
case COMP_BOTTOM: case COMP_BOTTOM:
dim.height = maxHeight / 2; dim.height = maxHeight / 2 - actualVal / 2;
dim.width = maxWidth; dim.width = maxWidth;
finalH = maxHeight - dim.height; finalH = maxHeight - dim.height - actualVal;
yL = yL + finalH; yL = yL + finalH + actualVal;
break; break;
case COMP_LEFT: case COMP_LEFT:
dim.width = maxWidth / 2; dim.width = maxWidth / 2 - actualVal / 2;
dim.height = maxHeight; dim.height = maxHeight;
finalX = xL + dim.width; finalX = xL + dim.width + actualVal;
finalW = maxWidth - dim.width; finalW = maxWidth - dim.width - actualVal;
break; break;
default: default:
finalW = maxWidth / 2; finalW = maxWidth / 2 - actualVal / 2;
xL = xL + finalW; xL = xL + finalW + actualVal;
dim.width = maxWidth - finalW; dim.width = maxWidth - finalW - actualVal;
dim.height = maxHeight; dim.height = maxHeight;
} }
if (isCalculateChildPos) { 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.XCreator;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer; 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.XWFitLayout;
import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
@ -150,7 +151,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
//布局控件要先判断是不是可编辑 //布局控件要先判断是不是可编辑
XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer((XCreator) comp).getTopLayout(); 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; return false;
} }
@ -1221,4 +1222,4 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
public ConstraintsGroupModel getLayoutConstraints(XCreator creator) { public ConstraintsGroupModel getLayoutConstraints(XCreator creator) {
return new FRFitLayoutConstraints((XWFitLayout) container, 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; XWTabFitLayout tabLayout = (XWTabFitLayout) backUpContainer;
y = adjustY(y, tabLayout); y = adjustY(y, tabLayout);
} }
addComp(creator, x, y); //这时候应该要用计算后的父fit布局添加
this.container.getLayoutAdapter().addBean(creator, x, y);
((XWidgetCreator) creator).recalculateChildrenSize(); ((XWidgetCreator) creator).recalculateChildrenSize();
return true; return true;
} }
@ -102,4 +103,4 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter {
return ComponentUtils.getRelativeBounds(mainLayout); return ComponentUtils.getRelativeBounds(mainLayout);
} }
} }

Loading…
Cancel
Save