PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Prototipo/Servlet/src/java/Poligono.java

http://prototipomemoria.googlecode.com/
Java | 40 lines | 23 code | 9 blank | 8 comment | 1 complexity | 2e3fb62c873178b67dd8f2d7869c6d73 MD5 | raw file
 1
 2import java.util.ArrayList;
 3
 4/*
 5 * To change this template, choose Tools | Templates
 6 * and open the template in the editor.
 7 */
 8
 9/**
10 *
11 * @author Fran
12 */
13public class Poligono implements ElemGeograf {
14
15    private ArrayList<Coordenadas> coord;
16    private String descr;
17
18    public Poligono(ArrayList<Coordenadas> unasCoord)
19    {
20        this.coord = unasCoord;
21        this.coord.add(unasCoord.get(0));
22    }
23    public String getDescr()
24    {
25        return this.descr;
26    }
27
28    public String ToKml(int nivel) {
29        String result = "<Placemark> \n\t <Polygon> \n <outerBoundaryIs> <LinearRing>\n\t <coordinates>\n";
30        for(Coordenadas cord:coord)
31        {
32            result = result + cord.ToKml() + "\n";
33        }
34        result = result + "</coordinates> \n </LinearRing> \n  </outerBoundaryIs> \n </Polygon> \n </Placemark>";
35        return result;
36    }
37
38
39
40}