stevel05 Expert Licensed User Longtime User Oct 16, 2018 #1 I thought I'd try my hand at wrapping a library in java (it's been a while) and I decided to try the jfxtras CirclePopupMenu. It's working well, but there is method to set the AnimationInterpolation which is a functional interface. I can't for life of me work out how to wrap this so that the user can change the values. Relevant javadoc is here: http://jfxtras.org/doc/8.0/jfxtras-menu/jfxtras/scene/menu/CirclePopupMenu.html https://jar-download.com/javaDoc/or...yout/CircularPane.AnimationInterpolation.html https://jar-download.com/javaDoc/or...8.0-r4/jfxtras/scene/layout/CircularPane.html My current source code is attached. Any help would be appreciated. Attachments CirclePopupMenuWrapper.java CirclePopupMenuWrapper.java 2.6 KB · Views: 649 Last edited: Oct 16, 2018
I thought I'd try my hand at wrapping a library in java (it's been a while) and I decided to try the jfxtras CirclePopupMenu. It's working well, but there is method to set the AnimationInterpolation which is a functional interface. I can't for life of me work out how to wrap this so that the user can change the values. Relevant javadoc is here: http://jfxtras.org/doc/8.0/jfxtras-menu/jfxtras/scene/menu/CirclePopupMenu.html https://jar-download.com/javaDoc/or...yout/CircularPane.AnimationInterpolation.html https://jar-download.com/javaDoc/or...8.0-r4/jfxtras/scene/layout/CircularPane.html My current source code is attached. Any help would be appreciated.
Erel B4X founder Staff member Licensed User Longtime User Oct 16, 2018 #2 (tip: I'm pretty sure that you don't really need to wrap a Java library for this and can build it as a cross platform "view" with XUI.) You can implement the interface in your code and then either raise events with ba.raiseEvent or make the concrete class configurable with properties.
(tip: I'm pretty sure that you don't really need to wrap a Java library for this and can build it as a cross platform "view" with XUI.) You can implement the interface in your code and then either raise events with ba.raiseEvent or make the concrete class configurable with properties.
stevel05 Expert Licensed User Longtime User Oct 16, 2018 #3 Erel said: (tip: I'm pretty sure that you don't really need to wrap a Java library for this and can build it as a cross platform "view" with XUI.) Click to expand... Yes I am just experimenting with java again and thought this one would be simple . I found an example on programcreek : https://www.programcreek.com/java-a...in/java/nl/utwente/viskell/ui/CircleMenu.java Which does this: Code: Copy this.setAnimationInterpolation(CircularPane::animateOverTheArcWithFade); to set the value, but it's way over my head. It appears that there are some available options as static methods in the CircularPane class but I can't work out how to access them without using lambda's.
Erel said: (tip: I'm pretty sure that you don't really need to wrap a Java library for this and can build it as a cross platform "view" with XUI.) Click to expand... Yes I am just experimenting with java again and thought this one would be simple . I found an example on programcreek : https://www.programcreek.com/java-a...in/java/nl/utwente/viskell/ui/CircleMenu.java Which does this: Code: Copy this.setAnimationInterpolation(CircularPane::animateOverTheArcWithFade); to set the value, but it's way over my head. It appears that there are some available options as static methods in the CircularPane class but I can't work out how to access them without using lambda's.
stevel05 Expert Licensed User Longtime User Oct 17, 2018 #4 Thank you @Erel, you gave me the information I needed it just took me some time to digest it. The answer came to me as I was driving to a gig. I'm just glad we have B4a and B4j so that I only have to worry about this sort of thing when I want to. At least I now understand the :: Method reference in readiness for java 8 libraries Just the rest of Lambda's to contend with. Last edited: Oct 17, 2018
Thank you @Erel, you gave me the information I needed it just took me some time to digest it. The answer came to me as I was driving to a gig. I'm just glad we have B4a and B4j so that I only have to worry about this sort of thing when I want to. At least I now understand the :: Method reference in readiness for java 8 libraries Just the rest of Lambda's to contend with.