Changeset 30353 in osm for applications/editors/josm/plugins/measurement/src/org/openstreetmap
- Timestamp:
- 2014-03-24T22:03:31+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java
r30104 r30353 88 88 89 89 resetButton = new SideButton(new AbstractAction() { 90 91 92 93 94 95 90 { 91 putValue(NAME, tr("Reset")); 92 putValue(SMALL_ICON,ImageProvider.get("dialogs", "select")); 93 putValue(SHORT_DESCRIPTION, tr("Reset current measurement results and delete measurement path.")); 94 putValue("help", HelpUtil.ht("/Dialog/Measurement#Reset")); 95 } 96 96 @Override 97 97 public void actionPerformed(ActionEvent e) 98 98 { 99 99 resetValues(); 100 100 } 101 101 }); … … 222 222 ds = currentDs; 223 223 } 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 224 } 225 226 @Override 227 public void destroy() { 228 super.destroy(); 229 NavigatableComponent.removeSoMChangeListener(this); 230 DataSet.removeSelectionListener(this); 231 if (ds != null) { 232 ds.removeDataSetListener(this); 233 ds = null; 234 } 235 } 236 237 private boolean waysContain(Node n) { 238 if (ways != null) { 239 for (Way w : ways) { 240 if (w.containsNode(n)) { 241 return true; 242 } 243 } 244 } 245 return false; 246 } 247 248 248 @Override public void nodeMoved(NodeMovedEvent event) { 249 249 Node n = event.getNode(); … … 262 262 @Override public void dataChanged(DataChangedEvent event) {} 263 263 264 265 266 267 268 264 @Override 265 public void systemOfMeasurementChanged(String oldSoM, String newSoM) { 266 // Refresh selection to take into account new system of measurement 267 selectionChanged(Main.main.getCurrentDataSet().getSelected()); 268 } 269 269 } -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java
r29578 r30353 144 144 } 145 145 146 146 /* 147 147 * Use an equal area sinusoidal projection to improve accuracy and so we can still use normal polygon area calculation 148 * http ://stackoverflow.com/questions/4681737/how-to-calculate-the-area-of-a-polygon-on-the-earths-surface-using-python148 * https://stackoverflow.com/questions/4681737/how-to-calculate-the-area-of-a-polygon-on-the-earths-surface-using-python 149 149 */ 150 150 public static double calcX(LatLon p1){ 151 151 return p1.lat() * Math.PI * 6367000 / 180; 152 152 } 153 153 154 154 public static double calcY(LatLon p1){ -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java
r28624 r30353 32 32 newFrame.addMapMode(btn); 33 33 } else { 34 35 36 34 btn = null; 35 mode = null; 36 measurementDialog = null; 37 37 } 38 38 }
Note:
See TracChangeset
for help on using the changeset viewer.