01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-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; either
09: * version 2.1 of the License, or (at your option) any later version.
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: * Created on 7 giugno 2003, 19.11
17: */
18: package org.geotools.renderer.style;
19:
20: // J2SE dependencies
21: import java.awt.Composite;
22: import java.awt.Paint;
23:
24: import org.geotools.resources.Utilities;
25:
26: /**
27: * A style that contains the specification to renderer both the contour and the interior of a shape
28: *
29: * @author Andrea Aime
30: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/render/src/main/java/org/geotools/renderer/style/PolygonStyle2D.java $
31: * @version $Id: PolygonStyle2D.java 22226 2006-10-18 20:06:40Z acuster $
32: */
33: public class PolygonStyle2D extends LineStyle2D {
34: protected Paint fill;
35: protected Composite fillComposite;
36:
37: /**
38: * Returns the filling color for the {@linkplain org.geotools.renderer.geom.Polygon polygon} to
39: * be rendered, or <code>null</code> if none.
40: *
41: * @return the current fill or null if none
42: */
43: public Paint getFill() {
44: return this .fill;
45: }
46:
47: /**
48: * Sets filling color for the {@linkplain org.geotools.renderer.geom.Polygon polygon} to be
49: * rendered. Set it to <code>null</code> if no filling is to be performed.
50: *
51: * @param fill
52: */
53: public void setFill(Paint fill) {
54: this .fill = fill;
55: }
56:
57: /**
58: * Returns the fill Composite for the {@linkplain org.geotools.renderer.geom.Polyline polyline}
59: * to be rendered, or <code>null</code> if the contour is to be opaque
60: *
61: * @return the current fill composite or null if none
62: */
63: public Composite getFillComposite() {
64: return this .fillComposite;
65: }
66:
67: /**
68: * Sets the fill Composite for the {@linkplain org.geotools.renderer.geom.Polyline polyline} to
69: * be rendered. Set it to <code>null</code> if the contour is to be opaque
70: *
71: * @param fillComposite
72: */
73: public void setFillComposite(Composite fillComposite) {
74: this .fillComposite = fillComposite;
75: }
76:
77: /**
78: * Returns a string representation of this style.
79: */
80: public String toString() {
81: return Utilities.getShortClassName(this ) + '[' + fill + ']';
82: }
83: }
|