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 org.geotools.event.AbstractGTComponent;
019: import org.geotools.factory.CommonFactoryFinder;
020: import org.geotools.factory.GeoTools;
021: import org.opengis.filter.FilterFactory;
022: import org.opengis.filter.expression.Expression;
023:
024: /**
025: * Default color map entry implementation
026: *
027: * @author aaime
028: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/styling/ColorMapEntryImpl.java $
029: */
030: public class ColorMapEntryImpl extends AbstractGTComponent implements
031: ColorMapEntry {
032: private static final java.util.logging.Logger LOGGER = org.geotools.util.logging.Logging
033: .getLogger("org.geotools.core");
034: private static final FilterFactory filterFactory = CommonFactoryFinder
035: .getFilterFactory(GeoTools.getDefaultHints());
036: private Expression quantity;
037: private Expression opacity;
038: private Expression color;
039: private String label;
040:
041: /**
042: * @see org.geotools.styling.ColorMapEntry#getLabel()
043: */
044: public String getLabel() {
045: return this .label;
046: }
047:
048: /**
049: * @see org.geotools.styling.ColorMapEntry#setLabel(java.lang.String)
050: */
051: public void setLabel(String label) {
052: this .label = label;
053: fireChanged();
054: }
055:
056: /**
057: * @see org.geotools.styling.ColorMapEntry#setColor(org.geotools.filter.Expression)
058: */
059: public void setColor(Expression color) {
060: this .color = color;
061: }
062:
063: /**
064: * @see org.geotools.styling.ColorMapEntry#getColor()
065: */
066: public Expression getColor() {
067: return this .color;
068: }
069:
070: /**
071: * @see org.geotools.styling.ColorMapEntry#setOpacity(org.geotools.filter.Expression)
072: */
073: public void setOpacity(Expression opacity) {
074: this .opacity = opacity;
075: }
076:
077: /**
078: * @see org.geotools.styling.ColorMapEntry#getOpacity()
079: */
080: public Expression getOpacity() {
081: return this .opacity;
082: }
083:
084: /**
085: * @see org.geotools.styling.ColorMapEntry#setQuantity(org.geotools.filter.Expression)
086: */
087: public void setQuantity(Expression quantity) {
088: this .quantity = quantity;
089: }
090:
091: /**
092: * @see org.geotools.styling.ColorMapEntry#getQuantity()
093: */
094: public Expression getQuantity() {
095: return quantity;
096: }
097:
098: public void accept(StyleVisitor visitor) {
099: visitor.visit(this);
100: }
101: }
|