<div dir="ltr">I am unconvinced yet that this is a good path. The reason is that different transitions have different combinations of properties to them. JDK-8091607 [1] asks for a common superclass for transitions that have a Node property. JDK-8226456 [2] asks for a common superclass for parent transitions (although this case is a bit different), Since only 1 superclass is possible, it might be better to use interfaces for these. The problem described in the ticket and in [1] is that many instanceof checks are needed, and this can be relieved with an interface as well. Code duplication will still be present though.<div><br></div><div>I think that some prototyping is required first.<br><div><div><br></div><div>- Nir</div><div><br></div><div>[1] <a href="https://bugs.openjdk.org/browse/JDK-8091607">https://bugs.openjdk.org/browse/JDK-8091607</a><br></div><div>[2] <a href="https://bugs.openjdk.org/browse/JDK-8226456">https://bugs.openjdk.org/browse/JDK-8226456</a></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 8, 2023 at 10:03 PM Carl Carlec <<a href="mailto:carl.carlec@gmail.com">carl.carlec@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto"><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">Hello JavaFX community,</div><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">I've created a draft PR for an enhancement to Transitions: <a aria-label="Link https://github.com/openjdk/jfx/pull/1061" title="https://github.com/openjdk/jfx/pull/1061" href="https://github.com/openjdk/jfx/pull/1061" rel="noreferrer noopener" target="_blank">https://github.com/openjdk/jfx/pull/1061</a></div><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">JavaFX contains many different Transitions that have a durationProperty() and related getter/setter.</div><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">Those transitions benefit from an abstract super class which defines this once. </div><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">This will therefore reduce a lot of code duplications or big switch-cases to handle all Transitions like the one linked in the ticket.</div><p style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px"> </p><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">I propose to create a new abstract class called TimedTransition, which extends from Transition and defines the durationProperty() + getter/setter. All Transitions which define a durationProperty() will now extend from it and do not need to define it.</div><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">Those Transitions are affected: FadeTransition, FillTransition, PathTransition, PauseTransition, RotateTransition, ScaleTransition, StrokeTransition, TranslateTransition.</div><p style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px"> </p><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">Feedback welcome!</div><p style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px"> </p><div style="color:rgb(0,0,0);margin-bottom:0px;margin-left:0px;margin-top:0px">Carl</div></div></div></blockquote></div>