diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 2d7180bba1..39c7f1a720 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -380,9 +380,9 @@ public class FormArea extends JComponent implements ScrollRulerComponent { Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); XWBorderLayout parent = (XWBorderLayout) layout.getParent(); root.setScale(scale); - parent.setScale(scale); // 自适应布局的父层是border - if (layout.getParent() != null) { + if (parent != null) { + parent.setScale(scale); int paraHeight = parent.toData().getNorthSize(); XLayoutContainer paraComponent = designer.getParaComponent(); if (needCalculateParaHeight && paraComponent != null) { @@ -395,7 +395,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { parent.add(root, WBorderLayout.CENTER); root.setBounds(0, this.designer.getParaHeight(), d.width, d.height); } - layout.getParent().setSize(d.width, d.height + this.designer.getParaHeight()); + parent.setSize(d.width, d.height + this.designer.getParaHeight()); // 调整自适应布局大小后,同步调整参数界面和border大小,此时刷新下formArea FormArea.this.validate(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index e1f7f882ad..80898f592d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -75,6 +75,9 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { super.populate(); WLayout wabs = parent.toData(); CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + if (boundsWidget == null){ + return; + } Rectangle bounds = boundsWidget.getBounds(); x.setValue(bounds.x); y.setValue(bounds.y); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index 6b538d14fe..d76c2f891e 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -80,6 +80,9 @@ public class WidgetBoundPane extends BasicPane { public void populate() { WLayout wabs = parent.toData(); CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + if (boundsWidget == null){ + return; + } Rectangle bounds = new Rectangle(boundsWidget.getBounds()); width.setValue(bounds.width); height.setValue(bounds.height);