MobilityDesignerRichComponentsTouchEnabled

Touch Enabled Rich SVG Components

This document may change during the implementation of this feature.

This document is continuation of document about Rich SVG Components.

Contents


Abstract

This document describes touch enabled Rich SVG Components. Before reading this document you should be familiar with specification of the Rich SVG Components.

Motivation is to extend functionality of Rich SVG Components. This feature has no impact on Visual Mobile Designer and can be used without it.

Functionality

With growing popularity of touch enabled devices developers looking for libraries to utilize new technology through Java ME. The Rich SVG Components should provide out of the box solution to support touch screen events in mobile devices.

Implementation

Touch screen events

Events are handled by SVG components via InputHandler interface "handlePointerPress" and "handlePointerRelease" methods. Default implementation of these methods just notify pointer listeners attached to SVGComponent. Each component also has several behaviors respectively pointer location ( see this behavior for each specific component ). Mentioned methods have passed event as argument which coordinates are absolute screen coordinates. SVGComponent is notified about event if its method "getBounds()" returns rectangle that contains event point . Realization of mentioned methods in InputHandler interface could skip handling of event based on shape of SVGComponent ( f.e. button could have ellipse shape. In this case realization should not care about events related to a neighborhood of the corners of bounded rectangle ). Such decision is up to implementation of "handle*" methods. Touch event contains additional information that could help to recognize different situation. F.e. double click ( and multiple click with any count ) could be handled in the different way than simple single click .

Supported components

  • SVGForm
  • SVGButton
  • SVGLabel
  • SVGRadioButton
  • SVGCheckBox
  • SVGComboBox
  • SVGList
  • SVGSlider
  • SVGSpinner
  • SVGTextField

Description of behavior:

SVGForm

The SVGForm component it's a container for rest of the SVG Components just like MIDP Form contains SVG Items. No touch screen support required. SVGForm just notify about touch event as described in general implementation overview above.

SVGButton

Default behavior of Button is exactly same as when "Fire" key button is pressed in mobile device. When component is pressed should be selected.

SVGLabel

SVGLabel in most cases is not component that user cares about. It doesn't have handling of touch events. In most cases it is like just a "picture".

SVGRadioButton

When component is pressed should be selected. Rest of the radio buttons connected with selected one should be unselected.

SVGCheckBox

When component is pressed should be selected. The behavior is the same as "Fire" key button handling.

SVGComboBox

  • Touch event over the "choices button" opens list of choices (if it is not shown). It's like pressing "Left" button for SVGComboBox with hidden list of choices.
  • Touch event over the "choices button" hides list of choices (if it is shown). It's like pressing "Right" button for SVGComboBox with shown list of choices.
  • Touch event for pointer inside list of choices is the same as for SVGList touch event handling with single selection mode for Selection model.
  • Double click action over input field is the same as "Fire" key handling.
  • Double click action inside opened list of choices hide this list and selects chosen list element ( if any ) in the combobox editor .

SVGList

Behavior if SVGList depends on mode of SelectionModel. In case of single mode selection model SVGList handle following cases:

  • Element is selected if pointer was clicked over this element. Previous selection is cleared.
  • List will be scrolled in case of DnD action. Scrolling will be done according to vertical length of DnD path.
  • Current element is the same as selected one. This concerns behavior of key handling. Pressing "Left" and "Right" keys will be handled respectively selected ( current ) element .

In case of multiple mode selection model SVGList handle following cases:

  • Element is selected if pointer was clicked over this element and element was not selected. Previous selection is not cleared if it doesn't contain this element.
  • Element is deselected if pointer was clicked over this element and this element had selection. Previous selection is not cleared ( except subject element ).
  • List will be scrolled in case of DnD action. Scrolling will be done according to vertical length of DnD path.
  • Current element is last clicked . This concerns behavior of key handling. Pressing "Left" and "Right" keys will be handled respectively selected ( current ) element . Selection will be cleared and assigned to selected ( current ) element in case of usage "Left" and "Right" buttons.


SVGSlider

  • Touch event for slider at the left side from knob moves knob to left ( with decrementing value respectively ).
  • Touch event for slider at the right side from knob moves knob to right ( with incrementing value respectively ).
  • Dragging and dropping knob leads to moving knob to value that is aligned respectively length of pointer's way (value is updated respectively).

SVGSpinner

  • Touch event for UP button is the same as "Right" key handling .
  • Touch event for DOWN button is the same as "Left" key handling .
  • Double click action over input field is the same as "Fire" key handling.

SVGTextField

When component is pressed should be selected. Caret should be placed at the end of the text. Double click action is the same as "Fire" key handling.

contact: Karol Harezlak

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo