Re: [OpenMap Users] Issue with OMGraphicHandlerLayer

From: Don Dietrick <dietrick_at_bbn.com>
Date: Fri, 10 Jul 2009 17:01:45 -0400

Hi Mulone,

How you extend OMGraphic depends on what you are doing. You can extend
OMGraphicList and add certain OMGraphics to it in certain ways, or you
can extend the OMGraphic that has the geometry of the object you are
trying to represent but need more functionality. I generally extend
OMGraphicList, because that lets me control the visibility of different
parts of the list depending on the status of the object I'm trying to
represent.

You also have the option of using attributes
(OMGraphic.putAttribute(key, value), OMGraphic.getAttribute(key) to
store objects you might need later, without extending the actual class.

Hope this helps,

Don

Mulone wrote:
> Thanks, now I'm able to display html tooltips.
> To implement these fancy info panels I was thinking of subclassing the
> OMGraphic, to make it compatible with the framework. What would be the best
> class to start with?
>
> Cheerio,
> Mulone
>
>
> Don Dietrick wrote:
>
>> Java tooltips support multi-line html text.
>>
>> If you want to draw fancy stuff or other controls, remember that Layer
>> is a JComponent, and you can do what you want with the paint() method -
>> including having some other Components that get called, too. You have
>> to be careful, because OpenMap layers don't call up the paint()
>> hierarchy, so the Layer background doesn't get rendered and obscure
>> layers below it. But you can create your own info widgets and display
>> them.
>>
>> - Don
>>
>> Mulone wrote:
>>
>>> It works! I can see the tooltips. Do they support multiline-html code?
>>> Actually I'd like to implement a small browser/tooltip, such as
>>> http://img196.imageshack.us/img196/5295/tooltip.png
>>> Do you think I can use a JEditorPane and a few controls and display them
>>> on
>>> the map?
>>>
>>> Many thanks!
>>> Mulone
>>>
>>>
>>> Don Dietrick wrote:
>>>
>>>
>>>> If it's methods are getting called, it's active. I'd use a debugger and
>>>> step through where the events are going to see why your layer isn't
>>>> reacting. I think you are doing the right things, it's just that
>>>> something isn't quite flowing all the way through to the layer and I
>>>> can't spot the problem.
>>>>
>>>> - Don
>>>>
>>>> Mulone wrote:
>>>>
>>>>
>>>>> Ok. I use this class:
>>>>>
>>>>> public class OSMPanMouseMode extends NavMouseMode
>>>>> {
>>>>> public OSMPanMouseMode()
>>>>> {
>>>>> super();
>>>>> super.setModeCursor( Cursor.getDefaultCursor() );
>>>>> setID("OSMNav");
>>>>> }
>>>>> // other stuff
>>>>> }
>>>>>
>>>>> And I load it this way:
>>>>>
>>>>> OSMMouseDelegator mouseDelegator = new OSMMouseDelegator();
>>>>> mouseDelegator.addMouseMode(new OSMPanMouseMode());
>>>>> mapHandler.add(mouseDelegator);
>>>>>
>>>>> And it works, the methods of the OSMPanMouseMode get called. I don't
>>>>> know
>>>>> how to check whether this mouse mode is active. Any hints?
>>>>>
>>>>> Thanks again,
>>>>> Mulone
>>>>>
>>>>>
>>>>> Don Dietrick wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Hi Mulone,
>>>>>>
>>>>>> The StandardMapMouseInterpreter is the class that will call the
>>>>>> isHighlightable(). Your code looks OK, although I usually don't
>>>>>> bother
>>>>>> setting the mouse event interpreter if you are using the standard one.
>>>>>> Is the OSMNav mouse mode active?
>>>>>>
>>>>>> - Don
>>>>>>
>>>>>> Mulone wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi guys,
>>>>>>>
>>>>>>> I've found this interesting thread
>>>>>>> http://openmap.bbn.com/mailArchives/openmap-users/2004-06/2869.html
>>>>>>> and
>>>>>>> I'm
>>>>>>> trying to code it in my application.
>>>>>>> This is the stuff I've added to my OMGraphicHandlerLayer:
>>>>>>> http://www.copypastecode.com/7028
>>>>>>> Note: I can't use the properties file because our application all the
>>>>>>> settings are loaded programmatically.
>>>>>>>
>>>>>>> Unfortunately I seem to be unable to make it work... The method
>>>>>>> isHighlightable() never gets called. I tried to debug the framework
>>>>>>> to
>>>>>>> figure out what I'm doing wrong but no luck so far.
>>>>>>> Which is the class that invokes the isHighlightable?
>>>>>>>
>>>>>>> Thanks for your patience and helpful hints.
>>>>>>> Mulone
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> [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"]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>> [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"]
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>> --
>> [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"]
>>
>>
>>
>
>

--
[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 Jul 10 2009 - 17:02:21 EDT

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