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 java.net.URI;
020:
021: import javax.swing.Icon;
022:
023: import org.geotools.catalog.ServiceInfo;
024:
025: /**
026: * Implementation of ServiceInfo.
027: *
028: * @author Justin Deoliveira, The Open Planning Project
029: *
030: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/catalog/defaults/DefaultServiceInfo.java $
031: */
032: public class DefaultServiceInfo implements ServiceInfo {
033:
034: protected String title, description, _abstract;
035: protected URI schema;
036: protected URI source, publisher;
037: protected String[] keywords;
038: protected Icon icon;
039:
040: protected DefaultServiceInfo() {
041: // to be used in an over-ride
042: }
043:
044: public DefaultServiceInfo(String title, String description,
045: String _abstract, URI source, URI publisher, URI schema,
046: String[] keywords, Icon icon) {
047: this .title = title;
048: this .description = description;
049: this ._abstract = _abstract;
050: this .schema = schema;
051: this .source = source;
052: this .publisher = publisher;
053: this .keywords = keywords;
054: this .icon = icon;
055: }
056:
057: /**
058: * Returns the service title, may be empty or null if unsupported.
059: * <p>
060: * Note this is always metadata, and is in user terms.
061: * </p>
062: *
063: * @return title, may be empty, null if unsupported.
064: */
065: public String getTitle() {
066: return title;
067: }
068:
069: public void setTitle(String title) {
070: this .title = title;
071: }
072:
073: /**
074: * Returns the service keywords. Maps to the Dublin Core Subject element.
075: *
076: */
077: public String[] getKeywords() { // aka Subject
078: return keywords;
079: }
080:
081: public void setKeywords(String[] keywords) {
082: this .keywords = keywords;
083: }
084:
085: /**
086: * Returns the service description
087: *
088: */
089: public String getDescription() {
090: return description;
091: }
092:
093: public void setDescription(String description) {
094: this .description = description;
095: }
096:
097: /**
098: * Return the service abstract
099: *
100: */
101: public String getAbstract() {
102: return _abstract;
103: }
104:
105: public void setAbstract(String _abstract) {
106: this ._abstract = _abstract;
107: }
108:
109: /**
110: * Return the service publisher
111: *
112: */
113: public URI getPublisher() {
114: return publisher;
115: }
116:
117: public void setPublisher(URI publisher) {
118: this .publisher = publisher;
119: }
120:
121: /**
122: * Returns the xml schema namespace for this service type. Maps to the Dublin Code Format
123: * element
124: *
125: */
126: public URI getSchema() { // aka format
127: return schema;
128: }
129:
130: public void setSchema(URI schema) {
131: this .schema = schema;
132: }
133:
134: /**
135: * Returns the service source. Maps to the Dublin Core Server Element
136: *
137: */
138: public URI getSource() { // aka server
139: return source;
140: }
141:
142: public void setSource(URI source) {
143: this .source = source;
144: }
145:
146: /**
147: * Base symbology (with out decorators) representing this IService.
148: * <p>
149: * The Icon returned should conform the the Eclipse User Interface Guidelines (16x16
150: * image with a 16x15 glyph centered).
151: * </p>
152: * <p>
153: * This plug-in provides default images based on service type:
154: *
155: * <pre><code>
156: * <b>return</b> ISharedImages.getImagesDescriptor( IService );
157: * </code></pre>
158: *
159: * <ul>
160: * <p>
161: * Any LabelProvider should use the default image, a label decorator should be used to pick up
162: * these images in a separate thread. This allows services like WFS make blocking request to
163: * pick up the image from their GetCapabilities.
164: * </p>
165: *
166: * @return Icon symbolizing this IService.
167: */
168: public Icon getIcon() {
169: return icon;
170: }
171:
172: public void setIcon(Icon icon) {
173: this.icon = icon;
174: }
175:
176: }
|