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

Unified Diff: samples/total/client/ColorPicker.dart

Issue 10635015: Delete proxy and total samples, which have bit-rotted. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/total/client/ClientChart.dart ('k') | samples/total/client/Command.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/total/client/ColorPicker.dart
===================================================================
--- samples/total/client/ColorPicker.dart (revision 9011)
+++ samples/total/client/ColorPicker.dart (working copy)
@@ -1,59 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-/**
- * A graphical picker for a set of predefined colors.
- */
-class ColorPicker extends Picker {
-
- List<String> _colors;
- int _columns;
- int _margin;
- int _rows;
- int _width;
-
- ColorPicker(Element root, this._colors, this._rows, this._columns, this._width, this._margin)
- : super("color-picker") {
- if (_colors.length < _rows * _columns) {
- throw new RuntimeException("colors.length < rows * columns");
- }
-
- setParent(root);
-
- int w = _columns * (_width + _margin) + _margin;
- int h = _rows * (_width + _margin) + _margin;
-
- root.attributes["class"] = "color-picker";
- root.style.setProperty("width", HtmlUtils.toPx(w));
- root.style.setProperty("height", HtmlUtils.toPx(h));
- root.classes.add("fadeOut");
-
- Document doc = root.document;
-
- int idx = 0;
- for (int j = 0; j < _rows; j++) {
- int y = _margin + j * (_width + _margin);
- for (int i = 0; i < _columns; i++) {
- int x = _margin + i * (_width + _margin);
-
- DivElement div = new Element.tag("div");
- div.attributes["class"] = "color-picker-item";
- div.id = "color-picker-${idx}";
- div.style.setProperty("position", "absolute");
- div.style.setProperty("left", HtmlUtils.toPx(x));
- div.style.setProperty("top", HtmlUtils.toPx(y));
- div.style.setProperty("width", HtmlUtils.toPx(_width));
- div.style.setProperty("height", HtmlUtils.toPx(_width));
- if (idx == 0) {
- div.style.setProperty("background", "url(/img/inner-menu-bg.png)");
- } else {
- div.style.setProperty("background-color", _colors[idx]);
- }
- div.on.click.add(_clickHandler);
-
- root.nodes.add(div);
- idx++;
- }
- }
- }
-}
« no previous file with comments | « samples/total/client/ClientChart.dart ('k') | samples/total/client/Command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698