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 org.opengis.filter.Filter;
020: import org.opengis.filter.expression.Expression;
021: import org.geotools.factory.Factory;
022:
023: /**
024: * Abstract base class for implementing style factories.
025: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/styling/StyleFactory.java $
026: */
027: public interface StyleFactory extends Factory {
028: public TextSymbolizer createTextSymbolizer(Fill fill, Font[] fonts,
029: Halo halo, Expression label, LabelPlacement labelPlacement,
030: String geometryPropertyName);
031:
032: public ExternalGraphic createExternalGraphic(URL url, String format);
033:
034: public ExternalGraphic createExternalGraphic(String uri,
035: String format);
036:
037: public AnchorPoint createAnchorPoint(Expression x, Expression y);
038:
039: public Displacement createDisplacement(Expression x, Expression y);
040:
041: // public LinePlacement createLinePlacement();
042: public PointSymbolizer createPointSymbolizer();
043:
044: // public PointPlacement createPointPlacement();
045: public Mark createMark(Expression wellKnownName, Stroke stroke,
046: Fill fill, Expression size, Expression rotation);
047:
048: /**
049: * Convinence method for obtaining a mark of a fixed shape
050: *
051: * @return a Mark that matches the name in this method.
052: */
053: public Mark getCircleMark();
054:
055: /**
056: * Convinence method for obtaining a mark of a fixed shape
057: *
058: * @return a Mark that matches the name in this method.
059: */
060: public Mark getXMark();
061:
062: /**
063: * Convinence method for obtaining a mark of a fixed shape
064: *
065: * @return a Mark that matches the name in this method.
066: */
067: public Mark getStarMark();
068:
069: /**
070: * Convinence method for obtaining a mark of a fixed shape
071: *
072: * @return a Mark that matches the name in this method.
073: */
074: public Mark getSquareMark();
075:
076: /**
077: * Convinence method for obtaining a mark of a fixed shape
078: *
079: * @return a Mark that matches the name in this method.
080: */
081: public Mark getCrossMark();
082:
083: /**
084: * Convinence method for obtaining a mark of a fixed shape
085: *
086: * @return a Mark that matches the name in this method.
087: */
088: public Mark getTriangleMark();
089:
090: /**
091: * Creates a new extent.
092: *
093: * @param name The name of the extent.
094: * @param value The value of the extent.
095: *
096: * @return The new extent.
097: */
098: public Extent createExtent(String name, String value);
099:
100: /**
101: * Creates a new feature type constraint.
102: *
103: * @param featureTypeName The feature type name.
104: * @param filter The filter.
105: * @param extents The extents.
106: *
107: * @return The new feature type constaint.
108: */
109: public FeatureTypeConstraint createFeatureTypeConstraint(
110: String featureTypeName, Filter filter, Extent[] extents);
111:
112: public LayerFeatureConstraints createLayerFeatureConstraints(
113: FeatureTypeConstraint[] featureTypeConstraints);
114:
115: public FeatureTypeStyle createFeatureTypeStyle(Rule[] rules);
116:
117: /**
118: * Creates a new ImageOutline.
119: *
120: * @param symbolizer A line or polygon symbolizer.
121: *
122: * @return The new image outline.
123: */
124: public ImageOutline createImageOutline(Symbolizer symbolizer);
125:
126: public LinePlacement createLinePlacement(Expression offset);
127:
128: public PolygonSymbolizer createPolygonSymbolizer();
129:
130: public Halo createHalo(Fill fill, Expression radius);
131:
132: public Fill createFill(Expression color,
133: Expression backgroundColor, Expression opacity,
134: Graphic graphicFill);
135:
136: public LineSymbolizer createLineSymbolizer();
137:
138: public PointSymbolizer createPointSymbolizer(Graphic graphic,
139: String geometryPropertyName);
140:
141: public Style createStyle();
142:
143: public NamedStyle createNamedStyle();
144:
145: public Fill createFill(Expression color, Expression opacity);
146:
147: public Fill createFill(Expression color);
148:
149: public TextSymbolizer createTextSymbolizer();
150:
151: public PointPlacement createPointPlacement(AnchorPoint anchorPoint,
152: Displacement displacement, Expression rotation);
153:
154: /**
155: * A convienice method to make a simple stroke
156: *
157: * @param color the color of the line
158: * @param width the width of the line
159: *
160: * @return the stroke object
161: *
162: * @see org.geotools.stroke
163: */
164: public Stroke createStroke(Expression color, Expression width);
165:
166: /**
167: * A convienice method to make a simple stroke
168: *
169: * @param color the color of the line
170: * @param width The width of the line
171: * @param opacity The opacity of the line
172: *
173: * @return The stroke
174: *
175: * @see org.geotools.stroke
176: */
177: public Stroke createStroke(Expression color, Expression width,
178: Expression opacity);
179:
180: /**
181: * creates a stroke
182: *
183: * @param color The color of the line
184: * @param width The width of the line
185: * @param opacity The opacity of the line
186: * @param lineJoin - the type of Line joint
187: * @param lineCap - the type of line cap
188: * @param dashArray - an array of floats describing the dashes in the line
189: * @param dashOffset - where in the dash array to start drawing from
190: * @param graphicFill - a graphic object to fill the line with
191: * @param graphicStroke - a graphic object to draw the line with
192: *
193: * @return The completed stroke.
194: *
195: * @see org.geotools.stroke
196: */
197: public Stroke createStroke(Expression color, Expression width,
198: Expression opacity, Expression lineJoin,
199: Expression lineCap, float[] dashArray,
200: Expression dashOffset, Graphic graphicFill,
201: Graphic graphicStroke);
202:
203: public Rule createRule();
204:
205: public LineSymbolizer createLineSymbolizer(Stroke stroke,
206: String geometryPropertyName);
207:
208: public FeatureTypeStyle createFeatureTypeStyle();
209:
210: public Graphic createGraphic(ExternalGraphic[] externalGraphics,
211: Mark[] marks, Symbol[] symbols, Expression opacity,
212: Expression size, Expression rotation);
213:
214: public Font createFont(Expression fontFamily, Expression fontStyle,
215: Expression fontWeight, Expression fontSize);
216:
217: public Mark createMark();
218:
219: public PolygonSymbolizer createPolygonSymbolizer(Stroke stroke,
220: Fill fill, String geometryPropertyName);
221:
222: public RasterSymbolizer createRasterSymbolizer();
223:
224: public RasterSymbolizer createRasterSymbolizer(
225: String geometryPropertyName, Expression opacity,
226: ChannelSelection channel, Expression overlap,
227: ColorMap colorMap, ContrastEnhancement ce,
228: ShadedRelief relief, Symbolizer outline);
229:
230: public RasterSymbolizer getDefaultRasterSymbolizer();
231:
232: public ChannelSelection createChannelSelection(
233: SelectedChannelType[] channels);
234:
235: public ContrastEnhancement createContrastEnhancement();
236:
237: public ContrastEnhancement createContrastEnhancement(
238: Expression gammaValue);
239:
240: public SelectedChannelType createSelectedChannelType(String name,
241: ContrastEnhancement enhancement);
242:
243: /**
244: * @deprecated Use {@link #createSelectedChannelType(String, ContrastEnhancement)}
245: */
246: public SelectedChannelType createSelectedChannelType(String name,
247: Expression gammaValue);
248:
249: public ColorMap createColorMap();
250:
251: public ColorMapEntry createColorMapEntry();
252:
253: public Style getDefaultStyle();
254:
255: public Stroke getDefaultStroke();
256:
257: public Fill getDefaultFill();
258:
259: public Mark getDefaultMark();
260:
261: public PointSymbolizer getDefaultPointSymbolizer();
262:
263: public PolygonSymbolizer getDefaultPolygonSymbolizer();
264:
265: public LineSymbolizer getDefaultLineSymbolizer();
266:
267: /**
268: * Creates a default Text Symbolizer, using the defaultFill, defaultFont
269: * and defaultPointPlacement, Sets the geometry attribute name to be
270: * geometry:text. No Halo is set. <b>The label is not set</b>
271: *
272: * @return A default TextSymbolizer
273: */
274: public TextSymbolizer getDefaultTextSymbolizer();
275:
276: public Graphic createDefaultGraphic();
277:
278: public Graphic getDefaultGraphic();
279:
280: public Font getDefaultFont();
281:
282: public PointPlacement getDefaultPointPlacement();
283:
284: public StyledLayerDescriptor createStyledLayerDescriptor();
285:
286: public UserLayer createUserLayer();
287:
288: public NamedLayer createNamedLayer();
289:
290: public RemoteOWS createRemoteOWS(String service,
291: String onlineResource);
292:
293: public ShadedRelief createShadedRelief(Expression reliefFactor);
294: }
|