JavaFX embedded in jme3

In the git repository there is a src/test/java folder, it has some examples using it.

Hi,

the lastest working code is :

and for basic sample code see src/test on source of JME3-JFX. We use scene builder 2.0 to create fxml file, so you can edit sample/test to have only one button or label.

I fix the issue you’ve got with jme3_skel: use the ‘launch’ tack to run.

So, abstractwindows are finally also resizable when being externalized. The border now behaves as expected, and the windowbar for moving the window does so also. Still the css rarly not loading one open.

I just wanted to say, this works extremely well and is very simple to use, especially with the FXML loading capabilities! The JavaFX editor in netbeans (JFX Fluidon) makes GUI creation a breeze. The speed of JavaFX is also very nice as well. I am currently using this for all my games and it works splendidly.

After a bit of searching, I found this which seems to work! :slight_smile:

@geekdentz Why did you need to search? You were given the source repository path, with all our basic tests included.

Tried this but it didn’t work for me: JME3-JFX/Test.java at master · empirephoenix/JME3-JFX · GitHub

@geekdenz , Can you provide more info about what didn’t work (log, screenshot, expected,…) ? So we can fix it.

Thanks

@david_bernard_31 @abies and everyone else using this library.

I finally have the time that i want to fix the current problems with the internal&external Windows.
In my opinion most of these originate in the design jfxextras used for their layouting and resize handling.

So I would like to kick it out, and create a own simple windowing system, features I would implement would be:
→ Icon
→ maximize
→ close
→ externalize
→ resizing with border and programatical
→ moving via titlebar dragging and programatical
→ Do everything that is possible via CSS for the required elements, so that the windows can be styled
→ Unified behaviour of externalized and internalized windows.

→ Bonus if i manage it: Seamless externalisation via Dragging out of jme window.
→ Bonus preference storage, allow a preference-storage to save prefered location and mode of windows, eg. your inventory will always open at same place with same size.

What are your opinions regarding the current window functionality, my proposal, ect.?
Also if I do the rewrite is any of you more competent with CSS than me and could give a helping hand for a DefaultWindow design that will be included into the library?

Currently I doesn’t use window, so I don’t have any comments about existing or your proposal. I guess I’m less competent than you with fx-css, I do the minimum (change color, font). Anyway I’m ok to help if I can.

Hi playing around with the new window implementation I noticed some hard microlags in jfx itself (even without jme)
I found out that these magic parameters really help, could any of you test if they improve performance on your systems as well?

-Djavafx.animation.fullspeed=true -Dprism.order=sw

I didn’t update or fetch JME-JFX since a long time on my local fork.

commit 8ebb0c06fe892b7219b6e204d6732d45c43b1b1f
Author: Kai Boernert <kai-boernert@visiongamestudios.de>
Date:   Fri Jan 2 12:54:20 2015 +0100

    next resizing fix :/
    
    Signed-off-by: Kai Boernert <kai-boernert@visiongamestudios.de>

commit 8bf081c22ebd42ec1e7c69b4be18606e8f96da2c
Merge: cb2e242 fd1da10
Author: Kai Boernert <kai-boernert@visiongamestudios.de>
Date:   Fri Jan 2 12:44:18 2015 +0100

    Merge branch 'master' of https://github.com/empirephoenix/JME3-JFX

I did a test this morning, without

-Djavafx.animation.fullspeed=true -Dprism.order=sw

com.jme3x.jfx.Test (an others, except injfx) crash. I copy/paste the log below, I include my gfx driver info (I’m on archlinux 64):

...
févr. 22, 2015 12:17:01 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFOS: Vendor: NVIDIA Corporation
févr. 22, 2015 12:17:01 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFOS: OpenGL Version: 4.5.0 NVIDIA 346.35
févr. 22, 2015 12:17:01 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFOS: Renderer: GeForce GTX 660/PCIe/SSE2
févr. 22, 2015 12:17:01 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFOS: GLSL Ver: 4.50 NVIDIA
...
The program 'java' received an X Window System error.
This probably reflects a bug in the program.
The error was 'RenderBadPicture (invalid Picture parameter)'.
  (Details: serial 3961 error_code 143 request_code 139 minor_code 7)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
AL lib: (EE) alc_cleanup: 1 device not closed


ah thats the bug i got already month ago on arch.

I still did not figure out what causes this, but it doe sonly happen in the smaller test cases, in my large application it never happens, so i guess its a sych bug.

I never had it before (I don’t remember). But I don’t have it with your :

-Djavafx.animation.fullspeed=true -Dprism.order=sw

:smile:

it deactivates the hardware acceleration :smile:
Apparently for linux at least the layouting is way faster that way.

Ok, I just finsihed the initial reimplementing work on the windows. Could any of you please test them via the Test class?

Finsihed:
→ Manually specified Hotspots for ProtonCursorProvider, as jme refuses to load them from file.
→ Performance optimizations via default Properties used for PRISM rendering.
→ Rare Xorg based crash due to problems with accelerated PRISM rendering.
→ maximize
→ close
→ externalize
→ resizing with border and programmatic
→ moving via title-bar dragging and programmatic
→ Do everything that is possible via CSS for the required elements, so that the windows can be styled
→ Unified behaviour of externalized and internalized windows.

OpenList:
→ Bonus if i manage it: Seamless externalisation via Dragging out of jme window.
→ Bonus preference storage, allow a preference-storage to save prefered location and mode of windows, eg. your inventory will always open at same place with same size.

2 Likes

Test.java and others Seem to work, but I miss right and bottom border of the floating window, see image.

Hm guess I have a layouting bug still in it then :slight_smile:
Will take a look at it

Ok I think I finally managed to track most of the issues left down, it should work now :slight_smile:
→ assuming the minWidth and height are properly set in the content / set to computed.

@david_bernard_31 would be very nice if you could test again.

I don’t find issue when I ran Test.java and TestIsCovered.java.
Good work

1 Like