001 //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/portal/context/GeneralExtension.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.portal.context;
037
038 /**
039 * this class encapsulates the deegree specific extensions of the general section of a web map context document. this is
040 * a description of the GUI including the used modules (<tt>Frontend</tt>) and the parameters to control the map view (
041 * <tt>Marshallable</tt>).
042 *
043 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
044 * @author last edited by: $Author: apoth $
045 *
046 * @version $Revision: 20707 $, $Date: 2009-11-11 09:45:30 +0100 (Mi, 11. Nov 2009) $
047 */
048 public class GeneralExtension {
049 private Frontend frontend;
050
051 private MapParameter mapParameter;
052
053 private IOSettings iOSettings;
054
055 private AuthentificationSettings authSettings;
056
057 private boolean transparent = true;
058
059 private String bgColor = "0xFFFFFF";
060
061 private String mode;
062
063 private Node layerTreeRoot;
064
065 private MapModel mapModel;
066
067 /**
068 * Creates a new GeneralExtension object.
069 *
070 * @param iOSettings
071 *
072 * @param frontend
073 * @param mapParameter
074 * @param authSettings
075 * @param mode
076 * @param layerTreeRoot
077 */
078 public GeneralExtension( IOSettings iOSettings, Frontend frontend, MapParameter mapParameter,
079 AuthentificationSettings authSettings, String mode, Node layerTreeRoot ) {
080 setFrontend( frontend );
081 setMapParameter( mapParameter );
082 setIOSettings( iOSettings );
083 setAuthentificationSettings( authSettings );
084 setLayerTreeRoot( layerTreeRoot );
085 this.mode = mode;
086
087 }
088
089 /**
090 * Creates a new GeneralExtension object.
091 *
092 * @param iOSettings
093 *
094 * @param frontend
095 * @param mapParameter
096 * @param authSettings
097 * @param mode
098 * @param layerTreeRoot
099 * @param mapModel
100 */
101 public GeneralExtension( IOSettings iOSettings, Frontend frontend, MapParameter mapParameter,
102 AuthentificationSettings authSettings, String mode, Node layerTreeRoot, MapModel mapModel ) {
103 this( iOSettings, frontend, mapParameter, authSettings, mode, layerTreeRoot );
104 this.mapModel = mapModel;
105 }
106
107 /**
108 * @return the mapModel
109 */
110 public MapModel getMapModel() {
111 return mapModel;
112 }
113
114 /**
115 * @param mapModel the mapModel to set
116 */
117 public void setMapModel( MapModel mapModel ) {
118 this.mapModel = mapModel;
119 }
120
121 /**
122 * returns true if the maps background should be transparent
123 *
124 * @return <code>true</code> if the maps background should be transparent
125 */
126 public boolean isTransparent() {
127 return transparent;
128 }
129
130 /**
131 * @see #isTransparent()
132 * @param transparent
133 */
134 public void setTransparent( boolean transparent ) {
135 this.transparent = transparent;
136 }
137
138 /**
139 * returns the desired background color of the map
140 *
141 * @return the desired background color of the map
142 */
143 public String getBgColor() {
144 return bgColor;
145 }
146
147 /**
148 * @see #getBgColor()
149 * @param bgColor
150 */
151 public void setBgColor( String bgColor ) {
152 this.bgColor = bgColor;
153 }
154
155 /**
156 * returns the frontend (GUI) description encapsulating objekt
157 *
158 * @return the frontend (GUI) description encapsulating objekt
159 */
160 public Frontend getFrontend() {
161 return frontend;
162 }
163
164 /**
165 * sets the frontend (GUI) description encapsulating objekt
166 *
167 * @param frontend
168 * <tt>Frontend</tt>
169 */
170 public void setFrontend( Frontend frontend ) {
171 this.frontend = frontend;
172 }
173
174 /**
175 * returns the parameters describing the control options for the map
176 *
177 * @return <tt>MapParameter</tt> encapsulating several control params
178 */
179 public MapParameter getMapParameter() {
180 return mapParameter;
181 }
182
183 /**
184 * sets the parameters describing the control options for the map
185 *
186 * @param mapParameter
187 * <tt>MapParameter</tt> encapsulating several control params
188 */
189 public void setMapParameter( MapParameter mapParameter ) {
190 this.mapParameter = mapParameter;
191 }
192
193 /**
194 * @return Returns the iOSettings.
195 */
196 public IOSettings getIOSettings() {
197 return iOSettings;
198 }
199
200 /**
201 * @param settings
202 * The iOSettings to set.
203 */
204 public void setIOSettings( IOSettings settings ) {
205 iOSettings = settings;
206 }
207
208 /**
209 * @return the authenication settings
210 */
211 public AuthentificationSettings getAuthentificationSettings() {
212 return authSettings;
213 }
214
215 /**
216 * @param authSettings
217 * the new authentication settings.
218 */
219 public void setAuthentificationSettings( AuthentificationSettings authSettings ) {
220 this.authSettings = authSettings;
221 }
222
223 /**
224 * returns the current mode of a map client using a WMC. A mode defines the action that occurs if a user performs a
225 * mouse action on the map
226 *
227 * @return the current mode of a map client using a WMC. A mode defines the action that occurs if a user performs a
228 * mouse action on the map
229 */
230 public String getMode() {
231 return mode;
232 }
233
234 /**
235 * @see #getMode()
236 * @param mode
237 */
238 public void setMode( String mode ) {
239 this.mode = mode;
240 }
241
242 /**
243 * @param layerTreeRoot
244 * to set
245 */
246 public void setLayerTreeRoot( Node layerTreeRoot ) {
247 this.layerTreeRoot = layerTreeRoot;
248 }
249
250 /**
251 * @return the xml-element containing the layer tree root.
252 */
253 public Node getLayerTreeRoot() {
254 return layerTreeRoot;
255 }
256
257 }