On Thursday, September 11, 2003, at 12:12 PM, George Uecker wrote:
> Hi Scott,
>
> I have exactly the same problem. It stems from the fact that the zoom
> box is not drawn on a layer; rather, it is drawn directly into the
> mapBean's graphics by the NavMouseMode's mouseDragged() method. This
> implies that the zoom box is ONLY drawn when the mouse button is held
> down and while the mouse is actively being moved. If you continue to
> hold down the button, but stop moving the mouse, no further zoom boxes
> are drawn and the last one drawn gets overwritten the next time your
> dynamic layers repaint themselves.
>
> There are a couple of ways we could change this:
>
> 1. Add a special layer for zoom boxes and other special-purpose
> transient graphics, then make the NavMouseMode draw into this layer
> instead of directly into the mapBean's graphics.
> 2. Add a timer in NavMouseMode that draws the current box at a given
> rate starting when mousePressed() is called and stopping when
> mouseReleased() is called. Since the box is drawn using XOR mode,
> this will effectively make the box "blink" while the cursor is held
> stationary.
>
> 3. Automatically send your own "Pause" event from the mousePressed()
> method and a "Resume" event from mouseReleased(). This will look
> good, but the downside is that your other objects won't be updated
> while the zoom box is active. This may or may not be acceptable for
> your application.
>
> Does anybody have any other ideas?
A better solution would be to make the NavMouseMode a
com.bbn.openmap.event.PaintListener, and add it to the MapBean as a
PaintListener when a box is being defined (removing it when the box is
undefined). This will give the NavMouseMode an opportunity to draw
whenever the MapBean repaints. This is how the drawing tool handles
this situation.
- Don
> sam16@cwru.edu wrote:
>
>> Hi all. I'm using OpenMap to display a bunch of moving objects on a
>> map. The
>> user can switch the mouse mode to NavMouseMode and then click and
>> drag to
>> recenter and resize the viewing area. When I "pause" the display so
>> that the
>> map objects aren't moving, this behavior works fine. But if I have
>> the objects
>> running and updating their position, the rectangular box that is
>> created by
>> clicking and dragging the cursor disappears on every update of the
>> map objects.
>> Once it disappears, the user can make it reappear by continuing to
>> drag the
>> cursor, but it disappears again on the next map object update. This
>> makes the
>> box flicker. While the zooming/recentering behavior still works, the
>> flickering is distracting and makes it hard to figure out where the
>> zoom box is
>> actually located. Any ideas on how to fix this behavior? I'm using a
>> BufferedMapBean, if that makes a difference.
>>
>> Thanks,
>> Scott
>> --
>> [To unsubscribe to this list send an email to "majdart@bbn.com"
>> with the following text in the BODY of the message "unsubscribe
>> openmap-users"]
>>
>
>
> --
> George Uecker george.uecker@dot21rts.com
> Software Engineer (410) 480-7236
> Dot21 Real-Time Systems Inc. (410) 313-7515 fax
>
>
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Thu Sep 11 12:22:12 2003
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:36 EDT