|
|
@ -455,11 +455,11 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous |
|
|
|
|
|
|
|
|
|
|
|
private void doWithCellElementDragged(int evtX, int evtY, CellSelection cs) { |
|
|
|
private void doWithCellElementDragged(int evtX, int evtY, CellSelection cs) { |
|
|
|
ElementCasePane reportPane = grid.getElementCasePane(); |
|
|
|
ElementCasePane reportPane = grid.getElementCasePane(); |
|
|
|
java.awt.Rectangle cellRectangle = cs.toRectangle(); |
|
|
|
java.awt.Rectangle startRec = cs.toRectangle(); |
|
|
|
|
|
|
|
|
|
|
|
ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(reportPane, evtX, evtY, resolution); |
|
|
|
ColumnRow currentMouseCell = GridUtils.getAdjustEventColumnRow_withresolution(reportPane, evtX, evtY, resolution); |
|
|
|
if (cellRectangle.contains(selectedCellPoint.getColumn(), selectedCellPoint.getRow())) { |
|
|
|
if (startRec.contains(currentMouseCell.getColumn(), currentMouseCell.getRow())) { |
|
|
|
grid.getDragRectangle().setBounds(cellRectangle); |
|
|
|
grid.getDragRectangle().setBounds(startRec); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (isOutECBlockPane(evtX, evtY)) { |
|
|
|
if (isOutECBlockPane(evtX, evtY)) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -467,12 +467,12 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous |
|
|
|
int xDistance = evtX - this.oldEvtX; |
|
|
|
int xDistance = evtX - this.oldEvtX; |
|
|
|
int yDistance = evtY - this.oldEvtY; |
|
|
|
int yDistance = evtY - this.oldEvtY; |
|
|
|
int dragDirection = calculateDragDirection(xDistance, yDistance); |
|
|
|
int dragDirection = calculateDragDirection(xDistance, yDistance); |
|
|
|
grid.getDragRectangle().x = calculateDragRectangleX(selectedCellPoint, cellRectangle, dragDirection); |
|
|
|
grid.getDragRectangle().x = calculateDragRectangleX(currentMouseCell, startRec, dragDirection); |
|
|
|
grid.getDragRectangle().y = calculateDragRectangleY(selectedCellPoint, cellRectangle, dragDirection); |
|
|
|
grid.getDragRectangle().y = calculateDragRectangleY(currentMouseCell, startRec, dragDirection); |
|
|
|
grid.getDragRectangle().width = calculateDragRectangleWidth(selectedCellPoint, cellRectangle, dragDirection); |
|
|
|
grid.getDragRectangle().width = calculateDragRectangleWidth(currentMouseCell, startRec, dragDirection); |
|
|
|
grid.getDragRectangle().height = calculateDragRectangleHeight(selectedCellPoint, cellRectangle, dragDirection); |
|
|
|
grid.getDragRectangle().height = calculateDragRectangleHeight(currentMouseCell, startRec, dragDirection); |
|
|
|
} |
|
|
|
} |
|
|
|
reportPane.ensureColumnRowVisible(selectedCellPoint.getColumn() + 1, selectedCellPoint.getRow() + 1); |
|
|
|
reportPane.ensureColumnRowVisible(currentMouseCell.getColumn() + 1, currentMouseCell.getRow() + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int calculateDragDirection(int xDistance, int yDistance) { |
|
|
|
private int calculateDragDirection(int xDistance, int yDistance) { |
|
|
|