Hi Jody !
Happy to learn that I did not do anything wrong ! ;-)
I tried to do this :
Symbolizer s =
ptStyle.getFeatureTypeStyles()[0].getRules()[0].getSymbolizers()[0];
PointSymbolizer ps = (PointSymbolizer)s;
System.out.println("mark size = "+ ps.getGraphic().getMarks()[0].getSize());
System.out.println("fill opacity = "+
((Literal)ps.getGraphic().getMarks()[0].getFill().getOpacity()).getValue().getClass());
System.out.println("fill color = "+
ps.getGraphic().getMarks()[0].getFill().getColor());
StyleBuilder sb = new StyleBuilder();
Fill fill = sb.createFill(Color.red, 0.3);
ps.getGraphic().getMarks()[0].setFill(fill);
System.out.println("fill opacity = "+
((Literal)ps.getGraphic().getMarks()[0].getFill().getOpacity()).getValue().getClass());
in order to know type of opacity from the SLD and directly from the
StyleBuilder... And there is a difference !
In the first case (SLD), I got : class java.lang.String
In the second one (StyleBuilder), I got : class java.lang.Double
So it seems that "0.3", 0.3, 0.3f, 0.3d doesnt exactly the same. ;-)
What do you think about that ? Is there a way to fix this problem ?
Thomas
2008/4/9, Jody Garnett <[EMAIL PROTECTED]>:
>
> Anaxa Gore wrote:
>
> > Hello,
> >
> > I think I found an idea from where is coming my problem of opacity.
> > Maybe from a bad creation of Style, when reading the SLD...
> >
> It could be; the handling of expressions has been changing over time. I
> have been fixing problems are recently as last week on trunk? A lot of the
> expression handling for Styles was handled in several places; I am trying to
> boil it down to fewer to help with consistency.
>
> To review - the following literals expressions are all expected to work
> *exactly* the same: "0.3", 0.3, 0.3f, 0.3d
>
> > First, I wrote this SLD :
> > <CssParameter name="fill-opacity">0.3</CssParameter>
> >
> > And this code :
> >
> > But when I see my stars, there is no filling in it. Even though, I got
> > this result on the console :
> >
> > mark size = 80
> > fill opacity = 0.3
> > fill color = #FF0000
> >
> Can you do a check to see if the opacity is: the string "0.3" or the
> double 0.3 ?
>
> The code that requests the opacity should be using express.evaulate(
> feature, Double.class ) ... but I have caught the following variations:
> - ((Literal)expression).getValue()
> - SLD.opacity( mark )
>
> > So do you think it is really a problem in SLD loader ? If it is, is it
> > possible to fix it quickly ? If it is not...what did I do wrong ? ;-)
> >
> I don't think you did anything wrong; we are just in for testing testing
> testing...
> Jody
>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel