Changeset 15584 in osm for applications/editors
- Timestamp:
- 2009-06-04T01:11:51+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/czechaddress
- Files:
-
- 3 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/PrimUtils.java
r15582 r15584 1 /*2 * To change this template, choose Tools | Templates3 * and open the template in the editor.4 */5 6 1 package org.openstreetmap.josm.plugins.czechaddress; 7 2 … … 10 5 11 6 /** 12 * 7 * Utilities for handling {@link OsmPrimitive}s. 8 * 13 9 * @author Radomír Černoch, radomir.cernoch@gmail.com 14 10 */ … … 45 41 46 42 int val = o1.get(key).compareTo(o2.get(key)); 47 if (val != 0) { 48 return val; 49 } 43 if (val != 0) return val; 50 44 } 51 45 52 return o1.toString().compareTo(o2.toString()); 46 /*int val = o1.toString().compareTo(o2.toString()); 47 if (val != 0) return val;*/ 53 48 54 /*LatLon pos1 = null; 55 LatLon pos2 = null; 56 if (o1 instanceof Node) pos1 = ((Node) o1).coor; 57 if (o1 instanceof Way) pos1 = ((Way) o1).lastNode().coor; 58 if (o2 instanceof Node) pos1 = ((Node) o2).coor; 59 if (o2 instanceof Way) pos1 = ((Way) o2).lastNode().coor; 60 61 if (pos1 != null && pos2 != null) { 62 if (pos1.lat() < pos2.lat()) return -1; 63 if (pos1.lat() > pos2.lat()) return 1; 64 if (pos1.lon() < pos2.lon()) return -1; 65 if (pos1.lon() > pos2.lon()) return 1; 66 }*/ 49 return o1.compareTo(o2); 67 50 } 68 51 }; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/AddressElement.java
r15582 r15584 5 5 import org.openstreetmap.josm.data.osm.OsmPrimitive; 6 6 import org.openstreetmap.josm.data.osm.Way; 7 import org.openstreetmap.josm.plugins.czechaddress.PrimUtils; 7 8 import org.openstreetmap.josm.plugins.czechaddress.StringUtils; 8 9 import org.openstreetmap.josm.plugins.czechaddress.intelligence.Reasoner; … … 61 62 62 63 public static String getName(OsmPrimitive prim) { 63 String cp = prim.get( "addr:alternatenumber");64 String co = prim.get( "addr:housenumber");65 String street = prim.get( "addr:street");66 String city = prim.get( "addr:city");67 String name = prim.get( "name");64 String cp = prim.get(PrimUtils.KEY_ADDR_CP); 65 String co = prim.get(PrimUtils.KEY_ADDR_CO); 66 String street = prim.get(PrimUtils.KEY_ADDR_STREET); 67 String city = prim.get(PrimUtils.KEY_ADDR_CITY); 68 String name = prim.get(PrimUtils.KEY_NAME); 68 69 69 70 String result = ""; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
r15582 r15584 14 14 import org.openstreetmap.josm.plugins.czechaddress.CzechAddressPlugin; 15 15 import org.openstreetmap.josm.plugins.czechaddress.NotNullList; 16 import org.openstreetmap.josm.plugins.czechaddress.PrimUtils; 16 17 import org.openstreetmap.josm.plugins.czechaddress.StatusListener; 17 18 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.AddressElement; … … 68 69 matchesComboBox.setRenderer(new UniversalListRenderer()); 69 70 70 if (primitive.get( "addr:alternatenumber") != null) {71 alternateNumberEdit.setText(primitive.get( "addr:alternatenumber"));71 if (primitive.get(PrimUtils.KEY_ADDR_CP) != null) { 72 alternateNumberEdit.setText(primitive.get(PrimUtils.KEY_ADDR_CP)); 72 73 updateMatches(); 73 74 } … … 133 134 r.openTransaction(); 134 135 prim.keys = null; 135 prim.put( "addr:alternatenumber", alternateNumberEdit.getText());136 prim.put(PrimUtils.KEY_ADDR_CP, alternateNumberEdit.getText()); 136 137 r.update(prim); 137 138 elems.addAll(r.getCandidates(prim)); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ProposalContainer.java
r15582 r15584 181 181 @Override 182 182 public String toString() { 183 /*if (target.keySet().contains("name"))184 return target.get("name");185 186 if ( target.keySet().contains("addr:alternatenumber")187 || target.keySet().contains("addr:housenumber")) {188 189 String cp = target.get("addr:alternatenumber");190 String co = target.get("addr:housenumber");191 String ul = target.get("addr:street");192 193 if (cp == null) cp = "?";194 if (co == null) co = "?";195 if (ul == null) ul = "" ; else ul = " " + ul;196 197 return "Dům " + String.valueOf(cp) + "/" + String.valueOf(co) + ul;198 }*/199 200 183 return target.toString(); 201 184 }
Note:
See TracChangeset
for help on using the changeset viewer.