Browse Source

Pull request #2439: REPORT-40553 决策报表-连续点击空白设计面板,body没有处于未选中状态

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

* commit '44273fdf06543a4cb2e3c17a3757eec9e3781868':
  代码修改
  代码修改
  REPORT-40553 决策报表-连续点击空白设计面板,body没有处于未选中状态
final/10.0
Kara 4 years ago
parent
commit
e6dfe50930
  1. 18
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

18
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter {
// 获取焦点,以便获取热键 // 获取焦点,以便获取热键
designer.requestFocus(); designer.requestFocus();
} }
if (e.getButton() == MouseEvent.BUTTON1) { if (e.getButton() == MouseEvent.BUTTON1 && !beyondValidArea(e)) {
Direction dir = selectionModel.getDirectionAt(e); Direction dir = selectionModel.getDirectionAt(e);
if (!DesignerMode.isAuthorityEditing()) { if (!DesignerMode.isAuthorityEditing()) {
@ -177,13 +177,11 @@ public class EditingMouseListener extends MouseInputAdapter {
if (designer.isDrawLineMode()) { if (designer.isDrawLineMode()) {
designer.updateDrawLineMode(e); designer.updateDrawLineMode(e);
} else { } else {
int relativeX = Math.max(0, e.getX());
int relativeY = Math.max(0, e.getY());
if (selectionModel.hasSelectionComponent() if (selectionModel.hasSelectionComponent()
&& selectionModel.getSelection().getRelativeBounds().contains( && selectionModel.getSelection().getRelativeBounds().contains(
designer.getHorizontalScaleValue() + relativeX, designer.getHorizontalScaleValue() + e.getX(),
designer.getVerticalScaleValue() + relativeY)) { designer.getVerticalScaleValue() + e.getY())) {
lastPressEvent = e; lastPressEvent = e;
lastXCreator = selectionModel.getSelection().getSelectedCreator(); lastXCreator = selectionModel.getSelection().getSelectedCreator();
} else { } else {
@ -197,6 +195,16 @@ public class EditingMouseListener extends MouseInputAdapter {
e.translatePoint(oldX - e.getX(), oldY - e.getY()); e.translatePoint(oldX - e.getX(), oldY - e.getY());
} }
private boolean beyondValidArea(MouseEvent e) {
if (e.getX() < 0 || e.getY() < 0 ||
e.getX() > designer.getRootComponent().getWidth() ||
e.getY() > (designer.getRootComponent().getHeight() + designer.getParaHeight())) {
return true;
}
return false;
}
private void offsetEventPoint(MouseEvent e){ private void offsetEventPoint(MouseEvent e){
int x = designer.getRelativeX(e.getX()); int x = designer.getRelativeX(e.getX());
int y = designer.getRelativeY(e.getY()); int y = designer.getRelativeY(e.getY());

Loading…
Cancel
Save