001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2005, Refractions Research Inc.
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation;
010: * version 2.1 of the License.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: */
017: package org.geotools.catalog.defaults;
018:
019: import com.vividsolutions.jts.geom.Envelope;
020: import org.geotools.catalog.GeoResourceInfo;
021: import org.geotools.geometry.jts.ReferencedEnvelope;
022: import org.opengis.referencing.crs.CoordinateReferenceSystem;
023: import java.net.URI;
024: import javax.swing.Icon;
025:
026: /**
027: * Implementation of GeoResourceInfo.
028: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/catalog/defaults/DefaultGeoResourceInfo.java $
029: */
030: public class DefaultGeoResourceInfo implements GeoResourceInfo {
031: protected String title;
032: protected String description;
033: protected String name;
034: protected String[] keywords;
035: protected URI schema;
036: protected Icon icon;
037: protected ReferencedEnvelope bounds;
038:
039: protected DefaultGeoResourceInfo() {
040: // for over-riding
041: }
042:
043: public DefaultGeoResourceInfo(String title, String name,
044: String description, URI schema, Envelope bounds,
045: CoordinateReferenceSystem crs, String[] keywords, Icon icon) {
046: this (title, name, description, schema, new ReferencedEnvelope(
047: bounds, crs), keywords, icon);
048: }
049:
050: public DefaultGeoResourceInfo(String title, String name,
051: String description, URI schema, ReferencedEnvelope bounds,
052: String[] keywords, Icon icon) {
053: this .title = title;
054: this .description = description;
055: this .name = name;
056: this .keywords = keywords;
057: this .schema = schema;
058: this .icon = icon;
059: this .bounds = bounds;
060: }
061:
062: /* (non-Javadoc)
063: * @see org.geotools.catalog.GeoResourceInfo#getTitle()
064: */
065: public String getTitle() {
066: return title;
067: }
068:
069: /* (non-Javadoc)
070: * @see org.geotools.catalog.GeoResourceInfo#getKeywords()
071: */
072: public String[] getKeywords() { // aka Subject
073:
074: return keywords;
075: }
076:
077: /* (non-Javadoc)
078: * @see org.geotools.catalog.GeoResourceInfo#getDescription()
079: */
080: public String getDescription() {
081: return description;
082: }
083:
084: /* (non-Javadoc)
085: * @see org.geotools.catalog.GeoResourceInfo#getSchema()
086: */
087: public URI getSchema() { // aka namespace
088:
089: return schema;
090: }
091:
092: /* (non-Javadoc)
093: * @see org.geotools.catalog.GeoResourceInfo#getName()
094: */
095: public String getName() { // aka layer/type name
096:
097: return name;
098: }
099:
100: /* (non-Javadoc)
101: * @see org.geotools.catalog.GeoResourceInfo#getIcon()
102: */
103: public Icon getIcon() {
104: return icon;
105: }
106:
107: /* (non-Javadoc)
108: * @see org.geotools.catalog.GeoResourceInfo#getBounds()
109: */
110: public Envelope getBounds() { // part of Coverage
111:
112: return bounds;
113: }
114:
115: /* (non-Javadoc)
116: * @see org.geotools.catalog.GeoResourceInfo#getCRS()
117: */
118: public CoordinateReferenceSystem getCRS() { // part of Coverage
119:
120: return bounds.getCoordinateReferenceSystem();
121: }
122: }
|