Changeset 2931 in josm for trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
- Timestamp:
- 03.02.2010 09:48:51 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r2904 r2931 18 18 19 19 final public class ImageEntry implements Comparable<ImageEntry>, Cloneable { 20 File file; 21 Date time; 22 LatLon exifCoor; 20 private File file; 21 private LatLon exifCoor; 22 private Date exifTime; 23 Image thumbnail; 23 24 25 /** The following values are computed from the correlation with the gpx track */ 24 26 private CachedLatLon pos; 25 27 /** Speed in kilometer per second */ … … 27 29 /** Elevation (altitude) in meters */ 28 30 private Double elevation; 29 30 Image thumbnail;31 /** The time after correlation with a gpx track */ 32 private Date gpsTime; 31 33 32 34 /** … … 40 42 ImageEntry tmp; 41 43 44 /** 45 * getter methods that refer to the temporary value 46 */ 42 47 public CachedLatLon getPos() { 43 48 if (tmp != null) … … 55 60 return elevation; 56 61 } 62 public Date getGpsTime() { 63 if (tmp != null) 64 return tmp.gpsTime; 65 return gpsTime; 66 } 67 68 /** 69 * other getter methods 70 */ 71 public File getFile() { 72 return file; 73 } 74 public Date getExifTime() { 75 return exifTime; 76 } 77 LatLon getExifCoor() { 78 return exifCoor; 79 } 80 /** 81 * setter methods 82 */ 57 83 public void setPos(CachedLatLon pos) { 58 84 this.pos = pos; 85 } 86 public void setPos(LatLon pos) { 87 this.pos = new CachedLatLon(pos); 59 88 } 60 89 public void setSpeed(Double speed) { … … 64 93 this.elevation = elevation; 65 94 } 66 67 public File getFile() { 68 return file; 95 void setFile(File file) { 96 this.file = file; 97 } 98 void setExifTime(Date exifTime) { 99 this.exifTime = exifTime; 100 } 101 void setGpsTime(Date gpsTime) { 102 this.gpsTime = gpsTime; 103 } 104 void setExifCoor(LatLon exifCoor) { 105 this.exifCoor = exifCoor; 69 106 } 70 107 … … 80 117 } 81 118 82 public void setCoor(LatLon latlon)83 {84 pos = new CachedLatLon(latlon);85 }86 87 119 public int compareTo(ImageEntry image) { 88 if ( time != null && image.time != null)89 return time.compareTo(image.time);90 else if ( time == null && image.time == null)120 if (exifTime != null && image.exifTime != null) 121 return exifTime.compareTo(image.exifTime); 122 else if (exifTime == null && image.exifTime == null) 91 123 return 0; 92 else if ( time == null)124 else if (exifTime == null) 93 125 return -1; 94 126 else … … 96 128 } 97 129 98 public void applyTmp() { 99 if (tmp != null) { 100 pos = tmp.pos; 101 speed = tmp.speed; 102 elevation = tmp.elevation; 103 tmp = null; 104 } 105 } 130 /** 131 * Make a fresh copy and save it in the temporary variable. 132 */ 106 133 public void cleanTmp() { 107 134 tmp = clone(); … … 110 137 } 111 138 139 /** 140 * Copy the values from the temporary variable to the main instance. 141 */ 142 public void applyTmp() { 143 if (tmp != null) { 144 pos = tmp.pos; 145 speed = tmp.speed; 146 elevation = tmp.elevation; 147 gpsTime = tmp.gpsTime; 148 tmp = null; 149 } 150 } 151 152 /** 153 * If it has been tagged i.e. matched to a gpx track or retrieved lat/lon from exif 154 */ 112 155 public boolean isTagged() { 113 156 return pos != null; … … 115 158 116 159 /** 117 * only partial info160 * String representation. (only partial info) 118 161 */ 119 162 @Override
Note: See TracChangeset
for help on using the changeset viewer.
