[OpenMap Users] OpenMap on JavaFX, getGraphics(), Thread.sleep() in EDT and external Thread

From: Fabrice Bouye <FabriceB_at_spc.int>
Date: Mon, 15 Jun 2009 16:04:46 +1100

Hi,

I've been developing a GIS GUI for a while for one of our internal projects using the OpenMap bean as our GIS component. While the project was initially in pure Java Swing, the project's GUI has now switched to JavaFX since it's been released last December (recently switched to JavaFX 1.2).

 

As expected the map bean can be simply wrapped using the javafx.ext.swing.SwingComponent class and displayed as any other kind of Node in a Scene and it works good.

But, there are still some issues in the way OpenMap's various mouse mode are done : when rendering their own overlay, they use direct access to the map bean getGraphics() method, they use Thread.sleep() in the EDT and they launch an external Thread to change the projection (see ZoomMouseMove, PanMouseMode and NavMouseMode source code for example), things which is usually not considered to be Swing good programming practices as they do get along with Swing's passive rendering architecture and interact poorly with the EDT itself.

 

While the overlays show up Ok in Java when dragging the mouse around, they simply do not show up* at all when the bean is integrated in a JavaFX Scene.

*to be true, sometimes it shows up on the initial click and never again after.

 

I was wondering if there was any plan to change that for the next OpenMap major version?

(i.e.: replace direct active rendering by some passive rendering architecture, replace Thread by SwingTimer or SwingUtilities.invokeLater(), access to component properties only on EDT, etc.)

 

----
Fabrice Bouyé (http://fabricebouye.cv.fm/ <http://fabricebouye.cv.fm/> )
Fisheries IT Specialist
Tel: +687 26 20 00 (Ext 411)
Oceanic Fisheries, Pacific Community
http://www.spc.int/ <http://www.spc.int/>

 



--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Jun 15 2009 - 01:24:44 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT