You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add convenience functions for running Python code on the EDT #12
Let's add scyjava.awt.invoke(python_function) as a shortcut for EventQueue.invokeAndWait(java_runnable_object), and scyjava.awt.queue(python_function) as a shortcut for EventQueue.invokeLater(java_runnable_object). Internally it would work like this:
We could even provide convenience classes like this for all classes in the java.util.function package that would live at the top level of scijava, or maybe we could just put it at scijava.function. Unfortunately, we cannot auto map python functions/lambdas because we can only check the number of arguments but not the types, e.g. Function vs LongFunction and we do not know if anything is being returned (Consumer vs Function).
That would be quite a bit of work but is something that is probably very suitable for a student.
Activity
ctrueden commentedon Dec 16, 2019
CC @hanslovsky
hanslovsky commentedon Dec 17, 2019
Thanks @ctrueden
should be
We could even provide convenience classes like this for all classes in the
java.util.functionpackage that would live at the top level ofscijava, or maybe we could just put it atscijava.function. Unfortunately, we cannot auto map python functions/lambdas because we can only check the number of arguments but not the types, e.g.FunctionvsLongFunctionand we do not know if anything is being returned (ConsumervsFunction).That would be quite a bit of work but is something that is probably very suitable for a student.