661 |
|
|
662 |
|
|
663 |
|
|
664 |
|
public void dump(Cell cc) { |
665 |
|
pa("**** dump *******"+cc); |
666 |
|
Vector v = new Vector(); |
667 |
|
|
668 |
|
// add |
669 |
|
for (Cell c = cc.h(d.contains).s(d.contains); |
670 |
|
c != null; c = c.s(d.contains)) { |
671 |
|
v.add(c); |
672 |
|
} |
673 |
|
|
674 |
|
// sort |
675 |
|
for (int i=0; i+1<v.size(); i++) { |
676 |
|
Cell c = (Cell)v.get(i); |
677 |
|
int y = Integer.parseInt(c.s(d.pan).s(d.pan).t()); |
678 |
|
|
679 |
|
Cell swap = c; |
680 |
|
int swap_y = y; |
681 |
|
int swap_index = i; |
682 |
|
|
683 |
|
for (int j=i+1; j<v.size(); j++) { |
684 |
|
Cell cur = (Cell)v.get(j); |
685 |
|
int cur_y = Integer.parseInt(cur.s(d.pan).s(d.pan).t()); |
686 |
|
if (cur_y < swap_y) { |
687 |
|
swap = cur; |
688 |
|
swap_y = cur_y; |
689 |
|
swap_index = j; |
690 |
|
} |
691 |
|
} |
692 |
|
// swap |
693 |
|
v.set(i, swap); |
694 |
|
v.set(swap_index, c); |
695 |
|
} |
696 |
|
|
697 |
|
// output |
698 |
|
for (int i=0; i<v.size(); i++) { |
699 |
|
Cell c = (Cell)v.get(i); |
700 |
|
pa("text: " +c.t()+", y:"+c.s(d.pan).s(d.pan).t()); |
701 |
|
} |
702 |
|
} |
703 |
|
|
704 |
|
|
705 |
|
|