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

Side by Side Diff: samples/solar/web/solar.dart

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. 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/web/clock.dart ('k') | samples/solar3d/web/solar.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 /** 5 /**
6 * A solar system visualization. 6 * A solar system visualization.
7 */ 7 */
8 8
9 library solar; 9 library solar;
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 jupiter.addPlanet(new PlanetaryBody( 112 jupiter.addPlanet(new PlanetaryBody(
113 this, "Ganymede", "gray", 5.3 * f, 1070 * h, 7.154 * g)); 113 this, "Ganymede", "gray", 5.3 * f, 1070 * h, 7.154 * g));
114 jupiter.addPlanet(new PlanetaryBody( 114 jupiter.addPlanet(new PlanetaryBody(
115 this, "Callisto", "gray", 4.8 * f, 1882 * h, 16.689 * g)); 115 this, "Callisto", "gray", 4.8 * f, 1882 * h, 16.689 * g));
116 116
117 // Start the animation loop. 117 // Start the animation loop.
118 requestRedraw(); 118 requestRedraw();
119 } 119 }
120 120
121 void draw(num _) { 121 void draw(num _) {
122 num time = new Date.now().millisecondsSinceEpoch; 122 num time = new DateTime.now().millisecondsSinceEpoch;
123 123
124 if (renderTime != null) { 124 if (renderTime != null) {
125 showFps((1000 / (time - renderTime)).round()); 125 showFps((1000 / (time - renderTime)).round());
126 } 126 }
127 127
128 renderTime = time; 128 renderTime = time;
129 129
130 var context = canvas.context2d; 130 var context = canvas.context2d;
131 131
132 drawBackground(context); 132 drawBackground(context);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } else { 267 } else {
268 num angle = solarSystem.renderTime * orbitSpeed; 268 num angle = solarSystem.renderTime * orbitSpeed;
269 269
270 return new Point( 270 return new Point(
271 orbitRadius * cos(angle) + x, 271 orbitRadius * cos(angle) + x,
272 orbitRadius * sin(angle) + y); 272 orbitRadius * sin(angle) + y);
273 } 273 }
274 } 274 }
275 275
276 } 276 }
OLDNEW
« no previous file with comments | « samples/clock/web/clock.dart ('k') | samples/solar3d/web/solar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698