MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / pointerDragged

Method pointerDragged

CodenameOne/src/com/codename1/ui/Form.java:3595–3677  ·  view source on GitHub ↗
(int x, int y)

Source from the content-addressed store, hash-verified

3593
3594 /// {@inheritDoc}
3595 @Override
3596 public void pointerDragged(int x, int y) {
3597 if (Display.getInstance().isStylusPointer()) {
3598 Component stylusCmp = resolveInputComponent(x, y);
3599 if (stylusCmp != null) {
3600 stylusCmp.fireStylusEvent(ActionEvent.Type.PointerDrag, x, y);
3601 }
3602 }
3603 // disable the drag stop flag if we are dragging again
3604 boolean isScrollWheeling = Display.impl.isScrollWheeling();
3605 if (dragStopFlag) {
3606 pointerPressed(x, y);
3607 }
3608 autoRelease(x, y);
3609 boolean localPointerPressedAgainDuringDrag = pointerPressedAgainDuringDrag;
3610 pointerPressedAgainDuringDrag = false;
3611 if (pointerDraggedListeners != null) {
3612 ActionEvent av = new ActionEvent(this, ActionEvent.Type.PointerDrag, x, y);
3613 av.setPointerPressedDuringDrag(localPointerPressedAgainDuringDrag);
3614 pointerDraggedListeners.fireActionEvent(av);
3615 if (av.isConsumed()) {
3616 return;
3617 }
3618 }
3619
3620 setRippleMotion(null);
3621
3622 if (dragged != null) {
3623 LeadUtil.pointerDragged(dragged, x, y);
3624 return;
3625 }
3626
3627 if (pressedCmp != null && pressedCmp.isStickyDrag()) {
3628 stickyDrag = pressedCmp;
3629 }
3630
3631 if (stickyDrag != null) {
3632 LeadUtil.pointerDragged(stickyDrag, x, y);
3633 repaint();
3634 return;
3635 }
3636 Container actual = getActualPane(formLayeredPane, x, y);
3637 if (x < actual.getX()) {
3638 // special case for sidemenu
3639 Component cmp = ((BorderLayout) super.getLayout()).getWest();
3640 if (cmp != null) {
3641 cmp = ((Container) cmp).getComponentAt(x, y);
3642 while (cmp != null && cmp.isIgnorePointerEvents()) {
3643 cmp = cmp.getParent();
3644 }
3645
3646 if (cmp != null && cmp.isEnabled()) {
3647 cmp.pointerDragged(x, y);
3648 cmp.repaint();
3649 if (cmp == pressedCmp && cmp.isStickyDrag()) { //NOPMD CompareObjectsWithEquals
3650 stickyDrag = cmp;
3651 }
3652 }

Calls 15

getInstanceMethod · 0.95
resolveInputComponentMethod · 0.95
fireStylusEventMethod · 0.95
pointerPressedMethod · 0.95
autoReleaseMethod · 0.95
isConsumedMethod · 0.95
setRippleMotionMethod · 0.95
pointerDraggedMethod · 0.95
repaintMethod · 0.95
getActualPaneMethod · 0.95
getComponentAtMethod · 0.95