From d2730c56f7790ce1ea070d739d13e4dfcf9aebc3 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 27 Feb 2017 10:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E4=BB=BB=E5=8A=A1=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/adapters/layout/FRBodyLayoutAdapter.java | 6 +++--- .../adapters/layout/FRTabFitLayoutAdapter.java | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java index 8db19d9fb..b3072667b 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyLayoutAdapter.java @@ -6,6 +6,7 @@ import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.PaddingMargin; +import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.ComparatorUtils; @@ -639,9 +640,8 @@ public class FRBodyLayoutAdapter extends AbstractLayoutAdapter { * 又通过ComponentUtils.getRelativeBounds()方法获取到了绝对坐标, * 再次计算相对坐标,所以将y值重新变成绝对坐标。 * */ - if (currentCreator.getParent().getParent().getComponent(0) instanceof XWParameterLayout) { - int high = currentCreator.getParent().getParent().getComponent(0).getHeight(); - y = y + WCardMainBorderLayout.TAB_HEIGHT + high; + if (currentCreator.getBackupParent().getLocation().y == WBorderLayout.DEFAULT_SIZE) { + y = y + WCardMainBorderLayout.TAB_HEIGHT + WBorderLayout.DEFAULT_SIZE; } else { y = y + WCardMainBorderLayout.TAB_HEIGHT; } diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java index f0ccc3eb8..63a70e1bb 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java @@ -15,6 +15,7 @@ import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FRTabFitLayoutPropertiesGroupModel; import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.LayoutBorderStyle; +import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.ComparatorUtils; @@ -92,16 +93,16 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter { private int adjustY(int y, XWTabFitLayout tabLayout) { XWCardLayout cardLayout = (XWCardLayout) tabLayout.getBackupParent(); LayoutBorderStyle style = cardLayout.toData().getBorderStyle(); - if (container.getParent().getComponent(0) instanceof XWParameterLayout) { - y = y - container.getParent().getComponent(0).getHeight() - container.getParent().getComponent(0).getY(); + if (container.getLocation().y == WBorderLayout.DEFAULT_SIZE) { + y = y - WBorderLayout.DEFAULT_SIZE; } if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { - y -= WCardMainBorderLayout.TAB_HEIGHT; + y = y - WCardMainBorderLayout.TAB_HEIGHT; } return y; } - protected Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout){ - return ComponentUtils.getRelativeBounds(mainLayout); - } + protected Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout) { + return ComponentUtils.getRelativeBounds(mainLayout); + } } \ No newline at end of file