Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGPE-KML / src / org / gvsig / gpe / kml / writer / features / FolderWriter.java @ 11485

History | View | Annotate | Download (2.97 KB)

1
package org.gvsig.gpe.kml.writer.features;
2

    
3
import java.io.IOException;
4

    
5
import org.gvsig.gpe.kml.KmlTags;
6
import org.gvsig.gpe.xml.writer.Writer;
7

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