Re: [OpenMap Users] How To capture Event in a Layer

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 21 May 2008 11:32:30 -0400

Hi Mike,

Regarding the DateLayer not updating the date except when the projection
changes - I don't know if that's really a bug, it's just how it was
written (in 1998). It would be trivial to add a javax.swing.Timer class
that updated the label at regular intervals.

Cheers,

Don

Ta3ban4_at_aol.com wrote:
> Hi Don,
> I was looking how to get any mouse even in a layer i was
> creating for the purpose of learning by
> examples. I guess you are write OMGraphicHandler has a lot
> of functionality just need to dig a bit
> more in it.
> Another thing, I just notice a possible bug with the
> DateLayer, using the OpenMap example. The
> date is not being updated except when the projection is
> changed. Did anyone notice that or I missed
> something ?
>
> Thanks
> Mike
> In a message dated 5/16/2008 12:04:16 P.M. Eastern Standard Time,
> dietrick_at_bbn.com writes:
>
> Hi Mike,
>
> Do you really need the MouseEvent object, or do you just want to know
> when things (clicks, mouse overs, etc) happen over your map objects?
>
> The OMGraphicHandler has a lot of functionality already built into it
> to let you know when the mouse is doing something over your objects.
> Look at the com.bbn.openmap.layer.learn.InteractionLayer for guidance
> with respect to that.
>
> You can respond to mouse clicks this way, too, with the selected(...)
> method, popping up a window with your picture in it. Alternatively,
> you could construct html that references an image URL, and call
> layer.fireRequestBrowserContent(String browserContent).
>
> Hope this helps,
>
> Don
>
> On May 14, 2008, at 4:19 PM, Ta3ban4_at_aol.com wrote:
>
> > Chirs , Kennedy and All
> >
> > Thanks guys for taking the time to reply back.
> >
> > I got the mouse event working by doing the following ; Not
> > sure if this is the best/correct way ;
> >
> > public class MyLatLongLayer extends
> > OMGraphicHandlerLayer implements MapMouseListener
> > { ,,,,,,,
> > public MapMouseListener getMapMouseListener()
> > {return this;}
> > public String[] getMouseModeServiceList(){ return
> > new String[] { SelectMouseMode.modeID };}
> > }
> >
> >
> > Then from my main program I load the different layers and
> > then do the following
> > MouseDelegator mouseDelegator = new MouseDelegator();
> > mapHandler.add(mouseDelegator);
> > SelectMouseMode selectMouseMode = new SelectMouseMode();
> > mapHandler.add(selectMouseMode);
> > NavMouseMode2 nav2= new NavMouseMode2();
> > mapHandler.add(nav2);
> > ,,,,,
> > mapHandler.add(new MouseModeButtonPanel());
> >
> > From main gui by selecting Gestures from the
> > MouseModeButton i received the different mouse events in
> > MyLatLongLayer
> > The layer would be added to display the lat/long position
> >
> >
> > finally Let me give you an idea about my school project
> > maybe you guys can give me some hints and ideas how to proceed .
> >
> > My application side of that project is to receive
> > Aircraft objects that contain a lat/long and
> > some other simple information (N objects/sec ), display
> > them on a map and load the appropriate shape/tiff files.
> > User shall be able to click on the aircraft and get the
> > information about that aircraft in pop up window/or like
> > LocationLayer that holds cities.
> > I will implement the ideas that guys mentioned.
> >
> >
> > Thanks in Advance
> >
> > Mike
> >
> > In a message dated 5/14/2008 2:10:46 P.M. Eastern Standard Time,
> kroberts_at_syrres.com
> > writes:
> >
> > Mike,
> >
> > Since you're extending OMGraphicHandlerLayer, capturing mouse
> events
> > is
> > actually pretty easy. You basically need to do a couple of things:
> >
> > 1) Override the receivesMapEvents() method to return true.
> >
> > 2) Call the setMouseModeIDsForEvents() method in your constructor
> to
> > set the
> > MapMouseModes that you want to receive mouse clicks from. You
> > probably want
> > to listen for at least SelectMouseMode.
> >
> > 3) Override the appropriate method(s) to handle clicks on the layer:
> > leftClick(), getItemsForMapMenu(), etc...
> >
> > One note: I don't think the default StandardMapMouseInterpreter
> > passes left
> > clicks to the OMGraphicHandlerLayer by default. You may need to
> > create your
> > own class that extends StandardMapMouseInterpreter that overrides
> > leftClick() and passes the mouse event to the leftClick() method of
> > your
> > layer. I think that's what I did.
> >
> > I hope this helps.
> >
> > -Kennedy
> > --
> > View this message in context:
> http://www.nabble.com/How-To-capture-Event-in-a-Layer-tp17193632p17237519.html
> > Sent from the OpenMap mailing list archive at Nabble.com.
> >
> > --
> > [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"]
> >
> >
> >
> > Wondering what's for Dinner Tonight? Get new twists on family
> > favorites at AOL Food.
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 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"]
>
>
>
>
> ------------------------------------------------------------------------
> Wondering what's for Dinner Tonight? Get new twists on family favorites
> at AOL Food <http://food.aol.com/dinner-tonight?NCID=aolfod00030000000001>.

--
[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 May 21 2008 - 11:32:41 EDT

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