Re: [OpenMap Users] menus on select from OMGraphicHandlerLayer subclass

From: Don Dietrick <>
Date: Fri, 17 Sep 2004 08:03:44 -0400

On Sep 16, 2004, at 8:30 PM, Robert Najlis wrote:

> Hi,
> I am working on my own subclass of OMGraphicHandlerLayer. I have been
> able to get tooltips working on mousemovements, but I am having
> troubles getting reactions to clicks.
> I would really like to get menus popping up.
> I can get isSelectable and select to work, but I don't seem to be able
> to get deselect and getItemsForOMGraphicMenu(OMGraphic) to be called.
> (I am testing by just printing to the command line). I assume
> deselect must be working in some way, as the list size for select
> remains the same - but I don't see my System.out.println message
> getting called from the deselect function.

It turns out, deselect() doesn't get called by the
StandardMapMouseInterpreter. It should be, and I've changed it for the
release so that it will. We never noticed because we always tested it
with a drawing tool, and the drawing tool did the deselecting.

getItemsForOMGraphicMenu() should be getting called on a right-click.
It's coded for a cntrl-click to work as well, but for some reason my
version of Java isn't delivering the cntrl-click in the MouseListener's
mouseClicked() method. I haven't figured out why.

> Also, should I implement the functions mouseOver(MapMouseEvent) and
> leftClick(MapMouseEvent) in my class?

If you are using the released 4.6 version, you'll have to create a
different MapMouseInterpreter (extending StandardMapMouseInterpreter,
for instance), that actually forwards those calls to the GRP (the
layer). If you are using the version in the CVS tree, there's a
modification to the StandardMapMouseInterpreter where it checks the
layer via the receivesMapEvents() method, and you would return true
from that method in order to get the mouseOver() and leftClick()
methods called.

- Don

Don Dietrick,
BBN Technologies, Cambridge, MA

[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Sep 17 2004 - 08:09:13 EDT

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