Changeset 8911 in josm for trunk


Ignore:
Timestamp:
2015-10-19T23:03:43+02:00 (9 years ago)
Author:
simon04
Message:

GBC: improve Javadoc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/GBC.java

    r8510 r8911  
    122122    }
    123123
    124     public GBC grid(int x, int y) {
    125         gridx = x;
    126         gridy = y;
     124    /**
     125     * Sets the constraint's {@code gridx}, {@code gridy}.
     126     * @return This constraint for chaining.
     127     * @see #gridx
     128     * @see #gridy
     129     */
     130    public GBC grid(int gridx, int gridy) {
     131        this.gridx = gridx;
     132        this.gridy = gridy;
    127133        return this;
    128134    }
    129135
    130     public GBC span(int width, int height) {
    131         gridwidth = width;
    132         gridheight = height;
     136    /**
     137     * Sets the constraint's {@code gridwidth}, {@code gridheight}.
     138     * @return This constraint for chaining.
     139     * @see #gridwidth
     140     * @see #gridheight
     141     */
     142    public GBC span(int gridwidth, int gridheight) {
     143        this.gridwidth = gridwidth;
     144        this.gridheight = gridheight;
    133145        return this;
    134146    }
    135147
    136     public GBC span(int width) {
    137         gridwidth = width;
     148    /**
     149     * Sets the constraint's {@code gridwidth}.
     150     * @return This constraint for chaining.
     151     * @see #gridwidth
     152     */
     153    public GBC span(int gridwidth) {
     154        this.gridwidth = gridwidth;
    138155        return this;
    139156    }
    140157
    141     public static GBC std(int x, int y) {
    142         GBC c = new GBC();
    143         c.anchor = WEST;
    144         c.gridx = x;
    145         c.gridy = y;
    146         return c;
     158    /**
     159     * Create a standard constraint with the {@code gridx}, {@code gridy} set.
     160     *
     161     * Is equivalent to {@code std().grid(gridx, gridy)}
     162     * @return A standard constraint.
     163     * @see #std()
     164     * @see #grid(int, int)
     165     * @see #gridx
     166     * @see #gridy
     167     */
     168    public static GBC std(int gridx, int gridy) {
     169        return std().grid(gridx, gridy);
    147170    }
    148171
Note: See TracChangeset for help on using the changeset viewer.