1 | private void update(Container container) {↵ | | 1 | private void update(Container container) {↵
|
2 | int ncomponents = container.getComponentCount();↵ | | 2 | int ncomponents = container.getComponentCount();↵
|
3 | int old_nrows = nrows;↵ | | 3 | int old_nrows = nrows;↵
|
4 | int old_ncols = ncols;↵ | | 4 | int old_ncols = ncols;↵
|
5 | if (this.mode == FIXED_NUM_ROWS) {↵ | | 5 | if (this.mode == FIXED_NUM_ROWS) {↵
|
6 | nrows = this.size;↵ | | 6 | nrows = this.size;↵
|
7 | ncols = (ncomponents + nrows - 1) / nrows;↵ | | 7 | ncols = (ncomponents + nrows - 1) / nrows;↵
|
8 | } else {↵ | | 8 | } else {↵
|
9 | ncols = this.size;↵ | | 9 | ncols = this.size;↵
|
10 | nrows = (ncomponents + ncols - 1) / ncols;↵ | | 10 | nrows = (ncomponents + ncols - 1) / ncols;↵
|
11 | }↵ | | 11 | }↵
|
12 | if (old_nrows != nrows) {↵ | | 12 | if (old_nrows != nrows) {↵
|
13 | row_heights = new int[nrows];↵ | | 13 | row_heights = new int[nrows];↵
|
14 | }↵ | | 14 | }↵
|
15 | if (old_ncols != ncols) {↵ | | 15 | if (old_ncols != ncols) {↵
|
16 | col_widths = new int[ncols];↵ | | 16 | col_widths = new int[ncols];↵
|
17 | | | 17 |
|