Re: [OpenMap Users] MouseMode Support for cursorID Property

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Fri, 25 May 2012 10:42:46 -0400

The OverlayMapPanel uses a different MouseMode that has a "Gestures" id - it's called the OMMouseMode, and is specified in the properties. You should be able to change the cursor for it.

OMMouseMode is a combination of NavMouseMode, SelectMouseMode and PanMouseMode.

- Don

=-=-=-=-=-=-=-=-=
Don Dietrick
_at_dfdietrick
=-=-=-=-=-=-=-=-=


On Friday, May 25, 2012 at 10:16 AM, Renton Ian wrote:

> Daniel,
>
> Thanks for mentioning BasicMapPanel - I think I've figured out where the issue must be!
>
> The default build of OpenMap 5.0 uses OverlayMapPanel instead of BasicMapPanel so that it can draw the embedded nav & scale panels over the map. My software uses that too, and the MouseMode cursorIDs do not work with this MapPanel.
>
> If I switch my application to using BasicMapPanel, the cursors work perfectly. (But of course, I lose the overlays.)
>
> I can't see anything obvious in OverlayMapPanel that breaks it, so presumably it's just that the topmost element on the map area is the hackPanel and not a Layer. No obvious way to fix this bug springs to mind, but I will keep poking around the source.
>
>
> If you're wondering where the other MouseModes are in the default build, the properties file has them in the "openmap.components" property, but not in the "main.components". If you add "selectMouseMode navMouseMode distanceMouseMode panMouseMode" (and maybe also "mouseModePanel" if you want it) to main.components, they will be available.
>
> Ian
>
> --
> Ian Renton
> UX / Software Engineer
> ATLAS ELEKTRONIK UK
> Atlas House, Dorset Green Tech. Park, DT2 8ZB, U.K.
> Tel: +44 (0) 1305 212341
> -----Original Message-----
> From: Straub, Daniel [mailto:Daniel.Straub_at_cassidian.com]
> Sent: 25 May 2012 14:41
> To: openmap-users_at_bbn.com (mailto:openmap-users_at_bbn.com)
> Subject: RE: [OpenMap Users] MouseMode Support for cursorID Property
>
>
> Yes, i am using openmap 5.0, too.
> On my system (Win XP 32-bit with SP3) runs [Java(TM) SE Runtime Environment (build 1.6.0_20-b02)].
>
> I don't think the difference in the java-version is the problem. First thing i would think of is: Do you overwrite the cursor somewhere else?
> I only set up a BasicMapPanel by
> mapPanel = new BasicMapPanel(new
> PropertyHandler(propertiesPath));
> and it works...
>
> I tried to set the cursor in the default build but this doesn't work for me, too. I'm also wondering where all the MouseModes are, which are defined in the properties (selectMouseMode navMouseMode distanceMouseMode panMouseMode). If i go to the menu, only the gestures-MouseMode is visible which should be the selectMouseMode.
>
> Perhaps there is something else in the properties file, preventing the set cursor to get active? Did you try to set up a new properties-file only containing the settings you need?
>
>
> Hope someone else knows more about that.
>
> Daniel Straub
>
>
> -----Original Message-----
> From: Renton Ian [mailto:ian.renton_at_uk.atlas-elektronik.com]
> Sent: Friday, May 25, 2012 2:07 PM
> To: openmap-users_at_bbn.com (mailto:openmap-users_at_bbn.com)
> Subject: RE: [OpenMap Users] MouseMode Support for cursorID Property
>
> Thanks Daniel.
>
> I did add the mousemode to my components list.
>
> I've also attempted to set cursorIDs in the properties file of the default build of OpenMap 5.0, just to rule out anything weird I've done in my software, and it doesn't work there either. Are you using 5.0, or an earlier/later one?
>
> For the record I'm also on Sun JRE 6 r23, Win XP 32-bit SP3.
>
> Ian
>
> --
> Ian Renton
> UX / Software Engineer
> ATLAS ELEKTRONIK UK
> Atlas House, Dorset Green Tech. Park, DT2 8ZB, U.K.
> Tel: +44 (0) 1305 212341
> -----Original Message-----
> From: Straub, Daniel [mailto:Daniel.Straub_at_cassidian.com]
> Sent: 25 May 2012 12:41
> To: openmap-users_at_bbn.com (mailto:openmap-users_at_bbn.com)
> Subject: RE: [OpenMap Users] MouseMode Support for cursorID Property
>
>
> Hi,
>
> Using the following lines in the properties-file worked for me:
>
> openmap.components=DistanceMouseMode
> DistanceMouseMode.class=com.bbn.openmap.event.DistanceMouseMode
> DistanceMouseMode.cursorID=CROSSHAIR_CURSOR
>
> Did you add the mousemode to the components?
>
> In the DistanceMouseMode.java-file i see the following:
> // if you really want to change the cursor shape // setModeCursor(cursor.getPredefinedCursor(cursor.CROSSHAIR_CURSOR));
> But that should be the same as you did. Perhaps someone else knows what's going wrong here...
>
> Hope I could help.
> Daniel Straub
>
> -----Original Message-----
> From: Renton Ian [mailto:ian.renton_at_uk.atlas-elektronik.com]
> Sent: Friday, May 25, 2012 1:16 PM
> To: openmap-users_at_bbn.com (mailto:openmap-users_at_bbn.com)
> Subject: [OpenMap Users] MouseMode Support for cursorID Property
>
> Hi,
>
> It looks from the source of AbstractMouseMode that MouseModes support a cursorID property that sets the cursor to use when that MouseMode is active. It looks for one of the static defined cursors in java.awt.Cursor, e.g. CROSSHAIR_CURSOR.
>
> However, I can't get it to work in any MouseMode. I've tried loading it as a property, e.g.
>
> distanceMouseMode.cursorID=HAND_CURSOR
>
> ...and I've tried extending the class and setting the cursor programatically, e.g.
>
> public class DistanceMouseMode2 extends DistanceMouseMode
> {
> public DistanceMouseMode2()
> {
> super();
> setModeCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
> }
> }
>
> ...but the cursor remains the normal pointer.
>
> Can anyone tell me what I'm doing wrong?
>
> Thanks,
>
> Ian
>
> --
> Ian Renton
> UX / Software Engineer
> ATLAS ELEKTRONIK UK
> Atlas House, Dorset Green Tech. Park, DT2 8ZB, U.K.
> Tel: +44 (0) 1305 212341
> The information contained within this e-mail and any files attached to this e-mail are private and in addition may include commercially sensitive information. The contents of this e-mail are for the intended recipient only and therefore if you wish to disclose the information contained within this e-mail or attached files, please contact the sender prior to any such disclosure.
>
> If you are not the intended recipient, any disclosure, copying or distribution is prohibited. Please also contact the sender and inform them of the error and delete the e-mail, including any attached files from your system.
>
> Atlas Elektronik UK Limited Registered Office Meadows Road, Queensway Meadows, Newport, South Wales NP19 4SS, UK. Company No. 05582639
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com (mailto:majdart_at_bbn.com)"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com (mailto:majdart_at_bbn.com)"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>
> The information contained within this e-mail and any files attached to this e-mail are private and in addition may include commercially sensitive information. The contents of this e-mail are for the intended recipient only and therefore if you wish to disclose the information contained within this e-mail or attached files, please contact the sender prior to any such disclosure.
>
> If you are not the intended recipient, any disclosure, copying or distribution is prohibited. Please also contact the sender and inform them of the error and delete the e-mail, including any attached files from your system.
>
> Atlas Elektronik UK Limited Registered Office Meadows Road, Queensway Meadows, Newport, South Wales NP19 4SS, UK. Company No. 05582639
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com (mailto:majdart_at_bbn.com)"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com (mailto:majdart_at_bbn.com)"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>
> The information contained within this e-mail and any files attached to this e-mail are private and in addition may include commercially sensitive information. The contents of this e-mail are for the intended recipient only and therefore if you wish to disclose the information contained within this e-mail or attached files, please contact the sender prior to any such disclosure.
>
> If you are not the intended recipient, any disclosure, copying or distribution is prohibited. Please also contact the sender and inform them of the error and delete the e-mail, including any attached files from your system.
>
> Atlas Elektronik UK Limited Registered Office Meadows Road, Queensway Meadows, Newport, South Wales NP19 4SS, UK. Company No. 05582639
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com (mailto:majdart_at_bbn.com)"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>
>




--
[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 Fri May 25 2012 - 10:43:52 EDT

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