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

From: Don Dietrick <dietrick_at_bbn.com>
Date: Mon, 15 Jun 2009 11:42:30 -0400

Hi Fabrice,

Thanks for the initial feedback on getting OpenMap wrapped in JavaFX,
this is the first instance I've heard of someone trying this. I'm
interested in hearing how this works out.

I'm also trying to understand your characterization of the mouse modes
and how they contribute to making the map unresponsive. The mouse modes
don't do anything to the EDT in particular, they act much like the
navigation panel buttons and any other swing widget controlling the map.
The MapBean has a support object, containing a thread, that is
responsible for telling the layers the map projection has changed, and
the MapBean generally controls when that thread is woken up and tasked.
Are you using any of the other Swing widgets, or making API calls, to
change the MapBean's projection? Are they functioning, or does the
MapBean only render the initial projection?

Cheers,

- Don

Fabrice Bouye wrote:
>
> 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/)
> Fisheries IT Specialist
> Tel: +687 26 20 00 (Ext 411)
> Oceanic Fisheries, Pacific Community
> 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 - 11:43:22 EDT

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