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