Browse Source

REPORT-32317 cpt滚动条缩放问题

在更改了界面的比例后,增加更新滚动条的宽度的逻辑
feature/big-screen
Yvan 4 years ago
parent
commit
cc5e5d9587
  1. 11
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java

11
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -1206,4 +1206,15 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
super.whenClose(); super.whenClose();
reportComposite.doRemoveAction(); reportComposite.doRemoveAction();
} }
/**
* 更新滚动条的值(主要是为了重置滚动条里的BoundedRangeModel的extent值)使滚动条的宽度随着界面缩放而变化
*/
protected void updateScrollValue() {
ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane;
DynamicScrollBar verticalScrollBar = (DynamicScrollBar) elementCasePane.getVerticalScrollBar();
DynamicScrollBar horizontalScrollBar = (DynamicScrollBar) elementCasePane.getHorizontalScrollBar();
verticalScrollBar.setValue(verticalScrollBar.getValue());
horizontalScrollBar.setValue(horizontalScrollBar.getValue());
}
} }

2
designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java

@ -88,6 +88,8 @@ public class ReportComponentComposite extends JComponent implements RemoveListen
value = value < MIN ? MIN : value; value = value < MIN ? MIN : value;
int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND); int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND);
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution);
//更新滚动条值,使之随着界面缩放
parent.updateScrollValue();
} }
}; };

Loading…
Cancel
Save