From f2288dfd02892518f2f73e2ac6aff068dc6e576a Mon Sep 17 00:00:00 2001 From: Hades Date: Thu, 9 May 2019 09:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=9010.0.3=E5=9B=9E=E5=BD=92=E3=80=91?= =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8=E6=8A=A5=E8=A1=A8=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E6=9C=80=E5=8F=B3=E8=BE=B9=E7=9A=84=E5=88=97=E6=8B=96?= =?UTF-8?q?=E5=85=A5=E6=95=B0=E6=8D=AE=E5=90=8E=E6=8F=90=E7=A4=BA=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E5=8F=B3=E8=BE=B9=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/GridUtils.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridUtils.java b/designer-realize/src/main/java/com/fr/grid/GridUtils.java index dfe7a5f2d..11e907fc6 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUtils.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUtils.java @@ -12,6 +12,7 @@ import com.fr.general.ComparatorUtils; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; +import com.fr.poly.creator.ECBlockPane; import com.fr.report.ReportHelper; import com.fr.report.cell.CellElement; import com.fr.report.cell.FloatElement; @@ -48,8 +49,7 @@ public class GridUtils { //peter:下面这几个量是在Drag列的时候用. public final static int DRAG_CELL_SIZE = 1; //peter:drag的时候改变格子的宽度. - public final static int DRAG_SELECT_UNITS = 2; //peter:drag的时候,选中单元格. -// public static int resolution = (int) (ScreenResolution.getScreenResolution()* JSliderPane.getInstance().resolutionTimes); + public final static int DRAG_SELECT_UNITS = 2; //peter:drag的时候,选中单元格.// public static int resolution = (int) (ScreenResolution.getScreenResolution()* JSliderPane.getInstance().resolutionTimes); /** * Is above float element.(the return may be null).
@@ -125,7 +125,6 @@ public class GridUtils { */ public static double[] caculateFloatElementLocations(FloatElement floatElement, DynamicUnitList columnWidthList, DynamicUnitList rowHeightList, int verticalValue, int horizentalValue) { -// int resolution = ScreenResolution.getScreenResolution(); int resolution = (int) (ScreenResolution.getScreenResolution() * JSliderPane.getInstance().resolutionTimes); double floatX = columnWidthList.getRangeValue(horizentalValue, 0).toPixD(resolution) + floatElement.getLeftDistance().toPixD(resolution); @@ -180,7 +179,6 @@ public class GridUtils { private static int cc_selected_column_or_row(double mouseEvtPosition, int beginValue, int value, DynamicUnitList sizeList) { double tmpIntIndex = 0; int selectedCellIndex = 0; -// int resolution = ScreenResolution.getScreenResolution(); int resolution = (int) (ScreenResolution.getScreenResolution() * JSliderPane.getInstance().resolutionTimes); if (mouseEvtPosition < 0) { selectedCellIndex = value; @@ -239,7 +237,6 @@ public class GridUtils { private static int cc_selected_column_or_row_withresolution(double mouseEvtPosition, int beginValue, int value, DynamicUnitList sizeList, int resolution) { double tmpIntIndex = 0; int selectedCellIndex = 0; -// int resolution = ScreenResolution.getScreenResolution(); if (mouseEvtPosition < 0) { selectedCellIndex = value; for (; true; selectedCellIndex--) { @@ -311,6 +308,7 @@ public class GridUtils { public static boolean canMove(ElementCasePane reportPane, int cellColumn, int cellRow) { if (reportPane.mustInVisibleRange()) { Grid grid = reportPane.getGrid(); + checkGridCount(reportPane); int verticalEndValue = grid.getVerticalValue() + grid.getVerticalExtent() - 1; int horizontalEndValue = grid.getHorizontalValue() + grid.getHorizontalExtent() - 1; if (cellColumn > horizontalEndValue) { @@ -323,6 +321,16 @@ public class GridUtils { return true; } + /** + *聚合报表的报表块增加单元格的数量时 当单元格拉动一半会自动扩展成完整的单元格 + * 该单元格不被记录 check下重新计算下单元格数量 + */ + private static void checkGridCount(Object obj) { + if (obj instanceof ECBlockPane) { + ((ECBlockPane) obj).getTarget().firePropertyChange(); + } + } + /** * 选择一个Cell, 支持Merge. */