*/
public Object createDefaultStyle( IGeoResource resource, Color colour,
IProgressMonitor m ) throws IOException {
if( resource.canResolve(Style.class)){
Style style = resource.resolve( Style.class, null);
if( style != null ){
DuplicatingStyleVisitor v = new DuplicatingStyleVisitor();
style.accept(v);
return v.getCopy();
}
}
if( resource.canResolve(FeatureSource.class) ){
SimpleFeatureSource featureSource = null;
try {
featureSource = resource.resolve(SimpleFeatureSource.class, m);
}
catch (IOException e) {
e.printStackTrace();
return null;
}
Style style = createDefaultFeatureStyle(resource, colour, featureSource);
if( style != null ) return style;
}
if (resource.canResolve(GridCoverage.class)){
//GridCoverage grid = resource.resolve(GridCoverage.class, m );
return createDefaultGridCoverageStyle( resource, colour );