Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
errors resolving java methods from ringo(?)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Darren Cruse  
View profile  
 More options Jul 9 2012, 2:40 pm
From: Darren Cruse <darren.cr...@gmail.com>
Date: Mon, 9 Jul 2012 11:40:20 -0700 (PDT)
Local: Mon, Jul 9 2012 2:40 pm
Subject: errors resolving java methods from ringo(?)

I've got at least a start at a jsr223 script engine I've written to use
JavaFX from Ringo - I'm calling it RingoFX :).

It's working pretty well on a simple example - maybe kind of neat if JavaFX
ever gains some traction.  I'm using it along with the new JavaFX Scene
Builder where you can drag/drop your UI design, but instead of java for the
"controllers" I'm using Ringo (CommonJS) modules.

But I'm struggling a bit with a second example where I was attempting to
convert this iTunes search UI over to Ringo:
    http://www.oracle.com/technetwork/articles/java/expressfx-1665720.html

My code is failing to resolve types when I'm calling into java methods from
Ringo.

e.g. Here's some (abbreviated but) pretty simple code that's creating a
javaFX "ImageView" to use a graphic on the search button:
    importClass(Packages.javafx.scene.image.Image);
    importClass(Packages.javafx.scene.image.ImageView);

    var searchImageView = new ImageView(new
Image(getResource("magnifier.png").inputStream));
    view.searchButton.graphic = searchImageView;

And I can see in the debugger this is all working fine until that last line
(view.searchButton.graphic = searchImageView;) where it gives the error:
    org.mozilla.javascript.EvaluatorException:  Cannot convert
ImageView@37806b to javafx.scene.Node.

In that line I've just made this "setGraphic(Node)" into the javascript
style ".graphic = X" form:

http://docs.oracle.com/javafx/2/api/javafx/scene/control/Labeled.html...

But just to make sure that's not the problem, I switch that line to the
standard form i.e.:
    view.searchButton.setGraphic(searchImageView);

But I get the similar just slightly different error as follows:
    org.mozilla.javascript.EvaluatorException:  Can't find method
javax.scene.control.Labeled.setGraphic(javax.scene.image.ImageView)

In the debugger I double checked the types e.g.:
    % view.searchButton.class.name
    javafx.scene.control.Button
    % searchImageView.class.name
    javafx.scene.image.ImageView

So I feel like it's a failure to recognize ImageView "isa" Node.  But I
don't know why - ImageView directly extends javafx.scene.Node as seen here:
    http://docs.oracle.com/javafx/2/api/javafx/scene/image/ImageView.html

So no "conversion" should be needed(?)  

If it matters I should mention too that I saw the post about the issue with
JavaAdapter in Rhino 1.7R4:

https://groups.google.com/forum/?hl=en&fromgroups#!search/JavaAdapter...

And I am using the rhino-1.7R5-SNAPSHOT.jar with Ringo.  So I don't think
that's the problem...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »