001 /*
002 * GeoAPI - Java interfaces for OGC/ISO standards
003 * http://www.geoapi.org
004 *
005 * Copyright (C) 2008-2013 Open Geospatial Consortium, Inc.
006 * All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007 *
008 * Permission to use, copy, and modify this software and its documentation, with
009 * or without modification, for any purpose and without fee or royalty is hereby
010 * granted, provided that you include the following on ALL copies of the software
011 * and documentation or portions thereof, including modifications, that you make:
012 *
013 * 1. The full text of this NOTICE in a location viewable to users of the
014 * redistributed or derivative work.
015 * 2. Notice of any changes or modifications to the OGC files, including the
016 * date changes were made.
017 *
018 * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019 * NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020 * TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021 * THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022 * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023 *
024 * COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025 * CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026 *
027 * The name and trademarks of copyright holders may NOT be used in advertising or
028 * publicity pertaining to the software without specific, written prior permission.
029 * Title to copyright in this software and any associated documentation will at all
030 * times remain with copyright holders.
031 */
032 package org.opengis.style;
033
034 import org.opengis.filter.expression.ExpressionVisitor;
035 import org.opengis.metadata.citation.OnlineResource;
036
037 /**
038 * An interface for classes that want to perform operations on a Style
039 * hierarchy. It forms part of a GoF Visitor Pattern implementation.
040 * <p>
041 * A call to style.accept(StyleVisitor) will result in a call to one of the
042 * methods in this interface. The responsibility for traversing sub filters is
043 * intended to lie with the visitor (this is unusual, but permitted under the
044 * Visitor pattern).
045 * <p>
046 * A typical use would be to transcribe a style into a specific format, e.g. XML or SQL.
047 * Alternatively it may be to extract specific information from the Style structure, for example a list of all fills.
048 * Finally a a style visitor is often used (in conjunction with a factory) in the production of a
049 * copy; or slightly modified copy of the original style.
050 * <p>
051 * It is common practice for a StyleVisitor to also implement an ExpressionVisitor in
052 * order to traverse both data structures.
053 *
054 * @see ExpressionVisitor
055 * @see StyleFactory
056 * @author Open Geospatial Consortium
057 * @author James Macgill
058 * @author Ian Turton
059 * @author Johann Sorel (Geomatys)
060 * @since GeoAPI 2.2
061 */
062 public interface StyleVisitor {
063 /**
064 * Called when accept is called on a Style.
065 *
066 * @param style The style to visit
067 */
068 Object visit(Style style, Object data );
069
070 /**
071 * Called when accept is called on a FetaureTypeStyle
072 *
073 * @param fts the feature type styler to visit
074 */
075 Object visit(FeatureTypeStyle featureTypeStyle, Object data );
076
077 /**
078 * Called when accept is called on a rule
079 *
080 * @param rule the rule to visit
081 */
082 Object visit(Rule rule, Object data );
083
084 /**
085 * Called when accept is called on a pointsymbolizer
086 *
087 * @param ps the point symbolizer to visit
088 */
089 Object visit(PointSymbolizer pointSymbolizer, Object data );
090
091 /**
092 * Called when accept is called on a linesymbolizer
093 *
094 * @param line the line symbolizer to visit
095 */
096 Object visit(LineSymbolizer lineSymbolizer, Object data );
097
098 /**
099 * Called when accept is called on a polygon symbolizer
100 *
101 * @param poly the polygon symbolizer to visit
102 */
103 Object visit(PolygonSymbolizer polygonSymbolizer, Object data );
104
105 /**
106 * Called when accept is called on a textsymbolizer
107 *
108 * @param text the text symbolizer to visit
109 */
110 Object visit(TextSymbolizer textSymbolizer, Object data );
111
112 /**
113 * Called when accept is called on a rastersymbolizer
114 *
115 * @param raster the raster symbolizer to visit
116 */
117 Object visit(RasterSymbolizer rasterSymbolizer, Object data );
118
119 /**
120 * Called when accept is called on a extension symbolizer
121 *
122 * @param extension the extension symbolizer to visit
123 */
124 Object visit(ExtensionSymbolizer extension, Object data );
125
126 /**
127 * Called when accept is called on a description
128 *
129 * @param colorMap the description to visit
130 */
131 Object visit(Description description, Object data );
132
133 /**
134 * Called when accept is called on a displacement
135 *
136 * @param disp the displacement to visit
137 */
138 Object visit(Displacement displacement, Object data );
139
140 /**
141 * Called when accept is called on a fill
142 *
143 * @param fill the fill to be visited
144 */
145 Object visit(Fill fill, Object data );
146
147 /**
148 * Called when accept is called on a font
149 *
150 * @param font the font to be visited
151 */
152 Object visit(Font font, Object data );
153
154 /**
155 * Called when accept is called on a stroke
156 *
157 * @param stroke the stroke to visit
158 */
159 Object visit(Stroke stroke, Object data );
160
161 /**
162 * Called when accept is called on a graphic
163 *
164 * @param gr the graphic to visit
165 */
166 Object visit(Graphic graphic, Object data );
167
168 /**
169 * Called when accept is called on a graphic fill
170 *
171 * @param gr the graphic fill to visit
172 */
173 Object visit(GraphicFill graphicFill, Object data );
174
175 /**
176 * Called when accept is called on a graphic stroke
177 *
178 * @param gr the graphic stroke to visit
179 */
180 Object visit(GraphicStroke graphicStroke, Object data );
181
182 /**
183 * Called when accept is called on a mark
184 *
185 * @param mark the mark to visit
186 */
187 Object visit(Mark mark, Object data );
188
189 /**
190 * Called when accept is called on a external mark
191 *
192 * @param exmk the external mark to visit
193 */
194 Object visit(ExternalMark externalMark, Object data );
195
196 /**
197 * Called when accept is called on a external graphic
198 *
199 * @param exgr the external graphic to visit
200 */
201 Object visit(ExternalGraphic externalGraphic, Object data );
202
203 /**
204 * Called when accept is called on a Point Placement
205 *
206 * @param pp the point placement to visit
207 */
208 Object visit(PointPlacement pointPlacement, Object data );
209
210 /**
211 * Called when accept is called on a anchor point
212 *
213 * @param ap the anchor point to visit
214 */
215 Object visit(AnchorPoint anchorPoint, Object data );
216
217 /**
218 * Called when accept is called on a Line Placement
219 *
220 * @param lp the line placement to visit
221 */
222 Object visit(LinePlacement linePlacement, Object data );
223
224 /**
225 * Called when accept is called on a legend graphic
226 *
227 * @param lp the legend graphic to visit
228 */
229 Object visit(GraphicLegend graphicLegend, Object data );
230
231 /**
232 * Called when accept is called on a halo
233 *
234 * @param halo the halo to visit
235 */
236 Object visit(Halo halo, Object data );
237
238 /**
239 * Called when accept is called on a raster color map
240 *
241 * @param colorMap the color map to visit
242 */
243 Object visit(ColorMap colorMap, Object data );
244
245 /**
246 * Called when accept is called on a color replacement
247 *
248 * @param colorMap the color replacement to visit
249 */
250 Object visit(ColorReplacement colorReplacement, Object data );
251
252 /**
253 * Called when accept is called on a raster ContrastEnhancement element
254 * @param contrastEnhancement the {@link ContrastEnhancement} to visit.
255 */
256 Object visit(ContrastEnhancement contrastEnhancement, Object data );
257
258 /**
259 * Called when accept is called on a raster {@link ChannelSelection} element
260 * @param cs the {@link ChannelSelection} to visit.
261 */
262 Object visit(ChannelSelection channelSelection, Object data );
263
264 /**
265 * Called when accept is called on a raster {@link SelectedChannelType} element
266 * @param cs the {@link SelectedChannelType} to visit.
267 */
268 Object visit(SelectedChannelType selectChannelType, Object data );
269
270 /**
271 * Called when accept is called on a raster {@link ShadedRelief} element
272 * @param cs the {@link ShadedRelief} to visit.
273 */
274 Object visit(ShadedRelief shadedRelief, Object data );
275 }