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.sld.bindings;
017:
018: import org.picocontainer.MutablePicoContainer;
019: import org.w3c.dom.Document;
020: import org.w3c.dom.Element;
021: import javax.xml.namespace.QName;
022: import org.geotools.filter.Expression;
023: import org.geotools.styling.Fill;
024: import org.geotools.styling.Halo;
025: import org.geotools.styling.StyleFactory;
026: import org.geotools.xml.*;
027:
028: /**
029: * Binding object for the element http://www.opengis.net/sld:Halo.
030: *
031: * <p>
032: * <pre>
033: * <code>
034: * <xsd:element name="Halo">
035: * <xsd:annotation>
036: * <xsd:documentation> A "Halo" fills an extended
037: * area outside the glyphs of a rendered text label to
038: * make the label easier to read over a background. </xsd:documentation>
039: * </xsd:annotation>
040: * <xsd:complexType>
041: * <xsd:sequence>
042: * <xsd:element ref="sld:Radius" minOccurs="0"/>
043: * <xsd:element ref="sld:Fill" minOccurs="0"/>
044: * </xsd:sequence>
045: * </xsd:complexType>
046: * </xsd:element>
047: *
048: * </code>
049: * </pre>
050: * </p>
051: *
052: * @generated
053: */
054: public class SLDHaloBinding extends AbstractComplexBinding {
055: StyleFactory styleFactory;
056:
057: public SLDHaloBinding(StyleFactory styleFactory) {
058: this .styleFactory = styleFactory;
059: }
060:
061: /**
062: * @generated
063: */
064: public QName getTarget() {
065: return SLD.HALO;
066: }
067:
068: /**
069: * <!-- begin-user-doc -->
070: * <!-- end-user-doc -->
071: *
072: * @generated modifiable
073: */
074: public int getExecutionMode() {
075: return AFTER;
076: }
077:
078: /**
079: * <!-- begin-user-doc -->
080: * <!-- end-user-doc -->
081: *
082: * @generated modifiable
083: */
084: public Class getType() {
085: return Halo.class;
086: }
087:
088: /**
089: * <!-- begin-user-doc -->
090: * <!-- end-user-doc -->
091: *
092: * @generated modifiable
093: */
094: public void initialize(ElementInstance instance, Node node,
095: MutablePicoContainer context) {
096: }
097:
098: /**
099: * <!-- begin-user-doc -->
100: * <!-- end-user-doc -->
101: *
102: * @generated modifiable
103: */
104: public Object parse(ElementInstance instance, Node node,
105: Object value) throws Exception {
106: return styleFactory.createHalo((Fill) node
107: .getChildValue("Fill"), (Expression) node
108: .getChildValue("Radius"));
109: }
110: }
|