Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: samples/ui_lib/touch/Momentum.dart

Issue 11314019: Using 'interface' and 'abstract' for methods should produce error (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Implementations can be used to simulate the deceleration of an element within 6 * Implementations can be used to simulate the deceleration of an element within
7 * a certain region. To use this behavior you need to provide an initial 7 * a certain region. To use this behavior you need to provide an initial
8 * velocity that is meant to represent the gesture that is initiating this 8 * velocity that is meant to represent the gesture that is initiating this
9 * deceleration. You also provide the bounds of the region that the element 9 * deceleration. You also provide the bounds of the region that the element
10 * exists in, and the current offset of the element within that region. The 10 * exists in, and the current offset of the element within that region. The
11 * transitions will have the element decelerate to rest, or stretch past the 11 * transitions will have the element decelerate to rest, or stretch past the
12 * offset boundaries and then come to rest. 12 * offset boundaries and then come to rest.
13 * 13 *
14 * This is primarily designed to solve the problem of slow scrolling in mobile 14 * This is primarily designed to solve the problem of slow scrolling in mobile
15 * safari. You can use this along with the [Scroller] behavior to make a 15 * safari. You can use this along with the [Scroller] behavior to make a
16 * scrollable area scroll the same way it would in a native application. 16 * scrollable area scroll the same way it would in a native application.
17 * 17 *
18 * Implementations of this interface do not maintain any references to HTML 18 * Implementations of this interface do not maintain any references to HTML
19 * elements, and therefore cannot do any redrawing of elements. They only 19 * elements, and therefore cannot do any redrawing of elements. They only
20 * calculates where the element should be on an interval. It is the delegate's 20 * calculates where the element should be on an interval. It is the delegate's
21 * responsibility to redraw the element when the onDecelerate callback is 21 * responsibility to redraw the element when the onDecelerate callback is
22 * invoked. It is recommended that you move the element with a hardware 22 * invoked. It is recommended that you move the element with a hardware
23 * accelerated method such as using 'translate3d' on the element's 23 * accelerated method such as using 'translate3d' on the element's
24 * -webkit-transform style property. 24 * -webkit-transform style property.
25 */ 25 */
26 interface Momentum default TimeoutMomentum { 26 abstract class Momentum {
27 27
28 Momentum(MomentumDelegate delegate, [num defaultDecelerationFactor]); 28 factory Momentum(MomentumDelegate delegate, [num defaultDecelerationFactor]) = TimeoutMomentum;
29 29
30 bool get decelerating; 30 bool get decelerating;
31 31
32 num get decelerationFactor; 32 num get decelerationFactor;
33 33
34 /** 34 /**
35 * Transition end handler. This function must be invoked after any transition 35 * Transition end handler. This function must be invoked after any transition
36 * that occurred as a result of a call to the delegate's onDecelerate callback. 36 * that occurred as a result of a call to the delegate's onDecelerate callback.
37 */ 37 */
38 void onTransitionEnd(); 38 void onTransitionEnd();
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 545
546 Coordinate get destination { 546 Coordinate get destination {
547 if (!_moves.isEmpty) { 547 if (!_moves.isEmpty) {
548 final lastMove = _moves.last; 548 final lastMove = _moves.last;
549 return new Coordinate(lastMove.x, lastMove.y); 549 return new Coordinate(lastMove.x, lastMove.y);
550 } else { 550 } else {
551 return null; 551 return null;
552 } 552 }
553 } 553 }
554 } 554 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698