|
|
@ -722,7 +722,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
protected void delete(XCreator creator, int creatorWidth, int creatorHeight) { |
|
|
|
protected void delete(XCreator creator, int creatorWidth, int creatorHeight) { |
|
|
|
int x = creator.getX(); |
|
|
|
int x = creator.getX(); |
|
|
|
int y = creator.getY(); |
|
|
|
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 删除的组件之前所在布局的高度 |
|
|
|
* @param creatorHeight 删除的组件之前所在布局的高度 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void recalculateChildrenSize(int x, int y, int creatorWidth, int 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) { |
|
|
|
if (container.getComponentCount() == 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -744,11 +757,11 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
if (!rightComps.isEmpty() && getAllHeight(rightComps) == height) { |
|
|
|
if (!rightComps.isEmpty() && getAllHeight(rightComps) == height) { |
|
|
|
calculateRightRelatComponent(x, width + actualVal); |
|
|
|
calculateRightRelatComponent(x, width + actualVal); |
|
|
|
} else if (!leftComps.isEmpty() && getAllHeight(leftComps) == height) { |
|
|
|
} else if (!leftComps.isEmpty() && getAllHeight(leftComps) == height) { |
|
|
|
calculateLefttRelatComponent(width + actualVal); |
|
|
|
calculateLefttRelatComponent(width + actualVal, isDel); |
|
|
|
} else if (!downComps.isEmpty() && getAllWidth(downComps) == width) { |
|
|
|
} else if (!downComps.isEmpty() && getAllWidth(downComps) == width) { |
|
|
|
calculateDownRelatComponent(y, height + actualVal); |
|
|
|
calculateDownRelatComponent(y, height + actualVal); |
|
|
|
} else if (!upComps.isEmpty() && getAllWidth(upComps) == width) { |
|
|
|
} else if (!upComps.isEmpty() && getAllWidth(upComps) == width) { |
|
|
|
calculateUpRelatComponent(height + actualVal); |
|
|
|
calculateUpRelatComponent(height + actualVal, isDel); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 由于布局三等分的存在,可能会出现删除组件时,找不到关联的组件填充,此时特殊处理
|
|
|
|
// 由于布局三等分的存在,可能会出现删除组件时,找不到关联的组件填充,此时特殊处理
|
|
|
|
calculateNoRelatedComponent(x, y, width, height); |
|
|
|
calculateNoRelatedComponent(x, y, width, height); |
|
|
@ -823,7 +836,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
return; |
|
|
|
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) { |
|
|
|
private void calculateNoRelatedWhileRightBott(Rectangle bound, Component rcomp) { |
|
|
@ -858,7 +871,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height); |
|
|
|
recalculateChildrenSize(bound.x, bound.y, bound.width, bound.height, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int getMinWidth(List<Component> comps) { |
|
|
|
private int getMinWidth(List<Component> comps) { |
|
|
@ -1095,7 +1108,11 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
* 删除或拉伸控件左边框时 调整左侧的组件位置大小; |
|
|
|
* 删除或拉伸控件左边框时 调整左侧的组件位置大小; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected boolean calculateLefttRelatComponent(int objWidth) { |
|
|
|
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; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
int count = leftComps.size(); |
|
|
|
int count = leftComps.size(); |
|
|
@ -1153,7 +1170,11 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { |
|
|
|
* 删除或拉伸上边框 调整上方的组件位置大小 |
|
|
|
* 删除或拉伸上边框 调整上方的组件位置大小 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected boolean calculateUpRelatComponent(int objHeight) { |
|
|
|
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; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
int count = upComps.size(); |
|
|
|
int count = upComps.size(); |
|
|
|