Changeset 30466 in osm for applications/editors/josm/plugins/pointInfo/src
- Timestamp:
- 2014-05-21T22:41:44+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/pointInfo/src/org/openstreetmap/josm/plugins/pointinfo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pointInfo/src/org/openstreetmap/josm/plugins/pointinfo/PointInfoAction.java
r30372 r30466 103 103 @Override 104 104 protected void realRun() throws SAXException { 105 infoSync(pos, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));105 infoSync(pos, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, true)); 106 106 } 107 107 -
applications/editors/josm/plugins/pointInfo/src/org/openstreetmap/josm/plugins/pointinfo/ruianModule.java
r30373 r30466 37 37 import java.io.InputStream; 38 38 import java.io.ByteArrayInputStream; 39 40 import java.text.DecimalFormat; 41 import java.text.DecimalFormatSymbols; 39 42 40 43 import javax.json.Json; … … 74 77 private String m_kraj; 75 78 private String m_psc; 79 private float m_vzdalenost; 76 80 77 81 public addrPlaces () { … … 99 103 m_kraj = ""; 100 104 m_psc = ""; 105 m_vzdalenost = 0; 101 106 } 102 107 … … 177 182 } 178 183 184 public void setVzdalenost (float v) { 185 m_vzdalenost = v; 186 } 187 179 188 public long getRuianID () { 180 189 return m_ruian_id; … … 253 262 } 254 263 264 public String getVzdalenost () { 265 DecimalFormat df = new DecimalFormat("0.00"); 266 return df.format(m_vzdalenost) + "m"; 267 } 268 269 } 270 271 class objectWithoutGeometry { 272 private long m_ruian_id; 273 private int m_podlazi; 274 private int m_byty; 275 private String m_zpusob_vyuziti; 276 private String m_zpusob_vyuziti_kod; 277 private String m_zpusob_vyuziti_key; 278 private String m_zpusob_vyuziti_val; 279 private String m_dokonceni; 280 private String m_plati_od; 281 private float m_vzdalenost; 282 283 public objectWithoutGeometry () { 284 init(); 285 } 286 287 private void init () { 288 m_ruian_id = 0; 289 m_podlazi = 0; 290 m_byty = 0; 291 m_zpusob_vyuziti = ""; 292 m_zpusob_vyuziti_kod = ""; 293 m_zpusob_vyuziti_key = ""; 294 m_zpusob_vyuziti_val = ""; 295 m_dokonceni = ""; 296 m_plati_od = ""; 297 m_vzdalenost = 0; 298 } 299 300 public void setRuianID (long v) { 301 m_ruian_id = v; 302 } 303 304 public void setPodlazi (int v) { 305 m_podlazi = v; 306 } 307 308 public void setByty (int v) { 309 m_byty = v; 310 } 311 312 public void setZpusobVyuziti (String v) { 313 m_zpusob_vyuziti = v; 314 } 315 316 public void setZpusobVyuzitiKod (String v) { 317 m_zpusob_vyuziti_kod = v; 318 } 319 320 public void setZpusobVyuzitiKey (String v) { 321 m_zpusob_vyuziti_key = v; 322 } 323 324 public void setZpusobVyuzitiVal (String v) { 325 m_zpusob_vyuziti_val = v; 326 } 327 328 public void setDokonceni (String v) { 329 m_dokonceni = v; 330 } 331 332 public void setPlatiOd (String v) { 333 m_plati_od = v; 334 } 335 336 public void setVzdalenost (float v) { 337 m_vzdalenost = v; 338 } 339 340 public long getRuianID () { 341 return m_ruian_id; 342 } 343 344 public int getPodlazi () { 345 return m_podlazi; 346 } 347 348 public int getByty () { 349 return m_byty; 350 } 351 352 public String getZpusobVyuziti () { 353 return m_zpusob_vyuziti; 354 } 355 356 public String getZpusobVyuzitiKod () { 357 return m_zpusob_vyuziti_kod; 358 } 359 360 public String getZpusobVyuzitiKey () { 361 return m_zpusob_vyuziti_key; 362 } 363 364 public String getZpusobVyuzitiVal () { 365 return m_zpusob_vyuziti_val; 366 } 367 368 public String getDokonceni () { 369 return m_dokonceni; 370 } 371 372 public String getPlatiOd () { 373 return m_plati_od; 374 } 375 376 public String getVzdalenost () { 377 DecimalFormat df = new DecimalFormat("0.00"); 378 return df.format(m_vzdalenost) + "m"; 379 } 255 380 } 256 381 … … 275 400 private String m_objekt_plati_od; 276 401 402 private ArrayList <objectWithoutGeometry> m_so_bez_geometrie; 403 277 404 private ArrayList <addrPlaces> m_adresni_mista; 278 405 … … 323 450 m_objekt_plati_od = ""; 324 451 452 m_so_bez_geometrie = new ArrayList<objectWithoutGeometry> (); 325 453 m_adresni_mista = new ArrayList<addrPlaces> (); 326 454 … … 446 574 // ========================================================================= 447 575 try { 576 JsonArray arr = obj.getJsonArray("so_bez_geometrie"); 577 578 for(int i = 0; i < arr.size(); i++) 579 { 580 JsonObject soBezGeom = arr.getJsonObject(i); 581 objectWithoutGeometry so = new objectWithoutGeometry(); 582 583 try { 584 so.setRuianID(Long.parseLong(soBezGeom.getString("ruian_id"))); 585 } catch (Exception e) { 586 System.out.println("so_bez_geometrie.ruian_id: " + e.getMessage()); 587 } 588 589 try { 590 so.setPodlazi(Integer.parseInt(soBezGeom.getString("pocet_podlazi"))); 591 } catch (Exception e) { 592 System.out.println("so_bez_geometrie.pocet_podlazi: " + e.getMessage()); 593 } 594 595 try { 596 so.setByty(Integer.parseInt(soBezGeom.getString("pocet_bytu"))); 597 } catch (Exception e) { 598 System.out.println("so_bez_geometrie.pocet_bytu: " + e.getMessage()); 599 } 600 601 try { 602 so.setZpusobVyuziti(soBezGeom.getString("zpusob_vyuziti")); 603 } catch (Exception e) { 604 System.out.println("so_bez_geometrie.zpusob_vyuziti: " + e.getMessage()); 605 } 606 607 try { 608 so.setZpusobVyuzitiKod(soBezGeom.getString("zpusob_vyuziti_kod")); 609 } catch (Exception e) { 610 System.out.println("so_bez_geometrie.zpusob_vyuziti_kod: " + e.getMessage()); 611 } 612 613 try { 614 so.setZpusobVyuzitiKey(soBezGeom.getString("zpusob_vyuziti_key")); 615 } catch (Exception e) { 616 System.out.println("so_bez_geometrie.zpusob_vyuziti_key: " + e.getMessage()); 617 } 618 619 try { 620 so.setZpusobVyuzitiVal(soBezGeom.getString("zpusob_vyuziti_val")); 621 } catch (Exception e) { 622 System.out.println("so_bez_geometrie.zpusob_vyuziti_val: " + e.getMessage()); 623 } 624 625 try { 626 so.setDokonceni(soBezGeom.getString("dokonceni")); 627 } catch (Exception e) { 628 System.out.println("so_bez_geometrie.dokonceni: " + e.getMessage()); 629 } 630 631 try { 632 so.setPlatiOd(soBezGeom.getString("plati_od")); 633 } catch (Exception e) { 634 System.out.println("so_bez_geometrie.plati_od: " + e.getMessage()); 635 } 636 637 try { 638 so.setVzdalenost(Float.parseFloat(soBezGeom.getString("vzdalenost"))); 639 } catch (Exception e) { 640 System.out.println("so_bez_geometrie.vzdalenost: " + e.getMessage()); 641 } 642 643 m_so_bez_geometrie.add(so); 644 } 645 } catch (Exception e) { 646 System.out.println("so_bez_geometrie: " + e.getMessage()); 647 } 648 649 // ========================================================================= 650 try { 448 651 JsonArray arr = obj.getJsonArray("adresni_mista"); 449 652 … … 569 772 } catch (Exception e) { 570 773 System.out.println("adresni_mista.psc: " + e.getMessage()); 774 } 775 776 try { 777 am.setVzdalenost(Float.parseFloat(adresniMisto.getString("vzdalenost"))); 778 } catch (Exception e) { 779 System.out.println("adresni_mista.vzdalenost: " + e.getMessage()); 571 780 } 572 781 … … 879 1088 r.append("<tr><td bgcolor=#e5e5ff>"); 880 1089 if (!m_adresni_mista.get(i).getUlice().isEmpty()) { 1090 r.append(m_adresni_mista.get(i).getVzdalenost()); 1091 r.append("</td><td valign=\"top\" bgcolor=#e5e5ff>"); 881 1092 r.append(m_adresni_mista.get(i).getUlice() + " " + x); 882 1093 r.append("<br/><u>" + m_adresni_mista.get(i).getObec() + "</u>"); … … 887 1098 r.append(" <a href=file://tags.create-on-place/address:"+i+">"+ icon_create_addr_ruian +"</a>"); 888 1099 } else { 1100 r.append(m_adresni_mista.get(i).getVzdalenost()); 1101 r.append("</td><td valign=\"top\" bgcolor=#e5e5ff>"); 889 1102 r.append(m_adresni_mista.get(i).getCastObce() + " " + x + " "); 890 1103 if (!m_adresni_mista.get(i).getCastObce().equals(m_adresni_mista.get(i).getObec())) { … … 901 1114 r.append("</table><br/>"); 902 1115 } 1116 1117 if (m_so_bez_geometrie.size() > 0) { 1118 r.append("<i><u>Budovy bez geometrie v okolí</u></i><br/>"); 1119 r.append("<table>"); 1120 for (int i=0; i<m_so_bez_geometrie.size(); i++) { 1121 r.append("<tr><td bgcolor=#e5e5ff>"); 1122 r.append(m_so_bez_geometrie.get(i).getVzdalenost()); 1123 r.append("</td><td valign=\"top\" bgcolor=#e5e5ff>"); 1124 r.append(m_so_bez_geometrie.get(i).getRuianID()); 1125 if (m_so_bez_geometrie.get(i).getZpusobVyuziti().length() > 0) { 1126 r.append(" - " + m_so_bez_geometrie.get(i).getZpusobVyuziti()); 1127 } 1128 r.append("</td><td valign=\"top\" bgcolor=#e5e5ff>"); 1129 r.append(" <a href="+ url_stavebni_objekt + m_so_bez_geometrie.get(i).getRuianID() + ">"+ icon_ext_link +"</a> "); 1130 r.append(" <a href=file://tags.copy/building>"+ icon_copy_tags +"</a></br>"); 1131 r.append("</td></tr>"); 1132 } 1133 r.append("</table><br/>"); 1134 r.append("<br/>"); 1135 } 1136 903 1137 r.append("<hr/>"); 904 1138 r.append("<center><i><small>Zdroj: <a href=\"http://www.ruian.cz/\">" + m_source + "</a></small></i></center>"); … … 1130 1364 1131 1365 private String m_text = ""; 1132 private String URL = "http://josm.poloha.net/pointInfo/v 2/index.php";1366 private String URL = "http://josm.poloha.net/pointInfo/v3/index.php"; 1133 1367 protected PointInfoServer server = new PointInfoServer(); 1134 1368
Note:
See TracChangeset
for help on using the changeset viewer.