|
|
@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter { |
|
|
|
// 获取焦点,以便获取热键
|
|
|
|
// 获取焦点,以便获取热键
|
|
|
|
designer.requestFocus(); |
|
|
|
designer.requestFocus(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (e.getButton() == MouseEvent.BUTTON1 && e.getX() > 0 && e.getY() > 0) { |
|
|
|
if (e.getButton() == MouseEvent.BUTTON1 && !beyondValidArea(e)) { |
|
|
|
|
|
|
|
|
|
|
|
Direction dir = selectionModel.getDirectionAt(e); |
|
|
|
Direction dir = selectionModel.getDirectionAt(e); |
|
|
|
if (!DesignerMode.isAuthorityEditing()) { |
|
|
|
if (!DesignerMode.isAuthorityEditing()) { |
|
|
@ -194,6 +194,15 @@ 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()); |
|
|
|