Browse Source

Pull request #5453: REPORT-56602 页面设置的纸张大小与实际分页精度不符

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

* commit 'd76702ffbede459508c2a24519bb4dbf299db209':
  REPORT-56602 页面设置的纸张大小与实际分页精度不符
bugfix/10.0
kerry 3 years ago
parent
commit
c378d576e1
  1. 20
      designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java

20
designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java

@ -152,13 +152,11 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
private ScrollAction PRESS_ACTION = new ScrollAction() {
@Override
public boolean run(MouseEvent evt, int index, double tmpSize1, double tmpSize2, int tmpIncreaseSize, int oldEndValueSize, ElementCase report, DynamicUnitList sizeList) {
// int resolution = ScreenResolution.getScreenResolution();
if (isOnSeparatorLineIncludeZero(evt, tmpSize2, tmpIncreaseSize) || isOnNormalSeparatorLine(evt, tmpSize2)) {
dragType = GridUtils.DRAG_CELL_SIZE;
isDragPermited = true;
dragIndex = index;
showToolTip(evt, createToolTipString(sizeList.get(dragIndex).toPixD(resolution), sizeList.getRangeValue(0, dragIndex + 1).toPixD(resolution)));
showToolTip(evt, createToolTipString(sizeList.get(dragIndex), sizeList.getRangeValue(0, dragIndex + 1)));
return true;
}
if (between(evt, tmpSize1, tmpSize2)) {
@ -302,21 +300,18 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
protected abstract void resetGridSelectionBySelect(int index, ElementCasePane ePane);
private String createToolTipString(double doubleValue, double totalDoubleValue) {
private String createToolTipString(UNIT unitValue, UNIT totalUnitValue) {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
// int resolution = ScreenResolution.getScreenResolution();
FU ulen = FU.valueOfPix((int) doubleValue, resolution);
FU tulen = FU.valueOfPix((int) totalDoubleValue, resolution);
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
String unit = lengthUNIT.unitText();
double len = lengthUNIT.unit2Value4Scale(ulen);
double tlen = lengthUNIT.unit2Value4Scale(tulen);
double len = lengthUNIT.unit2Value4Scale(unitValue);
double tlen = lengthUNIT.unit2Value4Scale(totalUnitValue);
StringBuilder sb = new StringBuilder();
sb.append(String.format("%.2f", new Double(len)))
.append('/').append(String.format("%.2f", new Double(tlen)))
.append(unit).append('(')
.append((int)(doubleValue)).append('/')
.append((int)(totalDoubleValue))
.append((int)(unitValue.toPixD(resolution))).append('/')
.append((int)(totalUnitValue.toPixD(resolution)))
.append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px"))
.append(')');
return sb.toString();
@ -416,8 +411,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
iterateScrollBar(ePane, evt, DRAG_ACTION);
DynamicUnitList sizeList = getSizeList(report);
// int resolution = ScreenResolution.getScreenResolution();
this.setToolTipText2(this.createToolTipString(sizeList.get(dragIndex).toPixD(resolution), sizeList.getRangeValue(0, dragIndex + 1).toPixD(resolution)));
this.setToolTipText2(this.createToolTipString(sizeList.get(dragIndex), sizeList.getRangeValue(0, dragIndex + 1)));
}
ePane.repaint();

Loading…
Cancel
Save