Codebase list libkmlframework-java / e7ccea7
Added the Location and Orientation types to allow dynamic updating of these within a Model. Updownquark 13 years ago
2 changed file(s) with 98 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 /*
1 * Location.java Created Oct 13, 2010 by Andrew Butler, PSL
2 */
3 package org.boehn.kmlframework.kml;
4
5 public class Location extends KmlObject
6 {
7 private Double latitude;
8 private Double longitude;
9 private Double altitude;
10
11 public Location() {
12 }
13
14 public Double getLongitude() {
15 return longitude;
16 }
17
18 public void setLongitude(Double longitude) {
19 this.longitude = longitude;
20 }
21
22 public Double getLatitude() {
23 return latitude;
24 }
25
26 public void setLatitude(Double latitude) {
27 this.latitude = latitude;
28 }
29
30 public Double getAltitude() {
31 return altitude;
32 }
33
34 public void setAltitude(Double altitude) {
35 this.altitude = altitude;
36 }
37
38 public void write(Kml kml) throws KmlException {
39 kml.println("<Location" + getIdAndTargetIdFormatted(kml) + ">", 1);
40 if(latitude!=null)
41 kml.println("<latitude>"+latitude+"</latitude>");
42 if(longitude!=null)
43 kml.println("<longitude>"+longitude+"</longitude>");
44 if(altitude!=null)
45 kml.println("<altitude>"+altitude+"</altitude>");
46 kml.println(-1, "</Location>");
47 }
48 }
0 /*
1 * Location.java Created Oct 13, 2010 by Andrew Butler, PSL
2 */
3 package org.boehn.kmlframework.kml;
4
5 public class Orientation extends KmlObject
6 {
7 private Double heading;
8 private Double tilt;
9 private Double roll;
10
11 public Orientation() {
12 }
13
14 public Double getHeading() {
15 return heading;
16 }
17
18 public void setHeading(Double heading) {
19 this.heading = heading;
20 }
21
22 public Double getTilt() {
23 return tilt;
24 }
25
26 public void setTilt(Double tilt) {
27 this.tilt = tilt;
28 }
29
30 public Double getRoll() {
31 return roll;
32 }
33
34 public void setRoll(Double roll) {
35 this.roll = roll;
36 }
37
38 public void write(Kml kml) throws KmlException {
39 kml.println("<Orientation" + getIdAndTargetIdFormatted(kml) + ">", 1);
40 if(heading!=null)
41 kml.println("<heading>"+heading+"</heading>");
42 if(tilt!=null)
43 kml.println("<tilt>"+tilt+"</tilt>");
44 if(roll!=null)
45 kml.println("<roll>"+roll+"</roll>");
46 kml.println(-1, "</Orientation>");
47 }
48 }