001:
002: /*
003: * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
004: * for visualizing and manipulating spatial features with geometry and attributes.
005: *
006: * Copyright (C) 2003 Vivid Solutions
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or (at your option) any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
021: *
022: * For more information, contact:
023: *
024: * Vivid Solutions
025: * Suite #1A
026: * 2328 Government Street
027: * Victoria BC V8T 5G5
028: * Canada
029: *
030: * (250)385-6040
031: * www.vividsolutions.com
032: */
033:
034: package com.vividsolutions.wms;
035:
036: import java.util.*;
037:
038: /**
039: * Represents the capabilities WMS XML.
040: * @author Chris Hodgson chodgson@refractions.net
041: */
042: public class Capabilities {
043:
044: private MapLayer topLayer;
045: private String title;
046: private ArrayList mapFormats;
047: private WMService service;
048:
049: /**
050: * Creates a new WMS Capabilities object. Should generally only be used by the Parser.
051: * @param service the WMService to which these Capabilites belong
052: * @param title the title of this WMService
053: * @param topLayer the top MapLayer of the entire layer tree
054: * @param formatList the Collection of supported formats
055: */
056: public Capabilities(WMService service, String title,
057: MapLayer topLayer, Collection mapFormats) {
058: this .service = service;
059: this .title = title;
060: this .topLayer = topLayer;
061: this .mapFormats = new ArrayList(mapFormats);
062: }
063:
064: /**
065: * Gets a reference to the service which these Capabilities describe.
066: * @return the WMService which these Capabilities describe
067: */
068: public WMService getService() {
069: return service;
070: }
071:
072: /**
073: * Gets the top layer for these Capabilities.
074: * @return the top MapLayer for these Capabilities
075: */
076: public MapLayer getTopLayer() {
077: return topLayer;
078: }
079:
080: /**
081: * Gets the title of the Capabilities.
082: * @return the title of the map described by these Capabilities
083: */
084: public String getTitle() {
085: return this .title;
086: }
087:
088: /**
089: * Gets a copy of the list of formats supported by this getMap requests for this map.
090: * @return an array containing the formats supported by getMap requests for this map
091: */
092: public String[] getMapFormats() {
093: String[] formats = new String[mapFormats.size()];
094: Iterator it = mapFormats.iterator();
095: int i = 0;
096: while (it.hasNext()) {
097: formats[i++] = (String) it.next();
098: }
099: return formats;
100: }
101:
102: }
|