Codebase list libkmlframework-java / 1e62208
Only a small subset of KML objects may actually be used in a Delete, so I made a Deletable interface and moved the writeDelete method into it. The Document, Folder, Placemark, GroundOverlay, and ScreenOverlay types were update to implement Deletable and all other types were modified to remove the writeDelete method. The Delete class was modified to call the method in Deletable and to only accept Deletable values for its kmlObject field. Also corrected several "visibility" misspellings. Added support in the Kml class for the extension schema and added a printNoIndent method to make coordinates easier to read in output. In Model, I added the ability to specify an ID for the location and orientation so that these can be modified with Update Change later. Updownquark 13 years ago
45 changed file(s) with 235 addition(s) and 229 deletion(s). Raw diff Collapse all Expand all
3737 }
3838 kml.println(-1, "</Alias>");
3939 }
40
41 public void writeDelete(Kml kml) throws KmlException {
42 kml.println("<Alias" + getIdAndTargetIdFormatted(kml) + "></>");
43 }
4440 }
6363 }
6464 kml.println(-1, "</BallonStyle>");
6565 }
66
67 public void writeDelete(Kml kml) throws KmlException {
68 kml.println("<BallonStyle" + getIdAndTargetIdFormatted(kml) + "></>");
69 }
7066 }
2727 }
2828 kml.println(-1, "</Camera>");
2929 }
30
31 public void writeDelete(Kml kml) throws KmlException {
32 kml.println("<Camera" + getIdAndTargetIdFormatted(kml) + "></>");
33 }
3430 }
1111 public Container() {
1212 }
1313
14 public Container(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, List<Feature> feauters) {
15 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData);
14 public Container(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, List<Feature> feauters) {
15 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData);
1616 this.features = feauters;
1717 }
1818
4747 }
4848 kml.println(-1, "</Data>");
4949 }
50
51 public void writeDelete(Kml kml) throws KmlException {
52 kml.println("<Data" + getIdAndTargetIdFormatted(kml) + "></>");
53 }
54
5550 }
0 /*
1 * Deletable.java Created Oct 14, 2010 by Andrew Butler, PSL
2 */
3 package org.boehn.kmlframework.kml;
4
5 /**
6 * Only items that implement this interface can be deleted dynamically from a KML document using
7 * {@link Delete}. As of KML 2.2, the only items that may be deleted are {@link Document},
8 * {@link Folder}, {@link Placemark}, {@link GroundOverlay}, and {@link ScreenOverlay}.
9 */
10 public interface Deletable
11 {
12 /**
13 * Writes an abbreviated version of the KML element--an empty element with a single attribute,
14 * the targetId of the object to delete
15 *
16 * @param kml The KML document to write the element to
17 * @throws KmlException If an error occurs writing the element
18 */
19 public abstract void writeDelete(Kml kml) throws KmlException;
20 }
77 setKmlObject(kmlObject);
88 }
99
10 @Override
11 public void setKmlObject(KmlObject kmlObject)
12 {
13 if(!(kmlObject instanceof Deletable))
14 throw new IllegalArgumentException("Only deletable objects can be deleted");
15 super.setKmlObject(kmlObject);
16 }
17
1018 public void write(Kml kml) throws KmlException {
1119 kml.println("<Delete>", 1);
12 getKmlObject().writeDelete(kml);
20 ((Deletable) getKmlObject()).writeDelete(kml);
1321 kml.println(-1, "</Delete>");
1422 }
1523 }
55 import org.boehn.kmlframework.atom.AtomAuthor;
66 import org.boehn.kmlframework.atom.AtomLink;
77
8 public class Document extends Container {
8 public class Document extends Container implements Deletable {
99
1010 private List<Schema> schemas;
1111
1212 public Document() {}
1313
14 public Document(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, List<Feature> feauters, List<Schema> schemas) {
15 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, feauters);
14 public Document(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, List<Feature> feauters, List<Schema> schemas) {
15 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, feauters);
1616 this.schemas = schemas;
1717 }
1818
4242 }
4343
4444 public void writeDelete(Kml kml) throws KmlException {
45 kml.println("<Document" + getIdAndTargetIdFormatted(kml) + "></>");
45 kml.println("<Document" + getIdAndTargetIdFormatted(kml) + "></Document>");
4646 }
4747 }
8080 }
8181 kml.println(-1, "</ExtendedData>");
8282 }
83
84 public void writeDelete(Kml kml) throws KmlException {
85 kml.println("<ExtendedData" + getIdAndTargetIdFormatted(kml) + "></>");
86 }
8783 }
88 public abstract class Feature extends KmlObject {
99
1010 private String name;
11 private Boolean visability;
11 private Boolean visibility;
1212 private Boolean open;
1313 private AtomAuthor atomAuthor;
1414 private AtomLink atomLink;
2727
2828 public Feature() {}
2929
30 public Feature(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData) {
30 public Feature(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData) {
3131 this.name = name;
32 this.visability = visability;
32 this.visibility = visibility;
3333 this.open = open;
3434 this.atomAuthor = atomAuthor;
3535 this.atomLink = atomLink;
5555 this.name = name;
5656 }
5757
58 public Boolean isVisability() {
59 return visability;
60 }
61
62 public void setVisability(Boolean visability) {
63 this.visability = visability;
58 public Boolean isVisibility() {
59 return visibility;
60 }
61
62 public void setVisibility(Boolean visibility) {
63 this.visibility = visibility;
6464 }
6565
6666 public boolean isOpen() {
194194 if (name != null) {
195195 kml.println("<name>" + name + "</name>");
196196 }
197 if (visability != null) {
198 kml.println("<visability>" + booleanToInt(visability) + "</visability>");
197 if (visibility != null) {
198 kml.println("<visibility>" + booleanToInt(visibility) + "</visibility>");
199199 }
200200 if (open != null) {
201201 kml.println("<open>" + booleanToInt(open) + "</open>");
44 import org.boehn.kmlframework.atom.AtomAuthor;
55 import org.boehn.kmlframework.atom.AtomLink;
66
7 public class Folder extends Container {
7 public class Folder extends Container implements Deletable {
88
99 public Folder() {}
1010
11 public Folder(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, List<Feature> feauters) {
12 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, feauters);
11 public Folder(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, List<Feature> feauters) {
12 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, feauters);
1313 }
1414
1515 public void write(Kml kml) throws KmlException {
1919 }
2020
2121 public void writeDelete(Kml kml) throws KmlException {
22 kml.println("<Folder" + getIdAndTargetIdFormatted(kml) + "></>");
22 kml.println("<Folder" + getIdAndTargetIdFormatted(kml) + "></Folder>");
2323 }
2424 }
44 import org.boehn.kmlframework.atom.AtomAuthor;
55 import org.boehn.kmlframework.atom.AtomLink;
66
7 public class GroundOverlay extends Overlay {
7 public class GroundOverlay extends Overlay implements Deletable {
88
99 private Double altitude;
1010 private AltitudeModeEnum altitudeMode;
1616
1717 public GroundOverlay() {}
1818
19 public GroundOverlay(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, String color, Integer drawOrder, Icon icon, Double alititude, AltitudeModeEnum altitudeMode, Double north, Double south, Double east, Double west, Double rotation) {
20 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, color, drawOrder, icon);
19 public GroundOverlay(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, String color, Integer drawOrder, Icon icon, Double alititude, AltitudeModeEnum altitudeMode, Double north, Double south, Double east, Double west, Double rotation) {
20 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, color, drawOrder, icon);
2121 this.altitude = alititude;
2222 this.altitudeMode = altitudeMode;
2323 this.north = north;
115115 }
116116
117117 public void writeDelete(Kml kml) throws KmlException {
118 kml.println("<GroundOverlay" + getIdAndTargetIdFormatted(kml) + "></>");
118 kml.println("<GroundOverlay" + getIdAndTargetIdFormatted(kml) + "></GroundOverlay>");
119119 }
120120 }
1212 writeInner(kml);
1313 kml.println(-1, "</Icon>");
1414 }
15
16 public void writeDelete(Kml kml) throws KmlException {
17 kml.println("<Icon" + getIdAndTargetIdFormatted(kml) + "></>");
18 }
1915 }
9797 }
9898 kml.println(-1, "</IconStyle>");
9999 }
100
101 public void writeDelete(Kml kml) throws KmlException {
102 kml.println("<IconStyle" + getIdAndTargetIdFormatted(kml) + "></>");
103 }
104100 }
1010 protected Feature feature;
1111 protected boolean celestialData = false;
1212 protected boolean atomElementsIncluded = false;
13 protected boolean extensionElementsIncluded = false;
1314 protected boolean generateObjectIds = true;
1415
1516 private PrintWriter printWriter;
6364 this.atomElementsIncluded = atomElementsIncluded;
6465 }
6566
67 public boolean isExtensionElementsIncluded() {
68 return extensionElementsIncluded;
69 }
70
71 public void setExtensionElementsIncluded(boolean extensionElementsIncluded) {
72 this.extensionElementsIncluded = extensionElementsIncluded;
73 }
74
6675 public boolean isGenerateObjectIds() {
6776 return generateObjectIds;
6877 }
6978
7079 public void setGenerateObjectIds(boolean generateObjectIds) {
7180 this.generateObjectIds = generateObjectIds;
81 }
82
83 public void printNoIndent(String string) {
84 printWriter.print(string);
7285 }
7386
7487 public void print(String string) {
112125 }
113126
114127 public void write(Kml kml) throws KmlException {
115 kml.println("<kml xmlns=\"http://www.opengis.net/kml/2.2\"" + (celestialData ? " hint=\"target=sky\"" : "") + (atomElementsIncluded ? " xmlns:atom=\"http://www.w3.org/2005/Atom\"" : "") + ">", 1);
128 kml.println("<kml xmlns=\"http://www.opengis.net/kml/2.2\"" + (celestialData ? " hint=\"target=sky\"" : "")
129 + (atomElementsIncluded ? " xmlns:atom=\"http://www.w3.org/2005/Atom\"" : "")
130 + (extensionElementsIncluded ? " xmlns:gx=\"http://www.google.com/kml/ext/2.2\"" : "")
131 + ">", 1);
116132 if (networkLinkControl != null) {
117133 networkLinkControl.write(kml);
118134 }
2323 }
2424
2525 public abstract void write(Kml kml) throws KmlException;
26
27 public abstract void writeDelete(Kml kml) throws KmlException;
2826
2927 protected String getIdAndTargetIdFormatted(Kml kml) {
3028 if (kml.isGenerateObjectIds() && id == null) {
2626 }
2727 kml.println(-1, "</LabelStyle>");
2828 }
29
30 public void writeDelete(Kml kml) throws KmlException {
31 kml.println("<LabelStyle" + getIdAndTargetIdFormatted(kml) + "></>");
32 }
3329 }
7272 if (firstLoop) {
7373 firstLoop = false;
7474 } else {
75 kml.print(" ");
75 kml.printNoIndent(" ");
7676 }
77 kml.print(point.getLongitudeLatitudeAltitudeString());
77 kml.printNoIndent(point.getLongitudeLatitudeAltitudeString());
7878 }
7979 kml.println("</coordinates>");
8080 }
8181 kml.println(-1, "</LineString>");
8282 }
83
84 public void writeDelete(Kml kml) throws KmlException {
85 kml.println("<LineString" + getIdAndTargetIdFormatted(kml) + "></>");
86 }
8783 }
2626 }
2727 kml.println(-1, "</LineStyle>");
2828 }
29
30 public void writeDelete(Kml kml) throws KmlException {
31 kml.println("<LineStyle" + getIdAndTargetIdFormatted(kml) + "></>");
32 }
3329 }
7171 if (firstLoop) {
7272 firstLoop = false;
7373 } else {
74 kml.print(" ");
74 kml.printNoIndent(" ");
7575 }
76 kml.print(point.getLongitudeLatitudeAltitudeString());
76 kml.printNoIndent(point.getLongitudeLatitudeAltitudeString());
7777 }
7878 // We add the first coordinate to the end, as KML require the first coordinate to be equal to the last
7979 kml.print(" " + coordinates.get(0).getLongitudeLatitudeAltitudeString());
8282
8383 kml.println(-1, "</LinearRing>");
8484 }
85
86 public void writeDelete(Kml kml) throws KmlException {
87 kml.println("<LinearRing" + getIdAndTargetIdFormatted(kml) + "></>");
88 }
8985 }
9191 writeInner(kml);
9292 kml.println(-1, "</Link>");
9393 }
94
95 public void writeDelete(Kml kml) throws KmlException {
96 kml.println("<Link" + getIdAndTargetIdFormatted(kml) + "></>");
97 }
9894
9995 protected void writeInner(Kml kml) throws KmlException {
10096 if (href != null) {
6767 }
6868 kml.println(-1, "</ListStyle>");
6969 }
70
71 public void writeDelete(Kml kml) throws KmlException {
72 kml.println("<ListStyle" + getIdAndTargetIdFormatted(kml) + "></>");
73 }
7470 }
2727 }
2828 kml.println(-1, "</LookAt>");
2929 }
30
31 public void writeDelete(Kml kml) throws KmlException {
32 kml.println("<LookAt" + getIdAndTargetIdFormatted(kml) + "></>");
33 }
3430 }
1515 private Double scaleZ;
1616 private Link link;
1717 private List<Alias> resourceMap;
18 private String locationID;
19 private String orientationID;
20 private String scaleID;
1821
1922 public Model() {}
2023
129132 this.resourceMap = resourceMap;
130133 }
131134
135 public String getLocationID() {
136 return locationID;
137 }
138
139 public void setLocationID(String id) {
140 locationID=id;
141 }
142
143 public String getOrientationID() {
144 return orientationID;
145 }
146
147 public void setOrientationID(String id) {
148 orientationID=id;
149 }
150
151 public String getScaleID() {
152 return scaleID;
153 }
154
155 public void setScaleID(String id) {
156 scaleID=id;
157 }
158
132159 public void write(Kml kml) throws KmlException {
133160 kml.println("<Model" + getIdAndTargetIdFormatted(kml) + ">", 1);
134161 if (altitudeMode != null) {
135162 kml.println("<altitudeMode>" + altitudeMode + "</altitudeMode>");
136163 }
137164 if (longitude != null || latitude != null || altitude != null) {
138 kml.println("<Location>", 1);
165 kml.println("<Location"+
166 (locationID==null ? "" : " id=\""+locationID+"\"")
167 +">", 1);
139168 if (longitude != null) {
140169 kml.println("<longitude>" + longitude + "</longitude>");
141170 }
148177 kml.println(-1, "</Location>");
149178 }
150179 if (heading != null || tilt != null || roll != null) {
151 kml.println("<Orientation>", 1);
180 kml.println("<Orientation"
181 +(orientationID==null ? "" : " id=\""+orientationID+"\"")
182 +">", 1);
152183 if (heading != null) {
153184 kml.println("<heading>" + heading + "</heading>");
154185 }
161192 kml.println(-1, "</Orientation>");
162193 }
163194 if (scaleX != null || scaleY != null || scaleZ != null) {
164 kml.println("<Scale>", 1);
195 kml.println("<Scale"
196 +(scaleID==null ? "" : " id=\""+scaleID+"\"")
197 +">", 1);
165198 if (scaleX != null) {
166199 kml.println("<x>" + scaleX + "</x>");
167200 }
185218 }
186219 kml.println(-1, "</Model>");
187220 }
188
189 public void writeDelete(Kml kml) throws KmlException {
190 kml.println("<Model" + getIdAndTargetIdFormatted(kml) + "></>");
191 }
192221 }
2828 }
2929 kml.println(-1, "</MultiGeometry>");
3030 }
31
32 public void writeDelete(Kml kml) throws KmlException {
33 kml.println("<MultiGeometry" + getIdAndTargetIdFormatted(kml) + "></>");
34 }
3531 }
1212
1313 public NetworkLink() {}
1414
15 public NetworkLink(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, Boolean refreshVisability, Boolean flyToView, Link link) {
16 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData);
17 this.refreshVisibility = refreshVisability;
15 public NetworkLink(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, Boolean refreshVisibility, Boolean flyToView, Link link) {
16 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData);
17 this.refreshVisibility = refreshVisibility;
1818 this.flyToView = flyToView;
1919 this.link = link;
2020 }
5757 }
5858 kml.println(-1, "</NetworkLink>");
5959 }
60
61 public void writeDelete(Kml kml) throws KmlException {
62 kml.println("<NetworkLink" + getIdAndTargetIdFormatted(kml) + "></>");
63 }
6460 }
152152 }
153153 kml.println(-1, "</NetworkLinkControl>");
154154 }
155
156 public void writeDelete(Kml kml) throws KmlException {
157 kml.println("<NetworkLinkControl" + getIdAndTargetIdFormatted(kml) + "></>");
158 }
159155 }
1212
1313 public Overlay() {}
1414
15 public Overlay(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, String color, Integer drawOrder, Icon icon) {
16 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData);
15 public Overlay(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, String color, Integer drawOrder, Icon icon) {
16 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData);
1717 this.color = color;
1818 this.drawOrder = drawOrder;
1919 this.icon = icon;
4040 kml.println("<styleUrl>" + styleUrl + "</styleUrl>");
4141 kml.println(-1, "</Pair>");
4242 }
43
44 public void writeDelete(Kml kml) throws KmlException {
45 kml.println("<Pair" + getIdAndTargetIdFormatted(kml) + "></>");
46 }
4743 }
44 import org.boehn.kmlframework.atom.AtomAuthor;
55 import org.boehn.kmlframework.atom.AtomLink;
66
7 public class PhotoOverlay extends Overlay {
7 public class PhotoOverlay extends Overlay
8 {
89
910 private Double rotation;
11
1012 private Double leftFov;
13
1114 private Double rightFov;
15
1216 private Double bottomFov;
17
1318 private Double topFov;
19
1420 private Double near;
21
1522 private Integer tileSize;
23
1624 private Integer maxWidth;
25
1726 private Integer maxHeight;
27
1828 private GridOriginEnum gridOrigin;
29
1930 private Point point;
31
2032 private ShapeEnum shape;
21
22 public PhotoOverlay() {}
23
24 public PhotoOverlay(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, String color, Integer drawOrder, Icon icon, Double rotation, Double leftFov, Double rightFov, Double bottomFov, Double topFov, Double near, Integer tileSize, Integer maxWidth, Integer maxHeight, GridOriginEnum gridOrigin, Point point, ShapeEnum shape) {
25 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, color, drawOrder, icon);
33
34 public PhotoOverlay()
35 {
36 }
37
38 public PhotoOverlay(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor,
39 AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber,
40 String snippet, Integer snippetMaxLines, String description, AbstractView abstractView,
41 TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors,
42 Region region, ExtendedData extendedData, String color, Integer drawOrder, Icon icon,
43 Double rotation, Double leftFov, Double rightFov, Double bottomFov, Double topFov,
44 Double near, Integer tileSize, Integer maxWidth, Integer maxHeight,
45 GridOriginEnum gridOrigin, Point point, ShapeEnum shape)
46 {
47 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails,
48 phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive,
49 styleUrl, styleSelectors, region, extendedData, color, drawOrder, icon);
2650 this.rotation = rotation;
2751 this.leftFov = leftFov;
2852 this.rightFov = rightFov;
3660 this.point = point;
3761 this.shape = shape;
3862 }
39
40 public Double getRotation() {
63
64 public Double getRotation()
65 {
4166 return rotation;
4267 }
4368
44 public void setRotation(Double rotation) {
69 public void setRotation(Double rotation)
70 {
4571 this.rotation = rotation;
4672 }
4773
48 public Double getLeftFov() {
74 public Double getLeftFov()
75 {
4976 return leftFov;
5077 }
5178
52 public void setLeftFov(Double leftFov) {
79 public void setLeftFov(Double leftFov)
80 {
5381 this.leftFov = leftFov;
5482 }
5583
56 public Double getRightFov() {
84 public Double getRightFov()
85 {
5786 return rightFov;
5887 }
5988
60 public void setRightFov(Double rightFov) {
89 public void setRightFov(Double rightFov)
90 {
6191 this.rightFov = rightFov;
6292 }
6393
64 public Double getBottomFov() {
94 public Double getBottomFov()
95 {
6596 return bottomFov;
6697 }
6798
68 public void setBottomFov(Double bottomFov) {
99 public void setBottomFov(Double bottomFov)
100 {
69101 this.bottomFov = bottomFov;
70102 }
71103
72 public Double getTopFov() {
104 public Double getTopFov()
105 {
73106 return topFov;
74107 }
75108
76 public void setTopFov(Double topFov) {
109 public void setTopFov(Double topFov)
110 {
77111 this.topFov = topFov;
78112 }
79113
80 public Double getNear() {
114 public Double getNear()
115 {
81116 return near;
82117 }
83118
84 public void setNear(Double near) {
119 public void setNear(Double near)
120 {
85121 this.near = near;
86122 }
87123
88 public Integer getTileSize() {
124 public Integer getTileSize()
125 {
89126 return tileSize;
90127 }
91128
92 public void setTileSize(Integer tileSize) {
129 public void setTileSize(Integer tileSize)
130 {
93131 this.tileSize = tileSize;
94132 }
95133
96 public Integer getMaxWidth() {
134 public Integer getMaxWidth()
135 {
97136 return maxWidth;
98137 }
99138
100 public void setMaxWidth(Integer maxWidth) {
139 public void setMaxWidth(Integer maxWidth)
140 {
101141 this.maxWidth = maxWidth;
102142 }
103143
104 public Integer getMaxHeight() {
144 public Integer getMaxHeight()
145 {
105146 return maxHeight;
106147 }
107148
108 public void setMaxHeight(Integer maxHeight) {
149 public void setMaxHeight(Integer maxHeight)
150 {
109151 this.maxHeight = maxHeight;
110152 }
111153
112 public GridOriginEnum getGridOrigin() {
154 public GridOriginEnum getGridOrigin()
155 {
113156 return gridOrigin;
114157 }
115158
116 public void setGridOrigin(GridOriginEnum gridOrigin) {
159 public void setGridOrigin(GridOriginEnum gridOrigin)
160 {
117161 this.gridOrigin = gridOrigin;
118162 }
119163
120 public Point getPoint() {
164 public Point getPoint()
165 {
121166 return point;
122167 }
123168
124 public void setPoint(Point point) {
169 public void setPoint(Point point)
170 {
125171 this.point = point;
126172 }
127173
128 public ShapeEnum getShape() {
174 public ShapeEnum getShape()
175 {
129176 return shape;
130177 }
131178
132 public void setShape(ShapeEnum shape) {
179 public void setShape(ShapeEnum shape)
180 {
133181 this.shape = shape;
134182 }
135183
136 public void write(Kml kml) throws KmlException {
184 public void write(Kml kml) throws KmlException
185 {
137186 kml.println("<PhotoOverlay" + getIdAndTargetIdFormatted(kml) + ">", 1);
138187 super.writeInner(kml);
139 if (rotation != null) {
188 if(rotation != null)
189 {
140190 kml.println("<rotation>" + rotation + "</rotation>");
141191 }
142 if (leftFov != null || rightFov != null || bottomFov != null || topFov != null || near != null) {
192 if(leftFov != null || rightFov != null || bottomFov != null || topFov != null
193 || near != null)
194 {
143195 kml.println("<ViewVolume>", 1);
144 if (leftFov != null) {
196 if(leftFov != null)
197 {
145198 kml.println("<leftFov>" + leftFov + "</leftFov>");
146199 }
147 if (rightFov != null) {
200 if(rightFov != null)
201 {
148202 kml.println("<rightFov>" + rightFov + "</rightFov>");
149203 }
150 if (bottomFov != null) {
204 if(bottomFov != null)
205 {
151206 kml.println("<bottomFov>" + bottomFov + "</bottomFov>");
152207 }
153 if (topFov != null) {
208 if(topFov != null)
209 {
154210 kml.println("<topFov>" + topFov + "</topFov>");
155211 }
156 if (near != null) {
212 if(near != null)
213 {
157214 kml.println("<near>" + near + "</near>");
158215 }
159216 kml.println(-1, "</ViewVolume>");
160217 }
161 if (tileSize != null || maxWidth != null || maxHeight != null || gridOrigin != null) {
218 if(tileSize != null || maxWidth != null || maxHeight != null || gridOrigin != null)
219 {
162220 kml.println("<ImagePyramid>", 1);
163 if (tileSize != null) {
221 if(tileSize != null)
222 {
164223 kml.println("<tileSize>" + tileSize + "</tileSize>");
165224 }
166 if (maxWidth != null) {
225 if(maxWidth != null)
226 {
167227 kml.println("<maxWidth>" + maxWidth + "</maxWidth>");
168228 }
169 if (maxHeight != null) {
229 if(maxHeight != null)
230 {
170231 kml.println("<maxHeight>" + maxHeight + "</maxHeight>");
171232 }
172 if (gridOrigin != null) {
233 if(gridOrigin != null)
234 {
173235 kml.println("<gridOrigin>" + gridOrigin + "</gridOrigin>");
174236 }
175237 kml.println(-1, "</ImagePyramid>");
176 if (point != null) {
238 if(point != null)
239 {
177240 point.write(kml);
178241 }
179 if (shape != null) {
242 if(shape != null)
243 {
180244 kml.println("<shape>" + shape + "</shape>");
181245 }
182246 }
183247 kml.println(-1, "</PhotoOverlay>");
184248 }
185
186 public void writeDelete(Kml kml) throws KmlException {
187 kml.println("<PhotoOverlay" + getIdAndTargetIdFormatted(kml) + "></>");
188 }
189 }
249 }
44 import org.boehn.kmlframework.atom.AtomAuthor;
55 import org.boehn.kmlframework.atom.AtomLink;
66
7 public class Placemark extends Feature {
7 public class Placemark extends Feature implements Deletable {
88
99 private Geometry geometry;
1010
1414 setName(name);
1515 }
1616
17 public Placemark(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, Geometry geometry) {
18 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData);
17 public Placemark(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, Geometry geometry) {
18 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData);
1919 this.geometry = geometry;
2020 }
2121
8383 kml.println(-1, "</Point>");
8484 }
8585
86 public void writeDelete(Kml kml) throws KmlException {
87 kml.println("<Point" + getIdAndTargetIdFormatted(kml) + "></>");
88 }
89
9086 public String getLongitudeLatitudeAltitudeString() {
9187 return longitude +"," + latitude + (altitude != null? "," + altitude : "");
9288 }
3939 }
4040 kml.println(-1, "</PolyStyle>");
4141 }
42
43 public void writeDelete(Kml kml) throws KmlException {
44 kml.println("<PolyStyle" + getIdAndTargetIdFormatted(kml) + "></>");
45 }
4642 }
8989 }
9090 kml.println(-1, "</Polygon>");
9191 }
92
93 public void writeDelete(Kml kml) throws KmlException {
94 kml.println("<Polygon" + getIdAndTargetIdFormatted(kml) + "></>");
95 }
9692 }
169169 }
170170 kml.println(-1, "</Region>");
171171 }
172
173 public void writeDelete(Kml kml) throws KmlException {
174 kml.println("<Region" + getIdAndTargetIdFormatted(kml) + "></>");
175 }
176172 }
2828 }
2929 kml.println(-1, "</Schema>");
3030 }
31
32 public void writeDelete(Kml kml) throws KmlException {
33 kml.println("<Schema" + getIdAndTargetIdFormatted(kml) + "></>");
34 }
3531 }
44 import org.boehn.kmlframework.atom.AtomAuthor;
55 import org.boehn.kmlframework.atom.AtomLink;
66
7 public class ScreenOverlay extends Overlay {
7 public class ScreenOverlay extends Overlay implements Deletable {
88
99 private Double overlayX;
1010 private Double overlayY;
2626
2727 public ScreenOverlay() {}
2828
29 public ScreenOverlay(String name, Boolean visability, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, String color, Integer drawOrder, Icon icon, Double overlayX, Double overlayY, UnitEnum overlayXunits, UnitEnum overlayYunits, Double screenX, Double screenY, UnitEnum screenXunits, UnitEnum screenYunits, Double rotationX, Double rotationY, UnitEnum rotationXunits, UnitEnum rotationYunits, Double sizeX, Double sizeY, UnitEnum sizeXunits, UnitEnum sizeYunits, Double rotation) {
30 super(name, visability, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, color, drawOrder, icon);
29 public ScreenOverlay(String name, Boolean visibility, Boolean open, AtomAuthor atomAuthor, AtomLink atomLink, String address, String xalAddressDetails, String phoneNumber, String snippet, Integer snippetMaxLines,String description, AbstractView abstractView, TimePrimitive timePrimitive, String styleUrl, List<StyleSelector> styleSelectors, Region region, ExtendedData extendedData, String color, Integer drawOrder, Icon icon, Double overlayX, Double overlayY, UnitEnum overlayXunits, UnitEnum overlayYunits, Double screenX, Double screenY, UnitEnum screenXunits, UnitEnum screenYunits, Double rotationX, Double rotationY, UnitEnum rotationXunits, UnitEnum rotationYunits, Double sizeX, Double sizeY, UnitEnum sizeXunits, UnitEnum sizeYunits, Double rotation) {
30 super(name, visibility, open, atomAuthor, atomLink, address, xalAddressDetails, phoneNumber, snippet, snippetMaxLines, description, abstractView, timePrimitive, styleUrl, styleSelectors, region, extendedData, color, drawOrder, icon);
3131 this.overlayX = overlayX;
3232 this.overlayY = overlayY;
3333 this.overlayXunits = overlayXunits;
205205 }
206206
207207 public void writeDelete(Kml kml) throws KmlException {
208 kml.println("<ScreenOverlay" + getIdAndTargetIdFormatted(kml) + "></>");
208 kml.println("<ScreenOverlay" + getIdAndTargetIdFormatted(kml) + "></ScreenOverlay>");
209209 }
210210 }
3030 public void write(Kml kml) throws KmlException {
3131 kml.println("<SimpleData name=\"" + name +"\">" + value + "</SimpleData>");
3232 }
33
34 public void writeDelete(Kml kml) throws KmlException {
35 kml.println("<SimpleData" + getIdAndTargetIdFormatted(kml) + "></>");
36 }
3733 }
4444 }
4545 kml.println(-1, "</SimpleField>");
4646 }
47
48 public void writeDelete(Kml kml) throws KmlException {
49 kml.println("<SimpleField" + getIdAndTargetIdFormatted(kml) + "></>");
50 }
51
5247 }
8989 }
9090 kml.println(-1, "</Style>");
9191 }
92
93 public void writeDelete(Kml kml) throws KmlException {
94 kml.println("<Style" + getIdAndTargetIdFormatted(kml) + "></>");
95 }
9692 }
2020 }
2121 kml.println(-1, "</StyleMap>");
2222 }
23
24 public void writeDelete(Kml kml) throws KmlException {
25 kml.println("<StyleMap" + getIdAndTargetIdFormatted(kml) + "></>");
26 }
2723 }
3737 }
3838 kml.println(-1, "</TimeSpan>");
3939 }
40
41 public void writeDelete(Kml kml) throws KmlException {
42 kml.println("<TimeSpan" + getIdAndTargetIdFormatted(kml) + "></>");
43 }
4440 }
2424 }
2525 kml.println(-1, "</TimeStamp>");
2626 }
27
28 public void writeDelete(Kml kml) throws KmlException {
29 kml.println("<TimeStamp" + getIdAndTargetIdFormatted(kml) + "></>");
30 }
3127 }
3636 }
3737 kml.println(-1, "</Update>");
3838 }
39
40 public void writeDelete(Kml kml) throws KmlException {
41 kml.println("<Update" + getIdAndTargetIdFormatted(kml) + "></>");
42 }
4339 }
3232 }
3333 kml.println("</viewFormat>");
3434 }
35
36 public void writeDelete(Kml kml) throws KmlException {
37 kml.println("<viewFormat" + getIdAndTargetIdFormatted(kml) + "></>");
38 }
3935 }