jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/VariableGridLayout.java
author lana
Thu, 11 May 2017 18:11:13 +0000
changeset 45111 6aa4e0cafe2e
parent 25859 3317bb8137f4
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 12851
diff changeset
     2
 * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.tools.jconsole;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.swing.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
@SuppressWarnings("serial")
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
public class VariableGridLayout extends GridLayout {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
    private boolean fillRows, fillColumns;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
    public VariableGridLayout(int rows, int cols,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
                              int hgap, int vgap,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
                              boolean fillRows, boolean fillColumns) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
        super(rows, cols, hgap, vgap);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        this.fillRows    = fillRows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        this.fillColumns = fillColumns;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    public void setFillRow(JComponent c, boolean b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        c.putClientProperty("VariableGridLayout.fillRow", b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    public void setFillColumn(JComponent c, boolean b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        c.putClientProperty("VariableGridLayout.fillColumn", b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    public boolean getFillRow(JComponent c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        Boolean b = (Boolean)c.getClientProperty("VariableGridLayout.fillRow");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        return (b != null) ? b : fillRows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    public boolean getFillColumn(JComponent c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        Boolean b = (Boolean)c.getClientProperty("VariableGridLayout.fillColumn");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        return (b != null) ? b : fillColumns;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    public void layoutContainer(Container parent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        Insets insets = parent.getInsets();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        int ncomponents = parent.getComponentCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        int nrows = getRows();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        int ncols = getColumns();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        int hgap =  getHgap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        int vgap =  getVgap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        if (nrows > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            ncols = (ncomponents + nrows - 1) / nrows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
            nrows = (ncomponents + ncols - 1) / ncols;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        // Set heights
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        int x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        int y;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        int nFills = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        boolean[] fills = new boolean[nrows];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        int lastFillRow = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        int nComps = parent.getComponentCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        y = insets.top;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        for (int row = 0; row < nrows; row++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            // Find largest minimum height for this row
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
            int h = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            for (int col = 0; col < ncols; col++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                if (row * ncols + col < nComps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                    Component c = parent.getComponent(row * ncols + col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                    h = Math.max(h, c.getMinimumSize().height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            // Set heights for this row
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            x = insets.left;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            for (int col = 0; col < ncols; col++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                if (row * ncols + col < nComps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                    JComponent c = (JComponent)parent.getComponent(row * ncols + col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                    int w = c.getWidth();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                    c.setBounds(x, y, w, h);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                    x += w + hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                    if (col == 0 && getFillRow(c)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                        fills[row] = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            y += h + vgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            if (fills[row]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                nFills++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                lastFillRow = row;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        // Fill heights
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        if (nFills > 0 && y < parent.getHeight()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            // How much height to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            int hAdd = (parent.getHeight() - y) / nFills;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            int hAdded = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            for (int row = 0; row < nrows; row++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                if (fills[row]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                    if (row == lastFillRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                        // Compensate for rounding error
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                        hAdd = parent.getHeight() - (y+hAdded);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                    for (int col = 0; col < ncols; col++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                        if (row * ncols + col < nComps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                            Component c = parent.getComponent(row * ncols + col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                            Rectangle b = c.getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                            c.setBounds(b.x, b.y + hAdded, b.width, b.height + hAdd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                    hAdded += hAdd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        // Set widths
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        nFills = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        fills = new boolean[ncols];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        int lastFillCol = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        x = insets.left;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        for (int col = 0; col < ncols; col++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            // Find largest minimum width for this column
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            int w = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            for (int row = 0; row < nrows; row++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                if (row * ncols + col < nComps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                    Component c = parent.getComponent(row * ncols + col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                    w = Math.max(w, c.getMinimumSize().width);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            // Set widths for this column
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            y = insets.top;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            for (int row = 0; row < nrows; row++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                if (row * ncols + col < nComps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                    JComponent c = (JComponent)parent.getComponent(row * ncols + col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                    int h = c.getHeight();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                    c.setBounds(x, y, w, h);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                    y += h + vgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
                    if (row == 0 && getFillColumn(c)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                        fills[col] = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            x += w + hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            if (fills[col]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                nFills++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                lastFillCol = col;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        // Fill widths
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        if (nFills > 0 && x < parent.getWidth()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            // How much width to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            int wAdd = (parent.getWidth() - x) / nFills;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            int wAdded = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            for (int col = 0; col < ncols; col++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                if (fills[col]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                    if (col == lastFillCol) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                        wAdd = parent.getWidth() - (x+wAdded);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                    for (int row = 0; row < nrows; row++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                        if (row * ncols + col < nComps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                            Component c = parent.getComponent(row * ncols + col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                            Rectangle b = c.getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                            c.setBounds(b.x + wAdded, b.y, b.width + wAdd, b.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                    wAdded += wAdd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    public Dimension preferredLayoutSize(Container parent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        Insets insets = parent.getInsets();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        int ncomponents = parent.getComponentCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        int nrows = getRows();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        int ncols = getColumns();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        int hgap =  getHgap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        int vgap =  getVgap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        if (nrows > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            ncols = (ncomponents + nrows - 1) / nrows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            nrows = (ncomponents + ncols - 1) / ncols;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        int nComps = parent.getComponentCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        int y = insets.top;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        for (int row = 0; row < nrows; row++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            int h = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            for (int col = 0; col < ncols; col++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                if (row * ncols + col < nComps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                    Component c = parent.getComponent(row * ncols + col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                    h = Math.max(h, c.getMinimumSize().height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            y += h + vgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        int x = insets.left;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        for (int col = 0; col < ncols; col++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
            int w = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
            for (int row = 0; row < nrows; row++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                if (row * ncols + col < nComps) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                    Component c = parent.getComponent(row * ncols + col);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                    w = Math.max(w, c.getMinimumSize().width);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
            x += w + hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        return new Dimension(x, y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
}