diff --git a/designer_base/src/com/fr/design/dialog/InformationWarnPane.java b/designer_base/src/com/fr/design/dialog/InformationWarnPane.java index e5dd4fd9fb..eeb809cf28 100644 --- a/designer_base/src/com/fr/design/dialog/InformationWarnPane.java +++ b/designer_base/src/com/fr/design/dialog/InformationWarnPane.java @@ -143,7 +143,6 @@ public class InformationWarnPane extends JPanel{ contentPane.add(InformationWarnPane.this); contentPane.add(this.createControlButtonPane()); this.setModal(true); - this.pack(); GUICoreUtils.centerWindow(this); } diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index 3a030f7f2b..c293042927 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -722,7 +722,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { protected void delete(XCreator creator, int creatorWidth, int creatorHeight) { int x = creator.getX(); int y = creator.getY(); - recalculateChildrenSize(x, y, creatorWidth, creatorHeight); + recalculateChildrenSize(x, y, creatorWidth, creatorHeight, true); } /** @@ -734,6 +734,19 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { * @param creatorHeight 删除的组件之前所在布局的高度 */ public void recalculateChildrenSize(int x, int y, int creatorWidth, int creatorHeight) { + recalculateChildrenSize(x, y, creatorWidth, creatorHeight, false); + } + + /** + * 重新计算内部组件大小 + * + * @param x 坐标x + * @param y 坐标y + * @param creatorWidth 删除的组件之前所在布局的宽度 + * @param creatorHeight 删除的组件之前所在布局的高度 + * @param isDel 删除操作 + */ + public void recalculateChildrenSize(int x, int y, int creatorWidth, int creatorHeight, boolean isDel) { if (container.getComponentCount() == 0) { return; } else { @@ -744,11 +757,11 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { if (!rightComps.isEmpty() && getAllHeight(rightComps) == height) { calculateRightRelatComponent(x, width + actualVal); } else if (!leftComps.isEmpty() && getAllHeight(leftComps) == height) { - calculateLefttRelatComponent(width + actualVal); + calculateLefttRelatComponent(width + actualVal, isDel); } else if (!downComps.isEmpty() && getAllWidth(downComps) == width) { calculateDownRelatComponent(y, height + actualVal); } else if (!upComps.isEmpty() && getAllWidth(upComps) == width) { - calculateUpRelatComponent(height + actualVal); + calculateUpRelatComponent(height + actualVal, isDel); } else { // 由于布局三等分的存在,可能会出现删除组件时,找不到关联的组件填充,此时特殊处理 calculateNoRelatedComponent(x, y, width, height); @@ -823,7 +836,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { return; } } - recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); + recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height, true); } private void calculateNoRelatedWhileRightBott(Rectangle bound, Component rcomp) { @@ -858,7 +871,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { return; } } - recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); + recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height, true); } private int getMinWidth(List comps) { @@ -1095,7 +1108,11 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { * 删除或拉伸控件左边框时 调整左侧的组件位置大小; */ protected boolean calculateLefttRelatComponent(int objWidth) { - if (isBeyondAdjustWidthScope(objWidth)) { + return calculateLefttRelatComponent(objWidth, false); + } + + protected boolean calculateLefttRelatComponent(int objWidth, boolean isDel) { + if (!isDel && isBeyondAdjustWidthScope(objWidth)) { return false; } int count = leftComps.size(); @@ -1153,7 +1170,11 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { * 删除或拉伸上边框 调整上方的组件位置大小 */ protected boolean calculateUpRelatComponent(int objHeight) { - if (isBeyondAdjustHeightScope(objHeight)) { + return calculateUpRelatComponent(objHeight, false); + } + + protected boolean calculateUpRelatComponent(int objHeight, boolean isDel) { + if (!isDel && isBeyondAdjustHeightScope(objHeight)) { return false; } int count = upComps.size();