001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/graphics/sld/Drawing.java $
002    /*----------------    FILE HEADER  ------------------------------------------
003    
004     This file is part of deegree.
005     Copyright (C) 2001-2008 by:
006     EXSE, Department of Geography, University of Bonn
007     http://www.giub.uni-bonn.de/deegree/
008     lat/lon GmbH
009     http://www.lat-lon.de
010    
011     This library is free software; you can redistribute it and/or
012     modify it under the terms of the GNU Lesser General Public
013     License as published by the Free Software Foundation; either
014     version 2.1 of the License, or (at your option) any later version.
015    
016     This library is distributed in the hope that it will be useful,
017     but WITHOUT ANY WARRANTY; without even the implied warranty of
018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
019     Lesser General Public License for more details.
020    
021     You should have received a copy of the GNU Lesser General Public
022     License along with this library; if not, write to the Free Software
023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
024    
025     Contact:
026    
027     Andreas Poth
028     lat/lon GmbH
029     Aennchenstr. 19
030     53115 Bonn
031     Germany
032     E-Mail: poth@lat-lon.de
033    
034     Prof. Dr. Klaus Greve
035     Department of Geography
036     University of Bonn
037     Meckenheimer Allee 166
038     53115 Bonn
039     Germany
040     E-Mail: greve@giub.uni-bonn.de
041    
042     
043     ---------------------------------------------------------------------------*/
044    package org.deegree.graphics.sld;
045    
046    import java.util.HashMap;
047    import java.util.Map;
048    
049    /**
050     * This is the top level interface of <tt>Fill</tt> and <tt>Stroke</tt> defining the methods
051     * <tt>getGraphicFill()</tt> and <tt>getCssParameters()</tt> that are common to both.
052     * <p>
053     * 
054     * @author <a href="mailto:k.lupp@web.de">Katharina Lupp</a>
055     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider</a>
056     * @version $Revision: 9340 $ $Date: 2007-12-27 13:32:12 +0100 (Do, 27 Dez 2007) $
057     */
058    
059    public class Drawing {
060    
061        protected GraphicFill graphicFill = null;
062    
063        protected Map<String,Object> cssParams = null;
064    
065        /**
066         * Constructs a new instance of <tt>Drawing</tt>.
067         * 
068         * @param cssParams
069         * @param graphicFill
070         */
071        Drawing( Map<String,Object> cssParams, GraphicFill graphicFill ) {
072            this.cssParams = cssParams;
073            this.graphicFill = graphicFill;
074        }
075    
076        /**
077         * The GraphicFill element both indicates that a stipple-fill repeated graphic will be used and
078         * specifies the fill graphic.
079         * 
080         * @return the GraphicFill-Element
081         * 
082         */
083        public GraphicFill getGraphicFill() {
084            return graphicFill;
085        }
086    
087        /**
088         * The GraphicFill element both indicates that a stipple-fill repeated graphic will be used and
089         * specifies the fill graphic.
090         * 
091         * @param graphicFill
092         *            the GraphicFill-Element
093         * 
094         */
095        public void setGraphicFill( GraphicFill graphicFill ) {
096            this.graphicFill = graphicFill;
097        }
098    
099        /**
100         * A simple SVG/CSS2 styling parameters are given with the CssParameter element. <br>
101         * This method is for technical use. The user should access the specialized methods of the
102         * derived classes.
103         * 
104         * @return the CssParameters
105         */
106        public Map getCssParameters() {
107            return cssParams;
108        }
109    
110        /**
111         * A simple SVG/CSS2 styling parameters are given with the CssParameter element. <br>
112         * This method sets CssParameters.
113         * 
114         * @param cssParameters
115         *            the CssParameters
116         */
117        void setCssParameters( HashMap<String,Object> cssParameters ) {
118            this.cssParams = cssParameters;
119        }
120    
121        /**
122         * Simple SVG/CSS2 styling parameters are given with the CssParameter element. This method adds
123         * a CssParameter to a given set of CssParameters.
124         * <p>
125         * 
126         * @param key
127         *            the key of the object to insert
128         * @param value
129         *            the value of the object to insert
130         */
131        void addCssParameter( String key, Object value ) {
132            cssParams.put( key, value );
133        }
134    
135        /**
136         * Simple SVG/CSS2 styling parameters are given with the CssParameter element.
137         * <p>
138         * This method adds a CssParameter to a given set of CssParameters.
139         * 
140         * @param key
141         *            the key of the object to remove
142         */
143        void removeCssParameter( Object key ) {
144            cssParams.remove( key );
145        }
146    
147    }