Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var Transition = Java.type("javafx.animation.Transition");
var Duration = Java.type("javafx.util.Duration");
var PropertyTransition = Java.extend(Transition);
var t = new PropertyTransition() {
interpolate: function(frac) {
print("INTERPOLATE");
},
play: function() {
print("Starting play");
t.setCycleDuration(Duration.millis(3000));
Java.super(t).play();
}
}
t.play();
@tomsontom

This comment has been minimized.

Copy link
Owner Author

@tomsontom tomsontom commented Sep 20, 2014

Starting play
javax.script.ScriptException: TypeError: javafx.animation.Transition$$NashornJavaAdapter@460d0a57 has no such function "setCycleDuration" in at line number 11
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:586)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:570)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:525)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:521)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:187)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
at application.TestNashornX.main(TestNashornX.java:15)
Caused by: :11 TypeError: javafx.animation.Transition$$NashornJavaAdapter@460d0a57 has no such function "setCycleDuration"
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:58)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:214)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:186)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:173)
at jdk.nashorn.internal.runtime.linker.NashornBottomLinker.linkBean(NashornBottomLinker.java:118)
at jdk.nashorn.internal.runtime.linker.NashornBottomLinker.getGuardedInvocation(NashornBottomLinker.java:73)
at jdk.internal.dynalink.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124)
at jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:144)
at jdk.internal.dynalink.DynamicLinker.relink(DynamicLinker.java:232)
at jdk.nashorn.internal.scripts.Script$^eval_.L:9(:11)
at javafx.animation.Transition$$NashornJavaAdapter.play(Unknown Source)
at jdk.nashorn.internal.scripts.Script$^eval_.runScript(:16)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:535)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:209)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:568)
... 5 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment