Package net.rim.device.api.ui

Examples of net.rim.device.api.ui.TouchGesture


   */
  protected boolean touchEvent(TouchEvent message)
  {
    if(message.getEvent() == TouchEvent.GESTURE)
    {
      TouchGesture touchGesture = message.getGesture();
      if(touchGesture.getEvent() == TouchGesture.TAP)
      {   
        String osVersion = DeviceInfo.getSoftwareVersion();
        if (osVersion.startsWith("5.0")) {
          return super.touchEvent(message);
        }
View Full Code Here


    /**
     * @see net.rim.device.api.ui.Screen#touchEvent(TouchEvent)
     */
    protected boolean touchEvent(final TouchEvent message) {
        final TouchGesture touchGesture = message.getGesture();
        if (touchGesture != null) {
            // If the user has performed a swipe gesture we will move the
            // map accordingly.
            if (touchGesture.getEvent() == TouchGesture.SWIPE) {
                // Retrieve the swipe magnitude so we know how
                // far to move the map.
                final int magnitude = touchGesture.getSwipeMagnitude();

                // Move the map in the direction of the swipe.
                switch (touchGesture.getSwipeDirection()) {
                case TouchGesture.SWIPE_NORTH:
                    _map.move(0, -magnitude);
                    break;
                case TouchGesture.SWIPE_SOUTH:
                    _map.move(0, magnitude);
View Full Code Here

    /**
     * @see Screen#touchEvent(TouchEvent)
     */
    protected boolean touchEvent(final TouchEvent message) {
        TouchGesture touchGesture = null;

        final int event = message.getEvent();
        if (event == TouchEvent.GESTURE) {
            touchGesture = message.getGesture();
        }

        if (message.getEvent() == TouchEvent.CLICK || touchGesture != null
                && touchGesture.getEvent() == TouchGesture.TAP) {
            int type = 0;

            if (_editFieldDefault.isFocus()) {
                type = DEFAULT;
            } else if (_editFieldDate.isFocus()) {
View Full Code Here

    /**
     * @see Screen#touchEvent(TouchEvent)
     */
    protected boolean touchEvent(final TouchEvent message) {
        if (message.getEvent() == TouchEvent.GESTURE) {
            final TouchGesture gesture = message.getGesture();
            final int event = gesture.getEvent();

            final float magnitude = gesture.getPinchMagnitude();

            if (event == TouchGesture.PINCH_UPDATE) {
                onPinch(magnitude, false);
            } else if (event == TouchGesture.PINCH_END) {
                onPinch(magnitude, true);
View Full Code Here

        /**
         * @see Screen#touchEvent(TouchEvent)
         */
        protected boolean touchEvent(final TouchEvent message) {
            if (message.getEvent() == TouchEvent.GESTURE) {
                final TouchGesture touchGesture = message.getGesture();
                if (touchGesture.getEvent() == TouchGesture.TAP) {
                    _isSet = true;
                    close();
                    return true;
                }
            }
View Full Code Here

    /**
     * @see net.rim.device.api.ui.Field#touchEvent(TouchEvent)
     */
    protected boolean touchEvent(final TouchEvent event) {
        if (event.getEvent() == TouchEvent.GESTURE) {
            final TouchGesture gesture = event.getGesture();

            // Handle only trackpad swipe gestures
            if (gesture.getEvent() == TouchGesture.NAVIGATION_SWIPE) {
                final int direction = gesture.getSwipeDirection();

                Application.getApplication().invokeLater(new Runnable() {
                    /**
                     * @see Runnable#run()
                     */
 
View Full Code Here

    /**
     * @see net.rim.device.api.ui.Field#touchEvent(TouchEvent)
     */
    protected boolean touchEvent(final TouchEvent event) {
        if (event.getEvent() == TouchEvent.GESTURE) {
            final TouchGesture gesture = event.getGesture();

            // Handle only trackpad swipe gestures
            if (gesture.getEvent() == TouchGesture.NAVIGATION_SWIPE) {
                final int direction = gesture.getSwipeDirection();

                Application.getApplication().invokeLater(new Runnable() {
                    public void run() {
                        // Determine the direction of the swipe
                        if (direction == TouchGesture.SWIPE_NORTH) {
View Full Code Here

    /**
     * @see net.rim.device.api.ui.Field#touchEvent(TouchEvent)
     */
    protected boolean touchEvent(final TouchEvent message) {
        final TouchGesture touchGesture = message.getGesture();

        if (touchGesture != null && touchGesture.getEvent() == TouchGesture.TAP) {
            displayMemo();
            return true;
        }

        return super.touchEvent(message);
View Full Code Here

    /**
     * @see Screen#touchEvent(TouchEvent)
     */
    protected boolean touchEvent(final TouchEvent message) {
        final TouchGesture touchGesture = message.getGesture();
        if (touchGesture != null) {
            if (_mapManager.isPanning()) {
                // If the user has performed a swipe gesture within the map area
                // we will move the map accordingly.
                if (touchGesture.getEvent() == TouchGesture.SWIPE
                        && message.getY(1) < 240) {
                    int horizontal = 0;
                    int vertical = 0;

                    // Retrieve the swipe magnitude so we know how
                    // far to move the map.
                    final int magnitude = touchGesture.getSwipeMagnitude();

                    // Move the map in the direction of the swipe.
                    switch (touchGesture.getSwipeDirection()) {
                    case TouchGesture.SWIPE_NORTH:
                        vertical = magnitude / SCROLL_FACTOR;
                        // vertical = SCROLL_CHANGE;
                        break;
                    case TouchGesture.SWIPE_SOUTH:
                        vertical = -(magnitude / SCROLL_FACTOR);
                        // vertical = -(SCROLL_CHANGE * SCROLL_FACTOR);
                        break;
                    case TouchGesture.SWIPE_EAST:
                        horizontal = -(magnitude / SCROLL_FACTOR);
                        // horizontal = -(SCROLL_CHANGE);
                        break;
                    case TouchGesture.SWIPE_WEST:
                        horizontal = magnitude / SCROLL_FACTOR;
                        // horizontal = -SCROLL_CHANGE;
                        break;
                    }
                    update(horizontal, vertical);
                }
            }
            // Performing a double tap gesture on the map will toggle panning
            // mode
            if (touchGesture.getEvent() == TouchGesture.DOUBLE_TAP
                    && message.getY(1) < 240) {
                togglePanMode();
            }
        }

View Full Code Here

    /**
     * @see net.rim.device.api.ui.Screen#touchEvent(TouchEvent)
     */
    protected boolean touchEvent(final TouchEvent message) {
        final TouchGesture touchGesture = message.getGesture();

        if (touchGesture != null) {
            final int event = touchGesture.getEvent();

            if (event == TouchGesture.TAP) {
                swapFields();

                return true;
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.TouchGesture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.