From a5279b0a077611e53d73084304b99c3f0173710b Mon Sep 17 00:00:00 2001 From: MoMeak Date: Fri, 15 Dec 2017 17:15:13 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-6048=20[=E8=AE=BE=E8=AE=A1=E5=99=A8]?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E7=94=BB=E5=B8=83=E5=9D=97=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=B8=8D=E8=B7=9F=E9=9A=8F=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/XWAbsoluteLayout.java | 10 ++++------ .../creator/cardlayout/XWCardMainBorderLayout.java | 8 +++++++- .../ui/designer/component/WidgetAbsoluteBoundPane.java | 9 +++++++++ .../widget/ui/designer/component/WidgetBoundPane.java | 1 + 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java index 852cdf1220..8e654b7886 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -171,16 +171,14 @@ public class XWAbsoluteLayout extends XLayoutContainer { tabLayout.updateBoundsWidget(); } } - BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); - Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); } private Rectangle calculateBound(Rectangle rec, double pw, double ph) { Rectangle calRec = new Rectangle(0, 0, 0, 0); - calRec.x = (int) (rec.x / pw); - calRec.y = (int) (rec.y / ph); - calRec.width = (int) (rec.width / pw); - calRec.height = (int) (rec.height / ph); + calRec.x = (int) Math.round(rec.x / pw); + calRec.y = (int) Math.round(rec.y / ph); + calRec.width = (int) Math.round(rec.width / pw); + calRec.height = (int) Math.round(rec.height / ph); return calRec; } diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index 8f60672eca..2e6d82fb3d 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -17,7 +17,6 @@ import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.IOUtils; -import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.general.Inter; import java.awt.*; @@ -274,4 +273,11 @@ public class XWCardMainBorderLayout extends XWBorderLayout{ return this; } } + + /** + * data属性改变触发其他操作 + * + */ + public void firePropertyChange(){ + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index 262e52588a..3b64c4a8e8 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -1,7 +1,11 @@ package com.fr.design.widget.ui.designer.component; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.container.WLayout; import com.fr.general.Inter; @@ -35,6 +39,8 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { @Override public void update() { + FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + formDesigner.getSelectionModel().getSelection().backupBounds(); super.update(); Rectangle bounds = new Rectangle(creator.getBounds()); bounds.x = (int) x.getValue(); @@ -45,6 +51,9 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { WLayout wabs = parent.toData(); wabs.setBounds(creator.toData(), bounds); creator.setBounds(bounds); + LayoutUtils.layoutContainer(creator); + XWAbsoluteLayout layout = (XWAbsoluteLayout) parent; + layout.updateBoundsWidget(creator); } @Override diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index db2f634e93..9ca135f78a 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -81,6 +81,7 @@ public class WidgetBoundPane extends BasicPane { public void fix() { Rectangle bounds = new Rectangle(creator.getBounds()); + creator.setBackupBound(creator.getBounds()); int w = (int) width.getValue(); int h = (int) height.getValue(); Rectangle rec = ComponentUtils.getRelativeBounds(parent);