|
|
|
@ -4,6 +4,7 @@ import com.fr.design.actions.UpdateAction;
|
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.designer.beans.events.DesignerEvent; |
|
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
|
import com.fr.design.designer.creator.XCreatorUtils; |
|
|
|
|
import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
|
import com.fr.design.designer.creator.XWBorderLayout; |
|
|
|
|
import com.fr.design.designer.creator.XWFitLayout; |
|
|
|
@ -447,7 +448,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
|
|
|
|
|
XLayoutContainer root = FormArea.this.designer.getRootComponent(); |
|
|
|
|
if (root.acceptType(XWFitLayout.class)) { |
|
|
|
|
XWFitLayout layout = (XWFitLayout) root; |
|
|
|
|
traverAndAdjust(layout, 0.0); |
|
|
|
|
XCreatorUtils.traverAndAdjust(layout); |
|
|
|
|
layout.adjustCreatorsWhileSlide(0.0); |
|
|
|
|
// 拖动滑块,先将内部组件百分比大小计算,再计算容器大小
|
|
|
|
|
Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); |
|
|
|
@ -469,19 +470,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//循环遍历布局,按百分比调整子组件大小
|
|
|
|
|
private void traverAndAdjust(XCreator creator, double percent) { |
|
|
|
|
for (int i = 0; i < creator.getComponentCount(); i++) { |
|
|
|
|
Object object = creator.getComponent(i); |
|
|
|
|
if (object instanceof XCreator) { |
|
|
|
|
XCreator temp = (XCreator) object; |
|
|
|
|
temp.adjustCompSize(percent); |
|
|
|
|
traverAndAdjust(temp, percent); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 增加刻度条 |
|
|
|
|
*/ |
|
|
|
|