| 3918 | |
| 3919 | /// {@inheritDoc} |
| 3920 | @Override |
| 3921 | public void pointerReleased(int x, int y) { |
| 3922 | if (Display.getInstance().isStylusPointer()) { |
| 3923 | Component stylusCmp = resolveInputComponent(x, y); |
| 3924 | if (stylusCmp != null) { |
| 3925 | stylusCmp.fireStylusEvent(ActionEvent.Type.PointerReleased, x, y); |
| 3926 | } |
| 3927 | } |
| 3928 | try { |
| 3929 | Component origPressedCmp = pressedCmp; |
| 3930 | setRippleMotion(null); |
| 3931 | setPressedCmp(null); |
| 3932 | boolean isScrollWheeling = Display.impl.isScrollWheeling(); |
| 3933 | Container actual = getActualPane(formLayeredPane, x, y); |
| 3934 | if (componentsAwaitingRelease != null && componentsAwaitingRelease.size() == 1) { |
| 3935 | // special case allowing drag within a button |
| 3936 | Component atXY = actual.getComponentAt(x, y); |
| 3937 | if (atXY != null) { |
| 3938 | atXY = LeadUtil.leadParentImpl(atXY); |
| 3939 | } |
| 3940 | |
| 3941 | Component pendingC = componentsAwaitingRelease.get(0); |
| 3942 | if (pendingC != null) { |
| 3943 | pendingC = LeadUtil.leadParentImpl(pendingC); |
| 3944 | } |
| 3945 | if (atXY == pendingC) { //NOPMD CompareObjectsWithEquals |
| 3946 | componentsAwaitingRelease = null; |
| 3947 | if (dragged == pendingC) { //NOPMD CompareObjectsWithEquals |
| 3948 | if (pendingC.isDragAndDropInitialized()) { |
| 3949 | LeadUtil.dragFinished(pendingC, x, y); |
| 3950 | } else { |
| 3951 | LeadUtil.pointerReleased(pendingC, x, y); |
| 3952 | } |
| 3953 | dragged = null; |
| 3954 | } else { |
| 3955 | LeadUtil.pointerReleased(pendingC, x, y); |
| 3956 | if (dragged != null) { |
| 3957 | if (dragged.isDragAndDropInitialized()) { |
| 3958 | LeadUtil.dragFinished(dragged, x, y); |
| 3959 | dragged = null; |
| 3960 | } else { |
| 3961 | LeadUtil.pointerReleased(dragged, x, y); |
| 3962 | dragged = null; |
| 3963 | } |
| 3964 | } |
| 3965 | } |
| 3966 | fireReleaseListeners(x, y); |
| 3967 | return; |
| 3968 | } |
| 3969 | |
| 3970 | if (LeadUtil.leadComponentImpl(pendingC) instanceof ReleasableComponent) { |
| 3971 | ReleasableComponent rc = (ReleasableComponent) LeadUtil.leadComponentImpl(pendingC); |
| 3972 | int relRadius = rc.getReleaseRadius(); |
| 3973 | if (relRadius > 0 || pendingC.contains(x, y)) { |
| 3974 | Rectangle r = new Rectangle(pendingC.getAbsoluteX() - relRadius, pendingC.getAbsoluteY() - relRadius, pendingC.getWidth() + relRadius * 2, pendingC.getHeight() + relRadius * 2); |
| 3975 | if (r.contains(x, y)) { |
| 3976 | componentsAwaitingRelease = null; |
| 3977 | if (!pendingC.contains(x, y)) { |