RFR: 8290040: Provide simplified deterministic way to manage listeners [v9]

John Hendrikx jhendrikx at openjdk.org
Fri Dec 2 09:14:27 UTC 2022


On Fri, 2 Dec 2022 09:08:36 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/scene/Node.java line 1437:
>> 
>>> 1435:     }
>>> 1436: 
>>> 1437:     public final ReadOnlyBooleanProperty shownProperty() {
>> 
>> This property probably should have been named `showing` to align it with `Window.showing`, but the "good name" is already taken by `ComboBox` and other controls. Just out of interest, have you considered alternatives to `shown`?
>
> I didn't look too far for alternative names after I discovered `showing` would not be possible.  The name comes from `isTreeShowing` which is used for a similar purpose (inside `Node`) and from `conditionOnShowing` in ReactFX.
> 
> The name needs to imply that visibility has no effect on it (ie, `setVisible(false)` won't toggle it).  Neither does it check if the node isn't covered or off screen.
> 
> In theory you could use a more general name (like `active` as in "part of an active currently showing scene graph").  `isActive` seems to even be available...
> 
> A name like "used" or "inUse" may also work (as in "indicates the node is currently used as part of a currently showing scene graph".

That reminds me... `parent` is described as:

>  The parent of this {@code Node}. If this {@code Node} has not been added to a scene graph, then parent will be null.

Which I think is incorrect; parent can easily be non-null while not being part of a scene graph.

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

PR: https://git.openjdk.org/jfx/pull/830


More information about the openjfx-dev mailing list