RFR: 8272870: Add convenience factory methods for border and background [v2]

Kevin Rushforth kcr at openjdk.java.net
Fri Sep 3 21:11:08 UTC 2021

On Thu, 2 Sep 2021 12:14:58 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> Nir Lisker has updated the pull request incrementally with one additional commit since the last revision:
>>   Corrected comment tags
> modules/javafx.graphics/src/main/java/javafx/scene/layout/Background.java line 357:
>> 355: 
>> 356:     /**
>> 357:      * A convenience factory method for creating a background with a single {@code Paint}. The background will use the
> Suggestion to rephrase as:
> `A convenience factory method for creating a Background by specifying only the {@code Paint} for BackgroundFill`

Since the `Background` constructors take a list of `Paint` objects, I think saying a "single" `{@code Paint}` is helpful. I can see how adding "for `BackgroundFill`" (or maybe "as a `BackgroundFill`"?) might make it clearer.

> modules/javafx.graphics/src/main/java/javafx/scene/layout/Background.java line 361:
>> 359:      *
>> 360:      * @implSpec This call is equivalent to {@code new Background(new BackgroundFill(fill, null, null));}.
>> 361:      * @param fill the fill of the background
> `@param fill Any Paint. If null, the value Color.TRANSPARENT is used.`
> Picked from BackgroundFill constructor's doc

Good idea to indicate what happens on `null`, although that might be better in the description?


PR: https://git.openjdk.java.net/jfx/pull/610

More information about the openjfx-dev mailing list