Re: [OpenMap Users] Overriding EditableOMGraphic/OMDrawingTool deactivate() behaviour

From: Don Dietrick <>
Date: Tue, 12 Sep 2006 18:16:13 -0400

Hi Tom,

I think this is an effect caused by the settings in the
EditableOMPoly, and how the PolyAddPointState is handing the
mouseMoved commands in from the mouse mode. Underneath, the
EditableOMPoly has already added the new point to the poly, the
mouseMoved motion just repositions it while it's waiting to set it
with the mouse click. It's not smart enough to delete that last
point if the OMDrawingTool gets deactivated before the point is set.

Seems like the DrawingTool-EditableOMGraphics communications API has
to be adjusted so the EditableOMGraphic is told when the tool is
deactivated, allowing it to clean up. I think the EditableOMPoly
would be the only one that needs to react, although the others might
want to delete themselves if the tool exits at a point before the
OMGraphic is fully defined.

- Don

On Aug 29, 2006, at 2:30 AM, Thomas Schar wrote:

> Hi All,
> We have written a number of graphic components extending from the
> OMPoly/Line/etc classes and they work fine for most things.
> However, we have found that requiring a user to double click to end
> the drawing mode is problematic, especially when what they are
> drawing is not 'free form' (ie. a fixed discrete number of pts).
> The problem is that OMDrawingTool.deactivate() is appending an
> extra latlon point when called (ie. it adds an additional point
> when invoked using the current cusor position). Hence, by
> providing a 'stop drawing' type button that invokes deactivate()
> the user still adds an additional point when drawing.
> I've been reading through the OMDrawingTool / EditableOMGraphic
> source and can't seem to locate exactly where this extra point is
> coming from to override. Does anyone have any suggestions?
> (Just to recap in case I've been vague.
> UseCase: User selects object to draw from tool palette - it
> requires 4 pts. user clicks the 4 pts, and then wants to be able
> to press a 'finished' button. That button invokes deactivate().
> Problem is that the mouse listener is still running and so the
> mouseDown() still fires and a 5th point is added before the object
> is drawn. In the case causing an error).
> Many thanks.
> Tom.
> --
> [To unsubscribe to this list send an email to ""
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]

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 Sep 12 2006 - 18:17:23 EDT

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