001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2003-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.map;
017:
018: import java.awt.Color;
019:
020: import org.opengis.referencing.crs.CoordinateReferenceSystem;
021:
022: /**
023: * Extends DefaultMapContext to provide the whole set of request parameters a
024: * WMS GetMap request can have.
025: *
026: * <p>
027: * In particular, adds holding for the following parameter values:
028: *
029: * <ul>
030: * <li> WIDTH </li>
031: * <li> HEIGHT </li>
032: * <li> BGCOLOR </li>
033: * <li> TRANSPARENT </li>
034: * </ul>
035: * </p>
036: *
037: * @author simone giannecchini
038: * @version $Id: GraphicEnhancedMapContext.java 25075 2007-04-09 19:20:46Z desruisseaux $
039: */
040: public class GraphicEnhancedMapContext extends DefaultMapContext {
041:
042: /**
043: * requested map image width in output units (pixels)
044: *
045: * @uml.property name="mapWidth" multiplicity="(0 1)"
046: */
047: private int mapWidth;
048:
049: /**
050: * requested map image height in output units (pixels)
051: *
052: * @uml.property name="mapHeight" multiplicity="(0 1)"
053: */
054: private int mapHeight;
055:
056: /**
057: * Requested BGCOLOR, defaults to white according to WMS spec
058: *
059: * @uml.property name="bgColor" multiplicity="(0 1)"
060: */
061: private Color bgColor = Color.white;
062:
063: /**
064: * true if background transparency is requested
065: *
066: * @uml.property name="transparent" multiplicity="(0 1)"
067: */
068: private boolean transparent;
069:
070: /**
071: * Default constructor
072: *
073: * @deprecated
074: */
075: public GraphicEnhancedMapContext() {
076: super ();
077: }
078:
079: /**
080: * DOCUMENT ME!
081: *
082: * @param layers
083: * @deprecated
084: */
085: public GraphicEnhancedMapContext(MapLayer[] layers) {
086: super (layers);
087: }
088:
089: /**
090: * Default constructor
091: */
092: public GraphicEnhancedMapContext(final CoordinateReferenceSystem crs) {
093: super (crs);
094: }
095:
096: /**
097: * DOCUMENT ME!
098: *
099: * @param layers
100: */
101: public GraphicEnhancedMapContext(MapLayer[] layers,
102: final CoordinateReferenceSystem crs) {
103: super (layers, crs);
104: }
105:
106: /**
107: * DOCUMENT ME!
108: *
109: * @return DOCUMENT ME!
110: *
111: * @uml.property name="bgColor"
112: */
113: public Color getBgColor() {
114: return this .bgColor;
115: }
116:
117: /**
118: * DOCUMENT ME!
119: *
120: * @param bgColor
121: * DOCUMENT ME!
122: *
123: * @uml.property name="bgColor"
124: */
125: public void setBgColor(Color bgColor) {
126: this .bgColor = bgColor;
127: }
128:
129: /**
130: * DOCUMENT ME!
131: *
132: * @return DOCUMENT ME!
133: *
134: * @uml.property name="mapHeight"
135: */
136: public int getMapHeight() {
137: return this .mapHeight;
138: }
139:
140: /**
141: * DOCUMENT ME!
142: *
143: * @param mapHeight
144: * DOCUMENT ME!
145: *
146: * @uml.property name="mapHeight"
147: */
148: public void setMapHeight(int mapHeight) {
149: this .mapHeight = mapHeight;
150: }
151:
152: /**
153: * DOCUMENT ME!
154: *
155: * @return DOCUMENT ME!
156: *
157: * @uml.property name="mapWidth"
158: */
159: public int getMapWidth() {
160: return this .mapWidth;
161: }
162:
163: /**
164: * DOCUMENT ME!
165: *
166: * @param mapWidth
167: * DOCUMENT ME!
168: *
169: * @uml.property name="mapWidth"
170: */
171: public void setMapWidth(int mapWidth) {
172: this .mapWidth = mapWidth;
173: }
174:
175: /**
176: * DOCUMENT ME!
177: *
178: * @return DOCUMENT ME!
179: */
180: public boolean isTransparent() {
181: return this .transparent;
182: }
183:
184: /**
185: * Setting transparency for this wms context.
186: *
187: * @param transparent
188: * DOCUMENT ME!
189: *
190: * @uml.property name="transparent"
191: */
192: public void setTransparent(boolean transparent) {
193: this.transparent = transparent;
194: }
195:
196: }
|