How to use JavaFX SimpleSwingBrowser in Processing IDE? - javafx

I had just found this website: https://docs.oracle.com/javafx/2/swing/swing-fx-interoperability.htm.
On this site, there is an example to create a SimpleSwingBrowser.
The problem is that I can't use this code in Processing and I don't know how I can edit it so it will work.
Is there a way to use the JavaFX SimpleSwingBrowser in Processing (If needed in a Swing Frame or something like that)?
Thanks in advance,
Daantje

I can't find a way to import JavaFX code into Processing, which seems weird because Processing supports using JavaFX as a renderer. It might be possible to import JavaFX code, but a quick Google doesn't reveal how.
But hope is not lost. You can also just use Processing as a Java library, and run your sketch that way instead of via the Processing editor. Here is a tutorial that should get you started with that.
Then when you have your sketch running via Java, you can create a JavaFX frame however you normally would.

Related

Is there a way to generate windows and/or components in Ignition?

I was hoping that Ignition had a way to import/export windows to a non-binary format such as JSON or XML, but that seems not to be the case (or is there a way?).
Is there a way to use the script console to generate and populate a new window, or to insert components into an existing window?
This would be used for inserting templates and other components, such as navigation buttons etc.
Yes, but...
I assume here that you're referring to Vision windows. The windows are indeed binary serialized, but the underlying structure is XML. But getting the deserialization done programmatically is a pain and probably not worth it.
You can get a feel for what this looks like by opening a Vision window in the designer, right-clicking its Root Container and choosing Copy, then pasting it into Notepad. I myself tried to find a way to do this from a module and decided it wasn't worth it. For more detail, you can view that thread in the Ignition forum here.
However, that's not really useful for generating and populating a new window.
To do that, you need to do some Java programming. Vision is Java Swing under the hood. There are a couple ways you can dynamically build / populate a Window.
From Python, you can import any Java libraries you need and generate the window dynamically. For relatively simple things, you're probably better off working with the Template Canvas component. There's an Ignition forum thread discussing this topic here. This would be more of a run-time generation, not from the Script Console.
You can write your own module to do it.
Module SDK Vision Component Guide
Vision Component Module Example
Good luck!

Is there a way for AutoIt to get JavaFX application's text

I am new to AutoIt and I'm using its java bridge and I really liked it. But from what i understand even though it support swing and swt it does not support JavaFX. When I use it with a javaFx application, I cant get the texts with its finder tool. So is there a way to get around this? A simple way to get texts and other things from JavaFX application for test verification purposes? Thank you for all your answers
check JABSimpleSpy that is a spy based on java accessibiliy bridge build with AutoIt
https://www.autoitscript.com/wiki/FAQ#How_can_I_control_.28click.2C_edit_etc.29_an_external_.28html.29_application.3F

is it possible to bind javascript and qtwidgets?

I have tested QML&javascript performance. It looks like works not very well if QML UI control is complex.
Just wonder if it is possible to bind javascript and qtwidgets?
Your comment welcome
I found following project that generates Qt bindings for Qt Script. I haven't tried it though.
https://code.google.com/p/qtscriptgenerator/
It is recommended that Javascript code should be kept to a minimum. Since it is bad for performance as you mentioned, especially when it is run during animation. I don't know what you are up to, but it would be better to implement UI with QML(minimum Javascript) and logic with Qt (C++).

How to Record an Audio and Play in QML?

I am trying an application where i kept three buttons one for play,record and stop.
When i press the record button,it should start record the audio by me. and after stopping it,when i play it.it should retrieve the recorded audio from the file,where it is stored.
I have tried using this link below,but could not find any solution.
https://projects.developer.nokia.com/audiorecorder/changeset/67519324bc6ea96ef956dec1b494eb3a5417402b
Can anyone find me a solution for this.I am badly in need of this solution!!!
Thanks in Advance!!!
As far as I know, you should call the phonon's MediaSource/MediaObject classes to do it inthe back end.
#include <phonon/MediaObject>
#include <phonon/MediaSource>
Phonon::MediaObject *mobj....;
I dont know how QML is written but this is how you get to play media files in Qt.
Your link seems to have a solution for Symbian only.
One general thing: There is no recording API for QML. But there are C++ classes in QtMobility Multimedia which do what you want to do, you just need to export APIs to QML (that's what you can learn from the example in your link)

Writing web forms filler/submitter with QT C++

I'm scratching my head on how to accomplish the following task: I need to write a simple web forms filler/submitter with QT C++, it does the following:
1) Loads page url
2) Fills in form fields
3) Submits the form
Sounds easy, but I'm a web developer and can't find the way how to make QT accomplish the task, I only managed to load url with QWebView object using WebKit, have no idea what to do next, how to fill in fields and submit forms. Any hints, tutorials, videos? I appreciate this.
QWebElement class does all the work, just reading through the class documentation gave me a full idea on how to accomplish my task. Thanks to eveyrone for suggestions.
The best solution would be to write the logic in JavaScript that does what you want and then inject it into the page using QWebFrame::evaluateJavaScript() after it finishes loading.
There's also another way to do this; involving the document tree traversal API that's been available in QtWebKit since 4.6: QWebElement. You'd basically process the form pretty much the same as you would do in JavaScript, except that here the API is different and more limited. It's C++ though and might be a little bit faster. I guess, this approach might be less attractive for you, given you're a web developer and probably already know JavaScript.

Resources