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

Side by Side Diff: samples/clock/clock.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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
« no previous file with comments | « samples/clock/balls.dart ('k') | samples/clock/numbers.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library clock; 5 library clock;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'dart:math'; 8 import 'dart:math';
9 9
10 part 'balls.dart'; 10 part 'balls.dart';
(...skipping 16 matching lines...) Expand all
27 27
28 query("#notes").text = "${fpsAverage.round().toInt()} fps"; 28 query("#notes").text = "${fpsAverage.round().toInt()} fps";
29 } 29 }
30 } 30 }
31 31
32 class CountDownClock { 32 class CountDownClock {
33 static const int NUMBER_SPACING = 19; 33 static const int NUMBER_SPACING = 19;
34 static const double BALL_WIDTH = 19.0; 34 static const double BALL_WIDTH = 19.0;
35 static const double BALL_HEIGHT = 19.0; 35 static const double BALL_HEIGHT = 19.0;
36 36
37 List<ClockNumber> hours = new List<ClockNumber>(2); 37 List<ClockNumber> hours = new List<ClockNumber>.fixedLength(2);
38 List<ClockNumber> minutes = new List<ClockNumber>(2); 38 List<ClockNumber> minutes = new List<ClockNumber>.fixedLength(2);
39 List<ClockNumber> seconds = new List<ClockNumber>(2); 39 List<ClockNumber> seconds = new List<ClockNumber>.fixedLength(2);
40 int displayedHour = 0; 40 int displayedHour = 0;
41 int displayedMinute = 0; 41 int displayedMinute = 0;
42 int displayedSecond = 0; 42 int displayedSecond = 0;
43 Balls balls = new Balls(); 43 Balls balls = new Balls();
44 44
45 CountDownClock() { 45 CountDownClock() {
46 var parent = query("#canvas-content"); 46 var parent = query("#canvas-content");
47 47
48 createNumbers(parent, parent.clientWidth, parent.clientHeight); 48 createNumbers(parent, parent.clientWidth, parent.clientHeight);
49 49
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 void setElementPosition(Element elem, double x, double y) { 156 void setElementPosition(Element elem, double x, double y) {
157 elem.style.transform = 'translate(${x}px, ${y}px)'; 157 elem.style.transform = 'translate(${x}px, ${y}px)';
158 } 158 }
159 159
160 void setElementSize(Element elem, double l, double t, double r, double b) { 160 void setElementSize(Element elem, double l, double t, double r, double b) {
161 setElementPosition(elem, l, t); 161 setElementPosition(elem, l, t);
162 elem.style.right = "${r}px"; 162 elem.style.right = "${r}px";
163 elem.style.bottom = "${b}px"; 163 elem.style.bottom = "${b}px";
164 } 164 }
OLDNEW
« no previous file with comments | « samples/clock/balls.dart ('k') | samples/clock/numbers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698