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: /**
019: * An interface for classes that want to perform operations on a Style
020: * hierarchy. It forms part of a GoF Visitor Patern implementation. A call to
021: * style.accept(StyleVisitor) will result in a call to one of the methods in
022: * this interface. The responsibility for traversing sub filters is intended
023: * to lie with the visitor (this is unusual, but permited under the Visitor
024: * pattern). A typical use would be to transcribe a style into a specific
025: * format, e.g. XML or SQL. Alternativly it may be to extract specific
026: * information from the Style structure, for example a list of all fills.
027: *
028: * @author James Macgill
029: * @author Ian Turton
030: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/styling/StyleVisitor.java $
031: * @version $Id: StyleVisitor.java 20562 2006-07-16 14:54:53Z jgarnett $
032: */
033: public interface StyleVisitor {
034: /**
035: * Called when accept is called on a StyledLayerDescriptor.
036: *
037: * @param sld The StyledLayerDescriptor to visit
038: */
039: void visit(StyledLayerDescriptor sld);
040:
041: /**
042: * Called when accept is called on a NamedLayer.
043: *
044: * @param layer The NamedLayer to visit
045: */
046: void visit(NamedLayer layer);
047:
048: /**
049: * Called when accept is called on a UserLayer.
050: *
051: * @param layer The UserLayer to visit
052: */
053: void visit(UserLayer layer);
054:
055: /**
056: * Called when accept is called on a FeatureTypeConstraint.
057: *
058: * @param ftc The FeatureTypeConstraint to visit
059: */
060: void visit(FeatureTypeConstraint ftc);
061:
062: /**
063: * Called when accept is called on a Style.
064: *
065: * @param style The style to visit
066: */
067: void visit(Style style);
068:
069: /**
070: * Called when accept is called on a rule
071: *
072: * @param rule the rule to visit
073: */
074: void visit(Rule rule);
075:
076: /**
077: * Called when accept is called on a fetauretypestyle
078: *
079: * @param fts the feature type styler to visit
080: */
081: void visit(FeatureTypeStyle fts);
082:
083: /**
084: * Called when accept is called on a fill
085: *
086: * @param fill the fill to be visited
087: */
088: void visit(Fill fill);
089:
090: /**
091: * Called when accept is called on a stroke
092: *
093: * @param stroke the stroke to visit
094: */
095: void visit(Stroke stroke);
096:
097: /**
098: * since it is impossible to create a Symbolizer this method should
099: * generate an exception or warning.
100: *
101: * @param sym the symbolizer to visit
102: */
103: void visit(Symbolizer sym);
104:
105: /**
106: * Called when accept is called on a pointsymbolizer
107: *
108: * @param ps the point symbolizer to visit
109: */
110: void visit(PointSymbolizer ps);
111:
112: /**
113: * Called when accept is called on a linesymbolizer
114: *
115: * @param line the line symbolizer to visit
116: */
117: void visit(LineSymbolizer line);
118:
119: /**
120: * Called when accept is called on a polygon symbolizer
121: *
122: * @param poly the polygon symbolizer to visit
123: */
124: void visit(PolygonSymbolizer poly);
125:
126: /**
127: * Called when accept is called on a textsymbolizer
128: *
129: * @param text the text symbolizer to visit
130: */
131: void visit(TextSymbolizer text);
132:
133: /**
134: * Called when accept is called on a rastersymbolizer
135: *
136: * @param raster the raster symbolizer to visit
137: */
138: void visit(RasterSymbolizer raster);
139:
140: /**
141: * Called when accept is called on a graphic
142: *
143: * @param gr the graphic to visit
144: */
145: void visit(Graphic gr);
146:
147: /**
148: * Called when accept is called on a mark
149: *
150: * @param mark the mark to visit
151: */
152: void visit(Mark mark);
153:
154: /**
155: * Called when accept is called on a external graphic
156: *
157: * @param exgr the external graphic to visit
158: */
159: void visit(ExternalGraphic exgr);
160:
161: /**
162: * Called when accept is called on a Point Placement
163: *
164: * @param pp the point placement to visit
165: */
166: void visit(PointPlacement pp);
167:
168: /**
169: * Called when accept is called on a anchor point
170: *
171: * @param ap the anchor point to visit
172: */
173: void visit(AnchorPoint ap);
174:
175: /**
176: * Called when accept is called on a displacement
177: *
178: * @param dis the displacement to visit
179: */
180: void visit(Displacement dis);
181:
182: /**
183: * Called when accept is called on a Line Placement
184: *
185: * @param lp the line placement to visit
186: */
187: void visit(LinePlacement lp);
188:
189: /**
190: * Called when accept is called on a halo
191: *
192: * @param halo the halo to visit
193: */
194: void visit(Halo halo);
195:
196: /**
197: * Called when accept is called on a raster color map
198: *
199: * @param colorMap the color map to visit
200: */
201: void visit(ColorMap colorMap);
202:
203: /**
204: * Called when accept is called on a raster color map entry
205: *
206: * @param colorMapEntry the color map to visit
207: */
208: void visit(ColorMapEntry colorMapEntry);
209: }
|