001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.styling;
017:
018: import java.net.URL;
019: import java.util.Collections;
020: import java.util.Map;
021:
022: import org.opengis.filter.expression.Expression;
023:
024: /**
025: * Abstract base class for implementing style factories.
026: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/styling/AbstractStyleFactory.java $
027: */
028: public abstract class AbstractStyleFactory implements StyleFactory {
029: public abstract TextSymbolizer createTextSymbolizer(Fill fill,
030: Font[] fonts, Halo halo, Expression label,
031: LabelPlacement labelPlacement, String geometryPropertyName);
032:
033: public abstract ExternalGraphic createExternalGraphic(URL url,
034: String format);
035:
036: public abstract ExternalGraphic createExternalGraphic(String uri,
037: String format);
038:
039: public abstract AnchorPoint createAnchorPoint(Expression x,
040: Expression y);
041:
042: public abstract Displacement createDisplacement(Expression x,
043: Expression y);
044:
045: // public abstract LinePlacement createLinePlacement();
046: public abstract PointSymbolizer createPointSymbolizer();
047:
048: // public abstract PointPlacement createPointPlacement();
049: public abstract Mark createMark(Expression wellKnownName,
050: Stroke stroke, Fill fill, Expression size,
051: Expression rotation);
052:
053: /**
054: * Convinence method for obtaining a mark of a fixed shape
055: *
056: * @return a Mark that matches the name in this method.
057: */
058: public abstract Mark getCircleMark();
059:
060: /**
061: * Convinence method for obtaining a mark of a fixed shape
062: *
063: * @return a Mark that matches the name in this method.
064: */
065: public abstract Mark getXMark();
066:
067: /**
068: * Convinence method for obtaining a mark of a fixed shape
069: *
070: * @return a Mark that matches the name in this method.
071: */
072: public abstract Mark getStarMark();
073:
074: /**
075: * Convinence method for obtaining a mark of a fixed shape
076: *
077: * @return a Mark that matches the name in this method.
078: */
079: public abstract Mark getSquareMark();
080:
081: /**
082: * Convinence method for obtaining a mark of a fixed shape
083: *
084: * @return a Mark that matches the name in this method.
085: */
086: public abstract Mark getCrossMark();
087:
088: /**
089: * Convinence method for obtaining a mark of a fixed shape
090: *
091: * @return a Mark that matches the name in this method.
092: */
093: public abstract Mark getTriangleMark();
094:
095: public abstract FeatureTypeStyle createFeatureTypeStyle(Rule[] rules);
096:
097: public abstract LinePlacement createLinePlacement(Expression offset);
098:
099: public abstract PolygonSymbolizer createPolygonSymbolizer();
100:
101: public abstract Halo createHalo(Fill fill, Expression radius);
102:
103: public abstract Fill createFill(Expression color,
104: Expression backgroundColor, Expression opacity,
105: Graphic graphicFill);
106:
107: public abstract LineSymbolizer createLineSymbolizer();
108:
109: public abstract PointSymbolizer createPointSymbolizer(
110: Graphic graphic, String geometryPropertyName);
111:
112: public abstract Style createStyle();
113:
114: public abstract NamedStyle createNamedStyle();
115:
116: public abstract Fill createFill(Expression color, Expression opacity);
117:
118: public abstract Fill createFill(Expression color);
119:
120: public abstract TextSymbolizer createTextSymbolizer();
121:
122: public abstract PointPlacement createPointPlacement(
123: AnchorPoint anchorPoint, Displacement displacement,
124: Expression rotation);
125:
126: /**
127: * A convienice method to make a simple stroke
128: *
129: * @param color the color of the line
130: * @param width the width of the line
131: *
132: * @return the stroke object
133: *
134: * @see org.geotools.stroke
135: */
136: public abstract Stroke createStroke(Expression color,
137: Expression width);
138:
139: /**
140: * A convienice method to make a simple stroke
141: *
142: * @param color the color of the line
143: * @param width The width of the line
144: * @param opacity The opacity of the line
145: *
146: * @return The stroke
147: *
148: * @see org.geotools.stroke
149: */
150: public abstract Stroke createStroke(Expression color,
151: Expression width, Expression opacity);
152:
153: /**
154: * creates a stroke
155: *
156: * @param color The color of the line
157: * @param width The width of the line
158: * @param opacity The opacity of the line
159: * @param lineJoin - the type of Line joint
160: * @param lineCap - the type of line cap
161: * @param dashArray - an array of floats describing the dashes in the line
162: * @param dashOffset - where in the dash array to start drawing from
163: * @param graphicFill - a graphic object to fill the line with
164: * @param graphicStroke - a graphic object to draw the line with
165: *
166: * @return The completed stroke.
167: *
168: * @see org.geotools.stroke
169: */
170: public abstract Stroke createStroke(Expression color,
171: Expression width, Expression opacity, Expression lineJoin,
172: Expression lineCap, float[] dashArray,
173: Expression dashOffset, Graphic graphicFill,
174: Graphic graphicStroke);
175:
176: public abstract Rule createRule();
177:
178: public abstract LineSymbolizer createLineSymbolizer(Stroke stroke,
179: String geometryPropertyName);
180:
181: public abstract FeatureTypeStyle createFeatureTypeStyle();
182:
183: public abstract Graphic createGraphic(
184: ExternalGraphic[] externalGraphics, Mark[] marks,
185: Symbol[] symbols, Expression opacity, Expression size,
186: Expression rotation);
187:
188: public abstract Font createFont(Expression fontFamily,
189: Expression fontStyle, Expression fontWeight,
190: Expression fontSize);
191:
192: public abstract Mark createMark();
193:
194: public abstract PolygonSymbolizer createPolygonSymbolizer(
195: Stroke stroke, Fill fill, String geometryPropertyName);
196:
197: public abstract RasterSymbolizer createRasterSymbolizer(
198: String geometryPropertyName, Expression opacity,
199: ChannelSelection channel, Expression overlap,
200: ColorMap colorMap, ContrastEnhancement ce,
201: ShadedRelief relief, Symbolizer outline);
202:
203: public abstract RasterSymbolizer getDefaultRasterSymbolizer();
204:
205: public abstract ChannelSelection createChannelSelection(
206: SelectedChannelType[] channels);
207:
208: public abstract SelectedChannelType createSelectedChannelType(
209: String name, Expression enhancement);
210:
211: public abstract ColorMap createColorMap();
212:
213: public abstract ColorMapEntry createColorMapEntry();
214:
215: public abstract Style getDefaultStyle();
216:
217: public abstract Stroke getDefaultStroke();
218:
219: public abstract Fill getDefaultFill();
220:
221: public abstract Mark getDefaultMark();
222:
223: public abstract PointSymbolizer getDefaultPointSymbolizer();
224:
225: public abstract PolygonSymbolizer getDefaultPolygonSymbolizer();
226:
227: public abstract LineSymbolizer getDefaultLineSymbolizer();
228:
229: /**
230: * Creates a default Text Symbolizer, using the defaultFill, defaultFont
231: * and defaultPointPlacement, Sets the geometry attribute name to be
232: * geometry:text. No Halo is set. <b>The label is not set</b>
233: *
234: * @return A default TextSymbolizer
235: */
236: public abstract TextSymbolizer getDefaultTextSymbolizer();
237:
238: public abstract Graphic getDefaultGraphic();
239:
240: public abstract Font getDefaultFont();
241:
242: public abstract PointPlacement getDefaultPointPlacement();
243:
244: /**
245: * Returns implementation hints for this factory. The default
246: * implementation returns an empty map.
247: *
248: * @return DOCUMENT ME!
249: */
250: public Map getImplementationHints() {
251: return Collections.EMPTY_MAP;
252: }
253: }
|