Changeset 22732 in osm for applications/editors/josm/plugins/toms
- Timestamp:
- 2010-08-22T16:56:26+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r22725 r22732 271 271 buoy = new BuoyUkn(this, "active layer contains no OSM data"); 272 272 buoy.setNode(null); 273 buoy.paintSign(); 273 274 return; 274 275 } … … 280 281 buoy = new BuoyUkn(this, "Please select a node"); 281 282 buoy.setNode(null); 283 buoy.paintSign(); 282 284 return; 283 285 } … … 286 288 buoy = new BuoyUkn(this, "Please select only one node"); 287 289 buoy.setNode(null); 290 buoy.paintSign(); 288 291 return; 289 292 } … … 325 328 326 329 if (type.equals("buoy_lateral") || type.equals("beacon_lateral") 327 || keys.containsKey("seamark:buoy_lateral") 328 || keys.containsKey("seamark:beacon_lateral")) { 330 || keys.containsKey("seamark:buoy_lateral:category") 331 || keys.containsKey("seamark:buoy_lateral:shape") 332 || keys.containsKey("seamark:buoy_lateral:colour") 333 || keys.containsKey("seamark:beacon_lateral:category") 334 || keys.containsKey("seamark:beacon_lateral:shape") 335 || keys.containsKey("seamark:beacon_lateral:colour")) { 329 336 buoy = new BuoyLat(this, node); 337 buoy.paintSign(); 330 338 return; 331 339 332 340 } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal") 333 || keys.containsKey("seamark:buoy_cardinal") 334 || keys.containsKey("seamark:beacon_cardinal")) { 341 || keys.containsKey("seamark:buoy_cardinal:category") 342 || keys.containsKey("seamark:buoy_cardinal:shape") 343 || keys.containsKey("seamark:buoy_cardinal:colour") 344 || keys.containsKey("seamark:beacon_cardinal:category") 345 || keys.containsKey("seamark:beacon_cardinal:shape") 346 || keys.containsKey("seamark:beacon_cardinal:colour")) { 335 347 buoy = new BuoyCard(this, node); 348 buoy.paintSign(); 336 349 return; 337 350 338 351 } else if (type.equals("buoy_safe_water") 339 352 || type.equals("beacon_safe_water") 340 || keys.containsKey("seamark:buoy_safe_water") 341 || keys.containsKey("seamark:beacon_safe_water")) { 353 || keys.containsKey("seamark:buoy_safe_water:shape") 354 || keys.containsKey("seamark:buoy_safe_water:colour") 355 || keys.containsKey("seamark:beacon_safe_water:shape") 356 || keys.containsKey("seamark:beacon_safe_water:colour")) { 342 357 buoy = new BuoySaw(this, node); 358 buoy.paintSign(); 343 359 return; 344 360 345 361 } else if (type.equals("buoy_special_purpose") 346 362 || type.equals("beacon_special_purpose") 347 || keys.containsKey("seamark:buoy_special_purpose") 348 || keys.containsKey("seamark:beacon_special_purpose")) { 363 || keys.containsKey("seamark:buoy_special_purpose:shape") 364 || keys.containsKey("seamark:buoy_special_purpose:colour") 365 || keys.containsKey("seamark:beacon_special_purpose:shape") 366 || keys.containsKey("seamark:beacon_special_purpose:colour")) { 349 367 buoy = new BuoySpec(this, node); 368 buoy.paintSign(); 350 369 return; 351 370 352 371 } else if (type.equals("buoy_isolated_danger") 353 372 || type.equals("beacon_isolated_danger") 354 || (keys.containsKey("seamark:buoy_isolated_danger")) 355 || (keys.containsKey("seamark:beacon_isolated_danger"))) { 373 || keys.containsKey("seamark:buoy_isolated_danger:shape") 374 || keys.containsKey("seamark:buoy_isolated_danger:colour") 375 || keys.containsKey("seamark:beacon_isolated_danger:shape") 376 || keys.containsKey("seamark:beacon_isolated_danger:colour")) { 356 377 buoy = new BuoyIsol(this, node); 378 buoy.paintSign(); 357 379 return; 358 380 … … 363 385 || str.equals("red;green;red") || str.equals("green;red;green")) { 364 386 buoy = new BuoyLat(this, node); 387 buoy.paintSign(); 365 388 return; 366 389 } else if (str.equals("black;yellow") … … 368 391 || str.equals("yellow;black;yellow")) { 369 392 buoy = new BuoyCard(this, node); 393 buoy.paintSign(); 370 394 return; 371 395 } else if (str.equals("black;red;black")) { 372 396 buoy = new BuoyIsol(this, node); 397 buoy.paintSign(); 373 398 return; 374 399 } else if (str.equals("red;white")) { 375 400 buoy = new BuoySaw(this, node); 401 buoy.paintSign(); 376 402 return; 377 403 } else if (str.equals("yellow")) { 378 404 buoy = new BuoySaw(this, node); 405 buoy.paintSign(); 379 406 return; 380 407 } else { 381 408 buoy = new BuoyUkn(this, "Parse-Error: Invalid colour"); 382 409 buoy.setNode(node); 383 return; 384 } 385 } else if (keys.containsKey("seamark:light_float:topmark")) { 386 if (keys.containsKey("seamark:light_float:topmark:shape")) { 387 str = keys.get("seamark:light_float:topmark:shape"); 388 if (str.equals("cylinder") || str.equals("cone, point up")) { 389 buoy = new BuoyLat(this, node); 390 return; 391 } 392 } else if (keys.containsKey("seamark:light_float:topmark:colour")) { 393 str = keys.get("seamark:light_float:topmark:colour"); 394 if (str.equals("red") || str.equals("green")) { 395 buoy = new BuoyLat(this, node); 396 return; 397 } 410 buoy.paintSign(); 411 return; 412 } 413 } else if (keys.containsKey("seamark:light_float:topmark:shape")) { 414 str = keys.get("seamark:light_float:topmark:shape"); 415 if (str.equals("cylinder") || str.equals("cone, point up")) { 416 buoy = new BuoyLat(this, node); 417 buoy.paintSign(); 418 return; 419 } 420 } else if (keys.containsKey("seamark:light_float:topmark:colour")) { 421 str = keys.get("seamark:light_float:topmark:colour"); 422 if (str.equals("red") || str.equals("green")) { 423 buoy = new BuoyLat(this, node); 424 buoy.paintSign(); 425 return; 398 426 } 399 427 } … … 403 431 buoy = new BuoyUkn(this, "Seamark not set"); 404 432 buoy.setNode(node); 433 buoy.paintSign(); 405 434 return; 406 435 } … … 556 585 public void actionPerformed(java.awt.event.ActionEvent e) { 557 586 Node n; 558 String name;559 587 int type = cbM01TypeOfMark.getSelectedIndex(); 560 588 561 589 if (buoy == null) { 562 590 buoy = new BuoyUkn(dia, "Seamark not set"); 591 buoy.paintSign(); 563 592 return; 564 593 } … … 568 597 n = buoy.getNode(); 569 598 if (n == null) 570 n = onode; 571 if (n == null) 572 return; 573 name = buoy.getName(); 599 return; 574 600 switch (type) { 575 601 … … 615 641 } 616 642 617 buoy.setNode(n);618 643 buoy.setBuoyIndex(type); 619 644 buoy.refreshStyles(); 620 645 buoy.refreshLights(); 621 buoy.setName(name);622 if (buoy instanceof BuoyLat)623 buoy.setLightColour();624 646 buoy.paintSign(); 625 647 } … … 655 677 tbM01Region.setText("IALA-A"); 656 678 } 657 if (buoy instanceof BuoyLat)658 buoy.setLightColour();659 buoy.paintSign();660 679 } 661 680 }); … … 698 717 699 718 buoy.saveSign(); 700 buoy.paintSign();701 719 } 702 720 }); … … 791 809 public void focusLost(java.awt.event.FocusEvent e) { 792 810 buoy.setName(tfM01Name.getText()); 793 buoy.paintSign();794 811 } 795 812 }); … … 958 975 obuoy = null; 959 976 } 977 buoy.paintSign(); 960 978 } 961 979 }); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r22722 r22732 231 231 dlg.tfM01RepeatTime.setText(LightPeriod); 232 232 233 dlg.tfM01Name.setText(getName()); 234 233 235 if (isFired()) { 234 236 String lp, c; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r22722 r22732 110 110 } else 111 111 setStyleIndex(CARD_BEACON); 112 } else if ( (keys.containsKey("seamark:type") == true)112 } else if (keys.containsKey("seamark:type") 113 113 && (keys.get("seamark:type").equals("light_float"))) { 114 114 setStyleIndex(CARD_FLOAT); … … 148 148 } 149 149 } 150 151 paintSign();152 150 } 153 151 … … 278 276 super.setLightColour("W"); 279 277 } 280 278 281 279 public void saveSign() { 282 280 Node node = getNode(); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r22722 r22732 46 46 setTopMark(true); 47 47 48 if (keys.containsKey("name")) 49 setName(keys.get("name")); 50 51 if (keys.containsKey("seamark:name")) 52 setName(keys.get("seamark:name")); 53 54 if (keys.containsKey("seamark:buoy_isolated_danger:name")) 55 setName(keys.get("seamark:buoy_isolated_danger:name")); 56 else if (keys.containsKey("seamark:beacon_isolated_danger:name")) 57 setName(keys.get("seamark:beacon_isolated_danger:name")); 58 else if (keys.containsKey("seamark:light_float:name")) 59 setName(keys.get("seamark:light_float:name")); 60 48 61 if (keys.containsKey("seamark:buoy_isolated_danger:shape")) { 49 62 str = keys.get("seamark:buoy_isolated_danger:shape"); … … 63 76 } else 64 77 setStyleIndex(ISOL_BEACON); 65 } else if ( (keys.containsKey("seamark:type") == true)78 } else if (keys.containsKey("seamark:type") 66 79 && (keys.get("seamark:type").equals("light_float"))) { 67 80 setStyleIndex(CARD_FLOAT); … … 90 103 } 91 104 } 92 93 paintSign();94 105 } 95 106 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r22722 r22732 219 219 } else 220 220 setStyleIndex(LAT_BEACON); 221 } else if ( (keys.containsKey("seamark:type") == true)221 } else if (keys.containsKey("seamark:type") 222 222 && (keys.get("seamark:type").equals("light_float"))) { 223 223 setStyleIndex(LAT_FLOAT); … … 266 266 setLightPeriod(keys); 267 267 } 268 269 paintSign();270 268 } 271 269 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r22722 r22732 46 46 setLightColour("W"); 47 47 setBuoyIndex(SAFE_WATER); 48 49 if (keys.containsKey("name")) 50 setName(keys.get("name")); 51 52 if (keys.containsKey("seamark:name")) 53 setName(keys.get("seamark:name")); 54 55 if (keys.containsKey("seamark:buoy_safe_water:name")) 56 setName(keys.get("seamark:buoy_safe_water:name")); 57 else if (keys.containsKey("seamark:beacon_safe_water:name")) 58 setName(keys.get("seamark:beacon_safe_water:name")); 59 else if (keys.containsKey("seamark:light_float:name")) 60 setName(keys.get("seamark:light_float:name")); 48 61 49 62 if (keys.containsKey("seamark:buoy_safe_water:shape")) { … … 89 102 } 90 103 } 91 92 paintSign();93 104 } 94 105 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r22725 r22732 16 16 17 17 public class BuoySpec extends Buoy { 18 public BuoySpec(SmpDialogAction dia, 18 public BuoySpec(SmpDialogAction dia, Node node) { 19 19 super(dia); 20 20 … … 56 56 setBuoyIndex(SPECIAL_PURPOSE); 57 57 58 if (keys.containsKey("name")) 59 setName(keys.get("name")); 60 61 if (keys.containsKey("seamark:name")) 62 setName(keys.get("seamark:name")); 63 64 if (keys.containsKey("seamark:buoy_special_purpose:name")) 65 setName(keys.get("seamark:buoy_special_purpose:name")); 66 else if (keys.containsKey("seamark:beacon_special_purpose:name")) 67 setName(keys.get("seamark:beacon_special_purpose:name")); 68 else if (keys.containsKey("seamark:light_float:name")) 69 setName(keys.get("seamark:light_float:name")); 70 58 71 if (keys.containsKey("seamark:buoy_special_purpose:shape")) { 59 72 str = keys.get("seamark:buoy_special_purpose:shape"); … … 69 82 } 70 83 71 if (keys.containsKey("seamark:beacon_special_purpose")) 84 if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals( 85 "beacon_special_purpose")) 86 || keys.containsKey("seamark:special_purpose_beacon:colour") 87 || keys.containsKey("seamark:special_purpose_beacon:shape")) 72 88 setStyleIndex(SPEC_BEACON); 73 else if (keys.containsKey("seamark:light_float") 74 && keys.containsKey("seamark:light_float:colour") 89 else if (keys.containsKey("seamark:light_float:colour") 75 90 && keys.get("seamark:light_float:colour").equals("yellow")) 76 91 setStyleIndex(SPEC_FLOAT); … … 104 119 } 105 120 } 106 107 paintSign();108 121 } 109 122 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyUkn.java
r22722 r22732 31 31 setValid(false); 32 32 setBuoyIndex(0); 33 34 paintSign();35 33 } 36 34
Note:
See TracChangeset
for help on using the changeset viewer.