01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: * (C) 2002, Centre for Computational Geography
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation;
10: * version 2.1 of the License.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: */
17: package org.geotools.styling;
18:
19: /**
20: * A style object is quite hard to set up, involving fills, strokes,
21: * symbolizers and rules.
22: *
23: * @author James Macgill, CCG
24: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/styling/BasicPolygonStyle.java $
25: * @version $Id: BasicPolygonStyle.java 20703 2006-07-24 16:57:44Z jgarnett $
26: */
27: public class BasicPolygonStyle extends StyleImpl implements
28: org.geotools.styling.Style {
29: /**
30: * Creates a new instance of BasicPolygonStyle
31: */
32: public BasicPolygonStyle() {
33: this (new FillImpl(), new StrokeImpl());
34: }
35:
36: public BasicPolygonStyle(Fill fill, Stroke stroke) {
37: PolygonSymbolizerImpl polysym = new PolygonSymbolizerImpl();
38: polysym.setFill(fill);
39: polysym.setStroke(stroke);
40:
41: RuleImpl rule = new RuleImpl();
42: rule.setSymbolizers(new Symbolizer[] { polysym });
43:
44: FeatureTypeStyleImpl fts = new FeatureTypeStyleImpl();
45: fts.setRules(new Rule[] { rule });
46: this .setFeatureTypeStyles(new FeatureTypeStyle[] { fts });
47: }
48:
49: public String getAbstract() {
50: return "A simple polygon style";
51: }
52:
53: public String getName() {
54: return "default polygon style";
55: }
56:
57: public String getTitle() {
58: return "default polygon style";
59: }
60: }
|