|
|
|
@ -8,12 +8,12 @@ import com.fr.design.designer.beans.LayoutAdapter;
|
|
|
|
|
import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter; |
|
|
|
|
import com.fr.design.designer.beans.events.DesignerEditListener; |
|
|
|
|
import com.fr.design.designer.beans.events.DesignerEvent; |
|
|
|
|
import com.fr.design.designer.creator.*; |
|
|
|
|
import com.fr.design.fit.common.AdaptiveSwitchUtil; |
|
|
|
|
import com.fr.design.fit.common.LayoutTool; |
|
|
|
|
import com.fr.form.fit.NewFormMarkAttr; |
|
|
|
|
import com.fr.design.fit.common.TemplateTool; |
|
|
|
|
import com.fr.design.actions.NewFormMobileAttrAction; |
|
|
|
|
import com.fr.design.designer.creator.XComponent; |
|
|
|
|
import com.fr.design.designer.creator.XCreatorUtils; |
|
|
|
|
import com.fr.design.designer.creator.XElementCase; |
|
|
|
|
import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
|
import com.fr.design.designer.creator.XWTitleLayout; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.preview.DeveloperPreview; |
|
|
|
|
import com.fr.design.preview.FormAdaptivePreview; |
|
|
|
@ -29,7 +29,6 @@ import com.fr.design.utils.ComponentUtils;
|
|
|
|
|
import com.fr.file.FILE; |
|
|
|
|
import com.fr.form.FormElementCaseProvider; |
|
|
|
|
import com.fr.form.main.Form; |
|
|
|
|
import com.fr.form.main.mobile.FormMobileAttr; |
|
|
|
|
import com.fr.form.ui.ElementCaseEditor; |
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
|
|
|
|
@ -49,13 +48,11 @@ public class NewJForm extends JForm {
|
|
|
|
|
public NewJForm() { |
|
|
|
|
super(); |
|
|
|
|
init(); |
|
|
|
|
changePaneSize(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public NewJForm(Form form) { |
|
|
|
|
super(form); |
|
|
|
|
init(); |
|
|
|
|
changePaneSize(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public NewJForm(Form form, FILE file, Parameter[] parameters) { |
|
|
|
@ -67,48 +64,6 @@ public class NewJForm extends JForm {
|
|
|
|
|
if (DesignerUIModeConfig.getInstance().newUIMode()) { |
|
|
|
|
init(); |
|
|
|
|
} |
|
|
|
|
changePaneSize(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Description:改变body的大小,主要针对新模式下打开老模板出现截断的情况 |
|
|
|
|
* @param |
|
|
|
|
* @return: |
|
|
|
|
* @Author: Henry.Wang |
|
|
|
|
* @date: 2020/9/13 23:23 |
|
|
|
|
*/ |
|
|
|
|
private void changePaneSize() { |
|
|
|
|
NewFormMarkAttr newFormMarkAttr = this.getTarget().getAttrMark(NewFormMarkAttr.XML_TAG); |
|
|
|
|
if (newFormMarkAttr.isNotSetOriginSize()) { |
|
|
|
|
newFormMarkAttr.setBodyHeight(LayoutTool.getBodyHeight(this)); |
|
|
|
|
newFormMarkAttr.setBodyWidth(LayoutTool.getBodyWidth(this)); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//这种是针对body为绝对布局时,可能出现截断的情况
|
|
|
|
|
if (LayoutTool.absoluteLayoutForm(this)) { |
|
|
|
|
int bodyHeight = newFormMarkAttr.getBodyHeight(); |
|
|
|
|
int bodyWidth = newFormMarkAttr.getBodyWidth(); |
|
|
|
|
Rectangle rectangle = LayoutTool.getAbsoluteBodySize(this); |
|
|
|
|
if (!isNewJFrom() && (rectangle.width != bodyWidth || rectangle.height != bodyHeight)) { |
|
|
|
|
TemplateTool.onlyChangeAbsoluteBodySize(bodyHeight, bodyWidth, this); |
|
|
|
|
} else if (isNewJFrom()) { |
|
|
|
|
if (rectangle.width > bodyWidth && rectangle.height > bodyHeight) { |
|
|
|
|
TemplateTool.onlyChangeAbsoluteBodySize(rectangle.height, rectangle.width, this); |
|
|
|
|
} else if (rectangle.width > bodyWidth) { |
|
|
|
|
TemplateTool.onlyChangeAbsoluteBodySize(bodyHeight, rectangle.width, this); |
|
|
|
|
} else if (rectangle.height > bodyHeight) { |
|
|
|
|
TemplateTool.onlyChangeAbsoluteBodySize(rectangle.height, bodyWidth, this); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (AdaptiveSwitchUtil.isSwitchJFromIng()) { |
|
|
|
|
//这种是针对body中有绝对画布块,导致截断的情况
|
|
|
|
|
double scale = LayoutTool.getContainerPercent(); |
|
|
|
|
if (isNewJFrom()) { |
|
|
|
|
LayoutTool.scaleAbsoluteBlockComponentsBounds(this.getFormDesign().getRootComponent(), 1 / scale); |
|
|
|
|
} else { |
|
|
|
|
LayoutTool.scaleAbsoluteBlockComponentsBounds(this.getFormDesign().getRootComponent(), scale); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JFormType getJFormType() { |
|
|
|
@ -270,14 +225,6 @@ public class NewJForm extends JForm {
|
|
|
|
|
return new PreviewProvider[]{new FormPreview(), new MobilePreview()}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean mobileForm() { |
|
|
|
|
FormMobileAttr mobileAttr = this.getTarget().getFormMobileAttr(); |
|
|
|
|
if (mobileAttr.isMobileOnly() && mobileAttr.isAdaptivePropertyAutoMatch()) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private SwitchAction switchAction; |
|
|
|
|
|
|
|
|
|
public UIButton[] createExtraButtons() { |
|
|
|
|