Re: [OpenMap Users] Retrieving lat/lon on mouse click

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 21 Sep 2005 11:31:04 -0400

Hi Chris,

One thing you can do is create a MapMouseMode that does what you
want, and have the active MapMouseMode act as a proxy to it.
MapMouseModes have the capability to act as proxies to other mouse
modes, which means they funnel their events to another mouse mode
while appearing to still be active.

So, you could have your component switch the active MouseMode to
"Gestures" (or whatever), create your new MapMouseMode that listens
for a mouse click and calls back the location to your component, set
that mode on "Gestures", and remove the proxy when your component
gets the event.

Hope this helps,

Don

On Sep 20, 2005, at 5:06 PM, Chris Hopkins wrote:

>
> Hi all -
>
> I'm just wondering if anyone has done this before I start looking
> into it.
> Here's the scenario...I have an OpenMap app up and running and the
> user is
> entering a lat/lon point into an interface component (like a
> customized
> JPanel with some labels and text fields). I want to allow the
> operator to
> click that point on the map and retrieve that value
> programmatically within
> my customized JPanel. So, something like:
>
> LatLonPoint llp = mapBean.getNextMouseClickAsLLP();
>
> and getNextMouseClickAsLLP() will block until the user clicks on
> the map
> somewhere. Or perhaps some kind of callback mechanism is more
> appropriate.
>
> Perhaps I'm thinking about this too much but has anyone done this?
>
> Thanks,
> Chris
>
> --
> [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"]
>



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
[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 Wed Sep 21 2005 - 11:36:07 EDT

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