|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.fr.design.fit.common; |
|
|
|
package com.fr.design.fit.common; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.data.DesignTableDataManager; |
|
|
|
import com.fr.design.data.DesignTableDataManager; |
|
|
|
|
|
|
|
import com.fr.design.designer.creator.XCreatorUtils; |
|
|
|
import com.fr.design.fit.NewJForm; |
|
|
|
import com.fr.design.fit.NewJForm; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
@ -11,6 +12,7 @@ import com.fr.file.MemFILE; |
|
|
|
import com.fr.form.fit.NewFormMarkAttr; |
|
|
|
import com.fr.form.fit.NewFormMarkAttr; |
|
|
|
import com.fr.form.main.Form; |
|
|
|
import com.fr.form.main.Form; |
|
|
|
import com.fr.form.main.WidgetGather; |
|
|
|
import com.fr.form.main.WidgetGather; |
|
|
|
|
|
|
|
import com.fr.form.ui.ElementCaseEditor; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.container.WAbsoluteBodyLayout; |
|
|
|
import com.fr.form.ui.container.WAbsoluteBodyLayout; |
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout; |
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout; |
|
|
@ -94,15 +96,36 @@ public class AdaptiveSwitchUtil { |
|
|
|
} |
|
|
|
} |
|
|
|
//如果是从旧的设计模板转化为新的设计模式,并且不是全局配置的模板。则更新新模板的Pc端自适应属性
|
|
|
|
//如果是从旧的设计模板转化为新的设计模式,并且不是全局配置的模板。则更新新模板的Pc端自适应属性
|
|
|
|
if (newJForm.getTarget().getReportFitAttr() != null && newJForm.isNewJFrom()) { |
|
|
|
if (newJForm.getTarget().getReportFitAttr() != null && newJForm.isNewJFrom()) { |
|
|
|
|
|
|
|
//兼容处理老模式下报表块自适应属性设置为跟随报表整体自适应
|
|
|
|
|
|
|
|
compatibleProcessECReportFitAttr(newJForm.getTarget()); |
|
|
|
//修改自适应属性
|
|
|
|
//修改自适应属性
|
|
|
|
newJForm.getTarget().setReportFitAttr(shiftReportFitAttr(oldForm, newJForm.getTarget().getReportFitAttr().isFitFont())); |
|
|
|
newJForm.getTarget().setReportFitAttr(shiftReportFitAttr(oldForm, newJForm.getTarget().getReportFitAttr().isFitFont())); |
|
|
|
//修改绝对布局中的缩放属性
|
|
|
|
//修改绝对布局中的缩放属性
|
|
|
|
processAbsoluteLayoutCompatible(newJForm.getTarget()); |
|
|
|
processAbsoluteLayoutCompatible(newJForm.getTarget()); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
TemplateTool.saveForm(newJForm); |
|
|
|
TemplateTool.saveForm(newJForm); |
|
|
|
return newJForm; |
|
|
|
return newJForm; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void compatibleProcessECReportFitAttr(Form form) { |
|
|
|
|
|
|
|
Form.traversalWidget(form.getContainer(), new WidgetGather() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void dealWith(Widget widget) { |
|
|
|
|
|
|
|
ElementCaseEditor editor = (ElementCaseEditor) widget; |
|
|
|
|
|
|
|
ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, form); |
|
|
|
|
|
|
|
if (reportFitAttr.fitStateInPC() != 0) { |
|
|
|
|
|
|
|
editor.setReportFitAttr(reportFitAttr); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean dealWithAllCards() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, ElementCaseEditor.class); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void processAbsoluteLayoutCompatible(Form form) { |
|
|
|
private static void processAbsoluteLayoutCompatible(Form form) { |
|
|
|
Form.traversalWidget(form.getContainer(), new WidgetGather() { |
|
|
|
Form.traversalWidget(form.getContainer(), new WidgetGather() { |
|
|
|