Thanks Mark,
I did use the findClosest with the LinkLayer registered for the SelectMouseMode, but what I couldn't retreive corretcly on the client( LinkLayer ) was the AppObject for the LinkOMGraphicList, even though I was setting it for the graphics from the server.
That was when the LinkProperties came handy, I added the String I required displayed as a ToolTip as a LPC_GRAPHICID ( any key would do ) property to the LinkProperties before the LinkServer wrote the graphics onto the Link.
Then from client I could use the findClosest and then use the getProperty for the LPC_GRAPHICID key on the closest graphic.With the value retreived I could fire an InfoLine message or a ToolTip.
What I am looking at now is to bring to front any OMText objects that I add with the LinkOMGraphicList. These are added to the graphic list during a MouseEvent, say a mouse click . But they seem to be covered by the graphics for the countries.
Any thoughts ... ?!
Regards,
Pradeep.
--
On Thu, 5 Jul 2001 07:46:30
Mark Bucciarelli wrote:
>To get the layer to respond to mouse events in SelectMouseMode, add
>that mode to the array returned by the getMouseModeServiceList()
>method. I think you have to create your own layer subclass to do
>this.
>
>Once the layer responds to SelectMouseMode events you can customize
>the MouseMoved(MouseEvent) method for that layer to fire a tool
>tip request, something like this:
>
> public boolean mouseMoved(MouseEvent evt)
> {
> if (!isVisible()) return false;
> Location loc = findClosestLocation(evt);
> if (loc != null)
> {
> InfoDisplayEvent info = new InfoDisplayEvent(this, loc.getName());
> fireRequestToolTip(evt, loc.getName());
> }
> else
> fireHideToolTip(evt);
>
> return loc == null;
> }
>
>This code is for a location layer, so there may not be an equivalent
>method to findClosestLocation() (findClosestLink()?). Also, the
>SelectMouseMode is set to consume events, so if some other object is
>registered higher in the queue than the layer, and that object consumes
>the mouseMoved event, the layer will not get it. What I did to get
>around this was to modify the NavMouseMode class to not consume events.
>It's a hack, I probably should subclass to do this right.
>
>What's cool about this is that once you dig in this far, you can mess
>around with all the other mouse events, and do things like fire pop-up
>menu on a right click and whatever else UI candy you can think of.
>
>--
>Mark Bucciarelli Peregrine Systems, Inc. R&D, Boston
>(413) 253-0020 mbucciarelli@peregrine.com Yahoo: m_bucciarelli
>http://www.peregrine.com
>
>> -----Original Message-----
>> From: PRADEEP RAMACHANDRAN [mailto:arpradeep@lycos.com]
>> Sent: Thursday, July 05, 2001 10:13 AM
>> To: openmap-users@bbn.com
>> Subject: ToolTip with LinkLayer
>>
>>
>> Hello,
>>
>> Can the LinkLayer be made to fireToolTip messages
>> or InfoLine messages when in SelectMouseMode. I am
>> looking for a functionality similar to that in the
>> AreaShapeLayer where the abbreviated country names
>> appear on the InformationDelegator in gesture mode.
>>
>> Would it be correct to say that the only way to have
>> this done would be to associate an AppObject with the
>> LinkOMGraphicList for the LinkServer and have the
>> names created from reading a CSVFile record for the
>> corresponding shapefile record?
>>
>> I couldn't figure out what to expect when the Gestures
>> mode is active in the LinkLayer. Is there some behaviour
>> that can be observed for the layer when in gesture mode?
>>
>> Thanks,
>> Pradeep.
>>
>>
>>
>> Get 250 color business cards for FREE!
>> http://businesscards.lycos.com/vp/fastpath/
>>
>> --
>> [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"]
>>
>
Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/
--
[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 Fri Jul 6 08:48:55 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT