(int x, int y)
| 3556 | |
| 3557 | |
| 3558 | private void autoRelease(int x, int y) { |
| 3559 | if (componentsAwaitingRelease != null && componentsAwaitingRelease.size() == 1) { |
| 3560 | // special case allowing drag within a button |
| 3561 | Component atXY = LeadUtil.leadParentImpl(getComponentAt(x, y)); |
| 3562 | Component pendingC = componentsAwaitingRelease.get(0); |
| 3563 | if (pendingC != null) { |
| 3564 | pendingC = LeadUtil.leadParentImpl(pendingC); |
| 3565 | } |
| 3566 | Component pendingCLead = LeadUtil.leadComponentImpl(pendingC); |
| 3567 | if (atXY != pendingC) { //NOPMD CompareObjectsWithEquals |
| 3568 | if (pendingCLead instanceof ReleasableComponent) { |
| 3569 | ReleasableComponent rc = (ReleasableComponent) pendingCLead; |
| 3570 | int relRadius = rc.getReleaseRadius(); |
| 3571 | if (relRadius > 0) { |
| 3572 | Rectangle r = new Rectangle( |
| 3573 | pendingC.getAbsoluteX() - relRadius, |
| 3574 | pendingC.getAbsoluteY() - relRadius, |
| 3575 | pendingC.getWidth() + relRadius * 2, |
| 3576 | pendingC.getHeight() + relRadius * 2 |
| 3577 | ); |
| 3578 | if (!r.contains(x, y)) { |
| 3579 | componentsAwaitingRelease = null; |
| 3580 | LeadUtil.dragInitiated(pendingC); |
| 3581 | } |
| 3582 | return; |
| 3583 | } |
| 3584 | componentsAwaitingRelease = null; |
| 3585 | LeadUtil.dragInitiated(pendingC); |
| 3586 | } |
| 3587 | } else if (pendingCLead instanceof ReleasableComponent && ((ReleasableComponent) pendingCLead).isAutoRelease()) { |
| 3588 | componentsAwaitingRelease = null; |
| 3589 | LeadUtil.dragInitiated(pendingC); |
| 3590 | } |
| 3591 | } |
| 3592 | } |
| 3593 | |
| 3594 | /// {@inheritDoc} |
| 3595 | @Override |
no test coverage detected