Hi,

   thanks for the reply, i added the section to my ConstructStyle.java class
file, but wanted to ask because i want to display my shapefile by using
java's file chooser (i.e file->open->my.shp), is there anything that i would
need to also add with regards to the function createLineStyle?

The reason i ask is beacuse very early on when following some of the
tutorials in my ConstructMap.java i created a constrStyle object passed the
following:

// Pass file and feature schema referrence to myCreateStyle function
        constrStyle.myCreateStyle(file, myFeatureTypeSchema);

I can just about see why the code is much "neater" than my version, but does
that mean in terms of my constructor was the following code snippets:


 ConstructStyle( )
    {
          
         this.lineStyle = styleFactory.createStyle();
        
         this.myStyleBuilder = new StyleBuilder();// Create StyleBuilder
object  helps builds simple styles
            
        //createStyle(file,myFeatureTypeSchema);
         this.lineSymbolizer =
myStyleBuilder.createLineSymbolizer(Color.cyan); //create color to be
displayed
         lineStyle = myStyleBuilder.createStyle(lineSymbolizer); // use
mystlyebuilder object to create a style and store this in variable
             
    }

can be commented away, which i guess is yes :( (all that hardwork)?

----------------------------------------------------

I have general question here that i would like to ask, when creating
styles/symbolizers for a shap file, how does one know what he or she needs
to create? Because i 've looked at my shapefile and it's essentailly lines
connected to each to eacher other, like a grid representing the roads that i
converted from osm.


Thanks again 

  
        

Michael Bedward wrote:
> 
> Hi Luong,
> 
> There's some confusion about what's what in your code - especially
> regarding interfaces.  The good news is that it can all be a lot
> simpler :)
> 
> For starters, to make a simple style for a line feature type you can
> just use a method like this...
> 
>     public Style createLineStyle(String featureTypeName, Color c) {
>         StyleFactory sf = CommonFactoryFinder.getStyleFactory(null);
>         StyleBuilder sb = new StyleBuilder(sf);
>         LineSymbolizer sym = sb.createLineSymbolizer(c);
>         return sb.createStyle(featureTypeName, sym);
>     }
> 
> Hope this helps
> 
> Michael
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Styling-problem-tp2227157p2241460.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to