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

Side by Side Diff: samples/ui_lib/layout/SizingFunctions.dart

Issue 11235054: Removed IllegalAccessException and UnsupportedOperationException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: ADded test expectations. Created 8 years, 2 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/ui_lib/layout/GridTracks.dart ('k') | samples/ui_lib/layout/ViewLayout.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) 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 // This file has classes representing the grid sizing functions 5 // This file has classes representing the grid sizing functions
6 6
7 /** 7 /**
8 * Represents the sizing function used for the min or max of a row or column. 8 * Represents the sizing function used for the min or max of a row or column.
9 */ 9 */
10 // TODO(jmesserly): rename to GridSizing, or make internal 10 // TODO(jmesserly): rename to GridSizing, or make internal
(...skipping 26 matching lines...) Expand all
37 37
38 // TODO(jmesserly): kind of ugly to have this mutable property here, but 38 // TODO(jmesserly): kind of ugly to have this mutable property here, but
39 // we need to correctly track whether we're content sized during a layout 39 // we need to correctly track whether we're content sized during a layout
40 bool _contentSized; 40 bool _contentSized;
41 41
42 FixedSizing(this.length, [this.units = 'px']) 42 FixedSizing(this.length, [this.units = 'px'])
43 : super(), 43 : super(),
44 _contentSized = false { 44 _contentSized = false {
45 if (units != 'px' && units != '%') { 45 if (units != 'px' && units != '%') {
46 // TODO(jmesserly): support other unit types 46 // TODO(jmesserly): support other unit types
47 throw new UnsupportedOperationException('Units other than px and %'); 47 throw new UnsupportedError('Units other than px and %');
48 } 48 }
49 } 49 }
50 50
51 // TODO(jmesserly): this is only needed because of our mutable property 51 // TODO(jmesserly): this is only needed because of our mutable property
52 FixedSizing clone() => new FixedSizing(length, units); 52 FixedSizing clone() => new FixedSizing(length, units);
53 53
54 bool get isMinContentSized => _contentSized; 54 bool get isMinContentSized => _contentSized;
55 55
56 num resolveLength(num gridSize) { 56 num resolveLength(num gridSize) {
57 if (units == '%') { 57 if (units == '%') {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 class _MaxBreadthAccumulator implements _BreadthAccumulator { 141 class _MaxBreadthAccumulator implements _BreadthAccumulator {
142 const _MaxBreadthAccumulator(); 142 const _MaxBreadthAccumulator();
143 143
144 void setSize(GridTrack t, num value) { t.maxBreadth = value; } 144 void setSize(GridTrack t, num value) { t.maxBreadth = value; }
145 num getSize(GridTrack t) => t.maxBreadth; 145 num getSize(GridTrack t) => t.maxBreadth;
146 146
147 SizingFunction getSizingFunction(GridTrack t) => t.maxSizing; 147 SizingFunction getSizingFunction(GridTrack t) => t.maxSizing;
148 } 148 }
149 149
OLDNEW
« no previous file with comments | « samples/ui_lib/layout/GridTracks.dart ('k') | samples/ui_lib/layout/ViewLayout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698