Esempio n. 1
0
        public void addRoute(int pointer, PointerRoute route)
        {
            var routes = this._routeMap.putIfAbsent(pointer, () => new HashSet <PointerRoute>());

            D.assert(!routes.Contains(route));
            routes.Add(route);
        }
Esempio n. 2
0
 public void stopTrackingPointer(PointerRoute route)
 {
     if (this._isTrackingPointer)
     {
         this._isTrackingPointer = false;
         GestureBinding.instance.pointerRouter.removeRoute(this.pointer, route);
     }
 }
Esempio n. 3
0
 public void startTrackingPointer(PointerRoute route)
 {
     if (!this._isTrackingPointer)
     {
         this._isTrackingPointer = true;
         GestureBinding.instance.pointerRouter.addRoute(this.pointer, route);
     }
 }
Esempio n. 4
0
 public virtual void stopTrackingPointer(PointerRoute route)
 {
     if (_isTrackingPointer)
     {
         _isTrackingPointer = false;
         GestureBinding.instance.pointerRouter.removeRoute(pointer, route);
     }
 }
Esempio n. 5
0
 public _RouteEntry(
     PointerRoute route,
     Matrix4 transform
     )
 {
     this.route     = route;
     this.transform = transform;
 }
Esempio n. 6
0
 public void startTrackingPointer(PointerRoute route, Matrix4 transform)
 {
     if (!_isTrackingPointer)
     {
         _isTrackingPointer = true;
         GestureBinding.instance.pointerRouter.addRoute(pointer, route, transform);
     }
 }
Esempio n. 7
0
 void _dispatch(PointerEvent evt, PointerRoute route)
 {
     try {
         route(evt);
     }
     catch (Exception ex) {
         D.logError("Error while routing a pointer event: ", ex);
     }
 }
Esempio n. 8
0
 void _dispatch(PointerEvent evt, PointerRoute route, Matrix4 transform)
 {
     try {
         evt = evt.transformed(transform);
         route(evt);
     }
     catch (Exception ex) {
         D.logError("Error while routing a pointer event: ", ex);
     }
 }
Esempio n. 9
0
        public void addRoute(int pointer, PointerRoute route, Matrix4 transform = null)
        {
            var routes = _routeMap.putIfAbsent(
                pointer,
                () => new Dictionary <PointerRoute, Matrix4>()
                );

            D.assert(!routes.ContainsKey(route));
            routes[route] = transform;
        }
Esempio n. 10
0
        public void removeRoute(int pointer, PointerRoute route)
        {
            D.assert(this._routeMap.ContainsKey(pointer));
            var routes = this._routeMap[pointer];

            routes.Remove(route);
            if (routes.isEmpty())
            {
                this._routeMap.Remove(pointer);
            }
        }
Esempio n. 11
0
 public void removeGlobalRoute(PointerRoute route)
 {
     D.assert(this._globalRoutes.Contains(route));
     this._globalRoutes.Remove(route);
 }
Esempio n. 12
0
 public void addGlobalRoute(PointerRoute route)
 {
     D.assert(!this._globalRoutes.Contains(route));
     this._globalRoutes.Add(route);
 }
Esempio n. 13
0
 public override void stopTrackingPointer(PointerRoute route)
 {
     this._timer?.cancel();
     this._timer = null;
     base.stopTrackingPointer(route);
 }
Esempio n. 14
0
 static _RouteEntryPredicate isRoutePredicate(PointerRoute route)
 {
     return((_RouteEntry entry) => entry.route == route);
 }
Esempio n. 15
0
 public void removeGlobalRoute(PointerRoute route)
 {
     D.assert(_globalRoutes.ContainsKey(route));
     _globalRoutes.Remove(route);
 }
Esempio n. 16
0
 public void addGlobalRoute(PointerRoute route, Matrix4 transform = null)
 {
     D.assert(!_globalRoutes.ContainsKey(route));
     _globalRoutes[route] = transform;
 }