Ah; no good reason - 

There was however an "ok" reason; by providing an implementation and code that 
extended StyleLayer was not forced to provide the same boiler plate methods. 
Cutting and pasting the same setStyle / getStyle code into FeatureLayer, 
GridCoverageLayer and GridReaderLayer seemed like duplication.

Now here is a more interesting question ... should we move setStyle up to the 
Layer class and remove StyleLayer as not interesting? Even if a layer does not 
use SLD; the fact that it makes "something" available as features main mean 
that a user would like to control how that "something" is rendered?

This would have the benefit of making your code easier to write; it would have 
the downside of making it easy to delete the "empty" style currently returned 
(I really want to make sure that getStyle does not return null in order to make 
downstream code easier to write).
-- 
Jody Garnett


On Wednesday, 6 July 2011 at 8:34 PM, Michael Bedward wrote:

> Um... sorry Jody but I still don't understand. Why have an
> implementation at the Layer level rather than an abstract method ?
> 
> Michael
> 
> 
> On 6 July 2011 19:29, Jody Garnett <[email protected] 
> (mailto:[email protected])> wrote:
> > Andrea asked the same question ...
> > Layer.getStyle() is something that each layer implementation needs to
> > provide to spoon feed feature based renderers a style they can chew on. In
> > the same manner they get to spoon feed a FeatureSource (even if their
> > content is not features). Good times.... this is used to prevent the same
> > crazy workarounds appearing in each feature based rendering system
> > (StreamingRenderer, KML renderer etc...).
> > StyleLayer has getStyle and setStyle; that is the style can be changed; so
> > in a sense we are adding one new method (ie setStyle); and overriding
> > getStyle so it returns a field value.
> > --
> > Jody Garnett
> > 
> > On Wednesday, 6 July 2011 at 6:42 PM, Michael Bedward wrote:
> > 
> > Hi Jody,
> > 
> > Can you enlighten me on the relationship between the Layer.getStyle
> > method, which puts a Style into the user data map, and the
> > StyleLayer.getStyle method which returns a sub-class field ?
> > 
> > Michael

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to