Browse Source

REPORT-533 表单初始化布局新功能

bugfix 切换之后不等分的问题
master
zhouping 8 years ago
parent
commit
c84934b235
  1. 8
      designer_form/src/com/fr/design/designer/creator/XWFitLayout.java
  2. 7
      designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java

8
designer_form/src/com/fr/design/designer/creator/XWFitLayout.java

@ -21,6 +21,7 @@ import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.PaddingMargin;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WFitLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
import com.fr.general.FRScreen; import com.fr.general.FRScreen;
@ -685,7 +686,10 @@ public class XWFitLayout extends XLayoutContainer {
if (isRefreshing) { if (isRefreshing) {
return; return;
} }
LayoutUtils.layoutContainer(this); //当前的body布局为绝对布局的时候不要doLayout
if (toData().getBodyLayoutType() != WBodyLayoutType.ABSOLUTE){
LayoutUtils.layoutContainer(this);
}
WFitLayout layout = this.toData(); WFitLayout layout = this.toData();
//自适应布局新增控件后,其他控件位置也会变 //自适应布局新增控件后,其他控件位置也会变
XWidgetCreator creator = (XWidgetCreator) e.getChild(); XWidgetCreator creator = (XWidgetCreator) e.getChild();
@ -834,7 +838,7 @@ public class XWFitLayout extends XLayoutContainer {
* 处理自适应布局的directions * 处理自适应布局的directions
* @param xcreator 组件 * @param xcreator 组件
*/ */
private void dealDirections(XCreator xcreator, boolean isInit) { public void dealDirections(XCreator xcreator, boolean isInit) {
if (xcreator == null) { if (xcreator == null) {
return; return;
} }

7
designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java

@ -101,13 +101,13 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight()); xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight());
xfl.remove(xwAbsoluteLayout); xfl.remove(xwAbsoluteLayout);
xfl.toData().setLayoutType(WBodyLayoutType.FIT);
for (Component comp : components) { for (Component comp : components) {
XCreator xCreator = (XCreator)comp; XCreator xCreator = (XCreator)comp;
if (xCreator.shouldScaleCreator()){ if (xCreator.shouldScaleCreator()){
XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight()); XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight());
xfl.add(parentPanel, xCreator.toData().getWidgetName()); xfl.add(parentPanel, xCreator.toData().getWidgetName());
parentPanel.updateChildBound(xfl.getActualMinHeight());
continue; continue;
} }
xfl.add(xCreator); xfl.add(xCreator);
@ -116,9 +116,6 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
moveComponents2FitLayout(xfl); moveComponents2FitLayout(xfl);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreator(xfl); formDesigner.getSelectionModel().setSelectedCreator(xfl);
xfl.convert();
LayoutUtils.layoutContainer(xfl);
xfl.adjustCreatorsWhileSlide(xfl.getContainerPercent() - 1.0);
for (int i = 0; i < components.length; i++) { for (int i = 0; i < components.length; i++) {
Component comp = xfl.getComponent(i); Component comp = xfl.getComponent(i);
@ -133,6 +130,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
xfl.toData().setCompInterval(compInterval); xfl.toData().setCompInterval(compInterval);
xfl.addCompInterval(xfl.getAcualInterval()); xfl.addCompInterval(xfl.getAcualInterval());
} }
xfl.toData().setLayoutType(WBodyLayoutType.FIT);
return true; return true;
} }
} }
@ -212,6 +210,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
((XWCardMainBorderLayout)components[i]).recalculateChildWidth(components[i].getWidth()); ((XWCardMainBorderLayout)components[i]).recalculateChildWidth(components[i].getWidth());
((XWCardMainBorderLayout)components[i]).recalculateChildHeight(components[i].getHeight()); ((XWCardMainBorderLayout)components[i]).recalculateChildHeight(components[i].getHeight());
} }
xwFitLayout.dealDirections((XCreator)components[i], false);
} }
xwFitLayout.updateBoundsWidget(); xwFitLayout.updateBoundsWidget();
} }

Loading…
Cancel
Save