Re: [OpenMap Users] indexOf problem...

From: Bart Jourquin <bart.jourquin@fucam.ac.be>
Date: Mon Jun 30 2003 - 09:54:09 EDT

OpenMap Support wrote:

>
> On Monday, June 30, 2003, at 04:39 AM, Bart Jourquin wrote:
>
>> Hmm,
>>
>> Yes, if I do something like :
>>
>> EsriPolylineList ompl = new EsriPolylineList();
>> ompl.setVague(true);
>> ompl.add(omp);
>>
>> and then add the ompl to the EsriPlugIn's list, it works.
>>
>> Now, if I understand well, the "vaguenes" is used to consider a
>> (polyline) list as a single object.
>
>
> Exactly.
>
>> If it's so, why not add "setVague(true)" in the constructor of
>> EsriPolylineList, to make it more simple to use? Or perhaps did I
>> miss something...
>
>
> But only embedded EsriPolylineLists should be vague, right? The
> ShpInputStream sets EsriPolylineLists created for multi-shape objects
> to be vague, but it looks like you aren't using that.

Well, I do for the initial loading of the objects (EsriPlugin), but not
when I add new objects...

>
>
> I'm not sure how to make this easier. I don't really want to add an
> EmbeddedEsriPolylineList with vagueness set to true, because I don't
> think it would help - by the time someone realized why they would have
> to use an Embedded* class, they could have just used the super class,
> and the additional classes might make the API more intimidating (I
> could be convinced otherwise).
>
> We could have EsriGraphicLists check when a EsriGraphic is added, and
> if the child is a List, the parent sets vague to true because it would
> assume that the children are multi-part geometries. Is that a valid
> assumption for all cases?

I would say this is correct, but I can't validate this assumption.

>
> - Don
>
>> OpenMap Support wrote:
>>
>>> I wonder if it's an effect of the 'vagueness' actions of the
>>> OMGraphicList.
>>>
>>> If the OMGraphicList is not being vague (transparent),
>>> selectClosest() will return OMGraphics from embedded
>>> OMGraphicLists. I don't think indexOf() provides that same
>>> courtesy, because I don't think it knows how to provide an index for
>>> the embedded OMGraphic.
>>>
>>> Maybe indexOf should be returning the index of the parent
>>> OMGraphicList, which would work for you.
>>>
>>> Or, you can set the OMGraphicLists to be vague, and selectClosest
>>> will return the embedded OMGraphicList, and all will be well.
>>>
>>> - Don
>>>
>>> On Friday, June 27, 2003, at 06:28 AM, Bart Jourquin wrote:
>>>
>>>> Hi all,
>>>>
>>>> Take this simple code
>>>>
>>>> OMGraphic omg = list.selectClosest(e.getX(), e.getY(), 4);
>>>> if (omg != null) {
>>>> graphicIndex = list.indexOf(omg);
>>>> ...
>>>> }
>>>>
>>>>
>>>> The strange thing is that graphicIndex sometimes will contain -1!
>>>>
>>>> I observed this for the graphic list used in EsriPlugin
>>>> - with lists of EsriPolylines (not EsriPoints)
>>>> - only for new objects added to the list (using list.add(graphic)
>>>> and getModel().addBlankRecord();)
>>>> - only for OM4.6 beta (worked before)
>>>>
>>>> Can anyone figure out what's wrong here?
>>>>
>>>> Many thanks
>>>>
>>>> --
>>>> Prof Dr Bart Jourquin
>>>> F.U.Ca.M. - G.T.M.
>>>> Chaussee de Binche, 151a
>>>> B7000 Mons
>>>> Belgium
>>>> Tel. : +32 65 323293
>>>> Fax. : +32 65 315691
>>>> http://message.fucam.ac.be/~jourquin
>>>>
>>>>
>>>> --
>>>> [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"]
>>

--
[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 Mon Jun 30 09:55:29 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:36 EDT