| OLD | NEW |
| 1 // Copyright (c) 2012, 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 * A class encapsulating the managemnet of the Html [:<table>:] representing the
spreadsheet grid. | 6 * A class encapsulating the managemnet of the Html [:<table>:] representing the
spreadsheet grid. |
| 7 */ | 7 */ |
| 8 class HtmlTable { | 8 class HtmlTable { |
| 9 | 9 |
| 10 DivElement _formulaCellSelectingDiv; | 10 DivElement _formulaCellSelectingDiv; |
| 11 Spreadsheet _spreadsheet; | 11 Spreadsheet _spreadsheet; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 // FIXME | 69 // FIXME |
| 70 void appendChild(Node child) { | 70 void appendChild(Node child) { |
| 71 _table.nodes.add(child); | 71 _table.nodes.add(child); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void deleteRow(int index) { | 74 void deleteRow(int index) { |
| 75 _table.deleteRow(index); | 75 _table.deleteRow(index); |
| 76 } | 76 } |
| 77 | 77 |
| 78 ElementRect get rect() => _table.rect; | 78 Future<ElementRect> get rect() => _table.rect; |
| 79 | 79 |
| 80 // FIXME? | 80 // FIXME? |
| 81 TableRowElement getRowElement(int row) => _table.rows[row]; | 81 TableRowElement getRowElement(int row) => _table.rows[row]; |
| 82 | 82 |
| 83 // Add or remove a class name from a table cell. | 83 // Add or remove a class name from a table cell. |
| 84 void modifyClasses(Set<CellLocation> locations, String className, bool add, | 84 void modifyClasses(Set<CellLocation> locations, String className, bool add, |
| 85 int rows, int columns, int rowShift, int columnShift) { | 85 int rows, int columns, int rowShift, int columnShift) { |
| 86 ElementList tableRows = _table.rows; | 86 ElementList tableRows = _table.rows; |
| 87 locations.forEach((CellLocation loc) { | 87 locations.forEach((CellLocation loc) { |
| 88 if (!_inView(loc.rowCol, rows, columns, rowShift, columnShift)) { | 88 if (!_inView(loc.rowCol, rows, columns, rowShift, columnShift)) { |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 if (row <= 0 || row > rows) { | 413 if (row <= 0 || row > rows) { |
| 414 return false; | 414 return false; |
| 415 } | 415 } |
| 416 int col = rowCol.col - columnShift; | 416 int col = rowCol.col - columnShift; |
| 417 if (col <= 0 || col > columns) { | 417 if (col <= 0 || col > columns) { |
| 418 return false; | 418 return false; |
| 419 } | 419 } |
| 420 return true; | 420 return true; |
| 421 } | 421 } |
| 422 } | 422 } |
| OLD | NEW |