src/java.desktop/share/classes/java/awt/FlowLayout.java
author serb
Mon, 09 Sep 2019 12:23:22 -0700
changeset 58325 d32a3b1ca84a
parent 47216 71c04702a3d5
permissions -rw-r--r--
8225372: accessibility errors in tables in java.desktop files Reviewed-by: aivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
58325
d32a3b1ca84a 8225372: accessibility errors in tables in java.desktop files
serb
parents: 47216
diff changeset
     2
 * Copyright (c) 1995, 2019, 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
package java.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.io.ObjectInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * A flow layout arranges components in a directional flow, much
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * like lines of text in a paragraph. The flow direction is
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
    33
 * determined by the container's {@code componentOrientation}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * property and may be one of two values:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * <ul>
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
    36
 * <li>{@code ComponentOrientation.LEFT_TO_RIGHT}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
    37
 * <li>{@code ComponentOrientation.RIGHT_TO_LEFT}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * Flow layouts are typically used
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * to arrange buttons in a panel. It arranges buttons
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * horizontally until no more buttons fit on the same line.
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
    42
 * The line alignment is determined by the {@code align}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * property. The possible values are:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <li>{@link #LEFT LEFT}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <li>{@link #RIGHT RIGHT}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <li>{@link #CENTER CENTER}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * <li>{@link #LEADING LEADING}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <li>{@link #TRAILING TRAILING}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * For example, the following picture shows an applet using the flow
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * layout manager (its default layout manager) to position three buttons:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * <img src="doc-files/FlowLayout-1.gif"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * ALT="Graphic of Layout for Three Buttons"
58325
d32a3b1ca84a 8225372: accessibility errors in tables in java.desktop files
serb
parents: 47216
diff changeset
    57
 * style="margin: 7px 10px;">
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * Here is the code for this applet:
21957
97758de70fbd 8028019: AWT Doclint warning/error cleanup
rriggs
parents: 20451
diff changeset
    60
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * <hr><blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * import java.applet.Applet;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * public class myButtons extends Applet {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 *     Button button1, button2, button3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 *     public void init() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 *         button1 = new Button("Ok");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 *         button2 = new Button("Open");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 *         button3 = new Button("Close");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 *         add(button1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *         add(button2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 *         add(button3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * </pre></blockquote><hr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * A flow layout lets each component assume its natural (preferred) size.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * @author      Arthur van Hoff
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * @author      Sami Shaio
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23010
diff changeset
    82
 * @since       1.0
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * @see ComponentOrientation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
public class FlowLayout implements LayoutManager, java.io.Serializable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * This value indicates that each row of components
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * should be left-justified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public static final int LEFT        = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * This value indicates that each row of components
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * should be centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public static final int CENTER      = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * This value indicates that each row of components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * should be right-justified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    public static final int RIGHT       = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * This value indicates that each row of components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * should be justified to the leading edge of the container's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * orientation, for example, to the left in left-to-right orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * @see     java.awt.Component#getComponentOrientation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * @see     java.awt.ComponentOrientation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * @since   1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    public static final int LEADING     = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * This value indicates that each row of components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * should be justified to the trailing edge of the container's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * orientation, for example, to the right in left-to-right orientations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @see     java.awt.Component#getComponentOrientation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * @see     java.awt.ComponentOrientation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * @since   1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    public static final int TRAILING = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   128
     * {@code align} is the property that determines
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * how each row distributes empty space.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * It can be one of the following values:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * <ul>
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   132
     * <li>{@code LEFT}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   133
     * <li>{@code RIGHT}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   134
     * <li>{@code CENTER}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @see #getAlignment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @see #setAlignment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    int align;          // This is for 1.1 serialization compatibility
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   144
     * {@code newAlign} is the property that determines
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * how each row distributes empty space for the Java 2 platform,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * v1.2 and greater.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * It can be one of the following three values:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * <ul>
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   149
     * <li>{@code LEFT}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   150
     * <li>{@code RIGHT}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   151
     * <li>{@code CENTER}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   152
     * <li>{@code LEADING}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   153
     * <li>{@code TRAILING}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @see #getAlignment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * @see #setAlignment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    int newAlign;       // This is the one we actually use
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    /**
26749
b6598aa90114 8055326: Fix typos in client-related packages
serb
parents: 25859
diff changeset
   164
     * The flow layout manager allows a separation of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * components with gaps.  The horizontal gap will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * specify the space between components and between
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * the components and the borders of the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   168
     * {@code Container}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @see #getHgap()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * @see #setHgap(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    int hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    /**
26749
b6598aa90114 8055326: Fix typos in client-related packages
serb
parents: 25859
diff changeset
   177
     * The flow layout manager allows a separation of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * components with gaps.  The vertical gap will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * specify the space between rows and between the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   180
     * the rows and the borders of the {@code Container}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * @see #getHgap()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * @see #setHgap(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    int vgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * If true, components will be aligned on their baseline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    private boolean alignOnBaseline;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * JDK 1.1 serialVersionUID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     private static final long serialVersionUID = -7262534875583282631L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   199
     * Constructs a new {@code FlowLayout} with a centered alignment and a
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * default 5-unit horizontal and vertical gap.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    public FlowLayout() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        this(CENTER, 5, 5);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   207
     * Constructs a new {@code FlowLayout} with the specified
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * alignment and a default 5-unit horizontal and vertical gap.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * The value of the alignment argument must be one of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   210
     * {@code FlowLayout.LEFT}, {@code FlowLayout.RIGHT},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   211
     * {@code FlowLayout.CENTER}, {@code FlowLayout.LEADING},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   212
     * or {@code FlowLayout.TRAILING}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * @param align the alignment value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    public FlowLayout(int align) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        this(align, 5, 5);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * Creates a new flow layout manager with the indicated alignment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * and the indicated horizontal and vertical gaps.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * The value of the alignment argument must be one of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   224
     * {@code FlowLayout.LEFT}, {@code FlowLayout.RIGHT},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   225
     * {@code FlowLayout.CENTER}, {@code FlowLayout.LEADING},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   226
     * or {@code FlowLayout.TRAILING}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * @param      align   the alignment value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * @param      hgap    the horizontal gap between components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     *                     and between the components and the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   230
     *                     borders of the {@code Container}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @param      vgap    the vertical gap between components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     *                     and between the components and the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   233
     *                     borders of the {@code Container}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    public FlowLayout(int align, int hgap, int vgap) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        this.hgap = hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        this.vgap = vgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        setAlignment(align);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * Gets the alignment for this layout.
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   243
     * Possible values are {@code FlowLayout.LEFT},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   244
     * {@code FlowLayout.RIGHT}, {@code FlowLayout.CENTER},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   245
     * {@code FlowLayout.LEADING},
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   246
     * or {@code FlowLayout.TRAILING}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @return     the alignment value for this layout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * @see        java.awt.FlowLayout#setAlignment
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23010
diff changeset
   249
     * @since      1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    public int getAlignment() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        return newAlign;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * Sets the alignment for this layout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * Possible values are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * <ul>
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   259
     * <li>{@code FlowLayout.LEFT}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   260
     * <li>{@code FlowLayout.RIGHT}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   261
     * <li>{@code FlowLayout.CENTER}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   262
     * <li>{@code FlowLayout.LEADING}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   263
     * <li>{@code FlowLayout.TRAILING}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * @param      align one of the alignment values shown above
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * @see        #getAlignment()
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23010
diff changeset
   267
     * @since      1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    public void setAlignment(int align) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
        this.newAlign = align;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        // this.align is used only for serialization compatibility,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        // so set it to a value compatible with the 1.1 version
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        // of the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        switch (align) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        case LEADING:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
            this.align = LEFT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        case TRAILING:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
            this.align = RIGHT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
            this.align = align;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * Gets the horizontal gap between components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * and between the components and the borders
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   292
     * of the {@code Container}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * @return     the horizontal gap between components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     *             and between the components and the borders
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   296
     *             of the {@code Container}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * @see        java.awt.FlowLayout#setHgap
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23010
diff changeset
   298
     * @since      1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    public int getHgap() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        return hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * Sets the horizontal gap between components and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * between the components and the borders of the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   307
     * {@code Container}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * @param hgap the horizontal gap between components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     *             and between the components and the borders
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   311
     *             of the {@code Container}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * @see        java.awt.FlowLayout#getHgap
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23010
diff changeset
   313
     * @since      1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    public void setHgap(int hgap) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        this.hgap = hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * Gets the vertical gap between components and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * between the components and the borders of the
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   322
     * {@code Container}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * @return     the vertical gap between components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     *             and between the components and the borders
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   326
     *             of the {@code Container}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * @see        java.awt.FlowLayout#setVgap
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23010
diff changeset
   328
     * @since      1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    public int getVgap() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
        return vgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * Sets the vertical gap between components and between
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   336
     * the components and the borders of the {@code Container}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @param vgap the vertical gap between components
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     *             and between the components and the borders
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   340
     *             of the {@code Container}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * @see        java.awt.FlowLayout#getVgap
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23010
diff changeset
   342
     * @since      1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    public void setVgap(int vgap) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        this.vgap = vgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * Sets whether or not components should be vertically aligned along their
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * baseline.  Components that do not have a baseline will be centered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * The default is false.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * @param alignOnBaseline whether or not components should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     *                        vertically aligned on their baseline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    public void setAlignOnBaseline(boolean alignOnBaseline) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        this.alignOnBaseline = alignOnBaseline;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * Returns true if components are to be vertically aligned along
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * their baseline.  The default is false.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @return true if components are to be vertically aligned along
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     *              their baseline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    public boolean getAlignOnBaseline() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
        return alignOnBaseline;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * Adds the specified component to the layout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * Not used by this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * @param name the name of the component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @param comp the component to be added
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    public void addLayoutComponent(String name, Component comp) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * Removes the specified component from the layout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * Not used by this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * @param comp the component to remove
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * @see       java.awt.Container#removeAll
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    public void removeLayoutComponent(Component comp) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * Returns the preferred dimensions for this layout given the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * <i>visible</i> components in the specified target container.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * @param target the container that needs to be laid out
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * @return    the preferred dimensions to lay out the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     *            subcomponents of the specified container
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * @see Container
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * @see #minimumLayoutSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * @see       java.awt.Container#getPreferredSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    public Dimension preferredLayoutSize(Container target) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
      synchronized (target.getTreeLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
        Dimension dim = new Dimension(0, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
        int nmembers = target.getComponentCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        boolean firstVisibleComponent = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
        boolean useBaseline = getAlignOnBaseline();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        int maxAscent = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
        int maxDescent = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
        for (int i = 0 ; i < nmembers ; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
            Component m = target.getComponent(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
            if (m.isVisible()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
                Dimension d = m.getPreferredSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
                dim.height = Math.max(dim.height, d.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
                if (firstVisibleComponent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
                    firstVisibleComponent = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
                    dim.width += hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
                dim.width += d.width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
                if (useBaseline) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
                    int baseline = m.getBaseline(d.width, d.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
                    if (baseline >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
                        maxAscent = Math.max(maxAscent, baseline);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
                        maxDescent = Math.max(maxDescent, d.height - baseline);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
        if (useBaseline) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
            dim.height = Math.max(maxAscent + maxDescent, dim.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
        Insets insets = target.getInsets();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        dim.width += insets.left + insets.right + hgap*2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
        dim.height += insets.top + insets.bottom + vgap*2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
        return dim;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * Returns the minimum dimensions needed to layout the <i>visible</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * components contained in the specified target container.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @param target the container that needs to be laid out
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * @return    the minimum dimensions to lay out the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     *            subcomponents of the specified container
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * @see #preferredLayoutSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * @see       java.awt.Container
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * @see       java.awt.Container#doLayout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
    public Dimension minimumLayoutSize(Container target) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
      synchronized (target.getTreeLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
        boolean useBaseline = getAlignOnBaseline();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
        Dimension dim = new Dimension(0, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
        int nmembers = target.getComponentCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
        int maxAscent = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
        int maxDescent = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
        boolean firstVisibleComponent = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
        for (int i = 0 ; i < nmembers ; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
            Component m = target.getComponent(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
            if (m.visible) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
                Dimension d = m.getMinimumSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
                dim.height = Math.max(dim.height, d.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
                if (firstVisibleComponent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
                    firstVisibleComponent = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
                    dim.width += hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
                dim.width += d.width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
                if (useBaseline) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
                    int baseline = m.getBaseline(d.width, d.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
                    if (baseline >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
                        maxAscent = Math.max(maxAscent, baseline);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
                        maxDescent = Math.max(maxDescent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
                                              dim.height - baseline);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
        if (useBaseline) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
            dim.height = Math.max(maxAscent + maxDescent, dim.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
        Insets insets = target.getInsets();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
        dim.width += insets.left + insets.right + hgap*2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
        dim.height += insets.top + insets.bottom + vgap*2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
        return dim;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * Centers the elements in the specified row, if there is any slack.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * @param target the component which needs to be moved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * @param x the x coordinate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * @param y the y coordinate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * @param width the width dimensions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * @param height the height dimensions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * @param rowStart the beginning of the row
28059
e576535359cc 8067377: My hobby: caning, then then canning, the the can-can
martin
parents: 26749
diff changeset
   506
     * @param rowEnd the ending of the row
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * @param useBaseline Whether or not to align on baseline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * @param ascent Ascent for the components. This is only valid if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     *               useBaseline is true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * @param descent Ascent for the components. This is only valid if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     *               useBaseline is true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * @return actual row height
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
    private int moveComponents(Container target, int x, int y, int width, int height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
                                int rowStart, int rowEnd, boolean ltr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
                                boolean useBaseline, int[] ascent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
                                int[] descent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
        switch (newAlign) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
        case LEFT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
            x += ltr ? 0 : width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
        case CENTER:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
            x += width / 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
        case RIGHT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
            x += ltr ? width : 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
        case LEADING:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
        case TRAILING:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
            x += width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
        int maxAscent = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
        int nonbaselineHeight = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
        int baselineOffset = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
        if (useBaseline) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
            int maxDescent = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
            for (int i = rowStart ; i < rowEnd ; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
                Component m = target.getComponent(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
                if (m.visible) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
                    if (ascent[i] >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
                        maxAscent = Math.max(maxAscent, ascent[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
                        maxDescent = Math.max(maxDescent, descent[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
                    else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
                        nonbaselineHeight = Math.max(m.getHeight(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
                                                     nonbaselineHeight);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
            height = Math.max(maxAscent + maxDescent, nonbaselineHeight);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
            baselineOffset = (height - maxAscent - maxDescent) / 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
        for (int i = rowStart ; i < rowEnd ; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
            Component m = target.getComponent(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
            if (m.isVisible()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
                int cy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
                if (useBaseline && ascent[i] >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
                    cy = y + baselineOffset + maxAscent - ascent[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
                else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
                    cy = y + (height - m.height) / 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
                if (ltr) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
                    m.setLocation(x, cy);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
                    m.setLocation(target.width - x - m.width, cy);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
                x += m.width + hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
        return height;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * Lays out the container. This method lets each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * <i>visible</i> component take
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * its preferred size by reshaping the components in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * target container in order to satisfy the alignment of
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   581
     * this {@code FlowLayout} object.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     * @param target the specified component being laid out
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * @see Container
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * @see       java.awt.Container#doLayout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
    public void layoutContainer(Container target) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
      synchronized (target.getTreeLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
        Insets insets = target.getInsets();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
        int maxwidth = target.width - (insets.left + insets.right + hgap*2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
        int nmembers = target.getComponentCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
        int x = 0, y = insets.top + vgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
        int rowh = 0, start = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
        boolean ltr = target.getComponentOrientation().isLeftToRight();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
        boolean useBaseline = getAlignOnBaseline();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
        int[] ascent = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
        int[] descent = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
        if (useBaseline) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
            ascent = new int[nmembers];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
            descent = new int[nmembers];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
        for (int i = 0 ; i < nmembers ; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
            Component m = target.getComponent(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
            if (m.isVisible()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
                Dimension d = m.getPreferredSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
                m.setSize(d.width, d.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
                if (useBaseline) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
                    int baseline = m.getBaseline(d.width, d.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
                    if (baseline >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
                        ascent[i] = baseline;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
                        descent[i] = d.height - baseline;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
                    else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
                        ascent[i] = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
                if ((x == 0) || ((x + d.width) <= maxwidth)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
                    if (x > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
                        x += hgap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
                    x += d.width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
                    rowh = Math.max(rowh, d.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
                    rowh = moveComponents(target, insets.left + hgap, y,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
                                   maxwidth - x, rowh, start, i, ltr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
                                   useBaseline, ascent, descent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
                    x = d.width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
                    y += vgap + rowh;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
                    rowh = d.height;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
                    start = i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
        moveComponents(target, insets.left + hgap, y, maxwidth - x, rowh,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
                       start, nmembers, ltr, useBaseline, ascent, descent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
    // the internal serial version which says which version was written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
    // - 0 (default) for versions before the Java 2 platform, v1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
    // - 1 for version >= Java 2 platform v1.2, which includes "newAlign" field
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
    private static final int currentSerialVersion = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   651
     * This represent the {@code currentSerialVersion}
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   652
     * which is bein used.  It will be one of two values:
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   653
     * {@code 0} versions before Java 2 platform v1.2,
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   654
     * {@code 1} versions after  Java 2 platform v1.2.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
    private int serialVersionOnStream = currentSerialVersion;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * Reads this object out of a serialization stream, handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * objects written by older versions of the class that didn't contain all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * of the fields we use now..
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
    private void readObject(ObjectInputStream stream)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
         throws IOException, ClassNotFoundException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
        stream.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
        if (serialVersionOnStream < 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
            // "newAlign" field wasn't present, so use the old "align" field.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
            setAlignment(this.align);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
        serialVersionOnStream = currentSerialVersion;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
    /**
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 28059
diff changeset
   679
     * Returns a string representation of this {@code FlowLayout}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * object and its values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     * @return     a string representation of this layout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
        String str = "";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
        switch (align) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
          case LEFT:        str = ",align=left"; break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
          case CENTER:      str = ",align=center"; break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
          case RIGHT:       str = ",align=right"; break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
          case LEADING:     str = ",align=leading"; break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
          case TRAILING:    str = ",align=trailing"; break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
        return getClass().getName() + "[hgap=" + hgap + ",vgap=" + vgap + str + "]";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
}