Browse Source

Pull request #4236: REPORT-51188 决策报表的tab块,在绝对布局下拖拽存在缩小问题

Merge in DESIGN/design from ~KERRY/design_10.0:bugfix/10.0 to bugfix/10.0

* commit 'c99f38a8692cf88f624828a7707b989ff6892aaf':
  代码修改
  REPORT-51188 决策报表的tab块,在绝对布局下拖拽存在缩小问题
bugfix/10.0
kerry 4 years ago
parent
commit
8f5e86ec26
  1. 2
      designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java
  2. 22
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

2
designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java

@ -121,7 +121,7 @@ public class XWFitLayout extends XLayoutContainer {
* 更新组件的backupBound
* 拖动滑块改变容器大小改变的是界面显示大小更新bound再次拖入或拉伸边框用到
*/
private void updateCreatorsBackupBound() {
public void updateCreatorsBackupBound() {
for (int i=0,size=this.getComponentCount(); i<size; i++) {
Component comp = this.getComponent(i);
XCreator creator = (XCreator) comp;

22
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -36,6 +36,7 @@ import javax.swing.event.ChangeListener;
import java.awt.AWTEvent;
import java.awt.Adjustable;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Insets;
@ -268,8 +269,26 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
}
}
LayoutUtils.layoutContainer(root);
updateCreatorsBackupBound(root);
}
/**
* 给所有自适应布局内部的组件设置backupBounds
* @param creator
*/
private void updateCreatorsBackupBound(XCreator creator) {
if (creator.acceptType(XWFitLayout.class)) {
((XWFitLayout) creator).updateCreatorsBackupBound();
}
for (int i = 0; i < creator.getComponentCount(); i++) {
Component object = creator.getComponent(i);
if(object instanceof XCreator){
updateCreatorsBackupBound((XCreator) object);
}
}
}
//设置宽度的控件及响应事件
private void addWidthPaneListener() {
widthPane.addActionListener(
@ -411,8 +430,8 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
if (root.acceptType(XWFitLayout.class)) {
XWFitLayout layout = (XWFitLayout) root;
layout.setContainerPercent(value / DEFAULT_SLIDER);
layout.adjustCreatorsWhileSlide(percent);
traverAndAdjust(layout, percent);
layout.adjustCreatorsWhileSlide(percent);
// 拖动滑块,先将内部组件百分比大小计算,再计算容器大小
@ -449,7 +468,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
layout.setContainerPercent(1.0);
traverAndAdjust(layout, 0.0);
layout.adjustCreatorsWhileSlide(0.0);
// 拖动滑块,先将内部组件百分比大小计算,再计算容器大小
Dimension d = new Dimension(layout.getWidth(), layout.getHeight());

Loading…
Cancel
Save