PageRenderTime 23ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/Prototipo/PrototipoCommons/src/memoria/commons/structures/MultiPolygon.java

http://prototipomemoria.googlecode.com/
Java | 74 lines | 46 code | 20 blank | 8 comment | 1 complexity | a3fea954e16551ea52383d52f99b5f92 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package memoria.commons.structures;
  6. import java.util.ArrayList;
  7. import java.util.List;
  8. /**
  9. *
  10. * @author diego
  11. */
  12. public class MultiPolygon extends AbstractGeographicElement {
  13. private Polygon outerRing;
  14. private List<Polygon> poligonos = new ArrayList<Polygon>();
  15. public List<Polygon> getLineas() {
  16. return poligonos;
  17. }
  18. @Override
  19. public String getTypeRepresentation()
  20. {
  21. return "Multipolygon";
  22. }
  23. public void setLineas(List<Polygon> lineas) {
  24. this.poligonos = lineas;
  25. }
  26. public MultiPolygon(Polygon outerRing) {
  27. this.setOuterRing(outerRing);
  28. }
  29. @Override
  30. public List<Point> getCenterPoints(){
  31. return outerRing.getCenterPoints();
  32. }
  33. @Override
  34. public List<Point> getPoints() {
  35. List<Point> results = new ArrayList<Point>();
  36. for(Polygon pols : poligonos){
  37. results.addAll(pols.getPoints());
  38. }
  39. results.addAll(this.outerRing.getPoints());
  40. return results;
  41. }
  42. public List<Polygon> getPoligonos() {
  43. return poligonos;
  44. }
  45. public void setPoligonos(List<Polygon> poligonos) {
  46. this.poligonos = poligonos;
  47. }
  48. public Polygon getOuterRing() {
  49. return outerRing;
  50. }
  51. public void setOuterRing(Polygon outerRing) {
  52. this.outerRing = outerRing;
  53. }
  54. }