001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2003-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 org.geotools.event.AbstractGTComponent;
019:
020: /**
021: * A NamedStyle is used to refer to a style that has a name in a WMS.
022: *
023: * <p>
024: * A NamedStyle is a Style that has only Name, so all setters other than
025: * setName will throw an <code>UnsupportedOperationException</code>
026: * </p>
027: *
028: * @author jamesm
029: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/styling/NamedStyleImpl.java $
030: */
031: public class NamedStyleImpl extends AbstractGTComponent implements
032: NamedStyle {
033: /** DOCUMENT ME! */
034: private String name;
035:
036: /**
037: * DOCUMENT ME!
038: *
039: * @return DOCUMENT ME!
040: */
041: public String getName() {
042: return this .name;
043: }
044:
045: /**
046: * DOCUMENT ME!
047: *
048: * @param name DOCUMENT ME!
049: */
050: public void setName(String name) {
051: this .name = name;
052: fireChanged();
053: }
054:
055: /**
056: * DOCUMENT ME!
057: *
058: * @return DOCUMENT ME!
059: */
060: public String getTitle() {
061: return null;
062: }
063:
064: /**
065: * DOCUMENT ME!
066: *
067: * @param title DOCUMENT ME!
068: *
069: * @throws UnsupportedOperationException DOCUMENT ME!
070: */
071: public void setTitle(String title) {
072: throw new UnsupportedOperationException();
073: }
074:
075: /**
076: * DOCUMENT ME!
077: *
078: * @return DOCUMENT ME!
079: */
080: public String getAbstract() {
081: return null;
082: }
083:
084: /**
085: * DOCUMENT ME!
086: *
087: * @param abstractStr DOCUMENT ME!
088: *
089: * @throws UnsupportedOperationException DOCUMENT ME!
090: */
091: public void setAbstract(String abstractStr) {
092: throw new UnsupportedOperationException();
093: }
094:
095: /**
096: * DOCUMENT ME!
097: *
098: * @return DOCUMENT ME!
099: */
100: public boolean isDefault() {
101: return false;
102: }
103:
104: /**
105: * DOCUMENT ME!
106: *
107: * @param isDefault DOCUMENT ME!
108: *
109: * @throws UnsupportedOperationException DOCUMENT ME!
110: */
111: public void setDefault(boolean isDefault) {
112: throw new UnsupportedOperationException();
113: }
114:
115: /**
116: * DOCUMENT ME!
117: *
118: * @return DOCUMENT ME!
119: */
120: public FeatureTypeStyle[] getFeatureTypeStyles() {
121: return null;
122: }
123:
124: /**
125: * DOCUMENT ME!
126: *
127: * @param types DOCUMENT ME!
128: *
129: * @throws UnsupportedOperationException DOCUMENT ME!
130: */
131: public void setFeatureTypeStyles(FeatureTypeStyle[] types) {
132: throw new UnsupportedOperationException();
133: }
134:
135: /**
136: * DOCUMENT ME!
137: *
138: * @param type DOCUMENT ME!
139: *
140: * @throws UnsupportedOperationException DOCUMENT ME!
141: */
142: public void addFeatureTypeStyle(FeatureTypeStyle type) {
143: throw new UnsupportedOperationException();
144: }
145:
146: /**
147: * DOCUMENT ME!
148: *
149: * @param visitor DOCUMENT ME!
150: */
151: public void accept(StyleVisitor visitor) {
152: visitor.visit(this);
153: }
154: }
|