001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2002, Center for Computational Geography
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: * Contacts:
018: * UNITED KINGDOM: James Macgill. j.macgill@geog.leeds.ac.uk
019: */
020: package org.geotools.styling;
021:
022: import java.net.MalformedURLException;
023: import java.net.URL;
024: import java.util.Map;
025:
026: /**
027: * Holds a reference to an external graphics file with a URL to its location
028: * and its expected MIME type. Knowing the MIME type in advance allows stylers
029: * to select best-supported formats from a list of external graphics.
030: *
031: * <p></p>
032: *
033: * <p>
034: * The details of this object are taken from the <a
035: * href="https://portal.opengeospatial.org/files/?artifact_id=1188"> OGC
036: * Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.</a>:
037: * <pre><code>
038: * <xsd:element name="ExternalGraphic">
039: * <xsd:annotation>
040: * <xsd:documentation>
041: * An "ExternalGraphic" gives a reference to an external raster or
042: * vector graphical object.
043: * </xsd:documentation>
044: * </xsd:annotation>
045: * <xsd:complexType>
046: * <xsd:sequence>
047: * <xsd:element ref="sld:OnlineResource"/>
048: * <xsd:element ref="sld:Format"/>
049: * </xsd:sequence>
050: * </xsd:complexType>
051: * </xsd:element>
052: * </code></pre>
053: * </p>
054: *
055: * <p>
056: * Renderers can use this information when displaying styled features, though
057: * it must be remembered that not all renderers will be able to fully
058: * represent strokes as set out by this interface. For example, opacity may
059: * not be supported.
060: * </p>
061: *
062: * <p>
063: * Notes:
064: *
065: * <ul>
066: * <li>
067: * The graphical parameters and their values are derived from SVG/CSS2
068: * standards with names and semantics which are as close as possible.
069: * </li>
070: * </ul>
071: * </p>
072: *
073: * @author James Macgill, CCG
074: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/styling/ExternalGraphic.java $
075: * @version $Id: ExternalGraphic.java 20562 2006-07-16 14:54:53Z jgarnett $
076: */
077: public interface ExternalGraphic extends Symbol {
078: public static final ExternalGraphic[] EXTERNAL_GRAPHICS_EMPTY = new ExternalGraphic[0];
079:
080: /**
081: * converts a URI in a string to the location URL
082: *
083: * @param uri the uri of the external graphic
084: */
085: public void setURI(String uri);
086:
087: /**
088: * Provides the URL for where the external graphic resource can be located.
089: *
090: * @return The URL of the ExternalGraphic
091: *
092: * @throws MalformedURLException If the url held in the ExternalGraphic is
093: * malformed.
094: */
095: URL getLocation() throws MalformedURLException;
096:
097: /**
098: * Provides the URL for where the external graphic resource can be located.
099: *
100: * @param url The URL of the ExternalGraphic
101: */
102: void setLocation(URL url);
103:
104: /**
105: * Provides the format of the external graphic.
106: *
107: * @return The format of the external graphic. Reported as its MIME type
108: * in a String object.
109: */
110: String getFormat();
111:
112: /**
113: * Provides the format of the external graphic.
114: *
115: * @param format The format of the external graphic. Reported as its MIME
116: * type in a String object.
117: */
118: void setFormat(String format);
119:
120: public void setCustomProperties(Map list);
121:
122: public Map getCustomProperties();
123: }
|