jdk/src/share/classes/java/awt/GridBagConstraints.java
author tbell
Wed, 07 Oct 2009 14:15:01 -0700
changeset 3965 63aae8ce7f47
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1995-2006 Sun Microsystems, Inc.  All Rights Reserved.
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package java.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * The <code>GridBagConstraints</code> class specifies constraints
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * for components that are laid out using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * <code>GridBagLayout</code> class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * @author Doug Stein
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * @author Bill Spitzak (orignial NeWS & OLIT implementation)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * @see java.awt.GridBagLayout
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * @since JDK1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
public class GridBagConstraints implements Cloneable, java.io.Serializable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
     * Specifies that this component is the next-to-last component in its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
     * column or row (<code>gridwidth</code>, <code>gridheight</code>),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * or that this component be placed next to the previously added
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     * component (<code>gridx</code>, <code>gridy</code>).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * @see      java.awt.GridBagConstraints#gridwidth
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     * @see      java.awt.GridBagConstraints#gridheight
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * @see      java.awt.GridBagConstraints#gridx
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     * @see      java.awt.GridBagConstraints#gridy
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    public static final int RELATIVE = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * Specifies that this component is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * last component in its column or row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    public static final int REMAINDER = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * Do not resize the component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public static final int NONE = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * Resize the component both horizontally and vertically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    public static final int BOTH = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * Resize the component horizontally but not vertically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public static final int HORIZONTAL = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * Resize the component vertically but not horizontally.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    public static final int VERTICAL = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * Put the component in the center of its display area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    public static final int CENTER = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * Put the component at the top of its display area,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * centered horizontally.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    public static final int NORTH = 11;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * Put the component at the top-right corner of its display area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public static final int NORTHEAST = 12;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * Put the component on the right side of its display area,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * centered vertically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public static final int EAST = 13;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * Put the component at the bottom-right corner of its display area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    public static final int SOUTHEAST = 14;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * Put the component at the bottom of its display area, centered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * horizontally.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    public static final int SOUTH = 15;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * Put the component at the bottom-left corner of its display area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    public static final int SOUTHWEST = 16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * Put the component on the left side of its display area,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * centered vertically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    public static final int WEST = 17;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * Put the component at the top-left corner of its display area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    public static final int NORTHWEST = 18;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * Place the component centered along the edge of its display area
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * associated with the start of a page for the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * <code>ComponentOrienation</code>.  Equal to NORTH for horizontal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    public static final int PAGE_START = 19;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * Place the component centered along the edge of its display area
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * associated with the end of a page for the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * <code>ComponentOrienation</code>.  Equal to SOUTH for horizontal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    public static final int PAGE_END = 20;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * Place the component centered along the edge of its display area where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * lines of text would normally begin for the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * <code>ComponentOrienation</code>.  Equal to WEST for horizontal,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * left-to-right orientations and EAST for horizontal, right-to-left
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    public static final int LINE_START = 21;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * Place the component centered along the edge of its display area where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * lines of text would normally end for the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * <code>ComponentOrienation</code>.  Equal to EAST for horizontal,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * left-to-right orientations and WEST for horizontal, right-to-left
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    public static final int LINE_END = 22;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * Place the component in the corner of its display area where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * the first line of text on a page would normally begin for the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * <code>ComponentOrienation</code>.  Equal to NORTHWEST for horizontal,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * left-to-right orientations and NORTHEAST for horizontal, right-to-left
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    public static final int FIRST_LINE_START = 23;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * Place the component in the corner of its display area where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * the first line of text on a page would normally end for the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * <code>ComponentOrienation</code>.  Equal to NORTHEAST for horizontal,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * left-to-right orientations and NORTHWEST for horizontal, right-to-left
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public static final int FIRST_LINE_END = 24;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * Place the component in the corner of its display area where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * the last line of text on a page would normally start for the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * <code>ComponentOrienation</code>.  Equal to SOUTHWEST for horizontal,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * left-to-right orientations and SOUTHEAST for horizontal, right-to-left
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    public static final int LAST_LINE_START = 25;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * Place the component in the corner of its display area where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * the last line of text on a page would normally end for the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * <code>ComponentOrienation</code>.  Equal to SOUTHEAST for horizontal,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * left-to-right orientations and SOUTHWEST for horizontal, right-to-left
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    public static final int LAST_LINE_END = 26;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * that the component should be horizontally centered and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * vertically aligned along the baseline of the prevailing row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * If the component does not have a baseline it will be vertically
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    public static final int BASELINE = 0x100;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * that the component should be horizontally placed along the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * leading edge.  For components with a left-to-right orientation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * the leading edge is the left edge.  Vertically the component is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * aligned along the baseline of the prevailing row.  If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * component does not have a baseline it will be vertically
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    public static final int BASELINE_LEADING = 0x200;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * that the component should be horizontally placed along the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * trailing edge.  For components with a left-to-right
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * orientation, the trailing edge is the right edge.  Vertically
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * the component is aligned along the baseline of the prevailing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * row.  If the component does not have a baseline it will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * vertically centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    public static final int BASELINE_TRAILING = 0x300;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * that the component should be horizontally centered.  Vertically
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * the component is positioned so that its bottom edge touches
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * the baseline of the starting row.  If the starting row does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * have a baseline it will be vertically centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    public static final int ABOVE_BASELINE = 0x400;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * that the component should be horizontally placed along the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * leading edge.  For components with a left-to-right orientation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * the leading edge is the left edge.  Vertically the component is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * positioned so that its bottom edge touches the baseline of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * starting row.  If the starting row does not have a baseline it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * will be vertically centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    public static final int ABOVE_BASELINE_LEADING = 0x500;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * that the component should be horizontally placed along the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * trailing edge.  For components with a left-to-right
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * orientation, the trailing edge is the right edge.  Vertically
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * the component is positioned so that its bottom edge touches
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * the baseline of the starting row.  If the starting row does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * have a baseline it will be vertically centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    public static final int ABOVE_BASELINE_TRAILING = 0x600;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * that the component should be horizontally centered.  Vertically
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * the component is positioned so that its top edge touches the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * baseline of the starting row.  If the starting row does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * have a baseline it will be vertically centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    public static final int BELOW_BASELINE = 0x700;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * that the component should be horizontally placed along the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * leading edge.  For components with a left-to-right orientation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * the leading edge is the left edge.  Vertically the component is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * positioned so that its top edge touches the baseline of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * starting row.  If the starting row does not have a baseline it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * will be vertically centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    public static final int BELOW_BASELINE_LEADING = 0x800;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * Possible value for the <code>anchor</code> field.  Specifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * that the component should be horizontally placed along the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * trailing edge.  For components with a left-to-right
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * orientation, the trailing edge is the right edge.  Vertically
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * the component is positioned so that its top edge touches the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * baseline of the starting row.  If the starting row does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * have a baseline it will be vertically centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    public static final int BELOW_BASELINE_TRAILING = 0x900;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * Specifies the cell containing the leading edge of the component's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * display area, where the first cell in a row has <code>gridx=0</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * The leading edge of a component's display area is its left edge for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * a horizontal, left-to-right container and its right edge for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * horizontal, right-to-left container.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * The value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * <code>RELATIVE</code> specifies that the component be placed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * immediately following the component that was added to the container
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * just before this component was added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * The default value is <code>RELATIVE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * <code>gridx</code> should be a non-negative value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * @see java.awt.GridBagConstraints#gridy
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * @see java.awt.ComponentOrientation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    public int gridx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * Specifies the cell at the top of the component's display area,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * where the topmost cell has <code>gridy=0</code>. The value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * <code>RELATIVE</code> specifies that the component be placed just
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * below the component that was added to the container just before
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * this component was added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * The default value is <code>RELATIVE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * <code>gridy</code> should be a non-negative value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @see java.awt.GridBagConstraints#gridx
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    public int gridy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * Specifies the number of cells in a row for the component's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * display area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * Use <code>REMAINDER</code> to specify that the component's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * display area will be from <code>gridx</code> to the last
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * cell in the row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * Use <code>RELATIVE</code> to specify that the component's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * display area will be from <code>gridx</code> to the next
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * to the last one in its row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * <code>gridwidth</code> should be non-negative and the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * value is 1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * @see java.awt.GridBagConstraints#gridheight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    public int gridwidth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * Specifies the number of cells in a column for the component's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * display area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * Use <code>REMAINDER</code> to specify that the component's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * display area will be from <code>gridy</code> to the last
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * cell in the column.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * Use <code>RELATIVE</code> to specify that the component's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * display area will be from <code>gridy</code> to the next
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * to the last one in its column.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * <code>gridheight</code> should be a non-negative value and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * default value is 1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * @see java.awt.GridBagConstraints#gridwidth
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    public int gridheight;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * Specifies how to distribute extra horizontal space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * The grid bag layout manager calculates the weight of a column to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * be the maximum <code>weightx</code> of all the components in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * column. If the resulting layout is smaller horizontally than the area
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * it needs to fill, the extra space is distributed to each column in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * proportion to its weight. A column that has a weight of zero receives
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * no extra space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * If all the weights are zero, all the extra space appears between
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * the grids of the cell and the left and right edges.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * The default value of this field is <code>0</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * <code>weightx</code> should be a non-negative value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * @see java.awt.GridBagConstraints#weighty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    public double weightx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * Specifies how to distribute extra vertical space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * The grid bag layout manager calculates the weight of a row to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * the maximum <code>weighty</code> of all the components in a row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * If the resulting layout is smaller vertically than the area it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * needs to fill, the extra space is distributed to each row in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * proportion to its weight. A row that has a weight of zero receives no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * extra space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * If all the weights are zero, all the extra space appears between
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * the grids of the cell and the top and bottom edges.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * The default value of this field is <code>0</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * <code>weighty</code> should be a non-negative value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * @see java.awt.GridBagConstraints#weightx
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    public double weighty;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * This field is used when the component is smaller than its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * display area. It determines where, within the display area, to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * place the component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * <p> There are three kinds of possible values: orientation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * relative, baseline relative and absolute.  Orientation relative
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * values are interpreted relative to the container's component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * orientation property, baseline relative values are interpreted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * relative to the baseline and absolute values are not.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * absolute values are:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * <code>CENTER</code>, <code>NORTH</code>, <code>NORTHEAST</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * <code>EAST</code>, <code>SOUTHEAST</code>, <code>SOUTH</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * <code>SOUTHWEST</code>, <code>WEST</code>, and <code>NORTHWEST</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * The orientation relative values are: <code>PAGE_START</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * <code>PAGE_END</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * <code>LINE_START</code>, <code>LINE_END</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * <code>FIRST_LINE_START</code>, <code>FIRST_LINE_END</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * <code>LAST_LINE_START</code> and <code>LAST_LINE_END</code>.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * baseline relvative values are:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * <code>BASELINE</code>, <code>BASELINE_LEADING</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * <code>BASELINE_TRAILING</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * <code>ABOVE_BASELINE</code>, <code>ABOVE_BASELINE_LEADING</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * <code>ABOVE_BASELINE_TRAILING</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * <code>BELOW_BASELINE</code>, <code>BELOW_BASELINE_LEADING</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * and <code>BELOW_BASELINE_TRAILING</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * The default value is <code>CENTER</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * @see java.awt.ComponentOrientation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    public int anchor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * This field is used when the component's display area is larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * than the component's requested size. It determines whether to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * resize the component, and if so, how.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * The following values are valid for <code>fill</code>:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * <code>NONE</code>: Do not resize the component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * <code>HORIZONTAL</code>: Make the component wide enough to fill
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     *         its display area horizontally, but do not change its height.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * <code>VERTICAL</code>: Make the component tall enough to fill its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     *         display area vertically, but do not change its width.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * <code>BOTH</code>: Make the component fill its display area
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     *         entirely.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * The default value is <code>NONE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    public int fill;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * This field specifies the external padding of the component, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * minimum amount of space between the component and the edges of its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * display area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * The default value is <code>new Insets(0, 0, 0, 0)</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
    public Insets insets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * This field specifies the internal padding of the component, how much
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * space to add to the minimum width of the component. The width of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * the component is at least its minimum width plus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * <code>ipadx</code> pixels.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * The default value is <code>0</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * @see java.awt.GridBagConstraints#ipady
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
    public int ipadx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * This field specifies the internal padding, that is, how much
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * space to add to the minimum height of the component. The height of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * the component is at least its minimum height plus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * <code>ipady</code> pixels.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * The default value is 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * @see #clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * @see java.awt.GridBagConstraints#ipadx
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
    public int ipady;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * Temporary place holder for the x coordinate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
    int tempX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * Temporary place holder for the y coordinate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    int tempY;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * Temporary place holder for the Width of the component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
    int tempWidth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * Temporary place holder for the Height of the component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
    int tempHeight;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * The minimum width of the component.  It is used to calculate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * <code>ipady</code>, where the default will be 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * @see #ipady
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
    int minWidth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * The minimum height of the component. It is used to calculate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * <code>ipadx</code>, where the default will be 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * @see #ipadx
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
    int minHeight;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
    // The following fields are only used if the anchor is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
    // one of BASELINE, BASELINE_LEADING or BASELINE_TRAILING.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
    // ascent and descent include the insets and ipady values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
    transient int ascent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
    transient int descent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
    transient Component.BaselineResizeBehavior baselineResizeBehavior;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    // The folllowing two fields are used if the baseline type is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
    // CENTER_OFFSET.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
    // centerPadding is either 0 or 1 and indicates if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
    // the height needs to be padded by one when calculating where the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    // baseline lands
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
    transient int centerPadding;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
    // Where the baseline lands relative to the center of the component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
    transient int centerOffset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * JDK 1.1 serialVersionUID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
    private static final long serialVersionUID = -1000070633030801713L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * Creates a <code>GridBagConstraint</code> object with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * all of its fields set to their default value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
    public GridBagConstraints () {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
        gridx = RELATIVE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
        gridy = RELATIVE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
        gridwidth = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
        gridheight = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
        weightx = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
        weighty = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
        anchor = CENTER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
        fill = NONE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
        insets = new Insets(0, 0, 0, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
        ipadx = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
        ipady = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * Creates a <code>GridBagConstraints</code> object with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * all of its fields set to the passed-in arguments.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * Note: Because the use of this constructor hinders readability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * of source code, this constructor should only be used by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * automatic source code generation tools.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     * @param gridx     The initial gridx value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * @param gridy     The initial gridy value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     * @param gridwidth The initial gridwidth value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * @param gridheight        The initial gridheight value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * @param weightx   The initial weightx value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * @param weighty   The initial weighty value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     * @param anchor    The initial anchor value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     * @param fill      The initial fill value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     * @param insets    The initial insets value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     * @param ipadx     The initial ipadx value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * @param ipady     The initial ipady value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * @see java.awt.GridBagConstraints#gridx
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     * @see java.awt.GridBagConstraints#gridy
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * @see java.awt.GridBagConstraints#gridwidth
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * @see java.awt.GridBagConstraints#gridheight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * @see java.awt.GridBagConstraints#weightx
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * @see java.awt.GridBagConstraints#weighty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * @see java.awt.GridBagConstraints#anchor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     * @see java.awt.GridBagConstraints#fill
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * @see java.awt.GridBagConstraints#insets
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * @see java.awt.GridBagConstraints#ipadx
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * @see java.awt.GridBagConstraints#ipady
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
    public GridBagConstraints(int gridx, int gridy,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
                              int gridwidth, int gridheight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
                              double weightx, double weighty,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
                              int anchor, int fill,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
                              Insets insets, int ipadx, int ipady) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
        this.gridx = gridx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
        this.gridy = gridy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
        this.gridwidth = gridwidth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
        this.gridheight = gridheight;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
        this.fill = fill;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
        this.ipadx = ipadx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
        this.ipady = ipady;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
        this.insets = insets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
        this.anchor  = anchor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
        this.weightx = weightx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
        this.weighty = weighty;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * Creates a copy of this grid bag constraint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * @return     a copy of this grid bag constraint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
    public Object clone () {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
            GridBagConstraints c = (GridBagConstraints)super.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
            c.insets = (Insets)insets.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
            return c;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
        } catch (CloneNotSupportedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
            // this shouldn't happen, since we are Cloneable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
            throw new InternalError();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
    boolean isVerticallyResizable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
        return (fill == BOTH || fill == VERTICAL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
}