Re: Query on OpenmapApplet with Link Server ...

From: PRADEEP RAMACHANDRAN <arpradeep@lycos.com>
Date: Thu May 31 2001 - 09:31:29 EDT

Thanks a lot for the support Don,

The coloring works ... and it seems to be
possible both ways i.e. with the bounds as
used in the AreaHandler and with bounds read
off the link ...

The coloring came through with these :

fillcolor = originalProperties.getProperty("linklayer.areas." + drawParams.id.toUpperCase().intern() + "." + "fillColor");

properties.setProperty("fillColor",fillcolor);

In case it would reduce efforts for anyone,
I'll be happy to send in the source( server
starter, server and the arealinkhandler ), it
may be a fairly good starting point ...

Regards,
Pradeep.

--
On Wed, 30 May 2001 10:27:46  
 Donald F. Dietrick wrote:
>Hi Pradeep,
>
>You should use the bounds from the link to query the SpatialIndex to
>find the shape graphics that need to be returned to the client.  As the
>LinkSpatialIndex is running through the graphics in the shape file, you
>should be keeping track of the index of the graphics that are added to
>the link.  Before a graphic is added to the link, you should access the
>hash table to figure out which drawing attributes need to be applied to
>that particular graphic's properties.
>
>I don't think the toString() call on the color will work - you need to
>create a hex color string.  toString() has a bunch of other stuff in it.
>
>I think you are on the right track, and very close to having it work.
>
>- Don
>
>PRADEEP RAMACHANDRAN wrote:
>> 
>> Thanks for the response Don,
>> 
>> The server is returning graphics without the coloring...probably because of the reason that instead of using the bounds extracted from the query that comes through the link (query.getBoundingPolys() ), the fetchGraphics in the customised ShapeLinkServer simply calls the getGraphics method of the AreaHandler passing to it LinkProperties, LinkSpatialIndex and the LinkGraphicsList objects used by the link, the getGraphics call looks like this -
>> getGraphics(spatialindx, 90f, -180f, -90f, 180f, lgl, properties); the rest of the preocessing is the same as in the AreaHandler.
>> 
>> >From the digging in, that I could do ...the LinkSpatialIndex makes an ESRIRecord of a given type,  for eg. ESRILinkPolygonRecord, here the polygon set associated with the record would be added to the LinkGraphicsList. Finally the LinkGraphicList uses the LinkPoly object to write the lat/lon/x/y points with the linkproperties to the link ... Is this right?
>> 
>> It seems as though the only place then to set the coloring attribute then would be the LinkProperties object ...? probably with a call like -
>> 
>> properties.setProperty("fillColor",drawParams.drawingAttributes.getFillPaint().toString());
>> 
>> If setting the property like this is what gets the coloring done, then do I have to revert to using the bounds extracted from the link ... ?
>> 
>> Regards,
>> Pradeep.
>> 
>> --
>> 
>> On Tue, 29 May 2001 08:32:32
>>  Donald Dietrick wrote:
>> >Hi Pradeep,
>> >
>> >I think the LinkOMGraphic list is messing you up.  That was intended for
>> >holding on to OMGraphics read from the link, with the added
>> >functionality of looking up the graphics by ID set by the LinkServer, so
>> >the client can specify a particular graphic to the server.
>> >
>> >I can't see how the graphics, set with their drawing parameters, are
>> >written to the link by the server.  The modifications to the Shape
>> >package objects when they are used by a LinkServer let the graphics be
>> >written to the link instead of creating an OMGraphic.
>> >
>> >Is your server returning graphics that aren't being colored properly, or nothing?
>> >
>> >- Don
>> >
>> >PRADEEP RAMACHANDRAN wrote:
>> >>
>> >> Hello Don,
>> >>
>> >> Thanks for the hints ...
>> >>
>> >> Here is what I did ...
>> >>
>> >> Have modified the flow of control when a request arrives on the link to be as follows -
>> >> fetchGraphics( method as in ShapeLinkServer ) -> AreaLinkHandler.getGraphics(... ) -> AreaLinkHandler->RecordList(...)
>> >>
>> >> The modified AreaHandler uses a LinkSpatialIndex, LinkGraphicList and LinkProperties in all its associated methods. getGraphics in AreaHandler now uses the LinkSpatialIndex object instead of SpatialIndex to locate records. In RecordList a LinkOMGraphicList is created with initial capacity/increment as 10/10. Here is what I have in RecordList ...
>> >>
>> >>  int recNumber=rec.getRecordNumber();
>> >>  LinkOMGraphicList recList = new LinkOMGraphicList(10,10);
>> >>
>> >>  recList.setFillPaint (drawParams.drawingAttributes.getFillPaint());
>> >>   if (drawParams != null){
>> >>     rec.addOMGraphics(recList, drawParams.drawingAttributes);
>> >>   } else {
>> >>      rec.addOMGraphics(recList, defaultDrawParams.drawingAttributes);
>> >>     }
>> >>
>> >>  recList.setAppObject(new Integer(recNumber));
>> >>  return recList;
>> >>
>> >> The list returned is added to a LinkOMGraphicList and written onto the link as ...
>> >>
>> >>    lglist.addOMGraphic(RecordList(records1[i], drawParams));
>> >>    ESRILinkRecord reclink;
>> >>    try{
>> >>         if (records1[i] instanceof ESRILinkRecord) {
>> >>           reclink = (ESRILinkRecord)records1[i];
>> >>           reclink.writeLinkGraphics(lgl, properties);
>> >>         }
>> >>    } catch(IOException ex) {
>> >>        if (Debug.debugging("shape")) {
>> >>           ex.printStackTrace();
>> >>        }
>> >>      }
>> >>
>> >> The properties that I have in the properties file are similar to those that would be set for an AreaShapeLayer( keyIndex, areas, fillColor etc. ), with the exception of the shpfile and the indexfile ... the display continues to come up without the color settings ...
>> >>
>> >> Could you please let me know what I have missed ...  ?!!
>> >>
>> >> Regards,
>> >> Pradeep.
>> >>
>> >> --
>> >>
>> >> On Wed, 23 May 2001 14:07:24
>> >>  Donald F. Dietrick wrote:
>> >> >Hi Pradeep,
>> >> >
>> >> >In order to get defined areas to work for a LinkServer, modifications
>> >> >will have to be made to the ShapeLinkServer - right now it contains a
>> >> >reference to a LinkSpatialIndex, which is an extension to the
>> >> >SpatialIndex in the shape package.  You might have to write a
>> >> >AreaShapeLinkServer, that uses an AreaHandler instead, modified in the
>> >> >same way that the LinkSpatialIndex was modified to use the link to write
>> >> >graphics onto, instead of creating OMGraphics.
>> >> >
>> >> >  The ShapeLinkServer/ShapeServerStarter would have >to be extended/modified so that it is launched with a >properties file containing the DrawingAttributes >properties for the areas.  You could
>> >> >also have it contain the shape and spatial index file >properties in it,too, since the drawing attributes >depend on those.
>> >> >
>> >> >If you want the client to have some control over the drawing attributes,
>> >> >you could add code to use the link request properties to reset some of
>> >> >those values when they come in.
>> >> >
>> >> >
>> >> >- Don
>> >> >
>> >>
>> >> 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"]
>
>--
>[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 Thu May 31 09:32:59 2001

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