Statistics
| Revision:

root / branches / Mobile1.0 / org.gvsig.gpe.kml / src / org / gvsig / gpe / kml / writer / v21 / geometries / OuterBoundaryIsWriter.java @ 79

History | View | Annotate | Download (3.17 KB)

1
package org.gvsig.gpe.kml.writer.v21.geometries;
2

    
3
import java.io.IOException;
4

    
5
import org.gvsig.gpe.kml.utils.Kml2_1_Tags;
6
import org.gvsig.gpe.kml.writer.GPEKmlWriterHandlerImplementor;
7
import org.gvsig.gpe.writer.ICoordinateSequence;
8
import org.gvsig.gpe.xml.stream.IXmlStreamWriter;
9

    
10
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
11
 *
12
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
13
 *
14
 * This program is free software; you can redistribute it and/or
15
 * modify it under the terms of the GNU General Public License
16
 * as published by the Free Software Foundation; either version 2
17
 * of the License, or (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 * GNU General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU General Public License
25
 * along with this program; if not, write to the Free Software
26
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
27
 *
28
 * For more information, contact:
29
 *
30
 *  Generalitat Valenciana
31
 *   Conselleria d'Infraestructures i Transport
32
 *   Av. Blasco Ib??ez, 50
33
 *   46010 VALENCIA
34
 *   SPAIN
35
 *
36
 *      +34 963862235
37
 *   gvsig@gva.es
38
 *      www.gvsig.gva.es
39
 *
40
 *    or
41
 *
42
 *   IVER T.I. S.A
43
 *   Salamanca 50
44
 *   46005 Valencia
45
 *   Spain
46
 *
47
 *   +34 963163400
48
 *   dac@iver.es
49
 */
50
/* CVS MESSAGES:
51
 *
52
 * $Id: OuterBoundaryIsWriter.java 361 2008-01-10 08:41:21Z jpiera $
53
 * $Log$
54
 * Revision 1.3  2007/05/16 09:30:09  jorpiell
55
 * the writting methods has to have the errorHandler argument
56
 *
57
 * Revision 1.2  2007/05/08 07:53:08  jorpiell
58
 * Add comments to the writers
59
 *
60
 * Revision 1.1  2007/04/14 16:08:07  jorpiell
61
 * Kml writing support added
62
 *
63
 *
64
 */
65
/**
66
 * It writes the outerBoundary tag. Example:
67
 * <p>
68
 * <pre>
69
 * <code>
70
 * &lt;outerBoundaryIs&gt;
71
 * &lt;LinearRing&gt;
72
 * &lt;coordinates&gt;10.0,10.0 10.0,40.0 40.0,40.0 40.0,10.0 10.0,10.0&lt;/coordinates&gt;
73
 * &lt;/LinearRing&gt;
74
 * &lt;/outerBoundaryIs&gt;
75
 * </code>
76
 * </pre>
77
 * </p> 
78
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
79
 * @see http://code.google.com/apis/kml/documentation/kml_tags_21.html#outerboundaryis
80
 */
81
public class OuterBoundaryIsWriter {
82
        
83
        /**
84
         * It writes the outerBoundaryIs kml init tag
85
         * @param writer
86
         * Writer to write the labels
87
         * @param handler
88
         * The writer handler implementor
89
         * @param coords
90
         * A coordinates iterator. 
91
         * @throws IOException
92
         */
93
        public void start(IXmlStreamWriter writer, GPEKmlWriterHandlerImplementor handler,
94
                        ICoordinateSequence coords) throws IOException{
95
                writer.writeStartElement(Kml2_1_Tags.OUTERBOUNDARYIS);
96
                handler.getProfile().getLinearRingWriter().start(writer, handler, coords);
97
        }
98
        
99
        /**
100
         * It writes the outerBoundaryIs end tag
101
         * @param writer
102
         * Writer to write the labels
103
         * @param handler
104
         * The writer handler implementor
105
         * @throws IOException
106
         */
107
        public void end(IXmlStreamWriter writer, GPEKmlWriterHandlerImplementor handler) throws IOException{
108
                handler.getProfile().getLinearRingWriter().end(writer, handler);
109
                writer.writeEndElement();
110
        }
111
}