001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2002, Centre 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: package org.geotools.styling;
018:
019: import org.geotools.event.GTComponent;
020:
021: /**
022: * Indicates how geographical content should be displayed (we call this a style for simplicity; in the spec it is called a UserStyle (user-defined style)).
023: * <p>
024: * The details of this object are taken from the
025: * <a href="https://portal.opengeospatial.org/files/?artifact_id=1188">
026: * OGC Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.</a>:
027: * <pre><code>
028: * <xsd:element name="UserStyle">
029: * <xsd:annotation>
030: * <xsd:documentation>
031: * A UserStyle allows user-defined styling and is semantically
032: * equivalent to a WMS named style.
033: * </xsd:documentation>
034: * </xsd:annotation>
035: * <xsd:complexType>
036: * <xsd:sequence>
037: * <xsd:element ref="sld:Name" minOccurs="0"/>
038: * <xsd:element ref="sld:Title" minOccurs="0"/>
039: * <xsd:element ref="sld:Abstract" minOccurs="0"/>
040: * <xsd:element ref="sld:IsDefault" minOccurs="0"/>
041: * <xsd:element ref="sld:FeatureTypeStyle" maxOccurs="unbounded"/>
042: * </xsd:sequence>
043: * </xsd:complexType>
044: * </xsd:element>
045: * </code></pre>
046: *
047: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/styling/Style.java $
048: * @version $Id: Style.java 20562 2006-07-16 14:54:53Z jgarnett $
049: * @author James Macgill
050: */
051: public interface Style extends GTComponent {
052: /** Style name (machine readable, don't show to users) */
053: String getName();
054:
055: void setName(String name);
056:
057: /* Style Title (human readable name for user interfaces) */
058: String getTitle();
059:
060: void setTitle(String title);
061:
062: /** Description of this style */
063: String getAbstract();
064:
065: void setAbstract(String abstractStr);
066:
067: /**
068: * Indicates that this is the default style.
069: */
070: boolean isDefault();
071:
072: /**
073: * Indicates that this is the default style.
074: * <p>
075: * Assume this is kept for GeoServer enabling a WMS to track
076: * which style is considered the default. May consider providing a
077: * clientProperties mechanism similar to Swing JComponent allowing
078: * applications to mark up the Style content for custom uses.
079: * </p>
080: * @param isDefault
081: */
082: void setDefault(boolean isDefault);
083:
084: /**
085: * Array of FeatureTypeStyles in portrayal order.
086: * <p>
087: * FeatureTypeStyle entries are rendered in order of appearance in this
088: * list.
089: * </p>
090: * <p>
091: * <i>Note: We are using a Array here to continue with Java 1.4 deployment.</i>
092: * </p>
093: */
094: FeatureTypeStyle[] getFeatureTypeStyles();
095:
096: void setFeatureTypeStyles(FeatureTypeStyle[] types);
097:
098: void addFeatureTypeStyle(FeatureTypeStyle type);
099:
100: /**
101: * Used to navigate Style information during portrayal.
102: *
103: * @param visitor
104: */
105: void accept(StyleVisitor visitor);
106: }
|