001 //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/graphics/sld/Drawing.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 import java.util.HashMap; 039 import java.util.Map; 040 041 /** 042 * This is the top level interface of <tt>Fill</tt> and <tt>Stroke</tt> defining the methods 043 * <tt>getGraphicFill()</tt> and <tt>getCssParameters()</tt> that are common to both. 044 * <p> 045 * 046 * @author <a href="mailto:k.lupp@web.de">Katharina Lupp</a> 047 * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider</a> 048 * @version $Revision: 18195 $ $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $ 049 */ 050 051 public class Drawing { 052 053 /** 054 * the filler of a graphic 055 */ 056 protected GraphicFill graphicFill = null; 057 058 /** 059 * The css parameters. 060 */ 061 protected Map<String, Object> cssParams = null; 062 063 /** 064 * Constructs a new instance of <tt>Drawing</tt>. 065 * 066 * @param cssParams 067 * @param graphicFill 068 */ 069 Drawing( Map<String, Object> cssParams, GraphicFill graphicFill ) { 070 this.cssParams = cssParams; 071 this.graphicFill = graphicFill; 072 } 073 074 /** 075 * The GraphicFill element both indicates that a stipple-fill repeated graphic will be used and 076 * specifies the fill graphic. 077 * 078 * @return the GraphicFill-Element 079 * 080 */ 081 public GraphicFill getGraphicFill() { 082 return graphicFill; 083 } 084 085 /** 086 * The GraphicFill element both indicates that a stipple-fill repeated graphic will be used and 087 * specifies the fill graphic. 088 * 089 * @param graphicFill 090 * the GraphicFill-Element 091 * 092 */ 093 public void setGraphicFill( GraphicFill graphicFill ) { 094 this.graphicFill = graphicFill; 095 } 096 097 /** 098 * A simple SVG/CSS2 styling parameters are given with the CssParameter element. <br> 099 * This method is for technical use. The user should access the specialized methods of the 100 * derived classes. 101 * 102 * @return the CssParameters 103 */ 104 public Map<String, Object> getCssParameters() { 105 return cssParams; 106 } 107 108 /** 109 * A simple SVG/CSS2 styling parameters are given with the CssParameter element. <br> 110 * This method sets CssParameters. 111 * 112 * @param cssParameters 113 * the CssParameters 114 */ 115 void setCssParameters( HashMap<String, Object> cssParameters ) { 116 this.cssParams = cssParameters; 117 } 118 119 /** 120 * Simple SVG/CSS2 styling parameters are given with the CssParameter element. This method adds 121 * a CssParameter to a given set of CssParameters. 122 * <p> 123 * 124 * @param key 125 * the key of the object to insert 126 * @param value 127 * the value of the object to insert 128 */ 129 void addCssParameter( String key, Object value ) { 130 cssParams.put( key, value ); 131 } 132 133 /** 134 * Simple SVG/CSS2 styling parameters are given with the CssParameter element. 135 * <p> 136 * This method adds a CssParameter to a given set of CssParameters. 137 * 138 * @param key 139 * the key of the object to remove 140 */ 141 void removeCssParameter( Object key ) { 142 cssParams.remove( key ); 143 } 144 145 }