< prev index next >

src/java.desktop/share/classes/javax/swing/JList.java

Print this page




 945      * Defines the way list cells are layed out. Consider a {@code JList}
 946      * with five cells. Cells can be layed out in one of the following ways:
 947      *
 948      * <pre>
 949      * VERTICAL:          0
 950      *                    1
 951      *                    2
 952      *                    3
 953      *                    4
 954      *
 955      * HORIZONTAL_WRAP:   0  1  2
 956      *                    3  4
 957      *
 958      * VERTICAL_WRAP:     0  3
 959      *                    1  4
 960      *                    2
 961      * </pre>
 962      * <p>
 963      * A description of these layouts follows:
 964      *
 965      * <table border="1"
 966      *  summary="Describes layouts VERTICAL, HORIZONTAL_WRAP, and VERTICAL_WRAP">
 967      *   <tr><th><p style="text-align:left">Value</p></th><th><p style="text-align:left">Description</p></th></tr>




 968      *   <tr><td><code>VERTICAL</code>
 969      *       <td>Cells are layed out vertically in a single column.
 970      *   <tr><td><code>HORIZONTAL_WRAP</code>
 971      *       <td>Cells are layed out horizontally, wrapping to a new row as
 972      *           necessary. If the {@code visibleRowCount} property is less than
 973      *           or equal to zero, wrapping is determined by the width of the
 974      *           list; otherwise wrapping is done in such a way as to ensure
 975      *           {@code visibleRowCount} rows in the list.
 976      *   <tr><td><code>VERTICAL_WRAP</code>
 977      *       <td>Cells are layed out vertically, wrapping to a new column as
 978      *           necessary. If the {@code visibleRowCount} property is less than
 979      *           or equal to zero, wrapping is determined by the height of the
 980      *           list; otherwise wrapping is done at {@code visibleRowCount} rows.

 981      *  </table>
 982      * <p>
 983      * The default value of this property is <code>VERTICAL</code>.
 984      *
 985      * @param layoutOrientation the new layout orientation, one of:
 986      *        {@code VERTICAL}, {@code HORIZONTAL_WRAP} or {@code VERTICAL_WRAP}
 987      * @see #getLayoutOrientation
 988      * @see #setVisibleRowCount
 989      * @see #getScrollableTracksViewportHeight
 990      * @see #getScrollableTracksViewportWidth
 991      * @throws IllegalArgumentException if {@code layoutOrientation} isn't one of the
 992      *         allowable values
 993      * @since 1.4
 994      */
 995     @BeanProperty(visualUpdate = true, enumerationValues = {
 996             "JList.VERTICAL",
 997             "JList.HORIZONTAL_WRAP",
 998             "JList.VERTICAL_WRAP"}, description
 999             = "Defines the way list cells are layed out.")
1000     public void setLayoutOrientation(int layoutOrientation) {




 945      * Defines the way list cells are layed out. Consider a {@code JList}
 946      * with five cells. Cells can be layed out in one of the following ways:
 947      *
 948      * <pre>
 949      * VERTICAL:          0
 950      *                    1
 951      *                    2
 952      *                    3
 953      *                    4
 954      *
 955      * HORIZONTAL_WRAP:   0  1  2
 956      *                    3  4
 957      *
 958      * VERTICAL_WRAP:     0  3
 959      *                    1  4
 960      *                    2
 961      * </pre>
 962      * <p>
 963      * A description of these layouts follows:
 964      *
 965      * <table class="striped">
 966      * <caption>Describes layouts VERTICAL,HORIZONTAL_WRAP, and VERTICAL_WRAP
 967      * </caption>
 968      * <thead>
 969      *   <tr><th>Value</th><th>Description</th></tr>
 970      * </thead>
 971      * <tbody>
 972      *   <tr><td><code>VERTICAL</code>
 973      *       <td>Cells are layed out vertically in a single column.
 974      *   <tr><td><code>HORIZONTAL_WRAP</code>
 975      *       <td>Cells are layed out horizontally, wrapping to a new row as
 976      *           necessary. If the {@code visibleRowCount} property is less than
 977      *           or equal to zero, wrapping is determined by the width of the
 978      *           list; otherwise wrapping is done in such a way as to ensure
 979      *           {@code visibleRowCount} rows in the list.
 980      *   <tr><td><code>VERTICAL_WRAP</code>
 981      *       <td>Cells are layed out vertically, wrapping to a new column as
 982      *           necessary. If the {@code visibleRowCount} property is less than
 983      *           or equal to zero, wrapping is determined by the height of the
 984      *           list; otherwise wrapping is done at {@code visibleRowCount} rows.
 985      * </tbody>
 986      * </table>
 987      * <p>
 988      * The default value of this property is <code>VERTICAL</code>.
 989      *
 990      * @param layoutOrientation the new layout orientation, one of:
 991      *        {@code VERTICAL}, {@code HORIZONTAL_WRAP} or {@code VERTICAL_WRAP}
 992      * @see #getLayoutOrientation
 993      * @see #setVisibleRowCount
 994      * @see #getScrollableTracksViewportHeight
 995      * @see #getScrollableTracksViewportWidth
 996      * @throws IllegalArgumentException if {@code layoutOrientation} isn't one of the
 997      *         allowable values
 998      * @since 1.4
 999      */
1000     @BeanProperty(visualUpdate = true, enumerationValues = {
1001             "JList.VERTICAL",
1002             "JList.HORIZONTAL_WRAP",
1003             "JList.VERTICAL_WRAP"}, description
1004             = "Defines the way list cells are layed out.")
1005     public void setLayoutOrientation(int layoutOrientation) {


< prev index next >