[udig-devel] Migrating to uDig 1.1, 1 compiling error

Jody Garnett jgarnett at refractions.net
Wed Oct 4 12:04:45 PDT 2006


Hey Magna:

I would like it if you could make use of the following call instead:

Style style = handle.resolve( Style.class, null );

I may not have the syntax right, but the idea is sound - the handle for 
shapefile should know how to do the magic for you.
(Now let me check the code to ensure this has in fact been done)

Jody
> Hello:
> I am almost finishing my compilation but I have 1 error remained:
> In one of my plugins i have this code to read the sld file of a shapefile:
>
>     URL base=handle.getIdentifier();
>     String strUrl=base.getFile().substring(0,base.getFile().lastIndexOf("."))+".sld";
>      strUrl=base.getProtocol()+":"+strUrl;
>      System.out.println(strUrl);                 
>       url=new URL(strUrl);
>      StyleFactory factory=StyleFactoryFinder.createStyleFactory();
>     SLDStyle reader=new SLDStyle(factory,url);  //What can I put here instead??
>     Style[] style=reader.readXML();
>      System.out.println("style name: "+style[0].getName());
>
> I tried with StyleBuilder but I do not know were to include the URL to tell the program were to find the .sld file and read it.
> Hope you can help me with this code line....
> Thank you in advance,
> Magna
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>   



More information about the udig-devel mailing list