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.styling.LabelPlacement;
023: import org.geotools.styling.StyleFactory;
024: import org.geotools.xml.*;
025:
026: /**
027: * Binding object for the element http://www.opengis.net/sld:LabelPlacement.
028: *
029: * <p>
030: * <pre>
031: * <code>
032: * <xsd:element name="LabelPlacement">
033: * <xsd:annotation>
034: * <xsd:documentation> The "LabelPlacement"
035: * specifies where and how a text label should be
036: * rendered relative to a geometry. The present mechanism is
037: * poorly aligned with CSS/SVG. </xsd:documentation>
038: * </xsd:annotation>
039: * <xsd:complexType>
040: * <xsd:choice>
041: * <xsd:element ref="sld:PointPlacement"/>
042: * <xsd:element ref="sld:LinePlacement"/>
043: * </xsd:choice>
044: * </xsd:complexType>
045: * </xsd:element>
046: *
047: * </code>
048: * </pre>
049: * </p>
050: *
051: * @generated
052: */
053: public class SLDLabelPlacementBinding extends AbstractComplexBinding {
054: StyleFactory styleFactory;
055:
056: public SLDLabelPlacementBinding(StyleFactory styleFactory) {
057: this .styleFactory = styleFactory;
058: }
059:
060: /**
061: * @generated
062: */
063: public QName getTarget() {
064: return SLD.LABELPLACEMENT;
065: }
066:
067: /**
068: * <!-- begin-user-doc -->
069: * <!-- end-user-doc -->
070: *
071: * @generated modifiable
072: */
073: public int getExecutionMode() {
074: return AFTER;
075: }
076:
077: /**
078: * <!-- begin-user-doc -->
079: * <!-- end-user-doc -->
080: *
081: * @generated modifiable
082: */
083: public Class getType() {
084: return LabelPlacement.class;
085: }
086:
087: /**
088: * <!-- begin-user-doc -->
089: * <!-- end-user-doc -->
090: *
091: * @generated modifiable
092: */
093: public void initialize(ElementInstance instance, Node node,
094: MutablePicoContainer context) {
095: }
096:
097: /**
098: * <!-- begin-user-doc -->
099: * <!-- end-user-doc -->
100: *
101: * @generated modifiable
102: */
103: public Object parse(ElementInstance instance, Node node,
104: Object value) throws Exception {
105: //<xsd:choice>
106: // <xsd:element ref="sld:PointPlacement"/>
107: // <xsd:element ref="sld:LinePlacement"/>
108: //</xsd:choice>
109: return node.getChildValue(LabelPlacement.class);
110: }
111: }
|