So I understand why using set operations on an SLD that is actively
being used for rendering is bad and so I see why the set method has been
marked as deprecated.  How then am I supposed to create a
PointSymbolizer with a displacement field?  Given the APIs of the
objects involved in PointSymbolizer creation (StyleBuilder,
FilterFactory, Graphic, GraphicImpl, etc), I do not see any other means
of attaching a displacement field to my PointSymbolizer.  

Thanks,
Joe

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jody
Garnett
Sent: Thursday, September 18, 2008 3:35 PM
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] PointSymbolizer Displacement

I assume you are on trunk? The method is marked as deprecated because we

are trying to cut back on "set" methods as we go forward. The idea of a 
data structure that can be modifed as we are using it for rendering is 
not very cool.
If you can copy the data structure; and make the modification as you go 
(much like you handle Strings) it will be better.
Jody

Joe Dente wrote:
>
> Hi,
>
> This is probably more of a geotools question than a udig question, but

> I figured someone on this list will know the answer. I am trying to 
> displace a PointSymbolizer in my SLD and I am not having any luck.
>
> PointSymbolizer pointSym1 = sb.createPointSymbolizer();
>
> Graphic graphic1 = pointSym1.getGraphic();
>
> ExternalGraphic extGraphic1 = *new* ExternalGraphicImpl();
>
> extGraphic1.setURI(iconURL1.toString());
>
> extGraphic1.setFormat("image/png");
>
> graphic1.addExternalGraphic(extGraphic1);
>
> graphic1.setSize(ff.createLiteralExpression(16));
>
> graphic1.setOpacity(ff.createLiteralExpression(1.0));
>
> graphic1.setMarks(*new* Mark[0]);
>
> Displacement displacement = *new* DisplacementImpl(ff);
>
> displacement.setDisplacementY(ff.createLiteralExpression(-24));
>
> displacement.setDisplacementX(ff.createLiteralExpression(0));
>
> graphic1.setDisplacement(displacement);
>
> All my styling up until the displacement command works well. I can use

> the same Displacement on a TextSymbolizer and everything works as 
> expected. Looking at the javadocs, the setDisplacement method on 
> GraphicImpl has been marked as deprecated, but no replacement is 
> listed. Is it possible to displace a PointSymbolizer's icon?
>
> Thanks in advance,
>
> Joe.
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>   

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to