Re: [OpenMap Users] jpopupmenu after click?

From: Don Dietrick <>
Date: Tue, 10 Aug 2004 23:18:39 -0400

On Aug 10, 2004, at 11:35 AM, Ben Podoll wrote:
> But my other JPopUpMenu problem I still don't quite understand. I am
> overriding a method (getItemsForOMGraphicMenu) that takes a OMGraphic
> as a
> param and then returns a List of JMenuItems, right?
> So in my mouseClicked method am I suppose to call that with the
> graphic that
> the click occurred on and then that method just does whatever it needs
> to
> (i.e. gets the AppObject and creates the menu items I want) and
> returns it
> and then I have to manually create a JPopUpMenu and add all the items
> returned and then somehow display it near the mouse pointer?

No, not at all. You don't need a mouseClicked method, or any method
handing MouseEvents directly. All mouse events are (should be) handled
by the StandardMouseModeInterpreter embedded in the layer. That thing
is making the calls to the OMGraphicHandlerLayer's
GestureResponsePolicy methods. In effect, the
StandardMouseModeInterpreter is asking the layer how it should handle
the different situations it is encountering. The Interpreter figures
out that a right-click occurs on an OMGraphic, and makes the call to
the layer's getItemsForOMGraphicMenu letting you know which OMGraphic
was right-clicked on, asking you what you want to do. If you return
null, it does nothing. If you return a list of MenuItems, it displays

- 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 Tue Aug 10 2004 - 23:19:08 EDT

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