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