Hi Koen; the featuretypeStyles().add(fts) method is supposed to work. We 
will have to change the signature. This is an area where java generics 
are not very well done.
If you have a copy of the source code and can put together a patch it 
would be cool.
Jody

Koen Aerts wrote:
> Hello,
>
> I experience a problem when trying to update my code to 2.6-Snapshot
> release. 
> I am trying to replace the deprecated methods with the new intended methods,
> but I fail on adding a FeatureTypeStyle to a Style. See code below. How can
> I solve my problem?
>
> Thanks in advance!
> Koen
>
> import org.geotools.styling.FeatureTypeStyle;
> import org.geotools.styling.Style;
>
> StyleFactory styleFact = CommonFactoryFinder.getStyleFactory(null);
>       FilterFactory filterFac = CommonFactoryFinder.getFilterFactory(null);
>       
>       StyleBuilder styleBldr = new StyleBuilder();
>         Style style;
>         
>         Stroke stroke = styleFact.createStroke(
>                       filterFac.literal("#FF0000"),
>                       filterFac.literal(2));
>
>
>         LineSymbolizer symbolizer =
> styleFact.createLineSymbolizer(stroke,"the_geom");
>           
>         Rule rule = styleFact.createRule();
>         rule.symbolizers().add(symbolizer);
>         FeatureTypeStyle fts = styleFact.createFeatureTypeStyle();
>         fts.rules().add(rule);
>         style = styleFact.createStyle();
>         /*
>          * The method add(capture#1-of ? extends FeatureTypeStyle) in the
> type 
>          * List<capture#1-of ? extends FeatureTypeStyle> is not applicable
> for 
>          * the arguments (FeatureTypeStyle)
>          */
>         style.featureTypeStyles().add(fts); //==> ERROR (see above)
>         style.addFeatureTypeStyle(fts); //==> DEPRECATED
>   


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to