001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-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.styling;
017:
018: import java.util.List;
019: import org.geotools.event.GTComponent;
020:
021: /**
022: * How to style a feature type. This is introduced as a convenient package
023: * that can be used independently for feature types, for example in
024: * GML Default Styling. The "layer" concept is discarded inside of this
025: * element and all processing is relative to feature types.
026: * The FeatureTypeName is allowed to be optional, but only one feature
027: * type may be in context and it must match the syntax and semantics of all
028: * attribute references inside of the FeatureTypeStyle.
029: * <p>
030: * The details of this object are taken from the
031: * <a href="https://portal.opengeospatial.org/files/?artifact_id=1188">
032: * OGC Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.</a>:
033: * <pre><code>
034: * <xsd:element name="FeatureTypeStyle">
035: * <xsd:annotation>
036: * <xsd:documentation>
037: * A FeatureTypeStyle contains styling information specific to one
038: * feature type. This is the SLD level that separates the 'layer'
039: * handling from the 'feature' handling.
040: * </xsd:documentation>
041: * </xsd:annotation>
042: * <xsd:complexType>
043: * <xsd:sequence>
044: * <xsd:element ref="sld:Name" minOccurs="0"/>
045: * <xsd:element ref="sld:Title" minOccurs="0"/>
046: * <xsd:element ref="sld:Abstract" minOccurs="0"/>
047: * <xsd:element ref="sld:FeatureTypeName" minOccurs="0"/>
048: * <xsd:element ref="sld:SemanticTypeIdentifier" minOccurs="0"
049: * maxOccurs="unbounded"/>
050: * <xsd:element ref="sld:Rule" maxOccurs="unbounded"/>
051: * </xsd:sequence>
052: * </xsd:complexType>
053: * </xsd:element>
054: * </code></pre>
055: *
056: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/styling/FeatureTypeStyle.java $
057: * @version $Id: FeatureTypeStyle.java 22294 2006-10-20 00:55:40Z desruisseaux $
058: * @author James Macgill, CCG
059: */
060: public interface FeatureTypeStyle extends GTComponent {
061: public String getName();
062:
063: void setName(String name);
064:
065: public String getTitle();
066:
067: void setTitle(String title);
068:
069: public String getAbstract();
070:
071: void setAbstract(String abstractStr);
072:
073: /**
074: * Only features with the type name returned by this method should
075: * be styled by this feature type styler.
076: * @return The name of types that this styler applies to
077: */
078: String getFeatureTypeName();
079:
080: /**
081: * Sets the type name of the features that this styler should be
082: * applied to.
083: * @task REVISIT: should a set method be declared in this interface at all?
084: * @param name The TypeName of the features to be styled by this instance.
085: */
086: void setFeatureTypeName(String name);
087:
088: /**
089: * The SemanticTypeIdentifiers is experimental and is intended to be used
090: * to identify, using a community-controlled name(s), what the style is
091: * suitable to be used for.
092: * For example, a single style may be suitable to use with many
093: * different feature types. The syntax of the SemanticTypeIdentifiers
094: * string is undefined, but the strings "generic:line_string",
095: * "generic:polygon", "generic:point", "generic:text",
096: * "generic:raster", and "generic:any" are reserved to indicate
097: * that a FeatureTypeStyle may be used with any feature type
098: * with the corresponding default geometry type (i.e., no feature
099: * properties are referenced in the feature type style).
100: *
101: *
102: * @return An array of strings representing systematic types which
103: * could be styled by this instance.
104: **/
105: String[] getSemanticTypeIdentifiers();
106:
107: /**
108: * The SemanticTypeIdentifiers is experimental and is intended to be used
109: * to identify, using a community-controlled name(s), what the style is
110: * suitable to be used for.
111: * For example, a single style may be suitable to use with many
112: * different feature types. The syntax of the SemanticTypeIdentifiers
113: * string is undefined, but the strings "generic:line_string",
114: * "generic:polygon", "generic:point", "generic:text",
115: * "generic:raster", and "generic:any" are reserved to indicate
116: * that a FeatureTypeStyle may be used with any feature type
117: * with the corresponding default geometry type (i.e., no feature
118: * properties are referenced in the feature type style).
119: *
120: *
121: * @param types An array of strings representing systematic types which
122: * could be styled by this instance.
123: **/
124: void setSemanticTypeIdentifiers(String[] types);
125:
126: /**
127: * Rules govern the appearance of any given feature to be styled by
128: * this styler. Each rule contains conditions based on scale and
129: * feature attribute values. In addition, rules contain the symbolizers
130: * which should be applied when the rule holds true.
131: *
132: * @version SLD 1.0
133: * @version SLD 1.0.20 TODO: GeoAPI getRules(): List<Rule>
134: * @return The full set of rules contained in this styler.
135: */
136: Rule[] getRules();
137:
138: /**
139: * Rules govern the appearance of any given feature to be styled by
140: * this styler. Each rule contains conditions based on scale and
141: * feature attribute values. In addition, rules contain the symbolizers
142: * which should be applied when the rule holds true.
143: *
144: * @param rules The set of rules to be set for this styler.
145: */
146: void setRules(Rule[] rules);
147:
148: void addRule(Rule rule);
149:
150: /**
151: * Rules govern the appearance of any given feature to be styled by
152: * this styler.
153: * <p>
154: * This is *the* list being used to mange the rules!
155: * </p>
156: * @since GeoTools 2.2.M3, GeoAPI 2.0
157: */
158: List rules();
159:
160: void accept(StyleVisitor visitor);
161: }
|