|
|
|
@ -5,6 +5,7 @@ import com.fr.common.inputevent.InputEventBaseOnOS;
|
|
|
|
|
import com.fr.design.designer.beans.events.DesignerEditListener; |
|
|
|
|
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; |
|
|
|
@ -428,7 +429,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
|
|
|
|
|
if (root.acceptType(XWFitLayout.class)) { |
|
|
|
|
XWFitLayout layout = (XWFitLayout) root; |
|
|
|
|
layout.setContainerPercent(value / DEFAULT_SLIDER); |
|
|
|
|
traverAndAdjust(layout, percent); |
|
|
|
|
XCreatorUtils.traverAndAdjust(layout, percent); |
|
|
|
|
layout.adjustCreatorsWhileSlide(percent); |
|
|
|
|
|
|
|
|
|
// 拖动滑块,先将内部组件百分比大小计算,再计算容器大小
|
|
|
|
@ -464,7 +465,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
|
|
|
|
|
if (root.acceptType(XWFitLayout.class)) { |
|
|
|
|
XWFitLayout layout = (XWFitLayout) root; |
|
|
|
|
layout.setContainerPercent(1.0); |
|
|
|
|
traverAndAdjust(layout, 0.0); |
|
|
|
|
XCreatorUtils.traverAndAdjust(layout, 0.0); |
|
|
|
|
layout.adjustCreatorsWhileSlide(0.0); |
|
|
|
|
// 拖动滑块,先将内部组件百分比大小计算,再计算容器大小
|
|
|
|
|
|
|
|
|
@ -487,19 +488,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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 增加刻度条 |
|
|
|
|
*/ |
|
|
|
|