Browse Source

REPORT-48866【FR-X】任意决策报表,添加报表块,编辑进入报表块,放大缩小设计页面(ctrl+鼠标滚轮等操作),报表块内容放大缩小了,但虚线没有跟随变化大小

persist/11.0
kerry 4 years ago
parent
commit
1b036b2f95
  1. 15
      designer-realize/src/main/java/com/fr/design/fit/grid/NewFormDesignerGridUI.java
  2. 6
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java

15
designer-realize/src/main/java/com/fr/design/fit/grid/NewFormDesignerGridUI.java

@ -2,6 +2,7 @@ package com.fr.design.fit.grid;
import com.fr.design.designer.creator.XElementCase; import com.fr.design.designer.creator.XElementCase;
import com.fr.design.fit.AdaptiveCellElementPainter; import com.fr.design.fit.AdaptiveCellElementPainter;
import com.fr.design.fit.DesignerUIModeConfig;
import com.fr.design.fit.common.FormDesignerUtil; import com.fr.design.fit.common.FormDesignerUtil;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
@ -58,12 +59,22 @@ public class NewFormDesignerGridUI extends GridUI {
return; return;
} }
final Rectangle rectangle = getBoundsLineRect(elementCase, grid); final Rectangle rectangle = getBoundsLineRect(elementCase, grid);
int width = rectangle.width - columnWidthList.getRangeValue(0, horizontalValue).toPixI(resolution); int width = getScaleWidth(rectangle.width) - columnWidthList.getRangeValue(0, horizontalValue).toPixI(resolution);
int height = rectangle.height - rowHeightList.getRangeValue(0, verticalValue).toPixI(resolution); int height = getScaleHeight(rectangle.height) - rowHeightList.getRangeValue(0, verticalValue).toPixI(resolution);
drawBoundsLine(g2d, width, height); drawBoundsLine(g2d, width, height);
addListener(grid, elementCasePane, width, height, rectangle.width, rectangle.height); addListener(grid, elementCasePane, width, height, rectangle.width, rectangle.height);
} }
private int getScaleWidth(int width) {
return width * resolution / DesignerUIModeConfig.getInstance().getScreenResolution();
}
private int getScaleHeight(int height) {
return height * resolution / DesignerUIModeConfig.getInstance().getScreenResolution();
}
/** /**
* 获取需要画线的矩形大小 * 获取需要画线的矩形大小
*/ */

6
designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java

@ -6,7 +6,7 @@ import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.cell.bar.DynamicScrollBar; import com.fr.design.cell.bar.DynamicScrollBar;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.fit.DesignerUIModeConfig;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -74,7 +74,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
double value = jSliderContainer.getShowValue(); double value = jSliderContainer.getShowValue();
value = value > MAX ? MAX : value; value = value > MAX ? MAX : value;
value = value < MIN ? MIN : value; value = value < MIN ? MIN : value;
int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND); int resolution = (int) (DesignerUIModeConfig.getInstance().getScreenResolution() * value / HUND);
setScale(resolution); setScale(resolution);
// HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution); // HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution);
} }
@ -87,7 +87,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
private void setScale(int resolution) { private void setScale(int resolution) {
ElementCasePane elementCasePane = elementCaseDesigner.getEditingElementCasePane(); ElementCasePane elementCasePane = elementCaseDesigner.getEditingElementCasePane();
//网格线 //网格线
if (resolution < ScreenResolution.getScreenResolution() * MIN_TIME) { if (resolution < DesignerUIModeConfig.getInstance().getScreenResolution() * MIN_TIME) {
elementCasePane.getGrid().setShowGridLine(false); elementCasePane.getGrid().setShowGridLine(false);
} else { } else {
elementCasePane.getGrid().setShowGridLine(true); elementCasePane.getGrid().setShowGridLine(true);

Loading…
Cancel
Save