/[schmitzm]/trunk/src/skrueger/geotools/LegendIconFeatureRenderer.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/LegendIconFeatureRenderer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 315 by mojays, Wed Aug 26 11:03:27 2009 UTC revision 318 by alfonx, Wed Aug 26 13:33:32 2009 UTC
# Line 60  import org.apache.log4j.Logger; Line 60  import org.apache.log4j.Logger;
60  import org.geotools.factory.GeoTools;  import org.geotools.factory.GeoTools;
61  import org.geotools.factory.Hints;  import org.geotools.factory.Hints;
62  import org.geotools.feature.AttributeType;  import org.geotools.feature.AttributeType;
 import org.geotools.feature.Feature;  
 import org.geotools.feature.FeatureType;  
63  import org.geotools.feature.IllegalAttributeException;  import org.geotools.feature.IllegalAttributeException;
64    import org.geotools.feature.SimpleFeature;
65    import org.geotools.feature.SimpleFeatureType;
66  import org.geotools.geometry.jts.LiteShape2;  import org.geotools.geometry.jts.LiteShape2;
67  import org.geotools.renderer.lite.StyledShapePainter;  import org.geotools.renderer.lite.StyledShapePainter;
68  import org.geotools.renderer.style.SLDStyleFactory;  import org.geotools.renderer.style.SLDStyleFactory;
# Line 92  import com.vividsolutions.jts.geom.Polyg Line 92  import com.vividsolutions.jts.geom.Polyg
92   * <br>   * <br>
93   * <ul>   * <ul>
94   * <li>07.02.2008:<br>   * <li>07.02.2008:<br>
95   * Determining the default values of a {@link FeatureType} by   * Determining the default values of a {@link SimpleFeatureType} by
96   * {@link FeatureUtil#getDefaultAttributeValues(FeatureType)} instead of using   * {@link FeatureUtil#getDefaultAttributeValues(SimpleFeatureType)} instead of using
97   * {@link AttributeType#createDefaultValue()} directly, because the latter   * {@link AttributeType#createDefaultValue()} directly, because the latter
98   * returns {@code null} even though the attribut is not nillable.</li>   * returns {@code null} even though the attribut is not nillable.</li>
99   * </ul>   * </ul>
# Line 247  public class LegendIconFeatureRenderer e Line 247  public class LegendIconFeatureRenderer e
247          /**          /**
248           * Puts a BufferedImage into this.legendGraphic           * Puts a BufferedImage into this.legendGraphic
249           */           */
250          public void produceLegendGraphic(FeatureType featureType, Style gt2Style,          public void produceLegendGraphic(SimpleFeatureType featureType, Style gt2Style,
251                          Rule[] applicableRules) {                          Rule[] applicableRules) {
252    
253                  // final FeatureTypeStyle[] ftStyles = gt2Style.getFeatureTypeStyles();                  // final FeatureTypeStyle[] ftStyles = gt2Style.getFeatureTypeStyles();
# Line 448  public class LegendIconFeatureRenderer e Line 448  public class LegendIconFeatureRenderer e
448    
449          /**          /**
450           * Creates a little BufferedImage that presents the Style/Symbols used by           * Creates a little BufferedImage that presents the Style/Symbols used by
451           * the {@link MapLegend} to show a legend for the {@link FeatureType}           * the {@link MapLegend} to show a legend for the {@link SimpleFeatureType}
452           *           *
453           * @param rule           * @param rule
454           *            {@link Rule} that provides the text and the style to present           *            {@link Rule} that provides the text and the style to present
455           * @param featureType           * @param featureType
456           *            Schema that describes the kind of the sample {@link Feature}           *            Schema that describes the kind of the sample {@link SimpleFeature}
457           *            that will be rendered with the {@link Style}           *            that will be rendered with the {@link Style}
458           * @param bg           * @param bg
459           *            Background {@link Color} or <code>null</code>           *            Background {@link Color} or <code>null</code>
460           *           *
461           * @throws IllegalAttributeException           * @throws IllegalAttributeException
462           */           */
463          public BufferedImage createImageForRule(Rule rule, FeatureType featureType,          public BufferedImage createImageForRule(Rule rule, SimpleFeatureType featureType,
464                          Dimension size, Color bg) {                          Dimension size, Color bg) {
465    
466                  Symbolizer[] symbolizers = rule.getSymbolizers();                  Symbolizer[] symbolizers = rule.getSymbolizers();
# Line 504  public class LegendIconFeatureRenderer e Line 504  public class LegendIconFeatureRenderer e
504                                  // RasterSymbolizers..");                                  // RasterSymbolizers..");
505                                  // }                                  // }
506                                  // else                                  // else
507                                  final Feature sampleFeature = FeatureUtil.createSampleFeature(featureType);                                  final SimpleFeature sampleFeature = FeatureUtil.createSampleFeature(featureType);
508    
509                                  // The SLDStyleFactory has to be recreated, as it seams to cache                                  // The SLDStyleFactory has to be recreated, as it seams to cache
510                                  // some stuff.                                  // some stuff.
# Line 559  public class LegendIconFeatureRenderer e Line 559  public class LegendIconFeatureRenderer e
559    
560          /**          /**
561           * Creates a little BufferedImage that presents the Style/Symbols used by           * Creates a little BufferedImage that presents the Style/Symbols used by
562           * the {@link MapLegend} to show a legend for the {@link FeatureType}           * the {@link MapLegend} to show a legend for the {@link SimpleFeatureType}
563           *           *
564           * @param rule           * @param rule
565           *            {@link Rule} that provides the text and the style to present           *            {@link Rule} that provides the text and the style to present
566           * @param featureType           * @param featureType
567           *            Schema that describes the kind of the sample {@link Feature}           *            Schema that describes the kind of the sample {@link SimpleFeature}
568           *            that will be rendered with the {@link Style}           *            that will be rendered with the {@link Style}
569           *           *
570           * @throws IllegalAttributeException           * @throws IllegalAttributeException
571           */           */
572          public BufferedImage createImageForRule(final Rule rule,          public BufferedImage createImageForRule(final Rule rule,
573                          final FeatureType featureType, final Dimension size) {                          final SimpleFeatureType featureType, final Dimension size) {
574                  return createImageForRule(rule, featureType, size, null);                  return createImageForRule(rule, featureType, size, null);
575          }          }
576    

Legend:
Removed from v.315  
changed lines
  Added in v.318

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26