e0bc1f529c837760169d9d1bef53592c16a1a683
[jalviewjs.git] / site / swingjs / j2s / javax / swing / DefaultRowSorter.js
1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.RowFilter", "$.RowSorter"], "javax.swing.DefaultRowSorter", ["java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "java.util.ArrayList", "$.Arrays", "$.Collections", "javax.swing.SortOrder"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.sortsOnUpdates = false;
5 this.viewToModel = null;
6 this.modelToView = null;
7 this.comparators = null;
8 this.$isSortable = null;
9 this.cachedSortKeys = null;
10 this.sortComparators = null;
11 this.filter = null;
12 this.filterEntry = null;
13 this.sortKeys = null;
14 this.$useToString = null;
15 this.sorted = false;
16 this.maxSortKeys = 0;
17 this.modelWrapper = null;
18 this.modelRowCount = 0;
19 if (!Clazz.isClassDefined ("javax.swing.DefaultRowSorter.FilterEntry")) {
20 javax.swing.DefaultRowSorter.$DefaultRowSorter$FilterEntry$ ();
21 }
22 Clazz.instantialize (this, arguments);
23 }, javax.swing, "DefaultRowSorter", javax.swing.RowSorter);
24 Clazz.makeConstructor (c$, 
25 function () {
26 Clazz.superConstructor (this, javax.swing.DefaultRowSorter, []);
27 this.sortKeys = java.util.Collections.emptyList ();
28 this.maxSortKeys = 3;
29 });
30 Clazz.defineMethod (c$, "setModelWrapper", 
31 function (modelWrapper) {
32 if (modelWrapper == null) {
33 throw  new IllegalArgumentException ("modelWrapper most be non-null");
34 }var last = this.modelWrapper;
35 this.modelWrapper = modelWrapper;
36 if (last != null) {
37 this.modelStructureChanged ();
38 } else {
39 this.modelRowCount = this.getModelWrapper ().getRowCount ();
40 }}, "javax.swing.DefaultRowSorter.ModelWrapper");
41 Clazz.defineMethod (c$, "getModelWrapper", 
42 function () {
43 return this.modelWrapper;
44 });
45 Clazz.overrideMethod (c$, "getModel", 
46 function () {
47 return this.getModelWrapper ().getModel ();
48 });
49 Clazz.defineMethod (c$, "setSortable", 
50 function (column, sortable) {
51 this.checkColumn (column);
52 if (this.$isSortable == null) {
53 this.$isSortable =  Clazz.newBooleanArray (this.getModelWrapper ().getColumnCount (), false);
54 for (var i = this.$isSortable.length - 1; i >= 0; i--) {
55 this.$isSortable[i] = true;
56 }
57 }this.$isSortable[column] = sortable;
58 }, "~N,~B");
59 Clazz.defineMethod (c$, "isSortable", 
60 function (column) {
61 this.checkColumn (column);
62 return (this.$isSortable == null) ? true : this.$isSortable[column];
63 }, "~N");
64 Clazz.overrideMethod (c$, "setSortKeys", 
65 function (sortKeys) {
66 var old = this.sortKeys;
67 if (sortKeys != null && sortKeys.size () > 0) {
68 var max = this.getModelWrapper ().getColumnCount ();
69 for (var key, $key = sortKeys.iterator (); $key.hasNext () && ((key = $key.next ()) || true);) {
70 if (key == null || key.getColumn () < 0 || key.getColumn () >= max) {
71 throw  new IllegalArgumentException ("Invalid SortKey");
72 }}
73 this.sortKeys = java.util.Collections.unmodifiableList ( new java.util.ArrayList (sortKeys));
74 } else {
75 this.sortKeys = java.util.Collections.emptyList ();
76 }if (!this.sortKeys.equals (old)) {
77 this.fireSortOrderChanged ();
78 if (this.viewToModel == null) {
79 this.sort ();
80 } else {
81 this.sortExistingData ();
82 }}}, "java.util.List");
83 Clazz.overrideMethod (c$, "getSortKeys", 
84 function () {
85 return this.sortKeys;
86 });
87 Clazz.defineMethod (c$, "setMaxSortKeys", 
88 function (max) {
89 if (max < 1) {
90 throw  new IllegalArgumentException ("Invalid max");
91 }this.maxSortKeys = max;
92 }, "~N");
93 Clazz.defineMethod (c$, "getMaxSortKeys", 
94 function () {
95 return this.maxSortKeys;
96 });
97 Clazz.defineMethod (c$, "setSortsOnUpdates", 
98 function (sortsOnUpdates) {
99 this.sortsOnUpdates = sortsOnUpdates;
100 }, "~B");
101 Clazz.defineMethod (c$, "getSortsOnUpdates", 
102 function () {
103 return this.sortsOnUpdates;
104 });
105 Clazz.defineMethod (c$, "setRowFilter", 
106 function (filter) {
107 this.filter = filter;
108 this.sort ();
109 }, "javax.swing.RowFilter");
110 Clazz.defineMethod (c$, "getRowFilter", 
111 function () {
112 return this.filter;
113 });
114 Clazz.overrideMethod (c$, "toggleSortOrder", 
115 function (column) {
116 this.checkColumn (column);
117 if (this.isSortable (column)) {
118 var keys =  new java.util.ArrayList (this.getSortKeys ());
119 var sortKey;
120 var sortIndex;
121 for (sortIndex = keys.size () - 1; sortIndex >= 0; sortIndex--) {
122 if (keys.get (sortIndex).getColumn () == column) {
123 break;
124 }}
125 if (sortIndex == -1) {
126 sortKey =  new javax.swing.RowSorter.SortKey (column, javax.swing.SortOrder.ASCENDING);
127 keys.add (0, sortKey);
128 } else if (sortIndex == 0) {
129 keys.set (0, this.toggle (keys.get (0)));
130 } else {
131 keys.remove (sortIndex);
132 keys.add (0,  new javax.swing.RowSorter.SortKey (column, javax.swing.SortOrder.ASCENDING));
133 }if (keys.size () > this.getMaxSortKeys ()) {
134 keys = keys.subList (0, this.getMaxSortKeys ());
135 }this.setSortKeys (keys);
136 }}, "~N");
137 Clazz.defineMethod (c$, "toggle", 
138  function (key) {
139 if (key.getSortOrder () === javax.swing.SortOrder.ASCENDING) {
140 return  new javax.swing.RowSorter.SortKey (key.getColumn (), javax.swing.SortOrder.DESCENDING);
141 }return  new javax.swing.RowSorter.SortKey (key.getColumn (), javax.swing.SortOrder.ASCENDING);
142 }, "javax.swing.RowSorter.SortKey");
143 Clazz.overrideMethod (c$, "convertRowIndexToView", 
144 function (index) {
145 if (this.modelToView == null) {
146 if (index < 0 || index >= this.getModelWrapper ().getRowCount ()) {
147 throw  new IndexOutOfBoundsException ("Invalid index");
148 }return index;
149 }return this.modelToView[index];
150 }, "~N");
151 Clazz.overrideMethod (c$, "convertRowIndexToModel", 
152 function (index) {
153 if (this.viewToModel == null) {
154 if (index < 0 || index >= this.getModelWrapper ().getRowCount ()) {
155 throw  new IndexOutOfBoundsException ("Invalid index");
156 }return index;
157 }return this.viewToModel[index].modelIndex;
158 }, "~N");
159 Clazz.defineMethod (c$, "isUnsorted", 
160  function () {
161 var keys = this.getSortKeys ();
162 var keySize = keys.size ();
163 return (keySize == 0 || keys.get (0).getSortOrder () === javax.swing.SortOrder.UNSORTED);
164 });
165 Clazz.defineMethod (c$, "sortExistingData", 
166  function () {
167 var lastViewToModel = this.getViewToModelAsInts (this.viewToModel);
168 this.updateUseToString ();
169 this.cacheSortKeys (this.getSortKeys ());
170 if (this.isUnsorted ()) {
171 if (this.getRowFilter () == null) {
172 this.viewToModel = null;
173 this.modelToView = null;
174 } else {
175 var included = 0;
176 for (var i = 0; i < this.modelToView.length; i++) {
177 if (this.modelToView[i] != -1) {
178 this.viewToModel[included].modelIndex = i;
179 this.modelToView[i] = included++;
180 }}
181 }} else {
182 java.util.Arrays.sort (this.viewToModel);
183 this.setModelToViewFromViewToModel (false);
184 }this.fireRowSorterChanged (lastViewToModel);
185 });
186 Clazz.defineMethod (c$, "sort", 
187 function () {
188 this.sorted = true;
189 var lastViewToModel = this.getViewToModelAsInts (this.viewToModel);
190 this.updateUseToString ();
191 if (this.isUnsorted ()) {
192 this.cachedSortKeys =  new Array (0);
193 if (this.getRowFilter () == null) {
194 if (this.viewToModel != null) {
195 this.viewToModel = null;
196 this.modelToView = null;
197 } else {
198 return;
199 }} else {
200 this.initializeFilteredMapping ();
201 }} else {
202 this.cacheSortKeys (this.getSortKeys ());
203 if (this.getRowFilter () != null) {
204 this.initializeFilteredMapping ();
205 } else {
206 this.createModelToView (this.getModelWrapper ().getRowCount ());
207 this.createViewToModel (this.getModelWrapper ().getRowCount ());
208 }java.util.Arrays.sort (this.viewToModel);
209 this.setModelToViewFromViewToModel (false);
210 }this.fireRowSorterChanged (lastViewToModel);
211 });
212 Clazz.defineMethod (c$, "updateUseToString", 
213  function () {
214 var i = this.getModelWrapper ().getColumnCount ();
215 if (this.$useToString == null || this.$useToString.length != i) {
216 this.$useToString =  Clazz.newBooleanArray (i, false);
217 }for (--i; i >= 0; i--) {
218 this.$useToString[i] = this.useToString (i);
219 }
220 });
221 Clazz.defineMethod (c$, "initializeFilteredMapping", 
222  function () {
223 var rowCount = this.getModelWrapper ().getRowCount ();
224 var i;
225 var j;
226 var excludedCount = 0;
227 this.createModelToView (rowCount);
228 for (i = 0; i < rowCount; i++) {
229 if (this.include (i)) {
230 this.modelToView[i] = i - excludedCount;
231 } else {
232 this.modelToView[i] = -1;
233 excludedCount++;
234 }}
235 this.createViewToModel (rowCount - excludedCount);
236 for (i = 0, j = 0; i < rowCount; i++) {
237 if (this.modelToView[i] != -1) {
238 this.viewToModel[j++].modelIndex = i;
239 }}
240 });
241 Clazz.defineMethod (c$, "createModelToView", 
242  function (rowCount) {
243 if (this.modelToView == null || this.modelToView.length != rowCount) {
244 this.modelToView =  Clazz.newIntArray (rowCount, 0);
245 }}, "~N");
246 Clazz.defineMethod (c$, "createViewToModel", 
247  function (rowCount) {
248 var recreateFrom = 0;
249 if (this.viewToModel != null) {
250 recreateFrom = Math.min (rowCount, this.viewToModel.length);
251 if (this.viewToModel.length != rowCount) {
252 var oldViewToModel = this.viewToModel;
253 this.viewToModel =  new Array (rowCount);
254 System.arraycopy (oldViewToModel, 0, this.viewToModel, 0, recreateFrom);
255 }} else {
256 this.viewToModel =  new Array (rowCount);
257 }var i;
258 for (i = 0; i < recreateFrom; i++) {
259 this.viewToModel[i].modelIndex = i;
260 }
261 for (i = recreateFrom; i < rowCount; i++) {
262 this.viewToModel[i] =  new javax.swing.DefaultRowSorter.Row (this, i);
263 }
264 }, "~N");
265 Clazz.defineMethod (c$, "cacheSortKeys", 
266  function (keys) {
267 var keySize = keys.size ();
268 this.sortComparators =  new Array (keySize);
269 for (var i = 0; i < keySize; i++) {
270 this.sortComparators[i] = this.getComparator0 (keys.get (i).getColumn ());
271 }
272 this.cachedSortKeys = keys.toArray ( new Array (keySize));
273 }, "java.util.List");
274 Clazz.defineMethod (c$, "useToString", 
275 function (column) {
276 return (this.getComparator (column) == null);
277 }, "~N");
278 Clazz.defineMethod (c$, "setModelToViewFromViewToModel", 
279  function (unsetFirst) {
280 var i;
281 if (unsetFirst) {
282 for (i = this.modelToView.length - 1; i >= 0; i--) {
283 this.modelToView[i] = -1;
284 }
285 }for (i = this.viewToModel.length - 1; i >= 0; i--) {
286 this.modelToView[this.viewToModel[i].modelIndex] = i;
287 }
288 }, "~B");
289 Clazz.defineMethod (c$, "getViewToModelAsInts", 
290  function (viewToModel) {
291 if (viewToModel != null) {
292 var viewToModelI =  Clazz.newIntArray (viewToModel.length, 0);
293 for (var i = viewToModel.length - 1; i >= 0; i--) {
294 viewToModelI[i] = viewToModel[i].modelIndex;
295 }
296 return viewToModelI;
297 }return  Clazz.newIntArray (0, 0);
298 }, "~A");
299 Clazz.defineMethod (c$, "setComparator", 
300 function (column, comparator) {
301 this.checkColumn (column);
302 if (this.comparators == null) {
303 this.comparators =  new Array (this.getModelWrapper ().getColumnCount ());
304 }this.comparators[column] = comparator;
305 }, "~N,java.util.Comparator");
306 Clazz.defineMethod (c$, "getComparator", 
307 function (column) {
308 this.checkColumn (column);
309 if (this.comparators != null) {
310 return this.comparators[column];
311 }return null;
312 }, "~N");
313 Clazz.defineMethod (c$, "getComparator0", 
314  function (column) {
315 var comparator = this.getComparator (column);
316 if (comparator != null) {
317 return comparator;
318 }return null;
319 }, "~N");
320 Clazz.defineMethod (c$, "getFilterEntry", 
321  function (modelIndex) {
322 if (this.filterEntry == null) {
323 this.filterEntry = Clazz.innerTypeInstance (javax.swing.DefaultRowSorter.FilterEntry, this, null);
324 }this.filterEntry.modelIndex = modelIndex;
325 return this.filterEntry;
326 }, "~N");
327 Clazz.overrideMethod (c$, "getViewRowCount", 
328 function () {
329 if (this.viewToModel != null) {
330 return this.viewToModel.length;
331 }return this.getModelWrapper ().getRowCount ();
332 });
333 Clazz.overrideMethod (c$, "getModelRowCount", 
334 function () {
335 return this.getModelWrapper ().getRowCount ();
336 });
337 Clazz.defineMethod (c$, "allChanged", 
338  function () {
339 this.modelToView = null;
340 this.viewToModel = null;
341 this.comparators = null;
342 this.$isSortable = null;
343 if (this.isUnsorted ()) {
344 this.sort ();
345 } else {
346 this.setSortKeys (null);
347 }});
348 Clazz.overrideMethod (c$, "modelStructureChanged", 
349 function () {
350 this.allChanged ();
351 this.modelRowCount = this.getModelWrapper ().getRowCount ();
352 });
353 Clazz.overrideMethod (c$, "allRowsChanged", 
354 function () {
355 this.modelRowCount = this.getModelWrapper ().getRowCount ();
356 this.sort ();
357 });
358 Clazz.overrideMethod (c$, "rowsInserted", 
359 function (firstRow, endRow) {
360 this.checkAgainstModel (firstRow, endRow);
361 var newModelRowCount = this.getModelWrapper ().getRowCount ();
362 if (endRow >= newModelRowCount) {
363 throw  new IndexOutOfBoundsException ("Invalid range");
364 }this.modelRowCount = newModelRowCount;
365 if (this.shouldOptimizeChange (firstRow, endRow)) {
366 this.rowsInserted0 (firstRow, endRow);
367 }}, "~N,~N");
368 Clazz.overrideMethod (c$, "rowsDeleted", 
369 function (firstRow, endRow) {
370 this.checkAgainstModel (firstRow, endRow);
371 if (firstRow >= this.modelRowCount || endRow >= this.modelRowCount) {
372 throw  new IndexOutOfBoundsException ("Invalid range");
373 }this.modelRowCount = this.getModelWrapper ().getRowCount ();
374 if (this.shouldOptimizeChange (firstRow, endRow)) {
375 this.rowsDeleted0 (firstRow, endRow);
376 }}, "~N,~N");
377 Clazz.defineMethod (c$, "rowsUpdated", 
378 function (firstRow, endRow) {
379 this.checkAgainstModel (firstRow, endRow);
380 if (firstRow >= this.modelRowCount || endRow >= this.modelRowCount) {
381 throw  new IndexOutOfBoundsException ("Invalid range");
382 }if (this.getSortsOnUpdates ()) {
383 if (this.shouldOptimizeChange (firstRow, endRow)) {
384 this.rowsUpdated0 (firstRow, endRow);
385 }} else {
386 this.sorted = false;
387 }}, "~N,~N");
388 Clazz.defineMethod (c$, "rowsUpdated", 
389 function (firstRow, endRow, column) {
390 this.checkColumn (column);
391 this.rowsUpdated (firstRow, endRow);
392 }, "~N,~N,~N");
393 Clazz.defineMethod (c$, "checkAgainstModel", 
394  function (firstRow, endRow) {
395 if (firstRow > endRow || firstRow < 0 || endRow < 0 || firstRow > this.modelRowCount) {
396 throw  new IndexOutOfBoundsException ("Invalid range");
397 }}, "~N,~N");
398 Clazz.defineMethod (c$, "include", 
399  function (row) {
400 var filter = this.getRowFilter ();
401 if (filter != null) {
402 return filter.include (this.getFilterEntry (row));
403 }return true;
404 }, "~N");
405 Clazz.defineMethod (c$, "isTransformed", 
406  function () {
407 return (this.viewToModel != null);
408 });
409 Clazz.defineMethod (c$, "insertInOrder", 
410  function (toAdd, current) {
411 var last = 0;
412 var index;
413 var max = toAdd.size ();
414 for (var i = 0; i < max; i++) {
415 index = java.util.Arrays.binarySearch (current, toAdd.get (i));
416 if (index < 0) {
417 index = -1 - index;
418 }System.arraycopy (current, last, this.viewToModel, last + i, index - last);
419 this.viewToModel[index + i] = toAdd.get (i);
420 last = index;
421 }
422 System.arraycopy (current, last, this.viewToModel, last + max, current.length - last);
423 }, "java.util.List,~A");
424 Clazz.defineMethod (c$, "shouldOptimizeChange", 
425  function (firstRow, lastRow) {
426 if (!this.isTransformed ()) {
427 return false;
428 }if (!this.sorted || (lastRow - firstRow) > Clazz.doubleToInt (this.viewToModel.length / 10)) {
429 this.sort ();
430 return false;
431 }return true;
432 }, "~N,~N");
433 Clazz.defineMethod (c$, "rowsInserted0", 
434  function (firstRow, lastRow) {
435 var oldViewToModel = this.getViewToModelAsInts (this.viewToModel);
436 var i;
437 var delta = (lastRow - firstRow) + 1;
438 var added =  new java.util.ArrayList (delta);
439 for (i = firstRow; i <= lastRow; i++) {
440 if (this.include (i)) {
441 added.add ( new javax.swing.DefaultRowSorter.Row (this, i));
442 }}
443 var viewIndex;
444 for (i = this.modelToView.length - 1; i >= firstRow; i--) {
445 viewIndex = this.modelToView[i];
446 if (viewIndex != -1) {
447 this.viewToModel[viewIndex].modelIndex += delta;
448 }}
449 if (added.size () > 0) {
450 java.util.Collections.sort (added);
451 var lastViewToModel = this.viewToModel;
452 this.viewToModel =  new Array (this.viewToModel.length + added.size ());
453 this.insertInOrder (added, lastViewToModel);
454 }this.createModelToView (this.getModelWrapper ().getRowCount ());
455 this.setModelToViewFromViewToModel (true);
456 this.fireRowSorterChanged (oldViewToModel);
457 }, "~N,~N");
458 Clazz.defineMethod (c$, "rowsDeleted0", 
459  function (firstRow, lastRow) {
460 var oldViewToModel = this.getViewToModelAsInts (this.viewToModel);
461 var removedFromView = 0;
462 var i;
463 var viewIndex;
464 for (i = firstRow; i <= lastRow; i++) {
465 viewIndex = this.modelToView[i];
466 if (viewIndex != -1) {
467 removedFromView++;
468 this.viewToModel[viewIndex] = null;
469 }}
470 var delta = lastRow - firstRow + 1;
471 for (i = this.modelToView.length - 1; i > lastRow; i--) {
472 viewIndex = this.modelToView[i];
473 if (viewIndex != -1) {
474 this.viewToModel[viewIndex].modelIndex -= delta;
475 }}
476 if (removedFromView > 0) {
477 var newViewToModel =  new Array (this.viewToModel.length - removedFromView);
478 var newIndex = 0;
479 var last = 0;
480 for (i = 0; i < this.viewToModel.length; i++) {
481 if (this.viewToModel[i] == null) {
482 System.arraycopy (this.viewToModel, last, newViewToModel, newIndex, i - last);
483 newIndex += (i - last);
484 last = i + 1;
485 }}
486 System.arraycopy (this.viewToModel, last, newViewToModel, newIndex, this.viewToModel.length - last);
487 this.viewToModel = newViewToModel;
488 }this.createModelToView (this.getModelWrapper ().getRowCount ());
489 this.setModelToViewFromViewToModel (true);
490 this.fireRowSorterChanged (oldViewToModel);
491 }, "~N,~N");
492 Clazz.defineMethod (c$, "rowsUpdated0", 
493  function (firstRow, lastRow) {
494 var oldViewToModel = this.getViewToModelAsInts (this.viewToModel);
495 var i;
496 var j;
497 var delta = lastRow - firstRow + 1;
498 var modelIndex;
499 if (this.getRowFilter () == null) {
500 var updated =  new Array (delta);
501 for (j = 0, i = firstRow; i <= lastRow; i++, j++) {
502 updated[j] = this.viewToModel[this.modelToView[i]];
503 }
504 java.util.Arrays.sort (updated);
505 var intermediary =  new Array (this.viewToModel.length - delta);
506 for (i = 0, j = 0; i < this.viewToModel.length; i++) {
507 modelIndex = this.viewToModel[i].modelIndex;
508 if (modelIndex < firstRow || modelIndex > lastRow) {
509 intermediary[j++] = this.viewToModel[i];
510 }}
511 this.insertInOrder (java.util.Arrays.asList (updated), intermediary);
512 this.setModelToViewFromViewToModel (false);
513 } else {
514 var updated =  new java.util.ArrayList (delta);
515 var newlyVisible = 0;
516 var newlyHidden = 0;
517 var effected = 0;
518 for (i = firstRow; i <= lastRow; i++) {
519 if (this.modelToView[i] == -1) {
520 if (this.include (i)) {
521 updated.add ( new javax.swing.DefaultRowSorter.Row (this, i));
522 newlyVisible++;
523 }} else {
524 if (!this.include (i)) {
525 newlyHidden++;
526 } else {
527 updated.add (this.viewToModel[this.modelToView[i]]);
528 }this.modelToView[i] = -2;
529 effected++;
530 }}
531 java.util.Collections.sort (updated);
532 var intermediary =  new Array (this.viewToModel.length - effected);
533 for (i = 0, j = 0; i < this.viewToModel.length; i++) {
534 modelIndex = this.viewToModel[i].modelIndex;
535 if (this.modelToView[modelIndex] != -2) {
536 intermediary[j++] = this.viewToModel[i];
537 }}
538 if (newlyVisible != newlyHidden) {
539 this.viewToModel =  new Array (this.viewToModel.length + newlyVisible - newlyHidden);
540 }this.insertInOrder (updated, intermediary);
541 this.setModelToViewFromViewToModel (true);
542 }this.fireRowSorterChanged (oldViewToModel);
543 }, "~N,~N");
544 Clazz.defineMethod (c$, "checkColumn", 
545  function (column) {
546 if (column < 0 || column >= this.getModelWrapper ().getColumnCount ()) {
547 throw  new IndexOutOfBoundsException ("column beyond range of TableModel");
548 }}, "~N");
549 c$.$DefaultRowSorter$FilterEntry$ = function () {
550 Clazz.pu$h(self.c$);
551 c$ = Clazz.decorateAsClass (function () {
552 Clazz.prepareCallback (this, arguments);
553 this.modelIndex = 0;
554 Clazz.instantialize (this, arguments);
555 }, javax.swing.DefaultRowSorter, "FilterEntry", javax.swing.RowFilter.Entry);
556 Clazz.overrideMethod (c$, "getModel", 
557 function () {
558 return this.b$["javax.swing.DefaultRowSorter"].getModelWrapper ().getModel ();
559 });
560 Clazz.overrideMethod (c$, "getValueCount", 
561 function () {
562 return this.b$["javax.swing.DefaultRowSorter"].getModelWrapper ().getColumnCount ();
563 });
564 Clazz.overrideMethod (c$, "getValue", 
565 function (a) {
566 return this.b$["javax.swing.DefaultRowSorter"].getModelWrapper ().getValueAt (this.modelIndex, a);
567 }, "~N");
568 Clazz.overrideMethod (c$, "getStringValue", 
569 function (a) {
570 return this.b$["javax.swing.DefaultRowSorter"].getModelWrapper ().getStringValueAt (this.modelIndex, a);
571 }, "~N");
572 Clazz.overrideMethod (c$, "getIdentifier", 
573 function () {
574 return this.b$["javax.swing.DefaultRowSorter"].getModelWrapper ().getIdentifier (this.modelIndex);
575 });
576 c$ = Clazz.p0p ();
577 };
578 Clazz.pu$h(self.c$);
579 c$ = Clazz.declareType (javax.swing.DefaultRowSorter, "ModelWrapper");
580 Clazz.makeConstructor (c$, 
581 function () {
582 });
583 Clazz.defineMethod (c$, "getStringValueAt", 
584 function (a, b) {
585 var c = this.getValueAt (a, b);
586 if (c == null) {
587 return "";
588 }var d = c.toString ();
589 if (d == null) {
590 return "";
591 }return d;
592 }, "~N,~N");
593 c$ = Clazz.p0p ();
594 Clazz.pu$h(self.c$);
595 c$ = Clazz.decorateAsClass (function () {
596 this.sorter = null;
597 this.modelIndex = 0;
598 Clazz.instantialize (this, arguments);
599 }, javax.swing.DefaultRowSorter, "Row", null, Comparable);
600 Clazz.makeConstructor (c$, 
601 function (a, b) {
602 this.sorter = a;
603 this.modelIndex = b;
604 }, "javax.swing.DefaultRowSorter,~N");
605 Clazz.overrideMethod (c$, "compareTo", 
606 function (a) {
607 return this.sorter.compare (this.modelIndex, a.modelIndex);
608 }, "javax.swing.DefaultRowSorter.Row");
609 c$ = Clazz.p0p ();
610 });