OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.laf.dhtml.rich
Class AdfSwipeSupport

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfSwipeSupport

public class AdfSwipeSupport
extends AdfObject
Helps you add support for pan actions and swipe gestures. Current implementation supports horizontal or vertical swipe gestures. If there is a need, this class can be enhanced to support both. Note: Vertical swipe gesture would mean preventing default action of page scroll, and hence it isn't the most desired gesture support. Current implementation just invokes the callback. If needed it can be enhanced in future to queue custom DOM events.


Field Summary

public static Object
CALLBACK_PARAM
private Object
_callbackParam
private Object
_callbacks
public static Object
DIRECTION_DOWN
public static Object
DIRECTION_LEFT
Swipe and PAN direction
public static Object
DIRECTION_RIGHT
public static Object
DIRECTION_UP
private Object
_element
private Object
_isVertical
public static Object
MODE
public static Object
MODE_VERTICAL
private static Object
_MOUSE_SWIPE_DISTANCE_THRESHOLD
public static Object
PANCANCEL_CALLBACK
public static Object
PANEND_CALLBACK
public static Object
PANNING_CALLBACK
public static Object
PANSTART_CALLBACK
Callback and event names
public static Object
SUPPORT_MOUSE
Optional properties
private Object
_supportMouse
public static Object
SWIPE_CALLBACK
private static Object
_SWIPE_DISTANCE_THRESHOLD
private static Object
_SWIPE_VELOCITY_THRESHOLD
private static Object
_TOUCH_ACTION_PANX_CLASS
private static Object
_TOUCH_ACTION_PANY_CLASS
private static Object
_USER_SELECT_NONE_CLASS
private Object
_usesPointerEvents

Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass

Fields inherited from org.ecmascript.object.Object

prototype

Constructor Summary

public
AdfSwipeSupport(Object element, Object callbacks, Object options)
Helps you add support for pan actions and swipe gestures.

Method Summary

private Object
_cancelPanning(Object event, Object gestureEvent)
private Object
_cleanupState()
Cleans up state at the completion or abort of pan action
private Object
_getDirection(Object distance)
private Object
_getGestureEvent(Object eventType, Object srcEvent, Object pos)
private Object
_handleMouseDown(Object event)
private Object
_handlePanCancel(Object event)
Process the touchcancel event.
private Object
_handlePanEnd(Object event)
Process the touchend/mouseup into panend/swipe
private Object
_handlePanning(Object event)
Process Mousemove/touchmove handler into pan action
private Object
_handlePointerDown(Object event)
private Object
_handleTouchStart(Object event)
protected Object
Init(Object element, Object callbacks, Object options)
Initializes the instance.
protected static Object
InitClass()
private Object
_initiatePanning(Object event)
Sets up the event listeners to handle mousemove/touchmove and touchend/mouseup operations and process them into pan and swipe gesture.
private Object
_invokeCallback(Object type, Object gestureEvent)
private static Object
_isSwipe(Object gestureEvent)
Is swipe if the distance and velocity threshold are crossed
public Object
release()
Clears the events registered.
private static Object
_shouldPreventPanning(Object event)
Don't initiate swipe if the event is cancelled or a drag is in progress

Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, exportPrototypeSymbol, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toDebugString, toString

Field Detail


CALLBACK_PARAM

public static Object CALLBACK_PARAM

_callbackParam

private Object _callbackParam

_callbacks

private Object _callbacks

DIRECTION_DOWN

public static Object DIRECTION_DOWN

DIRECTION_LEFT

public static Object DIRECTION_LEFT

Swipe and PAN direction

DIRECTION_RIGHT

public static Object DIRECTION_RIGHT

DIRECTION_UP

public static Object DIRECTION_UP

_element

private Object _element

_isVertical

private Object _isVertical

MODE

public static Object MODE

MODE_VERTICAL

public static Object MODE_VERTICAL

_MOUSE_SWIPE_DISTANCE_THRESHOLD

private static Object _MOUSE_SWIPE_DISTANCE_THRESHOLD

PANCANCEL_CALLBACK

public static Object PANCANCEL_CALLBACK

PANEND_CALLBACK

public static Object PANEND_CALLBACK

PANNING_CALLBACK

public static Object PANNING_CALLBACK

PANSTART_CALLBACK

public static Object PANSTART_CALLBACK

Callback and event names

SUPPORT_MOUSE

public static Object SUPPORT_MOUSE

Optional properties

_supportMouse

private Object _supportMouse

SWIPE_CALLBACK

public static Object SWIPE_CALLBACK

_SWIPE_DISTANCE_THRESHOLD

private static Object _SWIPE_DISTANCE_THRESHOLD

_SWIPE_VELOCITY_THRESHOLD

private static Object _SWIPE_VELOCITY_THRESHOLD

_TOUCH_ACTION_PANX_CLASS

private static Object _TOUCH_ACTION_PANX_CLASS

_TOUCH_ACTION_PANY_CLASS

private static Object _TOUCH_ACTION_PANY_CLASS

_USER_SELECT_NONE_CLASS

private static Object _USER_SELECT_NONE_CLASS

_usesPointerEvents

private Object _usesPointerEvents

Constructor Detail


AdfSwipeSupport

public AdfSwipeSupport(Object element,
                       Object callbacks,
                       Object options)

Helps you add support for pan actions and swipe gestures. Current implementation supports horizontal or vertical swipe gestures. If there is a need, this class can be enhanced to support both. Note: Vertical swipe gesture would mean preventing default action of page scroll, and hence it isn't the most desired gesture support. Current implementation just invokes the callback. If needed it can be enhanced in future to queue custom DOM events.

Parameters:
element - The element on which the gesture should be recognized
callbacks - Object of gesture name and callback method references See the callbacks supported in the doc. The callbacks needs to be wrapped with AdfObject#createCallback call for the the context to be set correctly on callback invocation.
options - Optional properties for the gesture support a) SUPPORT_MOUSE: True if mouse actions should also results in gesture actions. Note: Text selection will be disabled if mouse actions needs to be supported. b) MODE: MODE_VERTICAL for vertical swipe gesture support. If not set (default), horizontal swipe gesture will be supported. c) CALLBACK_PARAM: The object assigned to this will be passed to the gesture callbacks as the second parameter. Helpful for stateless peers to get hold of component in the callbacks.

Method Detail


_cancelPanning

private Object _cancelPanning(Object event,
                              Object gestureEvent)

Parameters:
event  
gestureEvent  
Return:
Object

_cleanupState

private Object _cleanupState()

Cleans up state at the completion or abort of pan action

Return:
Object

_getDirection

private Object _getDirection(Object distance)

Parameters:
distance  
Return:
Object

_getGestureEvent

private Object _getGestureEvent(Object eventType,
                                Object srcEvent,
                                Object pos)

Parameters:
eventType  
srcEvent  
pos  
Return:
Object

_handleMouseDown

private Object _handleMouseDown(Object event)

Parameters:
event  
Return:
Object

_handlePanCancel

private Object _handlePanCancel(Object event)

Process the touchcancel event. Can be used for reverting the pan action initiated in UI. Can also be used to support ESC key if required in future.

Parameters:
event  
Return:
Object

_handlePanEnd

private Object _handlePanEnd(Object event)

Process the touchend/mouseup into panend/swipe

Parameters:
event  
Return:
Object

_handlePanning

private Object _handlePanning(Object event)

Process Mousemove/touchmove handler into pan action

Parameters:
event  
Return:
Object

_handlePointerDown

private Object _handlePointerDown(Object event)

Parameters:
event  
Return:
Object

_handleTouchStart

private Object _handleTouchStart(Object event)

Parameters:
event  
Return:
Object

Init

protected Object Init(Object element,
                      Object callbacks,
                      Object options)

Initializes the instance. Subclasses of AdfObject must call their superclass' Init

Parameters:
element  
callbacks  
options  
Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Return:
Object

_initiatePanning

private Object _initiatePanning(Object event)

Sets up the event listeners to handle mousemove/touchmove and touchend/mouseup operations and process them into pan and swipe gesture.

Parameters:
event  
Return:
Object

_invokeCallback

private Object _invokeCallback(Object type,
                               Object gestureEvent)

Parameters:
type  
gestureEvent  
Return:
Object

_isSwipe

private static Object _isSwipe(Object gestureEvent)

Is swipe if the distance and velocity threshold are crossed

Parameters:
gestureEvent  
Return:
Object

release

public Object release()

Clears the events registered. To be invoked from ComponentRemoved handler.

Return:
Object

_shouldPreventPanning

private static Object _shouldPreventPanning(Object event)

Don't initiate swipe if the event is cancelled or a drag is in progress

Parameters:
event  
Return:
Object

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.