001 //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/graphics/sld/AbstractSymbolizer.java $
002 /*----------------------------------------------------------------------------
003 This file is part of deegree, http://deegree.org/
004 Copyright (C) 2001-2009 by:
005 Department of Geography, University of Bonn
006 and
007 lat/lon GmbH
008
009 This library is free software; you can redistribute it and/or modify it under
010 the terms of the GNU Lesser General Public License as published by the Free
011 Software Foundation; either version 2.1 of the License, or (at your option)
012 any later version.
013 This library is distributed in the hope that it will be useful, but WITHOUT
014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016 details.
017 You should have received a copy of the GNU Lesser General Public License
018 along with this library; if not, write to the Free Software Foundation, Inc.,
019 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020
021 Contact information:
022
023 lat/lon GmbH
024 Aennchenstr. 19, 53177 Bonn
025 Germany
026 http://lat-lon.de/
027
028 Department of Geography, University of Bonn
029 Prof. Dr. Klaus Greve
030 Postfach 1147, 53001 Bonn
031 Germany
032 http://www.geographie.uni-bonn.de/deegree/
033
034 e-mail: info@deegree.org
035 ----------------------------------------------------------------------------*/
036 package org.deegree.graphics.sld;
037
038 /**
039 * This is the basis of all symbolizers. It defines the method <tt>getGeometry</tt> that's common
040 * to all symbolizers.
041 * <p>
042 * ----------------------------------------------------------------------
043 * </p>
044 *
045 * @author <a href="mailto:k.lupp@web.de">Katharina Lupp</a>
046 * @version $Revision: 18195 $ $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
047 */
048
049 public abstract class AbstractSymbolizer implements Symbolizer {
050
051 /**
052 * The max denominator initialized with 9E99;
053 */
054 protected double maxDenominator = 9E99;
055
056 /**
057 * The min denominator initialized with 0;
058 */
059 protected double minDenominator = 0;
060
061 /**
062 * The geometry of the sympbolizer
063 */
064 protected Geometry geometry = null;
065
066 /**
067 * The class to render.
068 */
069 protected String responsibleClass = null;
070
071 /**
072 * default constructor
073 */
074 AbstractSymbolizer() {
075 //nothing.
076 }
077
078 /**
079 * constructor initializing the class with the <Symbolizer>
080 * @param geometry
081 */
082 AbstractSymbolizer( Geometry geometry ) {
083 setGeometry( geometry );
084 }
085
086 /**
087 * constructor initializing the class with the <Symbolizer>
088 * @param geometry
089 * @param resonsibleClass
090 */
091 AbstractSymbolizer( Geometry geometry, String resonsibleClass ) {
092 setGeometry( geometry );
093 setResponsibleClass( resonsibleClass );
094 }
095
096 /**
097 * The Geometry element is optional and if it is absent then the default geometry property of
098 * the feature type that is used in the containing FeatureStyleType is used. The precise meaning
099 * of default geometry property is system-dependent. Most frequently, feature types will have
100 * only a single geometry property.
101 *
102 * @return the geometry of the symbolizer
103 *
104 */
105 public Geometry getGeometry() {
106 return geometry;
107 }
108
109 /**
110 * sets the <Geometry>
111 *
112 * @param geometry
113 * the geometry of the symbolizer
114 *
115 */
116 public void setGeometry( Geometry geometry ) {
117 this.geometry = geometry;
118 }
119
120 /**
121 * @return the MinScaleDenominator
122 */
123 public double getMinScaleDenominator() {
124 return minDenominator;
125 }
126
127 /**
128 * @param minDenominator
129 * the MinScaleDenominator
130 */
131 public void setMinScaleDenominator( double minDenominator ) {
132 this.minDenominator = minDenominator;
133 }
134
135 /**
136 * @return the MaxScaleDenominator
137 */
138 public double getMaxScaleDenominator() {
139 return maxDenominator;
140 }
141
142 /**
143 * @param maxDenominator
144 * the MaxScaleDenominator
145 */
146 public void setMaxScaleDenominator( double maxDenominator ) {
147 this.maxDenominator = maxDenominator;
148 }
149
150 /**
151 * returns the name of a class that will be used for rendering the current symbolizer. This
152 * enables a user to define his own rendering class (DisplayElement) for a symbolizer to realize
153 * styles/renderings that can't be defined using SLD at the moment.<BR>
154 * The returned class must extend
155 * org.deegree_impl.graphics.displayelements.GeometryDisplayElement_Impl<BR>
156 * For default the method returns the deegree default class name for rendering the current
157 * symbolizer.
158 *
159 * @return the name of a class that will be used for rendering the current symbolizer.
160 *
161 */
162 public String getResponsibleClass() {
163 return responsibleClass;
164 }
165
166 /**
167 * sets a class that will be used for rendering the current symbolizer. This enables a user to
168 * define his own rendering class (DisplayElement) for a symbolizer to realize styles/renderings
169 * that can't be defined using SLD at the moment.<BR>
170 * The passed class must extend
171 * org.deegree_impl.graphics.displayelements.GeometryDisplayElement_Impl
172 *
173 * @param responsibleClass
174 *
175 */
176 public void setResponsibleClass( String responsibleClass ) {
177 this.responsibleClass = responsibleClass;
178 }
179
180 }