Java Question B4j - Accessing a Functional Interface Class

stevel05

Expert
Licensed User
Longtime User
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
    2.6 KB · Views: 318
Last edited:

stevel05

Expert
Licensed User
Longtime User
(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.)

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:

B4X:
 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
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:
Top