On Wed, 20 May 2026 15:30:37 GMT, Michael Strauß <[email protected]> wrote:

>> Martin Fox has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 10 commits:
>> 
>>  - Merge remote-tracking branch 'upstream/master' into osbackdrop
>>  - New version of StageBackdrop API, separated into standard and platform 
>> variants
>>    
>>    commit dee190390d147e9032a734ab0abaab752e308c76
>>    Author: Martin Fox <[email protected]>
>>    Date:   Wed May 20 06:18:23 2026 -0700
>>    
>>        More minor cleanup
>>    
>>    commit 457c7eb99affd42f67dedb2c760fa639a88943b9
>>    Author: Martin Fox <[email protected]>
>>    Date:   Tue May 19 19:33:15 2026 -0700
>>    
>>        Cleaning up imports, comments, etc.
>>    
>>    commit 947a5e3598fd0e1b8f69747314405519a8a8794d
>>    Author: Martin Fox <[email protected]>
>>    Date:   Tue May 19 16:16:23 2026 -0700
>>    
>>        Disabling macOS 26 Liquid Glass effect
>>    
>>    commit 9c3d0389f3687504411fc840ecb878ebe9608e36
>>    Author: Martin Fox <[email protected]>
>>    Date:   Tue May 19 16:14:19 2026 -0700
>>    
>>        Backdrop options are now dynamic and set on the stage.
>>    
>>    commit 7d61c2b9bc15a7bdc7c79b0ddde651678404f065
>>    Author: Martin Fox <[email protected]>
>>    Date:   Tue May 19 11:15:09 2026 -0700
>>    
>>        Added options query and simplified Windows implementation
>>    
>>    commit c1514f348f9e1d9d3761aec9786dda25e12fa588
>>    Author: Martin Fox <[email protected]>
>>    Date:   Mon May 18 12:07:40 2026 -0700
>>    
>>        Revamped StageBackdrop API, splitting standard and platform backdrops 
>> and adding options
>>    
>>    commit 608cfa631967470bdbfc02a5b30e55ab3c932d32
>>    Merge: 551c9ec336 7110a0940d
>>    Author: Martin Fox <[email protected]>
>>    Date:   Thu May 14 07:08:44 2026 -0700
>>    
>>        Merge branch 'osbackdrop' into osbackdrop_dev
>>    
>>    commit 551c9ec336d9e6d3f90e37b278dc17df9a9bca03
>>    Author: Martin Fox <[email protected]>
>>    Date:   Wed Apr 8 08:51:49 2026 -0700
>>    
>>        Cleanup.
>>    
>>    commit c2e8ec8afc4df2dbd529470761b500e4d670bbeb
>>    Author: Martin Fox <[email protected]>
>>    Date:   Sat Apr 4 20:18:07 2026 -0700
>>    
>>        Factory for construction backdrops
>>    
>>    commit 4654e4071e19b0b45e44161925b38904d100dda5
>>    Author: Martin Fox <[email protected]>
>>    Date:   Wed Apr 1 16:20:29 2026 -0700
>>    
>>        So...
>
> modules/javafx.graphics/src/main/java/javafx/stage/StageBackdrop.java line 
> 110:
> 
>> 108:      * @return An unmodifiable list of names of the supported platform 
>> backdrops.
>> 109:      */
>> 110:     public static List<String> getPlatformBackdropNames() {
> 
> What's the reason for returning a list of names instead of a list of 
> backdrops? If you returned the latter, there would be no need for a factory 
> method to create a backdrop instance, and no way to pass in a wrong string.

When prototyping the CSS code and even the sample app the names were all that 
mattered. The utility functions I wrote to map strings to backdrops always had 
to deal with invalid names anyway. It also seems that a factory function aligns 
better with existing JavaFX API's (see Font) and forcing clients to iterate 
does not. And I realize that it probably doesn't matter here but iteration 
doesn't scale well. Overall I felt that a factory function was a better fit.

Put another way, we could return a list of backdrops instead of names but I 
would still want to provide a static function for finding a backdrop by name. 
But maybe I'm focusing too much on the specific use cases I encountered.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2048#discussion_r3275503749

Reply via email to