Search in sources :

Example 1 with Point

use of com.gwtmobile.ui.client.utils.Point in project GwtMobile by dennisjzh.

the class DragControllerMobile method onTouchMove.

public void onTouchMove(TouchEvent e) {
    e.preventDefault();
    e.stopPropagation();
    _touchMoving = true;
    onMove(e, new Point(e.touches().get(0).getClientX(), e.touches().get(0).getClientY()));
}
Also used : Point(com.gwtmobile.ui.client.utils.Point)

Example 2 with Point

use of com.gwtmobile.ui.client.utils.Point in project GwtMobile by dennisjzh.

the class DragControllerMobile method onTouchEnd.

public void onTouchEnd(TouchEvent e) {
    e.preventDefault();
    e.stopPropagation();
    if (!_touchMoving) {
        Utils.Console("fireclick ");
        fireClick(e);
    }
    _touchMoving = false;
    onEnd(e, new Point(e.changedTouches().get(0).getClientX(), e.changedTouches().get(0).getClientY()));
}
Also used : Point(com.gwtmobile.ui.client.utils.Point)

Example 3 with Point

use of com.gwtmobile.ui.client.utils.Point in project GwtMobile by dennisjzh.

the class DragControllerDesktop method onMouseDown.

public void onMouseDown(Event e) {
    EventTarget target = e.getEventTarget();
    boolean preventDefault = true;
    if (Element.is(target)) {
        Element ele = Element.as(target);
        // INPUT element will not get focus if default action is prevented.
        if (Utils.isHtmlFormControl(ele)) {
            ele.focus();
            preventDefault = false;
        }
    }
    if (preventDefault) {
        // prevent default action of selecting text
        e.preventDefault();
        e.stopPropagation();
        onStart(e, new Point(e.getClientX(), e.getClientY()));
    }
}
Also used : Element(com.google.gwt.dom.client.Element) Point(com.gwtmobile.ui.client.utils.Point) EventTarget(com.google.gwt.dom.client.EventTarget)

Example 4 with Point

use of com.gwtmobile.ui.client.utils.Point in project GwtMobile by dennisjzh.

the class DragControllerDesktop method onMouseMove.

public void onMouseMove(Event e) {
    e.preventDefault();
    e.stopPropagation();
    onMove(e, new Point(e.getClientX(), e.getClientY()));
}
Also used : Point(com.gwtmobile.ui.client.utils.Point)

Example 5 with Point

use of com.gwtmobile.ui.client.utils.Point in project GwtMobile by dennisjzh.

the class DragControllerMobile method onTouchStart.

public void onTouchStart(TouchEvent e) {
    EventTarget target = e.getEventTarget();
    boolean preventDefault = true;
    if (Element.is(target)) {
        Element ele = Element.as(target);
        // INPUT element will not get focus if default action is prevented.
        if (Utils.isHtmlFormControl(ele)) {
            ele.focus();
            preventDefault = false;
        }
    }
    if (preventDefault) {
        // prevent default action of selecting text
        e.preventDefault();
        e.stopPropagation();
    }
    // FIXME: for multi-touch platforms.
    onStart(e, new Point(e.touches().get(0).getClientX(), e.touches().get(0).getClientY()));
}
Also used : Element(com.google.gwt.dom.client.Element) Point(com.gwtmobile.ui.client.utils.Point) EventTarget(com.google.gwt.dom.client.EventTarget)

Aggregations

Point (com.gwtmobile.ui.client.utils.Point)6 Element (com.google.gwt.dom.client.Element)2 EventTarget (com.google.gwt.dom.client.EventTarget)2