Changeset 6 in josm for src/org/openstreetmap/josm/data
- Timestamp:
- 2005-10-01T04:01:45+02:00 (20 years ago)
- Location:
- src/org/openstreetmap/josm/data
- Files:
-
- 7 edited
-
GeoPoint.java (modified) (2 diffs)
-
Preferences.java (modified) (4 diffs)
-
osm/DataSet.java (modified) (1 diff)
-
osm/Node.java (modified) (1 diff)
-
osm/OsmPrimitive.java (modified) (1 diff)
-
projection/Projection.java (modified) (1 diff)
-
projection/UTM.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/data/GeoPoint.java
r1 r6 1 1 package org.openstreetmap.josm.data; 2 2 3 3 4 /** … … 44 45 return null; 45 46 } 47 48 /** 49 * GeoPoints are equal, if their lat/lon are equal or, if lat or lon are NaN, 50 * if their x/y are equal. 51 */ 52 @Override 53 public boolean equals(Object obj) { 54 if (!(obj instanceof GeoPoint)) 55 return false; 56 GeoPoint gp = (GeoPoint)obj; 57 58 if (Double.isNaN(lat) || Double.isNaN(lon)) 59 return x == gp.x && y == gp.y; 60 return lat == gp.lat && lon == gp.lon; 61 } 62 63 @Override 64 public int hashCode() { 65 return super.hashCode(); 66 } 67 68 46 69 } -
src/org/openstreetmap/josm/data/Preferences.java
r1 r6 4 4 import java.io.FileReader; 5 5 import java.io.FileWriter; 6 import java.util.List; 6 7 7 8 import javax.swing.UIManager; … … 34 35 public Projection projection = new UTM(); 35 36 37 36 38 /** 37 * The monitor geometry in meter per pixel. (How big is 1 pixel in meters) 38 * Example: 17" Sony flatscreen in 1280x1024 mode: 0.000264 ppm 39 * 40 * Remember: ppm = dpi/25400 39 * Whether nodes on the same place should be considered identical. 41 40 */ 42 public double ppm = 0.000264; 41 public boolean mergeNodes = true; 42 43 43 44 44 45 /** 46 * List of all available Projections. 47 */ 45 48 public static final Projection[] allProjections = new Projection[]{ 46 49 new UTM(), … … 85 88 86 89 projection = (Projection)Class.forName(root.getChildText("projection")).newInstance(); 90 mergeNodes = root.getChild("mergeNodes") != null; 87 91 } catch (Exception e) { 88 92 if (e instanceof PreferencesException) … … 100 104 Element root = new Element("josm-settings"); 101 105 102 root.getChildren().add(new Element("laf").setText(laf.getClassName())); 103 root.getChildren().add(new Element("projection").setText(projection.getClass().getName())); 106 List children = root.getChildren(); 107 children.add(new Element("laf").setText(laf.getClassName())); 108 children.add(new Element("projection").setText(projection.getClass().getName())); 109 if (mergeNodes) 110 children.add(new Element("mergeNodes")); 104 111 105 112 try { -
src/org/openstreetmap/josm/data/osm/DataSet.java
r2 r6 119 119 } 120 120 121 @Override 121 122 public DataSet clone() { 122 123 try {return (DataSet)super.clone();} catch (CloneNotSupportedException e) {} -
src/org/openstreetmap/josm/data/osm/Node.java
r1 r6 15 15 */ 16 16 public GeoPoint coor; 17 18 /** 19 * Nodes are equal when their coordinates are equal. 20 */ 21 @Override 22 public boolean equals(Object obj) { 23 if (!(obj instanceof Node)) 24 return false; 25 Node n = (Node)obj; 26 if (coor == null) 27 return n.coor == null; 28 return coor.equals(n.coor) && super.equals(obj); 29 } 30 31 /** 32 * Compute the hashcode from the OsmPrimitive's hash and the coor's hash. 33 */ 34 @Override 35 public int hashCode() { 36 return (coor == null ? 0 : coor.hashCode()) + super.hashCode(); 37 } 38 39 17 40 } -
src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2 r6 20 20 * If set to true, this object has been modified in the current session. 21 21 */ 22 public boolean modified = false; 22 transient public boolean modified = false; 23 23 24 24 /** 25 25 * If set to true, this object is currently selected. 26 26 */ 27 public boolean selected = false; 27 transient public boolean selected = false; 28 29 /** 30 * Osm primitives are equal, when their keys are equal. 31 */ 32 @Override 33 public boolean equals(Object obj) { 34 if (obj == null) 35 return false; 36 if (!(obj instanceof OsmPrimitive)) 37 return false; 38 OsmPrimitive osm = (OsmPrimitive)obj; 39 if (keys == null) 40 return osm.keys == null; 41 return keys.equals(osm.keys); 42 } 43 44 /** 45 * Compute the hashCode from the keys. 46 */ 47 @Override 48 public int hashCode() { 49 return keys == null ? 0 : keys.hashCode(); 50 } 51 52 28 53 } -
src/org/openstreetmap/josm/data/projection/Projection.java
r1 r6 45 45 * Describe the projection converter in one or two words. 46 46 */ 47 @Override 47 48 abstract public String toString(); 48 49 -
src/org/openstreetmap/josm/data/projection/UTM.java
r1 r6 49 49 this.ecc_squared = ecc_squared; 50 50 } 51 @Override 51 52 public String toString() { 52 53 return name;
Note:
See TracChangeset
for help on using the changeset viewer.
