fa4a9de55fe2e73d3b29ba4e40c392c216dc7c28
[jalviewjs.git] / site / j2s / javax / swing / JTable.js
1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["java.lang.Enum", "javax.swing.DefaultCellEditor", "$.JCheckBox", "$.JComponent", "$.Scrollable", "javax.swing.event.CellEditorListener", "$.ListSelectionListener", "$.RowSorterListener", "$.TableColumnModelListener", "$.TableModelListener", "javax.swing.plaf.UIResource", "javax.swing.table.DefaultTableCellRenderer", "$.TableCellRenderer", "javax.swing.DropMode", "javax.swing.border.EmptyBorder"], "javax.swing.JTable", ["java.lang.Boolean", "$.Double", "$.Float", "$.IllegalArgumentException", "$.Number", "java.util.Date", "java.awt.Color", "$.Dimension", "$.Point", "$.Rectangle", "java.awt.event.MouseEvent", "java.text.NumberFormat", "javax.swing.DefaultListSelectionModel", "$.Icon", "$.ImageIcon", "$.JScrollPane", "$.JTextField", "$.JViewport", "$.SizeSequence", "$.SwingUtilities", "$.UIDefaults", "$.UIManager", "javax.swing.border.LineBorder", "javax.swing.event.RowSorterEvent", "$.TableModelEvent", "javax.swing.table.AbstractTableModel", "$.DefaultTableColumnModel", "$.DefaultTableModel", "$.JTableHeader", "$.TableColumn", "$.TableRowSorter", "jssun.swing.SwingUtilities2"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.dataModel = null;
5 this.columnModel = null;
6 this.selectionModel = null;
7 this.tableHeader = null;
8 this.rowHeight = 0;
9 this.rowMargin = 0;
10 this.gridColor = null;
11 this.showHorizontalLines = false;
12 this.showVerticalLines = false;
13 this.autoResizeMode = 0;
14 this.autoCreateColumnsFromModel = false;
15 this.preferredViewportSize = null;
16 this.rowSelectionAllowed = false;
17 this.cellSelectionEnabled = false;
18 this.editorComp = null;
19 this.cellEditor = null;
20 this.editingColumn = 0;
21 this.editingRow = 0;
22 this.defaultRenderersByColumnClass = null;
23 this.defaultEditorsByColumnClass = null;
24 this.selectionForeground = null;
25 this.selectionBackground = null;
26 this.rowModel = null;
27 this.dragEnabled = false;
28 this.surrendersFocusOnKeystroke = false;
29 this.editorRemover = null;
30 this.columnSelectionAdjusting = false;
31 this.rowSelectionAdjusting = false;
32 this.isRowHeightSet = false;
33 this.updateSelectionOnSort = false;
34 this.sortManager = null;
35 this.ignoreSortChange = false;
36 this.$sorterChanged = false;
37 this.autoCreateRowSorter = false;
38 this.fillsViewportHeight = false;
39 this.dropMode = null;
40 if (!Clazz.isClassDefined ("javax.swing.JTable.SortManager")) {
41 javax.swing.JTable.$JTable$SortManager$ ();
42 }
43 if (!Clazz.isClassDefined ("javax.swing.JTable.ModelChange")) {
44 javax.swing.JTable.$JTable$ModelChange$ ();
45 }
46 Clazz.instantialize (this, arguments);
47 }, javax.swing, "JTable", javax.swing.JComponent, [javax.swing.event.TableModelListener, javax.swing.Scrollable, javax.swing.event.TableColumnModelListener, javax.swing.event.ListSelectionListener, javax.swing.event.CellEditorListener, javax.swing.event.RowSorterListener]);
48 Clazz.prepareFields (c$, function () {
49 this.dropMode = javax.swing.DropMode.USE_SELECTION;
50 });
51 Clazz.makeConstructor (c$, 
52 function () {
53 this.construct (null, null, null);
54 });
55 Clazz.makeConstructor (c$, 
56 function (dm) {
57 this.construct (dm, null, null);
58 }, "javax.swing.table.TableModel");
59 Clazz.makeConstructor (c$, 
60 function (dm, cm) {
61 this.construct (dm, cm, null);
62 }, "javax.swing.table.TableModel,javax.swing.table.TableColumnModel");
63 Clazz.makeConstructor (c$, 
64 function (dm, cm, sm) {
65 Clazz.superConstructor (this, javax.swing.JTable);
66 this.setLayout (null);
67 if (cm == null) {
68 cm = this.createDefaultColumnModel ();
69 this.autoCreateColumnsFromModel = true;
70 }this.setColumnModel (cm);
71 if (sm == null) {
72 sm = this.createDefaultSelectionModel ();
73 }this.setSelectionModel (sm);
74 if (dm == null) {
75 dm = this.createDefaultDataModel ();
76 }this.setModel (dm);
77 this.initializeLocalVars ();
78 this.updateUI ();
79 }, "javax.swing.table.TableModel,javax.swing.table.TableColumnModel,javax.swing.ListSelectionModel");
80 Clazz.makeConstructor (c$, 
81 function (numRows, numColumns) {
82 this.construct ( new javax.swing.table.DefaultTableModel (numRows, numColumns));
83 }, "~N,~N");
84 Clazz.makeConstructor (c$, 
85 function (rowData, columnNames) {
86 this.construct ( new javax.swing.table.DefaultTableModel (rowData, columnNames));
87 }, "java.util.Vector,java.util.Vector");
88 Clazz.makeConstructor (c$, 
89 function (rowData, columnNames) {
90 this.construct (((Clazz.isClassDefined ("javax.swing.JTable$1") ? 0 : javax.swing.JTable.$JTable$1$ ()), Clazz.innerTypeInstance (javax.swing.JTable$1, this, Clazz.cloneFinals ("columnNames", columnNames, "rowData", rowData))));
91 }, "~A,~A");
92 Clazz.defineMethod (c$, "addNotify", 
93 function () {
94 Clazz.superCall (this, javax.swing.JTable, "addNotify", []);
95 this.configureEnclosingScrollPane ();
96 });
97 Clazz.defineMethod (c$, "configureEnclosingScrollPane", 
98 function () {
99 var p = this.getParent ();
100 if (Clazz.instanceOf (p, javax.swing.JViewport)) {
101 var gp = p.getParent ();
102 if (Clazz.instanceOf (gp, javax.swing.JScrollPane)) {
103 var scrollPane = gp;
104 var viewport = scrollPane.getViewport ();
105 if (viewport == null || viewport.getView () !== this) {
106 return;
107 }scrollPane.setColumnHeaderView (this.getTableHeader ());
108 this.configureEnclosingScrollPaneUI ();
109 }}});
110 Clazz.defineMethod (c$, "configureEnclosingScrollPaneUI", 
111  function () {
112 var p = this.getParent ();
113 if (Clazz.instanceOf (p, javax.swing.JViewport)) {
114 var gp = p.getParent ();
115 if (Clazz.instanceOf (gp, javax.swing.JScrollPane)) {
116 var scrollPane = gp;
117 var viewport = scrollPane.getViewport ();
118 if (viewport == null || viewport.getView () !== this) {
119 return;
120 }var border = scrollPane.getBorder ();
121 if (border == null || Clazz.instanceOf (border, javax.swing.plaf.UIResource)) {
122 var scrollPaneBorder = javax.swing.UIManager.getBorder ("Table.scrollPaneBorder");
123 if (scrollPaneBorder != null) {
124 scrollPane.setBorder (scrollPaneBorder);
125 }}var corner = scrollPane.getCorner ("UPPER_TRAILING_CORNER");
126 if (corner == null || Clazz.instanceOf (corner, javax.swing.plaf.UIResource)) {
127 corner = null;
128 try {
129 corner = javax.swing.UIManager.get ("Table.scrollPaneCornerComponent");
130 } catch (e) {
131 if (Clazz.exceptionOf (e, Exception)) {
132 } else {
133 throw e;
134 }
135 }
136 scrollPane.setCorner ("UPPER_TRAILING_CORNER", corner);
137 }}}});
138 Clazz.overrideMethod (c$, "removeNotify", 
139 function () {
140 });
141 Clazz.defineMethod (c$, "unconfigureEnclosingScrollPane", 
142 function () {
143 var p = this.getParent ();
144 if (Clazz.instanceOf (p, javax.swing.JViewport)) {
145 var gp = p.getParent ();
146 if (Clazz.instanceOf (gp, javax.swing.JScrollPane)) {
147 var scrollPane = gp;
148 var viewport = scrollPane.getViewport ();
149 if (viewport == null || viewport.getView () !== this) {
150 return;
151 }scrollPane.setColumnHeaderView (null);
152 var corner = scrollPane.getCorner ("UPPER_TRAILING_CORNER");
153 if (Clazz.instanceOf (corner, javax.swing.plaf.UIResource)) {
154 scrollPane.setCorner ("UPPER_TRAILING_CORNER", null);
155 }}}});
156 Clazz.defineMethod (c$, "setUIProperty", 
157 function (propertyName, value) {
158 if (propertyName === "rowHeight") {
159 if (!this.isRowHeightSet) {
160 this.setRowHeight ((value).intValue ());
161 this.isRowHeightSet = false;
162 }return;
163 }Clazz.superCall (this, javax.swing.JTable, "setUIProperty", [propertyName, value]);
164 }, "~S,~O");
165 c$.createScrollPaneForTable = Clazz.defineMethod (c$, "createScrollPaneForTable", 
166 function (aTable) {
167 return  new javax.swing.JScrollPane (aTable);
168 }, "javax.swing.JTable");
169 Clazz.defineMethod (c$, "setTableHeader", 
170 function (tableHeader) {
171 if (this.tableHeader !== tableHeader) {
172 var old = this.tableHeader;
173 if (old != null) {
174 old.setTable (null);
175 }this.tableHeader = tableHeader;
176 if (tableHeader != null) {
177 tableHeader.setTable (this);
178 }this.firePropertyChangeObject ("tableHeader", old, tableHeader);
179 }}, "javax.swing.table.JTableHeader");
180 Clazz.defineMethod (c$, "getTableHeader", 
181 function () {
182 return this.tableHeader;
183 });
184 Clazz.defineMethod (c$, "setRowHeight", 
185 function (rowHeight) {
186 if (rowHeight <= 0) {
187 throw  new IllegalArgumentException ("New row height less than 1");
188 }var old = this.rowHeight;
189 this.rowHeight = rowHeight;
190 this.rowModel = null;
191 if (this.sortManager != null) {
192 this.sortManager.modelRowSizes = null;
193 }this.isRowHeightSet = true;
194 this.resizeAndRepaint ();
195 this.firePropertyChangeInt ("rowHeight", old, rowHeight);
196 }, "~N");
197 Clazz.defineMethod (c$, "getRowHeight", 
198 function () {
199 return this.rowHeight;
200 });
201 Clazz.defineMethod (c$, "getRowModel", 
202  function () {
203 if (this.rowModel == null) {
204 this.rowModel =  new javax.swing.SizeSequence (this.getRowCount (), this.getRowHeight ());
205 }return this.rowModel;
206 });
207 Clazz.defineMethod (c$, "setRowHeight", 
208 function (row, rowHeight) {
209 if (rowHeight <= 0) {
210 throw  new IllegalArgumentException ("New row height less than 1");
211 }this.getRowModel ().setSize (row, rowHeight);
212 if (this.sortManager != null) {
213 this.sortManager.setViewRowHeight (row, rowHeight);
214 }this.resizeAndRepaint ();
215 }, "~N,~N");
216 Clazz.defineMethod (c$, "getRowHeight", 
217 function (row) {
218 return (this.rowModel == null) ? this.getRowHeight () : this.rowModel.getSize (row);
219 }, "~N");
220 Clazz.defineMethod (c$, "setRowMargin", 
221 function (rowMargin) {
222 var old = this.rowMargin;
223 this.rowMargin = rowMargin;
224 this.resizeAndRepaint ();
225 this.firePropertyChangeInt ("rowMargin", old, rowMargin);
226 }, "~N");
227 Clazz.defineMethod (c$, "getRowMargin", 
228 function () {
229 return this.rowMargin;
230 });
231 Clazz.defineMethod (c$, "setIntercellSpacing", 
232 function (intercellSpacing) {
233 this.setRowMargin (intercellSpacing.height);
234 this.getColumnModel ().setColumnMargin (intercellSpacing.width);
235 this.resizeAndRepaint ();
236 }, "java.awt.Dimension");
237 Clazz.defineMethod (c$, "getIntercellSpacing", 
238 function () {
239 return  new java.awt.Dimension (this.getColumnModel ().getColumnMargin (), this.rowMargin);
240 });
241 Clazz.defineMethod (c$, "setGridColor", 
242 function (gridColor) {
243 if (gridColor == null) {
244 throw  new IllegalArgumentException ("New color is null");
245 }var old = this.gridColor;
246 this.gridColor = gridColor;
247 this.firePropertyChangeObject ("gridColor", old, gridColor);
248 this.repaint ();
249 }, "java.awt.Color");
250 Clazz.defineMethod (c$, "getGridColor", 
251 function () {
252 return this.gridColor;
253 });
254 Clazz.defineMethod (c$, "setShowGrid", 
255 function (showGrid) {
256 this.setShowHorizontalLines (showGrid);
257 this.setShowVerticalLines (showGrid);
258 this.repaint ();
259 }, "~B");
260 Clazz.defineMethod (c$, "setShowHorizontalLines", 
261 function (showHorizontalLines) {
262 var old = this.showHorizontalLines;
263 this.showHorizontalLines = showHorizontalLines;
264 this.firePropertyChangeBool ("showHorizontalLines", old, showHorizontalLines);
265 this.repaint ();
266 }, "~B");
267 Clazz.defineMethod (c$, "setShowVerticalLines", 
268 function (showVerticalLines) {
269 var old = this.showVerticalLines;
270 this.showVerticalLines = showVerticalLines;
271 this.firePropertyChangeBool ("showVerticalLines", old, showVerticalLines);
272 this.repaint ();
273 }, "~B");
274 Clazz.defineMethod (c$, "getShowHorizontalLines", 
275 function () {
276 return this.showHorizontalLines;
277 });
278 Clazz.defineMethod (c$, "getShowVerticalLines", 
279 function () {
280 return this.showVerticalLines;
281 });
282 Clazz.defineMethod (c$, "setAutoResizeMode", 
283 function (mode) {
284 if ((mode == 0) || (mode == 1) || (mode == 2) || (mode == 3) || (mode == 4)) {
285 var old = this.autoResizeMode;
286 this.autoResizeMode = mode;
287 this.resizeAndRepaint ();
288 if (this.tableHeader != null) {
289 this.tableHeader.resizeAndRepaint ();
290 }this.firePropertyChangeInt ("autoResizeMode", old, this.autoResizeMode);
291 }}, "~N");
292 Clazz.defineMethod (c$, "getAutoResizeMode", 
293 function () {
294 return this.autoResizeMode;
295 });
296 Clazz.defineMethod (c$, "setAutoCreateColumnsFromModel", 
297 function (autoCreateColumnsFromModel) {
298 if (this.autoCreateColumnsFromModel != autoCreateColumnsFromModel) {
299 var old = this.autoCreateColumnsFromModel;
300 this.autoCreateColumnsFromModel = autoCreateColumnsFromModel;
301 if (autoCreateColumnsFromModel) {
302 this.createDefaultColumnsFromModel ();
303 }this.firePropertyChangeBool ("autoCreateColumnsFromModel", old, autoCreateColumnsFromModel);
304 }}, "~B");
305 Clazz.defineMethod (c$, "getAutoCreateColumnsFromModel", 
306 function () {
307 return this.autoCreateColumnsFromModel;
308 });
309 Clazz.defineMethod (c$, "createDefaultColumnsFromModel", 
310 function () {
311 var m = this.getModel ();
312 if (m != null) {
313 var cm = this.getColumnModel ();
314 while (cm.getColumnCount () > 0) {
315 cm.removeColumn (cm.getColumn (0));
316 }
317 for (var i = 0; i < m.getColumnCount (); i++) {
318 var newColumn =  new javax.swing.table.TableColumn (i);
319 this.addColumn (newColumn);
320 }
321 }});
322 Clazz.defineMethod (c$, "setDefaultRenderer", 
323 function (columnClass, renderer) {
324 if (renderer != null) {
325 this.defaultRenderersByColumnClass.put (columnClass, renderer);
326 } else {
327 this.defaultRenderersByColumnClass.remove (columnClass);
328 }}, "Class,javax.swing.table.TableCellRenderer");
329 Clazz.defineMethod (c$, "getDefaultRenderer", 
330 function (columnClass) {
331 if (columnClass == null) {
332 return null;
333 } else {
334 var renderer = this.defaultRenderersByColumnClass.get (columnClass);
335 if (renderer != null) {
336 return renderer;
337 } else {
338 return this.getDefaultRenderer (columnClass.getSuperclass ());
339 }}}, "Class");
340 Clazz.defineMethod (c$, "setDefaultEditor", 
341 function (columnClass, editor) {
342 if (editor != null) {
343 this.defaultEditorsByColumnClass.put (columnClass, editor);
344 } else {
345 this.defaultEditorsByColumnClass.remove (columnClass);
346 }}, "Class,javax.swing.table.TableCellEditor");
347 Clazz.defineMethod (c$, "getDefaultEditor", 
348 function (columnClass) {
349 if (columnClass == null) {
350 return null;
351 } else {
352 var editor = this.defaultEditorsByColumnClass.get (columnClass);
353 if (editor != null) {
354 return editor;
355 } else {
356 return this.getDefaultEditor (columnClass.getSuperclass ());
357 }}}, "Class");
358 Clazz.defineMethod (c$, "setDragEnabled", 
359 function (b) {
360 this.dragEnabled = b;
361 }, "~B");
362 Clazz.defineMethod (c$, "getDragEnabled", 
363 function () {
364 return this.dragEnabled;
365 });
366 Clazz.defineMethod (c$, "setDropMode", 
367 function (dropMode) {
368 if (dropMode != null) {
369 switch (dropMode) {
370 case javax.swing.DropMode.USE_SELECTION:
371 case javax.swing.DropMode.ON:
372 case javax.swing.DropMode.INSERT:
373 case javax.swing.DropMode.INSERT_ROWS:
374 case javax.swing.DropMode.INSERT_COLS:
375 case javax.swing.DropMode.ON_OR_INSERT:
376 case javax.swing.DropMode.ON_OR_INSERT_ROWS:
377 case javax.swing.DropMode.ON_OR_INSERT_COLS:
378 this.dropMode = dropMode;
379 return;
380 }
381 }throw  new IllegalArgumentException (dropMode + ": Unsupported drop mode for table");
382 }, "javax.swing.DropMode");
383 Clazz.defineMethod (c$, "getDropMode", 
384 function () {
385 return this.dropMode;
386 });
387 Clazz.defineMethod (c$, "setAutoCreateRowSorter", 
388 function (autoCreateRowSorter) {
389 var oldValue = this.autoCreateRowSorter;
390 this.autoCreateRowSorter = autoCreateRowSorter;
391 if (autoCreateRowSorter) {
392 this.setRowSorter ( new javax.swing.table.TableRowSorter (this.getModel ()));
393 }this.firePropertyChangeBool ("autoCreateRowSorter", oldValue, autoCreateRowSorter);
394 }, "~B");
395 Clazz.defineMethod (c$, "getAutoCreateRowSorter", 
396 function () {
397 return this.autoCreateRowSorter;
398 });
399 Clazz.defineMethod (c$, "setUpdateSelectionOnSort", 
400 function (update) {
401 if (this.updateSelectionOnSort != update) {
402 this.updateSelectionOnSort = update;
403 this.firePropertyChangeBool ("updateSelectionOnSort", !update, update);
404 }}, "~B");
405 Clazz.defineMethod (c$, "getUpdateSelectionOnSort", 
406 function () {
407 return this.updateSelectionOnSort;
408 });
409 Clazz.defineMethod (c$, "setRowSorter", 
410 function (sorter) {
411 var oldRowSorter = null;
412 if (this.sortManager != null) {
413 oldRowSorter = this.sortManager.sorter;
414 this.sortManager.dispose ();
415 this.sortManager = null;
416 }this.rowModel = null;
417 this.clearSelectionAndLeadAnchor ();
418 if (sorter != null) {
419 this.sortManager = Clazz.innerTypeInstance (javax.swing.JTable.SortManager, this, null, sorter);
420 }this.resizeAndRepaint ();
421 this.firePropertyChangeObject ("rowSorter", oldRowSorter, sorter);
422 this.firePropertyChangeObject ("sorter", oldRowSorter, sorter);
423 }, "javax.swing.RowSorter");
424 Clazz.defineMethod (c$, "getRowSorter", 
425 function () {
426 return (this.sortManager != null) ? this.sortManager.sorter : null;
427 });
428 Clazz.defineMethod (c$, "setSelectionMode", 
429 function (selectionMode) {
430 this.clearSelection ();
431 this.getSelectionModel ().setSelectionMode (selectionMode);
432 this.getColumnModel ().getSelectionModel ().setSelectionMode (selectionMode);
433 }, "~N");
434 Clazz.defineMethod (c$, "setRowSelectionAllowed", 
435 function (rowSelectionAllowed) {
436 var old = this.rowSelectionAllowed;
437 this.rowSelectionAllowed = rowSelectionAllowed;
438 if (old != rowSelectionAllowed) {
439 this.repaint ();
440 }this.firePropertyChangeBool ("rowSelectionAllowed", old, rowSelectionAllowed);
441 }, "~B");
442 Clazz.defineMethod (c$, "getRowSelectionAllowed", 
443 function () {
444 return this.rowSelectionAllowed;
445 });
446 Clazz.defineMethod (c$, "setColumnSelectionAllowed", 
447 function (columnSelectionAllowed) {
448 var old = this.columnModel.getColumnSelectionAllowed ();
449 this.columnModel.setColumnSelectionAllowed (columnSelectionAllowed);
450 if (old != columnSelectionAllowed) {
451 this.repaint ();
452 }this.firePropertyChangeBool ("columnSelectionAllowed", old, columnSelectionAllowed);
453 }, "~B");
454 Clazz.defineMethod (c$, "getColumnSelectionAllowed", 
455 function () {
456 return this.columnModel.getColumnSelectionAllowed ();
457 });
458 Clazz.defineMethod (c$, "setCellSelectionEnabled", 
459 function (cellSelectionEnabled) {
460 this.setRowSelectionAllowed (cellSelectionEnabled);
461 this.setColumnSelectionAllowed (cellSelectionEnabled);
462 var old = this.cellSelectionEnabled;
463 this.cellSelectionEnabled = cellSelectionEnabled;
464 this.firePropertyChangeBool ("cellSelectionEnabled", old, cellSelectionEnabled);
465 }, "~B");
466 Clazz.defineMethod (c$, "getCellSelectionEnabled", 
467 function () {
468 return this.getRowSelectionAllowed () && this.getColumnSelectionAllowed ();
469 });
470 Clazz.defineMethod (c$, "selectAll", 
471 function () {
472 if (this.isEditing ()) {
473 this.removeEditor ();
474 }if (this.getRowCount () > 0 && this.getColumnCount () > 0) {
475 var oldLead;
476 var oldAnchor;
477 var selModel;
478 selModel = this.selectionModel;
479 selModel.setValueIsAdjusting (true);
480 oldLead = this.getAdjustedIndex (selModel.getLeadSelectionIndex (), true);
481 oldAnchor = this.getAdjustedIndex (selModel.getAnchorSelectionIndex (), true);
482 this.setRowSelectionInterval (0, this.getRowCount () - 1);
483 jssun.swing.SwingUtilities2.setLeadAnchorWithoutSelection (selModel, oldLead, oldAnchor);
484 selModel.setValueIsAdjusting (false);
485 selModel = this.columnModel.getSelectionModel ();
486 selModel.setValueIsAdjusting (true);
487 oldLead = this.getAdjustedIndex (selModel.getLeadSelectionIndex (), false);
488 oldAnchor = this.getAdjustedIndex (selModel.getAnchorSelectionIndex (), false);
489 this.setColumnSelectionInterval (0, this.getColumnCount () - 1);
490 jssun.swing.SwingUtilities2.setLeadAnchorWithoutSelection (selModel, oldLead, oldAnchor);
491 selModel.setValueIsAdjusting (false);
492 }});
493 Clazz.defineMethod (c$, "clearSelection", 
494 function () {
495 this.selectionModel.clearSelection ();
496 this.columnModel.getSelectionModel ().clearSelection ();
497 });
498 Clazz.defineMethod (c$, "clearSelectionAndLeadAnchor", 
499  function () {
500 this.selectionModel.setValueIsAdjusting (true);
501 this.columnModel.getSelectionModel ().setValueIsAdjusting (true);
502 this.clearSelection ();
503 this.selectionModel.setAnchorSelectionIndex (-1);
504 this.selectionModel.setLeadSelectionIndex (-1);
505 this.columnModel.getSelectionModel ().setAnchorSelectionIndex (-1);
506 this.columnModel.getSelectionModel ().setLeadSelectionIndex (-1);
507 this.selectionModel.setValueIsAdjusting (false);
508 this.columnModel.getSelectionModel ().setValueIsAdjusting (false);
509 });
510 Clazz.defineMethod (c$, "getAdjustedIndex", 
511  function (index, row) {
512 var compare = row ? this.getRowCount () : this.getColumnCount ();
513 return index < compare ? index : -1;
514 }, "~N,~B");
515 Clazz.defineMethod (c$, "boundRow", 
516  function (row) {
517 if (row < 0 || row >= this.getRowCount ()) {
518 throw  new IllegalArgumentException ("Row index out of range");
519 }return row;
520 }, "~N");
521 Clazz.defineMethod (c$, "boundColumn", 
522  function (col) {
523 if (col < 0 || col >= this.getColumnCount ()) {
524 throw  new IllegalArgumentException ("Column index out of range");
525 }return col;
526 }, "~N");
527 Clazz.defineMethod (c$, "setRowSelectionInterval", 
528 function (index0, index1) {
529 this.selectionModel.setSelectionInterval (this.boundRow (index0), this.boundRow (index1));
530 }, "~N,~N");
531 Clazz.defineMethod (c$, "setColumnSelectionInterval", 
532 function (index0, index1) {
533 this.columnModel.getSelectionModel ().setSelectionInterval (this.boundColumn (index0), this.boundColumn (index1));
534 }, "~N,~N");
535 Clazz.defineMethod (c$, "addRowSelectionInterval", 
536 function (index0, index1) {
537 this.selectionModel.addSelectionInterval (this.boundRow (index0), this.boundRow (index1));
538 }, "~N,~N");
539 Clazz.defineMethod (c$, "addColumnSelectionInterval", 
540 function (index0, index1) {
541 this.columnModel.getSelectionModel ().addSelectionInterval (this.boundColumn (index0), this.boundColumn (index1));
542 }, "~N,~N");
543 Clazz.defineMethod (c$, "removeRowSelectionInterval", 
544 function (index0, index1) {
545 this.selectionModel.removeSelectionInterval (this.boundRow (index0), this.boundRow (index1));
546 }, "~N,~N");
547 Clazz.defineMethod (c$, "removeColumnSelectionInterval", 
548 function (index0, index1) {
549 this.columnModel.getSelectionModel ().removeSelectionInterval (this.boundColumn (index0), this.boundColumn (index1));
550 }, "~N,~N");
551 Clazz.defineMethod (c$, "getSelectedRow", 
552 function () {
553 return this.selectionModel.getMinSelectionIndex ();
554 });
555 Clazz.defineMethod (c$, "getSelectedColumn", 
556 function () {
557 return this.columnModel.getSelectionModel ().getMinSelectionIndex ();
558 });
559 Clazz.defineMethod (c$, "getSelectedRows", 
560 function () {
561 var iMin = this.selectionModel.getMinSelectionIndex ();
562 var iMax = this.selectionModel.getMaxSelectionIndex ();
563 if ((iMin == -1) || (iMax == -1)) {
564 return  Clazz.newIntArray (0, 0);
565 }var rvTmp =  Clazz.newIntArray (1 + (iMax - iMin), 0);
566 var n = 0;
567 for (var i = iMin; i <= iMax; i++) {
568 if (this.selectionModel.isSelectedIndex (i)) {
569 rvTmp[n++] = i;
570 }}
571 var rv =  Clazz.newIntArray (n, 0);
572 System.arraycopy (rvTmp, 0, rv, 0, n);
573 return rv;
574 });
575 Clazz.defineMethod (c$, "getSelectedColumns", 
576 function () {
577 return this.columnModel.getSelectedColumns ();
578 });
579 Clazz.defineMethod (c$, "getSelectedRowCount", 
580 function () {
581 var iMin = this.selectionModel.getMinSelectionIndex ();
582 var iMax = this.selectionModel.getMaxSelectionIndex ();
583 var count = 0;
584 for (var i = iMin; i <= iMax; i++) {
585 if (this.selectionModel.isSelectedIndex (i)) {
586 count++;
587 }}
588 return count;
589 });
590 Clazz.defineMethod (c$, "getSelectedColumnCount", 
591 function () {
592 return this.columnModel.getSelectedColumnCount ();
593 });
594 Clazz.defineMethod (c$, "isRowSelected", 
595 function (row) {
596 return this.selectionModel.isSelectedIndex (row);
597 }, "~N");
598 Clazz.defineMethod (c$, "isColumnSelected", 
599 function (column) {
600 return this.columnModel.getSelectionModel ().isSelectedIndex (column);
601 }, "~N");
602 Clazz.defineMethod (c$, "isCellSelected", 
603 function (row, column) {
604 if (!this.getRowSelectionAllowed () && !this.getColumnSelectionAllowed ()) {
605 return false;
606 }return (!this.getRowSelectionAllowed () || this.isRowSelected (row)) && (!this.getColumnSelectionAllowed () || this.isColumnSelected (column));
607 }, "~N,~N");
608 Clazz.defineMethod (c$, "changeSelectionModel", 
609  function (sm, index, toggle, extend, selected, anchor, anchorSelected) {
610 if (extend) {
611 if (toggle) {
612 if (anchorSelected) {
613 sm.addSelectionInterval (anchor, index);
614 } else {
615 sm.removeSelectionInterval (anchor, index);
616 if (Boolean.TRUE === this.getClientProperty ("Table.isFileList")) {
617 sm.addSelectionInterval (index, index);
618 sm.setAnchorSelectionIndex (anchor);
619 }}} else {
620 sm.setSelectionInterval (anchor, index);
621 }} else {
622 if (toggle) {
623 if (selected) {
624 sm.removeSelectionInterval (index, index);
625 } else {
626 sm.addSelectionInterval (index, index);
627 }} else {
628 sm.setSelectionInterval (index, index);
629 }}}, "javax.swing.ListSelectionModel,~N,~B,~B,~B,~N,~B");
630 Clazz.defineMethod (c$, "changeSelection", 
631 function (rowIndex, columnIndex, toggle, extend) {
632 var rsm = this.getSelectionModel ();
633 var csm = this.getColumnModel ().getSelectionModel ();
634 var anchorRow = this.getAdjustedIndex (rsm.getAnchorSelectionIndex (), true);
635 var anchorCol = this.getAdjustedIndex (csm.getAnchorSelectionIndex (), false);
636 var anchorSelected = true;
637 if (anchorRow == -1) {
638 if (this.getRowCount () > 0) {
639 anchorRow = 0;
640 }anchorSelected = false;
641 }if (anchorCol == -1) {
642 if (this.getColumnCount () > 0) {
643 anchorCol = 0;
644 }anchorSelected = false;
645 }var selected = this.isCellSelected (rowIndex, columnIndex);
646 anchorSelected = anchorSelected && this.isCellSelected (anchorRow, anchorCol);
647 this.changeSelectionModel (csm, columnIndex, toggle, extend, selected, anchorCol, anchorSelected);
648 this.changeSelectionModel (rsm, rowIndex, toggle, extend, selected, anchorRow, anchorSelected);
649 if (this.getAutoscrolls ()) {
650 var cellRect = this.getCellRect (rowIndex, columnIndex, false);
651 if (cellRect != null) {
652 this.scrollRectToVisible (cellRect);
653 }}}, "~N,~N,~B,~B");
654 Clazz.defineMethod (c$, "getSelectionForeground", 
655 function () {
656 return this.selectionForeground;
657 });
658 Clazz.defineMethod (c$, "setSelectionForeground", 
659 function (selectionForeground) {
660 var old = this.selectionForeground;
661 this.selectionForeground = selectionForeground;
662 this.firePropertyChangeObject ("selectionForeground", old, selectionForeground);
663 if (!selectionForeground.equals (old)) {
664 this.repaint ();
665 }}, "java.awt.Color");
666 Clazz.defineMethod (c$, "getSelectionBackground", 
667 function () {
668 return this.selectionBackground;
669 });
670 Clazz.defineMethod (c$, "setSelectionBackground", 
671 function (selectionBackground) {
672 var old = this.selectionBackground;
673 this.selectionBackground = selectionBackground;
674 this.firePropertyChangeObject ("selectionBackground", old, selectionBackground);
675 if (!selectionBackground.equals (old)) {
676 this.repaint ();
677 }}, "java.awt.Color");
678 Clazz.defineMethod (c$, "getColumn", 
679 function (identifier) {
680 var cm = this.getColumnModel ();
681 var columnIndex = cm.getColumnIndex (identifier);
682 return cm.getColumn (columnIndex);
683 }, "~O");
684 Clazz.defineMethod (c$, "convertColumnIndexToModel", 
685 function (viewColumnIndex) {
686 if (viewColumnIndex < 0) {
687 return viewColumnIndex;
688 }return this.getColumnModel ().getColumn (viewColumnIndex).getModelIndex ();
689 }, "~N");
690 Clazz.defineMethod (c$, "convertColumnIndexToView", 
691 function (modelColumnIndex) {
692 if (modelColumnIndex < 0) {
693 return modelColumnIndex;
694 }var cm = this.getColumnModel ();
695 for (var column = 0; column < this.getColumnCount (); column++) {
696 if (cm.getColumn (column).getModelIndex () == modelColumnIndex) {
697 return column;
698 }}
699 return -1;
700 }, "~N");
701 Clazz.defineMethod (c$, "convertRowIndexToView", 
702 function (modelRowIndex) {
703 var sorter = this.getRowSorter ();
704 if (sorter != null) {
705 return sorter.convertRowIndexToView (modelRowIndex);
706 }return modelRowIndex;
707 }, "~N");
708 Clazz.defineMethod (c$, "convertRowIndexToModel", 
709 function (viewRowIndex) {
710 var sorter = this.getRowSorter ();
711 if (sorter != null) {
712 return sorter.convertRowIndexToModel (viewRowIndex);
713 }return viewRowIndex;
714 }, "~N");
715 Clazz.defineMethod (c$, "getRowCount", 
716 function () {
717 var sorter = this.getRowSorter ();
718 if (sorter != null) {
719 return sorter.getViewRowCount ();
720 }return this.getModel ().getRowCount ();
721 });
722 Clazz.defineMethod (c$, "getColumnCount", 
723 function () {
724 return this.getColumnModel ().getColumnCount ();
725 });
726 Clazz.defineMethod (c$, "getColumnName", 
727 function (column) {
728 return this.getModel ().getColumnName (this.convertColumnIndexToModel (column));
729 }, "~N");
730 Clazz.defineMethod (c$, "getColumnClass", 
731 function (column) {
732 return this.getModel ().getColumnClass (this.convertColumnIndexToModel (column));
733 }, "~N");
734 Clazz.defineMethod (c$, "getValueAt", 
735 function (row, column) {
736 return this.getModel ().getValueAt (this.convertRowIndexToModel (row), this.convertColumnIndexToModel (column));
737 }, "~N,~N");
738 Clazz.defineMethod (c$, "setValueAt", 
739 function (aValue, row, column) {
740 this.getModel ().setValueAt (aValue, this.convertRowIndexToModel (row), this.convertColumnIndexToModel (column));
741 }, "~O,~N,~N");
742 Clazz.defineMethod (c$, "isCellEditable", 
743 function (row, column) {
744 return this.getModel ().isCellEditable (this.convertRowIndexToModel (row), this.convertColumnIndexToModel (column));
745 }, "~N,~N");
746 Clazz.defineMethod (c$, "addColumn", 
747 function (aColumn) {
748 if (aColumn.getHeaderValue () == null) {
749 var modelColumn = aColumn.getModelIndex ();
750 var columnName = this.getModel ().getColumnName (modelColumn);
751 aColumn.setHeaderValue (columnName);
752 }this.getColumnModel ().addColumn (aColumn);
753 }, "javax.swing.table.TableColumn");
754 Clazz.defineMethod (c$, "removeColumn", 
755 function (aColumn) {
756 this.getColumnModel ().removeColumn (aColumn);
757 }, "javax.swing.table.TableColumn");
758 Clazz.defineMethod (c$, "moveColumn", 
759 function (column, targetColumn) {
760 this.getColumnModel ().moveColumn (column, targetColumn);
761 }, "~N,~N");
762 Clazz.defineMethod (c$, "columnAtPoint", 
763 function (point) {
764 var x = point.x;
765 if (!this.getComponentOrientation ().isLeftToRight ()) {
766 x = this.getWidth () - x - 1;
767 }return this.getColumnModel ().getColumnIndexAtX (x);
768 }, "java.awt.Point");
769 Clazz.defineMethod (c$, "rowAtPoint", 
770 function (point) {
771 var y = point.y;
772 var result = (this.rowModel == null) ? Clazz.doubleToInt (y / this.getRowHeight ()) : this.rowModel.getIndex (y);
773 if (result < 0) {
774 return -1;
775 } else if (result >= this.getRowCount ()) {
776 return -1;
777 } else {
778 return result;
779 }}, "java.awt.Point");
780 Clazz.defineMethod (c$, "getCellRect", 
781 function (row, column, includeSpacing) {
782 var r =  new java.awt.Rectangle ();
783 var valid = true;
784 if (row < 0) {
785 valid = false;
786 } else if (row >= this.getRowCount ()) {
787 r.y = this.getHeight ();
788 valid = false;
789 } else {
790 r.height = this.getRowHeight (row);
791 r.y = (this.rowModel == null) ? row * r.height : this.rowModel.getPosition (row);
792 }if (column < 0) {
793 if (!this.getComponentOrientation ().isLeftToRight ()) {
794 r.x = this.getWidth ();
795 }valid = false;
796 } else if (column >= this.getColumnCount ()) {
797 if (this.getComponentOrientation ().isLeftToRight ()) {
798 r.x = this.getWidth ();
799 }valid = false;
800 } else {
801 var cm = this.getColumnModel ();
802 if (this.getComponentOrientation ().isLeftToRight ()) {
803 for (var i = 0; i < column; i++) {
804 r.x += cm.getColumn (i).getWidth ();
805 }
806 } else {
807 for (var i = cm.getColumnCount () - 1; i > column; i--) {
808 r.x += cm.getColumn (i).getWidth ();
809 }
810 }r.width = cm.getColumn (column).getWidth ();
811 }if (valid && !includeSpacing) {
812 var rm = Math.min (this.getRowMargin (), r.height);
813 var cm = Math.min (this.getColumnModel ().getColumnMargin (), r.width);
814 r.reshape (r.x + Clazz.doubleToInt (cm / 2), r.y + Clazz.doubleToInt (rm / 2), r.width - cm, r.height - rm);
815 }return r;
816 }, "~N,~N,~B");
817 Clazz.defineMethod (c$, "viewIndexForColumn", 
818  function (aColumn) {
819 var cm = this.getColumnModel ();
820 for (var column = 0; column < cm.getColumnCount (); column++) {
821 if (cm.getColumn (column) === aColumn) {
822 return column;
823 }}
824 return -1;
825 }, "javax.swing.table.TableColumn");
826 Clazz.defineMethod (c$, "doLayout", 
827 function () {
828 var resizingColumn = this.getResizingColumn ();
829 if (resizingColumn == null) {
830 this.setWidthsFromPreferredWidths (false);
831 } else {
832 var columnIndex = this.viewIndexForColumn (resizingColumn);
833 var delta = this.getWidth () - this.getColumnModel ().getTotalColumnWidth ();
834 this.accommodateDelta (columnIndex, delta);
835 delta = this.getWidth () - this.getColumnModel ().getTotalColumnWidth ();
836 if (delta != 0) {
837 resizingColumn.setWidth (resizingColumn.getWidth () + delta);
838 }this.setWidthsFromPreferredWidths (true);
839 }Clazz.superCall (this, javax.swing.JTable, "doLayout", []);
840 });
841 Clazz.defineMethod (c$, "getResizingColumn", 
842  function () {
843 return (this.tableHeader == null) ? null : this.tableHeader.getResizingColumn ();
844 });
845 Clazz.defineMethod (c$, "sizeColumnsToFit", 
846 function (lastColumnOnly) {
847 var oldAutoResizeMode = this.autoResizeMode;
848 this.setAutoResizeMode (lastColumnOnly ? 3 : 4);
849 this.sizeColumnsToFit (-1);
850 this.setAutoResizeMode (oldAutoResizeMode);
851 }, "~B");
852 Clazz.defineMethod (c$, "sizeColumnsToFit", 
853 function (resizingColumn) {
854 if (resizingColumn == -1) {
855 this.setWidthsFromPreferredWidths (false);
856 } else {
857 if (this.autoResizeMode == 0) {
858 var aColumn = this.getColumnModel ().getColumn (resizingColumn);
859 aColumn.setPreferredWidth (aColumn.getWidth ());
860 } else {
861 var delta = this.getWidth () - this.getColumnModel ().getTotalColumnWidth ();
862 this.accommodateDelta (resizingColumn, delta);
863 this.setWidthsFromPreferredWidths (true);
864 }}}, "~N");
865 Clazz.defineMethod (c$, "setWidthsFromPreferredWidths", 
866  function (inverse) {
867 var totalWidth = this.getWidth ();
868 var totalPreferred = this.getPreferredSize ().width;
869 var target = !inverse ? totalWidth : totalPreferred;
870 var cm = this.columnModel;
871 var r = ((Clazz.isClassDefined ("javax.swing.JTable$2") ? 0 : javax.swing.JTable.$JTable$2$ ()), Clazz.innerTypeInstance (javax.swing.JTable$2, this, Clazz.cloneFinals ("cm", cm, "inverse", inverse)));
872 this.adjustSizes (target, r, inverse);
873 }, "~B");
874 Clazz.defineMethod (c$, "accommodateDelta", 
875  function (resizingColumnIndex, delta) {
876 var columnCount = this.getColumnCount ();
877 var from = resizingColumnIndex;
878 var to = columnCount;
879 switch (this.autoResizeMode) {
880 case 1:
881 from = from + 1;
882 to = Math.min (from + 1, columnCount);
883 break;
884 case 2:
885 from = from + 1;
886 to = columnCount;
887 break;
888 case 3:
889 from = columnCount - 1;
890 to = from + 1;
891 break;
892 case 4:
893 from = 0;
894 to = columnCount;
895 break;
896 default:
897 return;
898 }
899 var start = from;
900 var end = to;
901 var cm = this.columnModel;
902 var r = ((Clazz.isClassDefined ("javax.swing.JTable$3") ? 0 : javax.swing.JTable.$JTable$3$ ()), Clazz.innerTypeInstance (javax.swing.JTable$3, this, Clazz.cloneFinals ("end", end, "start", start, "cm", cm)));
903 var totalWidth = 0;
904 for (var i = from; i < to; i++) {
905 var aColumn = this.columnModel.getColumn (i);
906 var input = aColumn.getWidth ();
907 totalWidth = totalWidth + input;
908 }
909 this.adjustSizes (totalWidth + delta, r, false);
910 return;
911 }, "~N,~N");
912 Clazz.defineMethod (c$, "adjustSizes", 
913  function (target, r, inverse) {
914 var N = r.getElementCount ();
915 var totalPreferred = 0;
916 for (var i = 0; i < N; i++) {
917 totalPreferred += r.getMidPointAt (i);
918 }
919 var s;
920 if ((target < totalPreferred) == !inverse) {
921 s = ((Clazz.isClassDefined ("javax.swing.JTable$4") ? 0 : javax.swing.JTable.$JTable$4$ ()), Clazz.innerTypeInstance (javax.swing.JTable$4, this, Clazz.cloneFinals ("r", r)));
922 } else {
923 s = ((Clazz.isClassDefined ("javax.swing.JTable$5") ? 0 : javax.swing.JTable.$JTable$5$ ()), Clazz.innerTypeInstance (javax.swing.JTable$5, this, Clazz.cloneFinals ("r", r)));
924 }this.adjustSizes (target, s, !inverse);
925 }, "~N,javax.swing.JTable.Resizable3,~B");
926 Clazz.defineMethod (c$, "adjustSizes", 
927  function (target, r, limitToRange) {
928 var totalLowerBound = 0;
929 var totalUpperBound = 0;
930 for (var i = 0; i < r.getElementCount (); i++) {
931 totalLowerBound += r.getLowerBoundAt (i);
932 totalUpperBound += r.getUpperBoundAt (i);
933 }
934 if (limitToRange) {
935 target = Math.min (Math.max (totalLowerBound, target), totalUpperBound);
936 }for (var i = 0; i < r.getElementCount (); i++) {
937 var lowerBound = r.getLowerBoundAt (i);
938 var upperBound = r.getUpperBoundAt (i);
939 var newSize;
940 if (totalLowerBound == totalUpperBound) {
941 newSize = lowerBound;
942 } else {
943 var f = (target - totalLowerBound) / (totalUpperBound - totalLowerBound);
944 newSize = Math.round (lowerBound + f * (upperBound - lowerBound));
945 }r.setSizeAt (newSize, i);
946 target -= newSize;
947 totalLowerBound -= lowerBound;
948 totalUpperBound -= upperBound;
949 }
950 }, "~N,javax.swing.JTable.Resizable2,~B");
951 Clazz.defineMethod (c$, "getToolTipText", 
952 function (event) {
953 var tip = null;
954 var p = event.getPoint ();
955 var hitColumnIndex = this.columnAtPoint (p);
956 var hitRowIndex = this.rowAtPoint (p);
957 if ((hitColumnIndex != -1) && (hitRowIndex != -1)) {
958 var renderer = this.getCellRenderer (hitRowIndex, hitColumnIndex);
959 var component = this.prepareRenderer (renderer, hitRowIndex, hitColumnIndex);
960 if (Clazz.instanceOf (component, javax.swing.JComponent)) {
961 var cellRect = this.getCellRect (hitRowIndex, hitColumnIndex, false);
962 p.translate (-cellRect.x, -cellRect.y);
963 var newEvent =  new java.awt.event.MouseEvent (component, event.getID (), event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0);
964 tip = (component).getToolTipText (newEvent);
965 }}if (tip == null) tip = this.getToolTipText ();
966 return tip;
967 }, "java.awt.event.MouseEvent");
968 Clazz.defineMethod (c$, "setSurrendersFocusOnKeystroke", 
969 function (surrendersFocusOnKeystroke) {
970 this.surrendersFocusOnKeystroke = surrendersFocusOnKeystroke;
971 }, "~B");
972 Clazz.defineMethod (c$, "getSurrendersFocusOnKeystroke", 
973 function () {
974 return this.surrendersFocusOnKeystroke;
975 });
976 Clazz.defineMethod (c$, "editCellAt", 
977 function (row, column) {
978 return this.editCellAt (row, column, null);
979 }, "~N,~N");
980 Clazz.defineMethod (c$, "editCellAt", 
981 function (row, column, e) {
982 if (this.cellEditor != null && !this.cellEditor.stopCellEditing ()) {
983 return false;
984 }if (row < 0 || row >= this.getRowCount () || column < 0 || column >= this.getColumnCount ()) {
985 return false;
986 }if (!this.isCellEditable (row, column)) return false;
987 if (this.editorRemover == null) {
988 }var editor = this.getCellEditor (row, column);
989 if (editor != null && editor.isCellEditable (e)) {
990 this.editorComp = this.prepareEditor (editor, row, column);
991 if (this.editorComp == null) {
992 this.removeEditor ();
993 return false;
994 }this.editorComp.setBounds (this.getCellRect (row, column, false));
995 this.add (this.editorComp);
996 this.editorComp.validate ();
997 this.editorComp.repaint ();
998 this.setCellEditor (editor);
999 this.setEditingRow (row);
1000 this.setEditingColumn (column);
1001 editor.addCellEditorListener (this);
1002 return true;
1003 }return false;
1004 }, "~N,~N,java.util.EventObject");
1005 Clazz.defineMethod (c$, "isEditing", 
1006 function () {
1007 return (this.cellEditor == null) ? false : true;
1008 });
1009 Clazz.defineMethod (c$, "getEditorComponent", 
1010 function () {
1011 return this.editorComp;
1012 });
1013 Clazz.defineMethod (c$, "getEditingColumn", 
1014 function () {
1015 return this.editingColumn;
1016 });
1017 Clazz.defineMethod (c$, "getEditingRow", 
1018 function () {
1019 return this.editingRow;
1020 });
1021 Clazz.overrideMethod (c$, "getUI", 
1022 function () {
1023 return this.ui;
1024 });
1025 Clazz.defineMethod (c$, "setUI", 
1026 function (ui) {
1027 if (this.ui !== ui) {
1028 Clazz.superCall (this, javax.swing.JTable, "setUI", [ui]);
1029 this.repaint ();
1030 }}, "javax.swing.plaf.TableUI");
1031 Clazz.overrideMethod (c$, "updateUI", 
1032 function () {
1033 var cm = this.getColumnModel ();
1034 for (var column = 0; column < cm.getColumnCount (); column++) {
1035 var aColumn = cm.getColumn (column);
1036 javax.swing.SwingUtilities.updateRendererOrEditorUI (aColumn.getCellRenderer ());
1037 javax.swing.SwingUtilities.updateRendererOrEditorUI (aColumn.getCellEditor ());
1038 javax.swing.SwingUtilities.updateRendererOrEditorUI (aColumn.getHeaderRenderer ());
1039 }
1040 var defaultRenderers = this.defaultRenderersByColumnClass.elements ();
1041 while (defaultRenderers.hasMoreElements ()) {
1042 javax.swing.SwingUtilities.updateRendererOrEditorUI (defaultRenderers.nextElement ());
1043 }
1044 var defaultEditors = this.defaultEditorsByColumnClass.elements ();
1045 while (defaultEditors.hasMoreElements ()) {
1046 javax.swing.SwingUtilities.updateRendererOrEditorUI (defaultEditors.nextElement ());
1047 }
1048 if (this.tableHeader != null && this.tableHeader.getParent () == null) {
1049 this.tableHeader.updateUI ();
1050 }this.configureEnclosingScrollPaneUI ();
1051 this.setUI (javax.swing.UIManager.getUI (this));
1052 });
1053 Clazz.overrideMethod (c$, "getUIClassID", 
1054 function () {
1055 return "TableUI";
1056 });
1057 Clazz.defineMethod (c$, "setModel", 
1058 function (dataModel) {
1059 if (dataModel == null) {
1060 throw  new IllegalArgumentException ("Cannot set a null TableModel");
1061 }if (this.dataModel !== dataModel) {
1062 var old = this.dataModel;
1063 if (old != null) {
1064 old.removeTableModelListener (this);
1065 }this.dataModel = dataModel;
1066 dataModel.addTableModelListener (this);
1067 this.tableChanged ( new javax.swing.event.TableModelEvent (dataModel, -1));
1068 this.firePropertyChangeObject ("model", old, dataModel);
1069 if (this.getAutoCreateRowSorter ()) {
1070 this.setRowSorter ( new javax.swing.table.TableRowSorter (dataModel));
1071 }}}, "javax.swing.table.TableModel");
1072 Clazz.defineMethod (c$, "getModel", 
1073 function () {
1074 return this.dataModel;
1075 });
1076 Clazz.defineMethod (c$, "setColumnModel", 
1077 function (columnModel) {
1078 if (columnModel == null) {
1079 throw  new IllegalArgumentException ("Cannot set a null ColumnModel");
1080 }var old = this.columnModel;
1081 if (columnModel !== old) {
1082 if (old != null) {
1083 old.removeColumnModelListener (this);
1084 }this.columnModel = columnModel;
1085 columnModel.addColumnModelListener (this);
1086 if (this.tableHeader != null) {
1087 this.tableHeader.setColumnModel (columnModel);
1088 }this.firePropertyChangeObject ("columnModel", old, columnModel);
1089 this.resizeAndRepaint ();
1090 }}, "javax.swing.table.TableColumnModel");
1091 Clazz.defineMethod (c$, "getColumnModel", 
1092 function () {
1093 return this.columnModel;
1094 });
1095 Clazz.defineMethod (c$, "setSelectionModel", 
1096 function (newModel) {
1097 if (newModel == null) {
1098 throw  new IllegalArgumentException ("Cannot set a null SelectionModel");
1099 }var oldModel = this.selectionModel;
1100 if (newModel !== oldModel) {
1101 if (oldModel != null) {
1102 oldModel.removeListSelectionListener (this);
1103 }this.selectionModel = newModel;
1104 newModel.addListSelectionListener (this);
1105 this.firePropertyChangeObject ("selectionModel", oldModel, newModel);
1106 this.repaint ();
1107 }}, "javax.swing.ListSelectionModel");
1108 Clazz.defineMethod (c$, "getSelectionModel", 
1109 function () {
1110 return this.selectionModel;
1111 });
1112 Clazz.overrideMethod (c$, "sorterChanged", 
1113 function (e) {
1114 if (e.getType () === javax.swing.event.RowSorterEvent.Type.SORT_ORDER_CHANGED) {
1115 var header = this.getTableHeader ();
1116 if (header != null) {
1117 header.repaint ();
1118 }} else if (e.getType () === javax.swing.event.RowSorterEvent.Type.SORTED) {
1119 this.$sorterChanged = true;
1120 if (!this.ignoreSortChange) {
1121 this.sortedTableChanged (e, null);
1122 }}}, "javax.swing.event.RowSorterEvent");
1123 Clazz.defineMethod (c$, "sortedTableChanged", 
1124  function (sortedEvent, e) {
1125 var editingModelIndex = -1;
1126 var change = (e != null) ? Clazz.innerTypeInstance (javax.swing.JTable.ModelChange, this, null, e) : null;
1127 if ((change == null || !change.allRowsChanged) && this.editingRow != -1) {
1128 editingModelIndex = this.convertRowIndexToModel (sortedEvent, this.editingRow);
1129 }this.sortManager.prepareForChange (sortedEvent, change);
1130 if (e != null) {
1131 if (change.type == 0) {
1132 this.repaintSortedRows (change);
1133 }this.notifySorter (change);
1134 if (change.type != 0) {
1135 this.$sorterChanged = true;
1136 }} else {
1137 this.$sorterChanged = true;
1138 }this.sortManager.processChange (sortedEvent, change, this.$sorterChanged);
1139 if (this.$sorterChanged) {
1140 if (this.editingRow != -1) {
1141 var newIndex = (editingModelIndex == -1) ? -1 : this.convertRowIndexToView (editingModelIndex, change);
1142 this.restoreSortingEditingRow (newIndex);
1143 }if (e == null || change.type != 0) {
1144 this.resizeAndRepaint ();
1145 }}if (change != null && change.allRowsChanged) {
1146 this.clearSelectionAndLeadAnchor ();
1147 this.resizeAndRepaint ();
1148 }}, "javax.swing.event.RowSorterEvent,javax.swing.event.TableModelEvent");
1149 Clazz.defineMethod (c$, "repaintSortedRows", 
1150  function (change) {
1151 if (change.startModelIndex > change.endModelIndex || change.startModelIndex + 10 < change.endModelIndex) {
1152 this.repaint ();
1153 return;
1154 }var eventColumn = change.event.getColumn ();
1155 var columnViewIndex = eventColumn;
1156 if (columnViewIndex == -1) {
1157 columnViewIndex = 0;
1158 } else {
1159 columnViewIndex = this.convertColumnIndexToView (columnViewIndex);
1160 if (columnViewIndex == -1) {
1161 return;
1162 }}var modelIndex = change.startModelIndex;
1163 while (modelIndex <= change.endModelIndex) {
1164 var viewIndex = this.convertRowIndexToView (modelIndex++);
1165 if (viewIndex != -1) {
1166 var dirty = this.getCellRect (viewIndex, columnViewIndex, false);
1167 var x = dirty.x;
1168 var w = dirty.width;
1169 if (eventColumn == -1) {
1170 x = 0;
1171 w = this.getWidth ();
1172 }this.repaint (x, dirty.y, w, dirty.height);
1173 }}
1174 }, "javax.swing.JTable.ModelChange");
1175 Clazz.defineMethod (c$, "restoreSortingSelection", 
1176  function (selection, lead, change) {
1177 for (var i = selection.length - 1; i >= 0; i--) {
1178 selection[i] = this.convertRowIndexToView (selection[i], change);
1179 }
1180 lead = this.convertRowIndexToView (lead, change);
1181 if (selection.length == 0 || (selection.length == 1 && selection[0] == this.getSelectedRow ())) {
1182 return;
1183 }this.selectionModel.setValueIsAdjusting (true);
1184 this.selectionModel.clearSelection ();
1185 for (var i = selection.length - 1; i >= 0; i--) {
1186 if (selection[i] != -1) {
1187 this.selectionModel.addSelectionInterval (selection[i], selection[i]);
1188 }}
1189 jssun.swing.SwingUtilities2.setLeadAnchorWithoutSelection (this.selectionModel, lead, lead);
1190 this.selectionModel.setValueIsAdjusting (false);
1191 }, "~A,~N,javax.swing.JTable.ModelChange");
1192 Clazz.defineMethod (c$, "restoreSortingEditingRow", 
1193  function (editingRow) {
1194 if (editingRow == -1) {
1195 var editor = this.getCellEditor ();
1196 if (editor != null) {
1197 editor.cancelCellEditing ();
1198 if (this.getCellEditor () != null) {
1199 this.removeEditor ();
1200 }}} else {
1201 this.editingRow = editingRow;
1202 this.repaint ();
1203 }}, "~N");
1204 Clazz.defineMethod (c$, "notifySorter", 
1205  function (change) {
1206 try {
1207 this.ignoreSortChange = true;
1208 this.$sorterChanged = false;
1209 switch (change.type) {
1210 case 0:
1211 if (change.event.getLastRow () == 2147483647) {
1212 this.sortManager.sorter.allRowsChanged ();
1213 } else if (change.event.getColumn () == -1) {
1214 this.sortManager.sorter.rowsUpdated (change.startModelIndex, change.endModelIndex);
1215 } else {
1216 this.sortManager.sorter.rowsUpdated (change.startModelIndex, change.endModelIndex, change.event.getColumn ());
1217 }break;
1218 case 1:
1219 this.sortManager.sorter.rowsInserted (change.startModelIndex, change.endModelIndex);
1220 break;
1221 case -1:
1222 this.sortManager.sorter.rowsDeleted (change.startModelIndex, change.endModelIndex);
1223 break;
1224 }
1225 } finally {
1226 this.ignoreSortChange = false;
1227 }
1228 }, "javax.swing.JTable.ModelChange");
1229 Clazz.defineMethod (c$, "convertRowIndexToView", 
1230  function (modelIndex, change) {
1231 if (modelIndex < 0) {
1232 return -1;
1233 }if (change != null && modelIndex >= change.startModelIndex) {
1234 if (change.type == 1) {
1235 if (modelIndex + change.length >= change.modelRowCount) {
1236 return -1;
1237 }return this.sortManager.sorter.convertRowIndexToView (modelIndex + change.length);
1238 } else if (change.type == -1) {
1239 if (modelIndex <= change.endModelIndex) {
1240 return -1;
1241 } else {
1242 if (modelIndex - change.length >= change.modelRowCount) {
1243 return -1;
1244 }return this.sortManager.sorter.convertRowIndexToView (modelIndex - change.length);
1245 }}}if (modelIndex >= this.getModel ().getRowCount ()) {
1246 return -1;
1247 }return this.sortManager.sorter.convertRowIndexToView (modelIndex);
1248 }, "~N,javax.swing.JTable.ModelChange");
1249 Clazz.defineMethod (c$, "convertSelectionToModel", 
1250  function (e) {
1251 var selection = this.getSelectedRows ();
1252 for (var i = selection.length - 1; i >= 0; i--) {
1253 selection[i] = this.convertRowIndexToModel (e, selection[i]);
1254 }
1255 return selection;
1256 }, "javax.swing.event.RowSorterEvent");
1257 Clazz.defineMethod (c$, "convertRowIndexToModel", 
1258  function (e, viewIndex) {
1259 if (e != null) {
1260 if (e.getPreviousRowCount () == 0) {
1261 return viewIndex;
1262 }return e.convertPreviousRowIndexToModel (viewIndex);
1263 }if (viewIndex < 0 || viewIndex >= this.getRowCount ()) {
1264 return -1;
1265 }return this.convertRowIndexToModel (viewIndex);
1266 }, "javax.swing.event.RowSorterEvent,~N");
1267 Clazz.overrideMethod (c$, "tableChanged", 
1268 function (e) {
1269 if (e == null || e.getFirstRow () == -1) {
1270 this.clearSelectionAndLeadAnchor ();
1271 this.rowModel = null;
1272 if (this.sortManager != null) {
1273 try {
1274 this.ignoreSortChange = true;
1275 this.sortManager.sorter.modelStructureChanged ();
1276 } finally {
1277 this.ignoreSortChange = false;
1278 }
1279 this.sortManager.allChanged ();
1280 }if (this.getAutoCreateColumnsFromModel ()) {
1281 this.createDefaultColumnsFromModel ();
1282 return;
1283 }this.resizeAndRepaint ();
1284 return;
1285 }if (this.sortManager != null) {
1286 this.sortedTableChanged (null, e);
1287 return;
1288 }if (this.rowModel != null) {
1289 this.repaint ();
1290 }if (e.getType () == 1) {
1291 this.tableRowsInserted (e);
1292 return;
1293 }if (e.getType () == -1) {
1294 this.tableRowsDeleted (e);
1295 return;
1296 }var modelColumn = e.getColumn ();
1297 var start = e.getFirstRow ();
1298 var end = e.getLastRow ();
1299 var dirtyRegion;
1300 if (modelColumn == -1) {
1301 dirtyRegion =  new java.awt.Rectangle (0, start * this.getRowHeight (), this.getColumnModel ().getTotalColumnWidth (), 0);
1302 } else {
1303 var column = this.convertColumnIndexToView (modelColumn);
1304 dirtyRegion = this.getCellRect (start, column, false);
1305 }if (end != 2147483647) {
1306 dirtyRegion.height = (end - start + 1) * this.getRowHeight ();
1307 this.repaint (dirtyRegion.x, dirtyRegion.y, dirtyRegion.width, dirtyRegion.height);
1308 } else {
1309 this.clearSelectionAndLeadAnchor ();
1310 this.resizeAndRepaint ();
1311 this.rowModel = null;
1312 }}, "javax.swing.event.TableModelEvent");
1313 Clazz.defineMethod (c$, "tableRowsInserted", 
1314  function (e) {
1315 var start = e.getFirstRow ();
1316 var end = e.getLastRow ();
1317 if (start < 0) {
1318 start = 0;
1319 }if (end < 0) {
1320 end = this.getRowCount () - 1;
1321 }var length = end - start + 1;
1322 this.selectionModel.insertIndexInterval (start, length, true);
1323 if (this.rowModel != null) {
1324 this.rowModel.insertEntries (start, length, this.getRowHeight ());
1325 }var rh = this.getRowHeight ();
1326 var drawRect =  new java.awt.Rectangle (0, start * rh, this.getColumnModel ().getTotalColumnWidth (), (this.getRowCount () - start) * rh);
1327 this.revalidate ();
1328 this.repaint (drawRect);
1329 }, "javax.swing.event.TableModelEvent");
1330 Clazz.defineMethod (c$, "tableRowsDeleted", 
1331  function (e) {
1332 var start = e.getFirstRow ();
1333 var end = e.getLastRow ();
1334 if (start < 0) {
1335 start = 0;
1336 }if (end < 0) {
1337 end = this.getRowCount () - 1;
1338 }var deletedCount = end - start + 1;
1339 var previousRowCount = this.getRowCount () + deletedCount;
1340 this.selectionModel.removeIndexInterval (start, end);
1341 if (this.rowModel != null) {
1342 this.rowModel.removeEntries (start, deletedCount);
1343 }var rh = this.getRowHeight ();
1344 var drawRect =  new java.awt.Rectangle (0, start * rh, this.getColumnModel ().getTotalColumnWidth (), (previousRowCount - start) * rh);
1345 this.revalidate ();
1346 this.repaint (drawRect);
1347 }, "javax.swing.event.TableModelEvent");
1348 Clazz.overrideMethod (c$, "columnAdded", 
1349 function (e) {
1350 if (this.isEditing ()) {
1351 this.removeEditor ();
1352 }this.resizeAndRepaint ();
1353 }, "javax.swing.event.TableColumnModelEvent");
1354 Clazz.overrideMethod (c$, "columnRemoved", 
1355 function (e) {
1356 if (this.isEditing ()) {
1357 this.removeEditor ();
1358 }this.resizeAndRepaint ();
1359 }, "javax.swing.event.TableColumnModelEvent");
1360 Clazz.overrideMethod (c$, "columnMoved", 
1361 function (e) {
1362 if (this.isEditing ()) {
1363 this.removeEditor ();
1364 }this.repaint ();
1365 }, "javax.swing.event.TableColumnModelEvent");
1366 Clazz.overrideMethod (c$, "columnMarginChanged", 
1367 function (e) {
1368 if (this.isEditing ()) {
1369 this.removeEditor ();
1370 }var resizingColumn = this.getResizingColumn ();
1371 if (resizingColumn != null && this.autoResizeMode == 0) {
1372 resizingColumn.setPreferredWidth (resizingColumn.getWidth ());
1373 }this.resizeAndRepaint ();
1374 }, "javax.swing.event.ChangeEvent");
1375 Clazz.defineMethod (c$, "limit", 
1376  function (i, a, b) {
1377 return Math.min (b, Math.max (i, a));
1378 }, "~N,~N,~N");
1379 Clazz.overrideMethod (c$, "columnSelectionChanged", 
1380 function (e) {
1381 var isAdjusting = e.getValueIsAdjusting ();
1382 if (this.columnSelectionAdjusting && !isAdjusting) {
1383 this.columnSelectionAdjusting = false;
1384 return;
1385 }this.columnSelectionAdjusting = isAdjusting;
1386 if (this.getRowCount () <= 0 || this.getColumnCount () <= 0) {
1387 return;
1388 }var firstIndex = this.limit (e.getFirstIndex (), 0, this.getColumnCount () - 1);
1389 var lastIndex = this.limit (e.getLastIndex (), 0, this.getColumnCount () - 1);
1390 var minRow = 0;
1391 var maxRow = this.getRowCount () - 1;
1392 if (this.getRowSelectionAllowed ()) {
1393 minRow = this.selectionModel.getMinSelectionIndex ();
1394 maxRow = this.selectionModel.getMaxSelectionIndex ();
1395 var leadRow = this.getAdjustedIndex (this.selectionModel.getLeadSelectionIndex (), true);
1396 if (minRow == -1 || maxRow == -1) {
1397 if (leadRow == -1) {
1398 return;
1399 }minRow = maxRow = leadRow;
1400 } else {
1401 if (leadRow != -1) {
1402 minRow = Math.min (minRow, leadRow);
1403 maxRow = Math.max (maxRow, leadRow);
1404 }}}var firstColumnRect = this.getCellRect (minRow, firstIndex, false);
1405 var lastColumnRect = this.getCellRect (maxRow, lastIndex, false);
1406 var dirtyRegion = firstColumnRect.union (lastColumnRect);
1407 this.repaint (dirtyRegion);
1408 }, "javax.swing.event.ListSelectionEvent");
1409 Clazz.overrideMethod (c$, "valueChanged", 
1410 function (e) {
1411 if (this.sortManager != null) {
1412 this.sortManager.viewSelectionChanged (e);
1413 }var isAdjusting = e.getValueIsAdjusting ();
1414 if (this.rowSelectionAdjusting && !isAdjusting) {
1415 this.rowSelectionAdjusting = false;
1416 return;
1417 }this.rowSelectionAdjusting = isAdjusting;
1418 if (this.getRowCount () <= 0 || this.getColumnCount () <= 0) {
1419 return;
1420 }var firstIndex = this.limit (e.getFirstIndex (), 0, this.getRowCount () - 1);
1421 var lastIndex = this.limit (e.getLastIndex (), 0, this.getRowCount () - 1);
1422 var firstRowRect = this.getCellRect (firstIndex, 0, false);
1423 var lastRowRect = this.getCellRect (lastIndex, this.getColumnCount () - 1, false);
1424 var dirtyRegion = firstRowRect.union (lastRowRect);
1425 this.repaint (dirtyRegion);
1426 }, "javax.swing.event.ListSelectionEvent");
1427 Clazz.overrideMethod (c$, "editingStopped", 
1428 function (e) {
1429 var editor = this.getCellEditor ();
1430 if (editor != null) {
1431 var value = editor.getCellEditorValue ();
1432 this.setValueAt (value, this.editingRow, this.editingColumn);
1433 this.removeEditor ();
1434 }}, "javax.swing.event.ChangeEvent");
1435 Clazz.overrideMethod (c$, "editingCanceled", 
1436 function (e) {
1437 this.removeEditor ();
1438 }, "javax.swing.event.ChangeEvent");
1439 Clazz.defineMethod (c$, "setPreferredScrollableViewportSize", 
1440 function (size) {
1441 this.preferredViewportSize = size;
1442 }, "java.awt.Dimension");
1443 Clazz.overrideMethod (c$, "getPreferredScrollableViewportSize", 
1444 function () {
1445 return this.preferredViewportSize;
1446 });
1447 Clazz.overrideMethod (c$, "getScrollableUnitIncrement", 
1448 function (visibleRect, orientation, direction) {
1449 var leadingRow;
1450 var leadingCol;
1451 var leadingCellRect;
1452 var leadingVisibleEdge;
1453 var leadingCellEdge;
1454 var leadingCellSize;
1455 leadingRow = this.getLeadingRow (visibleRect);
1456 leadingCol = this.getLeadingCol (visibleRect);
1457 if (orientation == 1 && leadingRow < 0) {
1458 return this.getRowHeight ();
1459 } else if (orientation == 0 && leadingCol < 0) {
1460 return 100;
1461 }leadingCellRect = this.getCellRect (leadingRow, leadingCol, true);
1462 leadingVisibleEdge = this.leadingEdge (visibleRect, orientation);
1463 leadingCellEdge = this.leadingEdge (leadingCellRect, orientation);
1464 if (orientation == 1) {
1465 leadingCellSize = leadingCellRect.height;
1466 } else {
1467 leadingCellSize = leadingCellRect.width;
1468 }if (leadingVisibleEdge == leadingCellEdge) {
1469 if (direction < 0) {
1470 var retVal = 0;
1471 if (orientation == 1) {
1472 while (--leadingRow >= 0) {
1473 retVal = this.getRowHeight (leadingRow);
1474 if (retVal != 0) {
1475 break;
1476 }}
1477 } else {
1478 while (--leadingCol >= 0) {
1479 retVal = this.getCellRect (leadingRow, leadingCol, true).width;
1480 if (retVal != 0) {
1481 break;
1482 }}
1483 }return retVal;
1484 } else {
1485 return leadingCellSize;
1486 }} else {
1487 var hiddenAmt = Math.abs (leadingVisibleEdge - leadingCellEdge);
1488 var visibleAmt = leadingCellSize - hiddenAmt;
1489 if (direction > 0) {
1490 return visibleAmt;
1491 } else {
1492 return hiddenAmt;
1493 }}}, "java.awt.Rectangle,~N,~N");
1494 Clazz.overrideMethod (c$, "getScrollableBlockIncrement", 
1495 function (visibleRect, orientation, direction) {
1496 if (this.getRowCount () == 0) {
1497 if (1 == orientation) {
1498 var rh = this.getRowHeight ();
1499 return (rh > 0) ? Math.max (rh, (Clazz.doubleToInt (visibleRect.height / rh)) * rh) : visibleRect.height;
1500 } else {
1501 return visibleRect.width;
1502 }}if (null == this.rowModel && 1 == orientation) {
1503 var row = this.rowAtPoint (visibleRect.getLocation ());
1504 var col = this.columnAtPoint (visibleRect.getLocation ());
1505 var cellRect = this.getCellRect (row, col, true);
1506 if (cellRect.y == visibleRect.y) {
1507 var rh = this.getRowHeight ();
1508 return Math.max (rh, (Clazz.doubleToInt (visibleRect.height / rh)) * rh);
1509 }}if (direction < 0) {
1510 return this.getPreviousBlockIncrement (visibleRect, orientation);
1511 } else {
1512 return this.getNextBlockIncrement (visibleRect, orientation);
1513 }}, "java.awt.Rectangle,~N,~N");
1514 Clazz.defineMethod (c$, "getPreviousBlockIncrement", 
1515  function (visibleRect, orientation) {
1516 var row;
1517 var col;
1518 var newEdge;
1519 var newCellLoc;
1520 var visibleLeadingEdge = this.leadingEdge (visibleRect, orientation);
1521 var leftToRight = this.getComponentOrientation ().isLeftToRight ();
1522 var newLeadingEdge;
1523 if (orientation == 1) {
1524 newEdge = visibleLeadingEdge - visibleRect.height;
1525 var x = visibleRect.x + (leftToRight ? 0 : visibleRect.width);
1526 newCellLoc =  new java.awt.Point (x, newEdge);
1527 } else if (leftToRight) {
1528 newEdge = visibleLeadingEdge - visibleRect.width;
1529 newCellLoc =  new java.awt.Point (newEdge, visibleRect.y);
1530 } else {
1531 newEdge = visibleLeadingEdge + visibleRect.width;
1532 newCellLoc =  new java.awt.Point (newEdge - 1, visibleRect.y);
1533 }row = this.rowAtPoint (newCellLoc);
1534 col = this.columnAtPoint (newCellLoc);
1535 if ( new Boolean (orientation == 1 & row < 0).valueOf ()) {
1536 newLeadingEdge = 0;
1537 } else if ( new Boolean (orientation == 0 & col < 0).valueOf ()) {
1538 if (leftToRight) {
1539 newLeadingEdge = 0;
1540 } else {
1541 newLeadingEdge = this.getWidth ();
1542 }} else {
1543 var newCellRect = this.getCellRect (row, col, true);
1544 var newCellLeadingEdge = this.leadingEdge (newCellRect, orientation);
1545 var newCellTrailingEdge = this.trailingEdge (newCellRect, orientation);
1546 if ((orientation == 1 || leftToRight) && (newCellTrailingEdge >= visibleLeadingEdge)) {
1547 newLeadingEdge = newCellLeadingEdge;
1548 } else if (orientation == 0 && !leftToRight && newCellTrailingEdge <= visibleLeadingEdge) {
1549 newLeadingEdge = newCellLeadingEdge;
1550 } else if (newEdge == newCellLeadingEdge) {
1551 newLeadingEdge = newCellLeadingEdge;
1552 } else {
1553 newLeadingEdge = newCellTrailingEdge;
1554 }}return Math.abs (visibleLeadingEdge - newLeadingEdge);
1555 }, "java.awt.Rectangle,~N");
1556 Clazz.defineMethod (c$, "getNextBlockIncrement", 
1557  function (visibleRect, orientation) {
1558 var trailingRow = this.getTrailingRow (visibleRect);
1559 var trailingCol = this.getTrailingCol (visibleRect);
1560 var cellRect;
1561 var cellFillsVis;
1562 var cellLeadingEdge;
1563 var cellTrailingEdge;
1564 var newLeadingEdge;
1565 var visibleLeadingEdge = this.leadingEdge (visibleRect, orientation);
1566 if (orientation == 1 && trailingRow < 0) {
1567 return visibleRect.height;
1568 } else if (orientation == 0 && trailingCol < 0) {
1569 return visibleRect.width;
1570 }cellRect = this.getCellRect (trailingRow, trailingCol, true);
1571 cellLeadingEdge = this.leadingEdge (cellRect, orientation);
1572 cellTrailingEdge = this.trailingEdge (cellRect, orientation);
1573 if (orientation == 1 || this.getComponentOrientation ().isLeftToRight ()) {
1574 cellFillsVis = cellLeadingEdge <= visibleLeadingEdge;
1575 } else {
1576 cellFillsVis = cellLeadingEdge >= visibleLeadingEdge;
1577 }if (cellFillsVis) {
1578 newLeadingEdge = cellTrailingEdge;
1579 } else if (cellTrailingEdge == this.trailingEdge (visibleRect, orientation)) {
1580 newLeadingEdge = cellTrailingEdge;
1581 } else {
1582 newLeadingEdge = cellLeadingEdge;
1583 }return Math.abs (newLeadingEdge - visibleLeadingEdge);
1584 }, "java.awt.Rectangle,~N");
1585 Clazz.defineMethod (c$, "getLeadingRow", 
1586  function (visibleRect) {
1587 var leadingPoint;
1588 if (this.getComponentOrientation ().isLeftToRight ()) {
1589 leadingPoint =  new java.awt.Point (visibleRect.x, visibleRect.y);
1590 } else {
1591 leadingPoint =  new java.awt.Point (visibleRect.x + visibleRect.width - 1, visibleRect.y);
1592 }return this.rowAtPoint (leadingPoint);
1593 }, "java.awt.Rectangle");
1594 Clazz.defineMethod (c$, "getLeadingCol", 
1595  function (visibleRect) {
1596 var leadingPoint;
1597 if (this.getComponentOrientation ().isLeftToRight ()) {
1598 leadingPoint =  new java.awt.Point (visibleRect.x, visibleRect.y);
1599 } else {
1600 leadingPoint =  new java.awt.Point (visibleRect.x + visibleRect.width - 1, visibleRect.y);
1601 }return this.columnAtPoint (leadingPoint);
1602 }, "java.awt.Rectangle");
1603 Clazz.defineMethod (c$, "getTrailingRow", 
1604  function (visibleRect) {
1605 var trailingPoint;
1606 if (this.getComponentOrientation ().isLeftToRight ()) {
1607 trailingPoint =  new java.awt.Point (visibleRect.x, visibleRect.y + visibleRect.height - 1);
1608 } else {
1609 trailingPoint =  new java.awt.Point (visibleRect.x + visibleRect.width - 1, visibleRect.y + visibleRect.height - 1);
1610 }return this.rowAtPoint (trailingPoint);
1611 }, "java.awt.Rectangle");
1612 Clazz.defineMethod (c$, "getTrailingCol", 
1613  function (visibleRect) {
1614 var trailingPoint;
1615 if (this.getComponentOrientation ().isLeftToRight ()) {
1616 trailingPoint =  new java.awt.Point (visibleRect.x + visibleRect.width - 1, visibleRect.y);
1617 } else {
1618 trailingPoint =  new java.awt.Point (visibleRect.x, visibleRect.y);
1619 }return this.columnAtPoint (trailingPoint);
1620 }, "java.awt.Rectangle");
1621 Clazz.defineMethod (c$, "leadingEdge", 
1622  function (rect, orientation) {
1623 if (orientation == 1) {
1624 return rect.y;
1625 } else if (this.getComponentOrientation ().isLeftToRight ()) {
1626 return rect.x;
1627 } else {
1628 return rect.x + rect.width;
1629 }}, "java.awt.Rectangle,~N");
1630 Clazz.defineMethod (c$, "trailingEdge", 
1631  function (rect, orientation) {
1632 if (orientation == 1) {
1633 return rect.y + rect.height;
1634 } else if (this.getComponentOrientation ().isLeftToRight ()) {
1635 return rect.x + rect.width;
1636 } else {
1637 return rect.x;
1638 }}, "java.awt.Rectangle,~N");
1639 Clazz.overrideMethod (c$, "getScrollableTracksViewportWidth", 
1640 function () {
1641 return !(this.autoResizeMode == 0);
1642 });
1643 Clazz.overrideMethod (c$, "getScrollableTracksViewportHeight", 
1644 function () {
1645 return this.getFillsViewportHeight () && Clazz.instanceOf (this.getParent (), javax.swing.JViewport) && ((this.getParent ()).getHeight () > this.getPreferredSize ().height);
1646 });
1647 Clazz.defineMethod (c$, "setFillsViewportHeight", 
1648 function (fillsViewportHeight) {
1649 var old = this.fillsViewportHeight;
1650 this.fillsViewportHeight = fillsViewportHeight;
1651 this.resizeAndRepaint ();
1652 this.firePropertyChangeBool ("fillsViewportHeight", old, fillsViewportHeight);
1653 }, "~B");
1654 Clazz.defineMethod (c$, "getFillsViewportHeight", 
1655 function () {
1656 return this.fillsViewportHeight;
1657 });
1658 Clazz.defineMethod (c$, "processKeyBinding", 
1659 function (ks, e, condition, pressed) {
1660 var retValue = Clazz.superCall (this, javax.swing.JTable, "processKeyBinding", [ks, e, condition, pressed]);
1661 if (!retValue && condition == 1 && this.isFocusOwner () && !Boolean.FALSE.equals (this.getClientProperty ("JTable.autoStartsEdit"))) {
1662 var editorComponent = this.getEditorComponent ();
1663 if (editorComponent == null) {
1664 if (e == null || e.getID () != 401) {
1665 return false;
1666 }var code = e.getKeyCode ();
1667 if (code == 16 || code == 17 || code == 18) {
1668 return false;
1669 }var leadRow = this.getSelectionModel ().getLeadSelectionIndex ();
1670 var leadColumn = this.getColumnModel ().getSelectionModel ().getLeadSelectionIndex ();
1671 if (leadRow != -1 && leadColumn != -1 && !this.isEditing ()) {
1672 if (!this.editCellAt (leadRow, leadColumn, e)) {
1673 return false;
1674 }}editorComponent = this.getEditorComponent ();
1675 if (editorComponent == null) {
1676 return false;
1677 }}if (Clazz.instanceOf (editorComponent, javax.swing.JComponent)) {
1678 retValue = (editorComponent).processKeyBinding (ks, e, 0, pressed);
1679 if (this.getSurrendersFocusOnKeystroke ()) {
1680 editorComponent.requestFocus ();
1681 }}}return retValue;
1682 }, "javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B");
1683 Clazz.defineMethod (c$, "setLazyValue", 
1684  function (h, c, s) {
1685 h.put (c, s);
1686 }, "java.util.Hashtable,Class,~S");
1687 Clazz.defineMethod (c$, "setLazyRenderer", 
1688  function (c, s) {
1689 this.setLazyValue (this.defaultRenderersByColumnClass, c, s);
1690 }, "Class,~S");
1691 Clazz.defineMethod (c$, "createDefaultRenderers", 
1692 function () {
1693 this.defaultRenderersByColumnClass =  new javax.swing.UIDefaults (8, 0.75);
1694 this.setLazyRenderer (JavaObject, "javax.swing.table.DefaultTableCellRenderer$UIResource");
1695 this.setLazyRenderer (Number, "javax.swing.JTable$NumberRenderer");
1696 this.setLazyRenderer (Float, "javax.swing.JTable$DoubleRenderer");
1697 this.setLazyRenderer (Double, "javax.swing.JTable$DoubleRenderer");
1698 this.setLazyRenderer (java.util.Date, "javax.swing.JTable$DateRenderer");
1699 this.setLazyRenderer (javax.swing.Icon, "javax.swing.JTable$IconRenderer");
1700 this.setLazyRenderer (javax.swing.ImageIcon, "javax.swing.JTable$IconRenderer");
1701 this.setLazyRenderer (Boolean, "javax.swing.JTable$BooleanRenderer");
1702 });
1703 Clazz.defineMethod (c$, "setLazyEditor", 
1704  function (c, s) {
1705 this.setLazyValue (this.defaultEditorsByColumnClass, c, s);
1706 }, "Class,~S");
1707 Clazz.defineMethod (c$, "createDefaultEditors", 
1708 function () {
1709 this.defaultEditorsByColumnClass =  new javax.swing.UIDefaults (3, 0.75);
1710 this.setLazyEditor (JavaObject, "javax.swing.JTable$GenericEditor");
1711 this.setLazyEditor (Number, "javax.swing.JTable$NumberEditor");
1712 this.setLazyEditor (Boolean, "javax.swing.JTable$BooleanEditor");
1713 });
1714 Clazz.defineMethod (c$, "initializeLocalVars", 
1715 function () {
1716 this.updateSelectionOnSort = true;
1717 this.setOpaque (true);
1718 this.createDefaultRenderers ();
1719 this.createDefaultEditors ();
1720 this.setTableHeader (this.createDefaultTableHeader ());
1721 this.setShowGrid (true);
1722 this.setAutoResizeMode (2);
1723 this.setRowHeight (16);
1724 this.isRowHeightSet = false;
1725 this.setRowMargin (1);
1726 this.setRowSelectionAllowed (true);
1727 this.setCellEditor (null);
1728 this.setEditingColumn (-1);
1729 this.setEditingRow (-1);
1730 this.setSurrendersFocusOnKeystroke (false);
1731 this.setPreferredScrollableViewportSize ( new java.awt.Dimension (450, 400));
1732 this.setAutoscrolls (true);
1733 });
1734 Clazz.defineMethod (c$, "createDefaultDataModel", 
1735 function () {
1736 return  new javax.swing.table.DefaultTableModel ();
1737 });
1738 Clazz.defineMethod (c$, "createDefaultColumnModel", 
1739 function () {
1740 return  new javax.swing.table.DefaultTableColumnModel ();
1741 });
1742 Clazz.defineMethod (c$, "createDefaultSelectionModel", 
1743 function () {
1744 return  new javax.swing.DefaultListSelectionModel ();
1745 });
1746 Clazz.defineMethod (c$, "createDefaultTableHeader", 
1747 function () {
1748 return  new javax.swing.table.JTableHeader (this.columnModel);
1749 });
1750 Clazz.defineMethod (c$, "resizeAndRepaint", 
1751 function () {
1752 this.revalidate ();
1753 this.repaint ();
1754 });
1755 Clazz.defineMethod (c$, "getCellEditor", 
1756 function () {
1757 return this.cellEditor;
1758 });
1759 Clazz.defineMethod (c$, "setCellEditor", 
1760 function (anEditor) {
1761 var oldEditor = this.cellEditor;
1762 this.cellEditor = anEditor;
1763 this.firePropertyChangeObject ("tableCellEditor", oldEditor, anEditor);
1764 }, "javax.swing.table.TableCellEditor");
1765 Clazz.defineMethod (c$, "setEditingColumn", 
1766 function (aColumn) {
1767 this.editingColumn = aColumn;
1768 }, "~N");
1769 Clazz.defineMethod (c$, "setEditingRow", 
1770 function (aRow) {
1771 this.editingRow = aRow;
1772 }, "~N");
1773 Clazz.defineMethod (c$, "getCellRenderer", 
1774 function (row, column) {
1775 var tableColumn = this.getColumnModel ().getColumn (column);
1776 var renderer = tableColumn.getCellRenderer ();
1777 if (renderer == null) {
1778 renderer = this.getDefaultRenderer (this.getColumnClass (column));
1779 }return renderer;
1780 }, "~N,~N");
1781 Clazz.defineMethod (c$, "prepareRenderer", 
1782 function (renderer, row, column) {
1783 var value = this.getValueAt (row, column);
1784 var isSelected = false;
1785 var hasFocus = false;
1786 if (!this.isPaintingForPrint ()) {
1787 isSelected = this.isCellSelected (row, column);
1788 var rowIsLead = (this.selectionModel.getLeadSelectionIndex () == row);
1789 var colIsLead = (this.columnModel.getSelectionModel ().getLeadSelectionIndex () == column);
1790 hasFocus = (rowIsLead && colIsLead) && this.isFocusOwner ();
1791 }return renderer.getTableCellRendererComponent (this, value, isSelected, hasFocus, row, column);
1792 }, "javax.swing.table.TableCellRenderer,~N,~N");
1793 Clazz.defineMethod (c$, "getCellEditor", 
1794 function (row, column) {
1795 var tableColumn = this.getColumnModel ().getColumn (column);
1796 var editor = tableColumn.getCellEditor ();
1797 if (editor == null) {
1798 editor = this.getDefaultEditor (this.getColumnClass (column));
1799 }return editor;
1800 }, "~N,~N");
1801 Clazz.defineMethod (c$, "prepareEditor", 
1802 function (editor, row, column) {
1803 var value = this.getValueAt (row, column);
1804 var isSelected = this.isCellSelected (row, column);
1805 var comp = editor.getTableCellEditorComponent (this, value, isSelected, row, column);
1806 return comp;
1807 }, "javax.swing.table.TableCellEditor,~N,~N");
1808 Clazz.defineMethod (c$, "removeEditor", 
1809 function () {
1810 });
1811 c$.$JTable$SortManager$ = function () {
1812 Clazz.pu$h(self.c$);
1813 c$ = Clazz.decorateAsClass (function () {
1814 Clazz.prepareCallback (this, arguments);
1815 this.sorter = null;
1816 this.modelSelection = null;
1817 this.modelLeadIndex = 0;
1818 this.syncingSelection = false;
1819 this.lastModelSelection = null;
1820 this.modelRowSizes = null;
1821 Clazz.instantialize (this, arguments);
1822 }, javax.swing.JTable, "SortManager");
1823 Clazz.makeConstructor (c$, 
1824 function (a) {
1825 this.sorter = a;
1826 a.addRowSorterListener (this.b$["javax.swing.JTable"]);
1827 }, "javax.swing.RowSorter");
1828 Clazz.defineMethod (c$, "dispose", 
1829 function () {
1830 if (this.sorter != null) {
1831 this.sorter.removeRowSorterListener (this.b$["javax.swing.JTable"]);
1832 }});
1833 Clazz.defineMethod (c$, "setViewRowHeight", 
1834 function (a, b) {
1835 if (this.modelRowSizes == null) {
1836 this.modelRowSizes =  new javax.swing.SizeSequence (this.b$["javax.swing.JTable"].getModel ().getRowCount (), this.b$["javax.swing.JTable"].getRowHeight ());
1837 }this.modelRowSizes.setSize (this.b$["javax.swing.JTable"].convertRowIndexToModel (a), b);
1838 }, "~N,~N");
1839 Clazz.defineMethod (c$, "allChanged", 
1840 function () {
1841 this.modelLeadIndex = -1;
1842 this.modelSelection = null;
1843 this.modelRowSizes = null;
1844 });
1845 Clazz.defineMethod (c$, "viewSelectionChanged", 
1846 function (a) {
1847 if (!this.syncingSelection && this.modelSelection != null) {
1848 this.modelSelection = null;
1849 }}, "javax.swing.event.ListSelectionEvent");
1850 Clazz.defineMethod (c$, "prepareForChange", 
1851 function (a, b) {
1852 if (this.b$["javax.swing.JTable"].getUpdateSelectionOnSort ()) {
1853 this.cacheSelection (a, b);
1854 }}, "javax.swing.event.RowSorterEvent,javax.swing.JTable.ModelChange");
1855 Clazz.defineMethod (c$, "cacheSelection", 
1856  function (a, b) {
1857 if (a != null) {
1858 if (this.modelSelection == null && this.sorter.getViewRowCount () != this.b$["javax.swing.JTable"].getModel ().getRowCount ()) {
1859 this.modelSelection =  new javax.swing.DefaultListSelectionModel ();
1860 var c = this.b$["javax.swing.JTable"].getSelectionModel ();
1861 var d = c.getMinSelectionIndex ();
1862 var e = c.getMaxSelectionIndex ();
1863 var f;
1864 for (var g = d; g <= e; g++) {
1865 if (c.isSelectedIndex (g)) {
1866 f = this.b$["javax.swing.JTable"].convertRowIndexToModel (a, g);
1867 if (f != -1) {
1868 this.modelSelection.addSelectionInterval (f, f);
1869 }}}
1870 f = this.b$["javax.swing.JTable"].convertRowIndexToModel (a, c.getLeadSelectionIndex ());
1871 jssun.swing.SwingUtilities2.setLeadAnchorWithoutSelection (this.modelSelection, f, f);
1872 } else if (this.modelSelection == null) {
1873 this.cacheModelSelection (a);
1874 }} else if (b.allRowsChanged) {
1875 this.modelSelection = null;
1876 } else if (this.modelSelection != null) {
1877 switch (b.type) {
1878 case -1:
1879 this.modelSelection.removeIndexInterval (b.startModelIndex, b.endModelIndex);
1880 break;
1881 case 1:
1882 this.modelSelection.insertIndexInterval (b.startModelIndex, b.endModelIndex, true);
1883 break;
1884 default:
1885 break;
1886 }
1887 } else {
1888 this.cacheModelSelection (null);
1889 }}, "javax.swing.event.RowSorterEvent,javax.swing.JTable.ModelChange");
1890 Clazz.defineMethod (c$, "cacheModelSelection", 
1891  function (a) {
1892 this.lastModelSelection = this.b$["javax.swing.JTable"].convertSelectionToModel (a);
1893 this.modelLeadIndex = this.b$["javax.swing.JTable"].convertRowIndexToModel (a, this.b$["javax.swing.JTable"].selectionModel.getLeadSelectionIndex ());
1894 }, "javax.swing.event.RowSorterEvent");
1895 Clazz.defineMethod (c$, "processChange", 
1896 function (a, b, c) {
1897 if (b != null) {
1898 if (b.allRowsChanged) {
1899 this.modelRowSizes = null;
1900 this.b$["javax.swing.JTable"].rowModel = null;
1901 } else if (this.modelRowSizes != null) {
1902 if (b.type == 1) {
1903 this.modelRowSizes.insertEntries (b.startModelIndex, b.endModelIndex - b.startModelIndex + 1, this.b$["javax.swing.JTable"].getRowHeight ());
1904 } else if (b.type == -1) {
1905 this.modelRowSizes.removeEntries (b.startModelIndex, b.endModelIndex - b.startModelIndex + 1);
1906 }}}if (c) {
1907 this.setViewRowHeightsFromModel ();
1908 this.restoreSelection (b);
1909 }}, "javax.swing.event.RowSorterEvent,javax.swing.JTable.ModelChange,~B");
1910 Clazz.defineMethod (c$, "setViewRowHeightsFromModel", 
1911  function () {
1912 if (this.modelRowSizes != null) {
1913 this.b$["javax.swing.JTable"].rowModel.setSizes (this.b$["javax.swing.JTable"].getRowCount (), this.b$["javax.swing.JTable"].getRowHeight ());
1914 for (var a = this.b$["javax.swing.JTable"].getRowCount () - 1; a >= 0; a--) {
1915 var b = this.b$["javax.swing.JTable"].convertRowIndexToModel (a);
1916 this.b$["javax.swing.JTable"].rowModel.setSize (a, this.modelRowSizes.getSize (b));
1917 }
1918 }});
1919 Clazz.defineMethod (c$, "restoreSelection", 
1920  function (a) {
1921 this.syncingSelection = true;
1922 if (this.lastModelSelection != null) {
1923 this.b$["javax.swing.JTable"].restoreSortingSelection (this.lastModelSelection, this.modelLeadIndex, a);
1924 this.lastModelSelection = null;
1925 } else if (this.modelSelection != null) {
1926 var b = this.b$["javax.swing.JTable"].getSelectionModel ();
1927 b.setValueIsAdjusting (true);
1928 b.clearSelection ();
1929 var c = this.modelSelection.getMinSelectionIndex ();
1930 var d = this.modelSelection.getMaxSelectionIndex ();
1931 var e;
1932 for (var f = c; f <= d; f++) {
1933 if (this.modelSelection.isSelectedIndex (f)) {
1934 e = this.b$["javax.swing.JTable"].convertRowIndexToView (f);
1935 if (e != -1) {
1936 b.addSelectionInterval (e, e);
1937 }}}
1938 var g = this.modelSelection.getLeadSelectionIndex ();
1939 if (g != -1) {
1940 g = this.b$["javax.swing.JTable"].convertRowIndexToView (g);
1941 }jssun.swing.SwingUtilities2.setLeadAnchorWithoutSelection (b, g, g);
1942 b.setValueIsAdjusting (false);
1943 }this.syncingSelection = false;
1944 }, "javax.swing.JTable.ModelChange");
1945 c$ = Clazz.p0p ();
1946 };
1947 c$.$JTable$ModelChange$ = function () {
1948 Clazz.pu$h(self.c$);
1949 c$ = Clazz.decorateAsClass (function () {
1950 Clazz.prepareCallback (this, arguments);
1951 this.startModelIndex = 0;
1952 this.endModelIndex = 0;
1953 this.type = 0;
1954 this.modelRowCount = 0;
1955 this.event = null;
1956 this.length = 0;
1957 this.allRowsChanged = false;
1958 Clazz.instantialize (this, arguments);
1959 }, javax.swing.JTable, "ModelChange");
1960 Clazz.makeConstructor (c$, 
1961 function (a) {
1962 this.startModelIndex = Math.max (0, a.getFirstRow ());
1963 this.endModelIndex = a.getLastRow ();
1964 this.modelRowCount = this.b$["javax.swing.JTable"].getModel ().getRowCount ();
1965 if (this.endModelIndex < 0) {
1966 this.endModelIndex = Math.max (0, this.modelRowCount - 1);
1967 }this.length = this.endModelIndex - this.startModelIndex + 1;
1968 this.type = a.getType ();
1969 this.event = a;
1970 this.allRowsChanged = (a.getLastRow () == 2147483647);
1971 }, "javax.swing.event.TableModelEvent");
1972 c$ = Clazz.p0p ();
1973 };
1974 Clazz.pu$h(self.c$);
1975 c$ = Clazz.declareType (javax.swing.JTable, "PrintMode", Enum);
1976 Clazz.defineEnumConstant (c$, "NORMAL", 0, []);
1977 Clazz.defineEnumConstant (c$, "FIT_WIDTH", 1, []);
1978 c$ = Clazz.p0p ();
1979 c$.$JTable$1$ = function () {
1980 Clazz.pu$h(self.c$);
1981 c$ = Clazz.declareAnonymous (javax.swing, "JTable$1", javax.swing.table.AbstractTableModel);
1982 Clazz.overrideMethod (c$, "getColumnName", 
1983 function (column) {
1984 return this.f$.columnNames[column].toString ();
1985 }, "~N");
1986 Clazz.defineMethod (c$, "getRowCount", 
1987 function () {
1988 return this.f$.rowData.length;
1989 });
1990 Clazz.defineMethod (c$, "getColumnCount", 
1991 function () {
1992 return this.f$.columnNames.length;
1993 });
1994 Clazz.defineMethod (c$, "getValueAt", 
1995 function (row, col) {
1996 return this.f$.rowData[row][col];
1997 }, "~N,~N");
1998 Clazz.overrideMethod (c$, "isCellEditable", 
1999 function (row, column) {
2000 return true;
2001 }, "~N,~N");
2002 Clazz.overrideMethod (c$, "setValueAt", 
2003 function (value, row, col) {
2004 this.f$.rowData[row][col] = value;
2005 this.fireTableCellUpdated (row, col);
2006 }, "~O,~N,~N");
2007 c$ = Clazz.p0p ();
2008 };
2009 c$.$JTable$2$ = function () {
2010 Clazz.pu$h(self.c$);
2011 c$ = Clazz.declareAnonymous (javax.swing, "JTable$2", null, javax.swing.JTable.Resizable3);
2012 Clazz.defineMethod (c$, "getElementCount", 
2013 function () {
2014 return this.f$.cm.getColumnCount ();
2015 });
2016 Clazz.defineMethod (c$, "getLowerBoundAt", 
2017 function (i) {
2018 return this.f$.cm.getColumn (i).getMinWidth ();
2019 }, "~N");
2020 Clazz.defineMethod (c$, "getUpperBoundAt", 
2021 function (i) {
2022 return this.f$.cm.getColumn (i).getMaxWidth ();
2023 }, "~N");
2024 Clazz.defineMethod (c$, "getMidPointAt", 
2025 function (i) {
2026 if (!this.f$.inverse) {
2027 return this.f$.cm.getColumn (i).getPreferredWidth ();
2028 } else {
2029 return this.f$.cm.getColumn (i).getWidth ();
2030 }}, "~N");
2031 Clazz.defineMethod (c$, "setSizeAt", 
2032 function (s, i) {
2033 if (!this.f$.inverse) {
2034 this.f$.cm.getColumn (i).setWidth (s);
2035 } else {
2036 this.f$.cm.getColumn (i).setPreferredWidth (s);
2037 }}, "~N,~N");
2038 c$ = Clazz.p0p ();
2039 };
2040 c$.$JTable$3$ = function () {
2041 Clazz.pu$h(self.c$);
2042 c$ = Clazz.declareAnonymous (javax.swing, "JTable$3", null, javax.swing.JTable.Resizable3);
2043 Clazz.defineMethod (c$, "getElementCount", 
2044 function () {
2045 return this.f$.end - this.f$.start;
2046 });
2047 Clazz.defineMethod (c$, "getLowerBoundAt", 
2048 function (i) {
2049 return this.f$.cm.getColumn (i + this.f$.start).getMinWidth ();
2050 }, "~N");
2051 Clazz.defineMethod (c$, "getUpperBoundAt", 
2052 function (i) {
2053 return this.f$.cm.getColumn (i + this.f$.start).getMaxWidth ();
2054 }, "~N");
2055 Clazz.defineMethod (c$, "getMidPointAt", 
2056 function (i) {
2057 return this.f$.cm.getColumn (i + this.f$.start).getWidth ();
2058 }, "~N");
2059 Clazz.defineMethod (c$, "setSizeAt", 
2060 function (s, i) {
2061 this.f$.cm.getColumn (i + this.f$.start).setWidth (s);
2062 }, "~N,~N");
2063 c$ = Clazz.p0p ();
2064 };
2065 c$.$JTable$4$ = function () {
2066 Clazz.pu$h(self.c$);
2067 c$ = Clazz.declareAnonymous (javax.swing, "JTable$4", null, javax.swing.JTable.Resizable2);
2068 Clazz.defineMethod (c$, "getElementCount", 
2069 function () {
2070 return this.f$.r.getElementCount ();
2071 });
2072 Clazz.defineMethod (c$, "getLowerBoundAt", 
2073 function (i) {
2074 return this.f$.r.getLowerBoundAt (i);
2075 }, "~N");
2076 Clazz.defineMethod (c$, "getUpperBoundAt", 
2077 function (i) {
2078 return this.f$.r.getMidPointAt (i);
2079 }, "~N");
2080 Clazz.defineMethod (c$, "setSizeAt", 
2081 function (newSize, i) {
2082 this.f$.r.setSizeAt (newSize, i);
2083 }, "~N,~N");
2084 c$ = Clazz.p0p ();
2085 };
2086 c$.$JTable$5$ = function () {
2087 Clazz.pu$h(self.c$);
2088 c$ = Clazz.declareAnonymous (javax.swing, "JTable$5", null, javax.swing.JTable.Resizable2);
2089 Clazz.defineMethod (c$, "getElementCount", 
2090 function () {
2091 return this.f$.r.getElementCount ();
2092 });
2093 Clazz.defineMethod (c$, "getLowerBoundAt", 
2094 function (i) {
2095 return this.f$.r.getMidPointAt (i);
2096 }, "~N");
2097 Clazz.defineMethod (c$, "getUpperBoundAt", 
2098 function (i) {
2099 return this.f$.r.getUpperBoundAt (i);
2100 }, "~N");
2101 Clazz.defineMethod (c$, "setSizeAt", 
2102 function (newSize, i) {
2103 this.f$.r.setSizeAt (newSize, i);
2104 }, "~N,~N");
2105 c$ = Clazz.p0p ();
2106 };
2107 Clazz.declareInterface (javax.swing.JTable, "Resizable2");
2108 Clazz.declareInterface (javax.swing.JTable, "Resizable3", javax.swing.JTable.Resizable2);
2109 Clazz.pu$h(self.c$);
2110 c$ = Clazz.declareType (javax.swing.JTable, "NumberRenderer", javax.swing.table.DefaultTableCellRenderer.UIResource);
2111 Clazz.makeConstructor (c$, 
2112 function () {
2113 Clazz.superConstructor (this, javax.swing.JTable.NumberRenderer);
2114 this.setHorizontalAlignment (4);
2115 });
2116 c$ = Clazz.p0p ();
2117 Clazz.pu$h(self.c$);
2118 c$ = Clazz.decorateAsClass (function () {
2119 this.formatter = null;
2120 Clazz.instantialize (this, arguments);
2121 }, javax.swing.JTable, "DoubleRenderer", javax.swing.JTable.NumberRenderer);
2122 Clazz.overrideMethod (c$, "setValue", 
2123 function (a) {
2124 if (this.formatter == null) {
2125 this.formatter = java.text.NumberFormat.getInstance ();
2126 }this.setText ((a == null) ? "" : this.formatter.format (a));
2127 }, "~O");
2128 c$ = Clazz.p0p ();
2129 Clazz.pu$h(self.c$);
2130 c$ = Clazz.declareType (javax.swing.JTable, "IconRenderer", javax.swing.table.DefaultTableCellRenderer.UIResource);
2131 Clazz.makeConstructor (c$, 
2132 function () {
2133 Clazz.superConstructor (this, javax.swing.JTable.IconRenderer);
2134 this.setHorizontalAlignment (0);
2135 });
2136 Clazz.overrideMethod (c$, "setValue", 
2137 function (a) {
2138 this.setIcon ((Clazz.instanceOf (a, javax.swing.Icon)) ? a : null);
2139 }, "~O");
2140 c$ = Clazz.p0p ();
2141 Clazz.pu$h(self.c$);
2142 c$ = Clazz.declareType (javax.swing.JTable, "BooleanRenderer", javax.swing.JCheckBox, [javax.swing.table.TableCellRenderer, javax.swing.plaf.UIResource]);
2143 Clazz.makeConstructor (c$, 
2144 function () {
2145 Clazz.superConstructor (this, javax.swing.JTable.BooleanRenderer);
2146 this.setHorizontalAlignment (0);
2147 this.setBorderPainted (true);
2148 });
2149 Clazz.overrideMethod (c$, "getTableCellRendererComponent", 
2150 function (a, b, c, d, e, f) {
2151 if (c) {
2152 this.setForeground (a.getSelectionForeground ());
2153 Clazz.superCall (this, javax.swing.JTable.BooleanRenderer, "setBackground", [a.getSelectionBackground ()]);
2154 } else {
2155 this.setForeground (a.getForeground ());
2156 this.setBackground (a.getBackground ());
2157 }this.setSelected ((b != null && (b).booleanValue ()));
2158 if (d) {
2159 this.setBorder (javax.swing.UIManager.getBorder ("Table.focusCellHighlightBorder"));
2160 } else {
2161 this.setBorder (javax.swing.JTable.BooleanRenderer.noFocusBorder);
2162 }return this;
2163 }, "javax.swing.JTable,~O,~B,~B,~N,~N");
2164 c$.noFocusBorder = c$.prototype.noFocusBorder =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);
2165 c$ = Clazz.p0p ();
2166 Clazz.pu$h(self.c$);
2167 c$ = Clazz.decorateAsClass (function () {
2168 this.argTypes = null;
2169 this.constructor = null;
2170 this.value = null;
2171 Clazz.instantialize (this, arguments);
2172 }, javax.swing.JTable, "GenericEditor", javax.swing.DefaultCellEditor);
2173 Clazz.prepareFields (c$, function () {
2174 this.argTypes =  Clazz.newArray (-1, [String]);
2175 });
2176 Clazz.makeConstructor (c$, 
2177 function () {
2178 Clazz.superConstructor (this, javax.swing.JTable.GenericEditor, [ new javax.swing.JTextField ()]);
2179 this.getComponent ().setName ("Table.editor");
2180 });
2181 Clazz.defineMethod (c$, "stopCellEditing", 
2182 function () {
2183 var a = Clazz.superCall (this, javax.swing.JTable.GenericEditor, "getCellEditorValue", []);
2184 try {
2185 if ("".equals (a)) {
2186 if (this.constructor.getDeclaringClass () === String) {
2187 this.value = a;
2188 }Clazz.superCall (this, javax.swing.JTable.GenericEditor, "stopCellEditing", []);
2189 }this.value = this.constructor.newInstance ( Clazz.newArray (-1, [a]));
2190 } catch (e) {
2191 if (Clazz.exceptionOf (e, Exception)) {
2192 (this.getComponent ()).setBorder ( new javax.swing.border.LineBorder (java.awt.Color.red));
2193 return false;
2194 } else {
2195 throw e;
2196 }
2197 }
2198 return Clazz.superCall (this, javax.swing.JTable.GenericEditor, "stopCellEditing", []);
2199 });
2200 Clazz.defineMethod (c$, "getTableCellEditorComponent", 
2201 function (a, b, c, d, e) {
2202 this.value = null;
2203 (this.getComponent ()).setBorder ( new javax.swing.border.LineBorder (java.awt.Color.black));
2204 try {
2205 var f = a.getColumnClass (e);
2206 if (f === Clazz._O) {
2207 f = String;
2208 }this.constructor = f.getConstructor (this.argTypes);
2209 } catch (e) {
2210 if (Clazz.exceptionOf (e, Exception)) {
2211 return null;
2212 } else {
2213 throw e;
2214 }
2215 }
2216 return Clazz.superCall (this, javax.swing.JTable.GenericEditor, "getTableCellEditorComponent", [a, b, c, d, e]);
2217 }, "javax.swing.JTable,~O,~B,~N,~N");
2218 Clazz.defineMethod (c$, "getCellEditorValue", 
2219 function () {
2220 return this.value;
2221 });
2222 c$ = Clazz.p0p ();
2223 Clazz.pu$h(self.c$);
2224 c$ = Clazz.declareType (javax.swing.JTable, "NumberEditor", javax.swing.JTable.GenericEditor);
2225 Clazz.makeConstructor (c$, 
2226 function () {
2227 Clazz.superConstructor (this, javax.swing.JTable.NumberEditor, []);
2228 (this.getComponent ()).setHorizontalAlignment (4);
2229 });
2230 c$ = Clazz.p0p ();
2231 Clazz.pu$h(self.c$);
2232 c$ = Clazz.declareType (javax.swing.JTable, "BooleanEditor", javax.swing.DefaultCellEditor);
2233 Clazz.makeConstructor (c$, 
2234 function () {
2235 Clazz.superConstructor (this, javax.swing.JTable.BooleanEditor, [ new javax.swing.JCheckBox ()]);
2236 var a = this.getComponent ();
2237 a.setHorizontalAlignment (0);
2238 });
2239 c$ = Clazz.p0p ();
2240 Clazz.defineStatics (c$,
2241 "$uiClassID", "TableUI",
2242 "AUTO_RESIZE_OFF", 0,
2243 "AUTO_RESIZE_NEXT_COLUMN", 1,
2244 "AUTO_RESIZE_SUBSEQUENT_COLUMNS", 2,
2245 "AUTO_RESIZE_LAST_COLUMN", 3,
2246 "AUTO_RESIZE_ALL_COLUMNS", 4);
2247 });