RFR: 8228363: ContextMenu.show with side=TOP does not work the first time in the presence of CSS

Robert Lichtenberger rlichten at openjdk.java.net
Thu Jan 21 06:40:44 UTC 2021

On Wed, 20 Jan 2021 16:49:35 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

> Regarding the spec change, I was thinking of this section, which you removed:
> ```
>      * To clarify the purpose of the {@code hpos} and {@code vpos} parameters,
>      * consider that they are relative to the anchor node. As such, a {@code hpos}
>      * and {@code vpos} of {@code CENTER} would mean that the ContextMenu appears
>      * on top of the anchor, with the (0,0) position of the {@code ContextMenu}
>      * positioned at (0,0) of the anchor. A {@code hpos} of right would then shift
>      * the {@code ContextMenu} such that its top-left (0,0) position would be attached
>      * to the top-right position of the anchor.
> ```
> As you pointed out, the reference to `hpos` and `vpos` is incorrect, but unless I'm missing something, it still seems like the concept still needs to be described.

I assume that a very long time ago, there were hpos and vpos parameters for this method. And that really required an explanation, because then you could e.g. specify hpos=RIGHT and vpos=BOTTOM, which would give a very strange position for the context menu (the top left corner of the menu would be in the bottom right corner of the button).
It also was very counter-intuitive that giving CENTER/CENTER for hpos/vpos would put the top left corner of the menu at the top left corner of the button.
However all this confusion was ended when Side was used instead of HPos/VPos. At that very moment all the confusing cases went away. No more BOTTOM/RIGHT or CENTER/CENTER placement.
So I think we can really just remove the (obsolete) explanation of hPos/vPos.


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

More information about the openjfx-dev mailing list