From b4abd422c9aee5195b9819c94fb8b71019a3521a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 28 Sep 2021 15:42:05 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-59952&REPORT-60057&REPORT-60139=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3pr=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/ui/designer/NewFormPane.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java index c4ac581b5..0771329cd 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java @@ -19,6 +19,7 @@ import com.fr.form.main.Form; import com.fr.form.ui.Widget; import com.fr.form.ui.container.OccupiedLayout; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; +import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WFitLayout; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; @@ -271,15 +272,22 @@ public class NewFormPane extends BasicPane { private void newForm(String path) { BaseJForm jForm; try { - jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, BaseJForm.class); - Form form = (Form) jForm.getTarget(); + Form form = initEmptyBodyForm(); initLayoutInfo(form, path); + jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, new Object[]{form}, BaseJForm.class); DesignerContext.getDesignerFrame().addAndActivateJTemplate((JTemplate) jForm); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } + private Form initEmptyBodyForm() { + WFitLayout body = new WFitLayout(); + WBorderLayout borderLayout = new WBorderLayout("form"); + borderLayout.addCenter(body); + return new Form(borderLayout); + } + /** * 通过布局文件的位置初始化Form对象的布局信息 *