Changeset 22561 in osm for applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
- Timestamp:
- 2010-08-04T10:41:59+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r22557 r22561 347 347 } 348 348 349 if (keys.containsKey("seamark:buoy_lateral:category") == true) { 349 if ((keys.containsKey("seamark:buoy_lateral:category") == true) 350 || (keys.containsKey("seamark:beacon_lateral:category") == true)) { 350 351 351 352 buoy = null; // Prototyp der Lateraltonne … … 353 354 String cat; // Kathegorie 354 355 355 if (keys.containsKey("seamark:buoy_lateral:colour") == false) { 356 if ((keys.containsKey("seamark:buoy_lateral:colour") == false) 357 && (keys.containsKey("seamark:beacon_lateral:colour") == false)) { 356 358 buoy = new BuoyUkn(this, "Parse-Error: Buoy without colour"); 357 359 buoy.setNode(node); … … 359 361 } 360 362 361 if (keys.containsKey("seamark:buoy_lateral:name")) 362 if (name.compareTo("") == 0) { 363 // name nur ueberschreiben, wenn nicht anderweitig gesetzt 363 if (name.compareTo("") == 0) { 364 if (keys.containsKey("seamark:buoy_lateral:name")) 364 365 name = keys.get("seamark:buoy_lateral:name"); 365 366 } 367 368 str = keys.get("seamark:buoy_lateral:colour"); 369 cat = keys.get("seamark:buoy_lateral:category"); 366 if (keys.containsKey("seamark:beacon_lateral:name")) 367 name = keys.get("seamark:beacon_lateral:name"); 368 } 369 370 if (keys.containsKey("seamark:buoy_lateral:category") == true) { 371 str = keys.get("seamark:buoy_lateral:colour"); 372 cat = keys.get("seamark:buoy_lateral:category"); 373 } else { 374 str = keys.get("seamark:beacon_lateral:colour"); 375 cat = keys.get("seamark:beacon_lateral:category"); 376 } 370 377 371 378 if (cat.compareTo("port") == 0) { … … 400 407 401 408 buoy = new BuoyLat(this, SeaMark.PREF_PORT_HAND); 402 if (str.compareTo("red;green;red") == 0 403 || str.compareTo("red-green-red") == 0) { 409 if (str.compareTo("red;green;red") == 0) { 404 410 buoy.setRegion(SeaMark.IALA_A); 405 411 buoy.setColour(SeaMark.RED_GREEN_RED); … … 416 422 417 423 buoy = new BuoyLat(this, SeaMark.PREF_STARBOARD_HAND); 418 if (str.compareTo("green;red;green") == 0 419 || str.compareTo("green-red-green") == 0) { 424 if (str.compareTo("green;red;green") == 0) { 420 425 buoy.setRegion(SeaMark.IALA_A); 421 426 buoy.setColour(SeaMark.GREEN_RED_GREEN); … … 466 471 // true) 467 472 // Test auf Kardinal- 468 if (keys.containsKey("seamark:buoy_cardinal:category") == true) { 473 if ((keys.containsKey("seamark:buoy_cardinal:category") == true) 474 || (keys.containsKey("seamark:beacon_cardinal:category") == true)) { 469 475 470 476 buoy = null; // Prototyp der Kardinaltonne … … 472 478 String cat; // Kathegorie 473 479 474 if (keys.containsKey("seamark:buoy_cardinal:colour") == false) { 475 buoy = new BuoyUkn(this, "Parse-Error: Tonne ohne Farbe"); 480 if ((keys.containsKey("seamark:buoy_cardinal:colour") == false) 481 && (keys.containsKey("seamark:beacon_cardinal:colour") == false)) { 482 buoy = new BuoyUkn(this, "Parse-Error: No colour set"); 476 483 buoy.setNode(node); 477 484 return; 478 485 } 479 486 480 if (keys.containsKey("seamark:buoy_cardinal:name")) 481 if (name.compareTo("") == 0) { 482 // name nur ueberschreiben, wenn nicht anderweitig gesetzt 487 if (name.compareTo("") == 0) { 488 if (keys.containsKey("seamark:buoy_cardinal:name")) 483 489 name = keys.get("seamark:buoy_lateral:name"); 484 } 485 486 str = keys.get("seamark:buoy_cardinal:colour"); 487 cat = keys.get("seamark:buoy_cardinal:category"); 490 if (keys.containsKey("seamark:beacon_cardinal:name")) 491 name = keys.get("seamark:beacon_lateral:name"); 492 } 493 494 if (keys.containsKey("seamark:buoy_cardinal:category") == true) { 495 str = keys.get("seamark:buoy_cardinal:colour"); 496 cat = keys.get("seamark:buoy_cardinal:category"); 497 } else { 498 str = keys.get("seamark:beacon_cardinal:colour"); 499 cat = keys.get("seamark:beacon_cardinal:category"); 500 } 488 501 489 502 // Test auf Kardinaltonne Nord 490 if (str.compareTo("black;yellow") == 0 491 || str.compareTo("black-yellow") == 0) { 503 if (str.compareTo("black;yellow") == 0) { 492 504 493 505 buoy = new BuoyCard(this, SeaMark.CARD_NORTH); … … 501 513 502 514 // Test auf Kardinaltonne Ost 503 if (str.compareTo("black;yellow;black") == 0 504 || str.compareTo("black-yellow-black") == 0) { 515 if (str.compareTo("black;yellow;black") == 0) { 505 516 506 517 buoy = new BuoyCard(this, SeaMark.CARD_EAST); … … 514 525 515 526 // Test auf Kardinaltonne Sued 516 if (str.compareTo("yellow;black") == 0 517 || str.compareTo("yellow-black") == 0) { 527 if (str.compareTo("yellow;black") == 0) { 518 528 519 529 buoy = new BuoyCard(this, SeaMark.CARD_SOUTH); … … 527 537 528 538 // Test auf Kardinaltonne West 529 if (str.compareTo("yellow;black;yellow") == 0 530 || str.compareTo("yellow-black-yellow") == 0) { 539 if (str.compareTo("yellow;black;yellow") == 0) { 531 540 532 541 buoy = new BuoyCard(this, SeaMark.CARD_WEST); … … 571 580 } 572 581 573 // Test auf Ansteuertonne (buoy_safewater582 // Test buoy_safewater 574 583 if (keys.containsKey("seamark:buoy_safewater:shape") == true) { 575 584 576 585 if (keys.containsKey("seamark:buoy_safewater:colour") == false) { 577 buoy = new BuoyUkn(this, "Parse-Error: Tonne ohne Farbe");586 buoy = new BuoyUkn(this, "Parse-Error: No colour set"); 578 587 buoy.setNode(node); 579 588 return; … … 582 591 str = keys.get("seamark:buoy_safewater:colour"); 583 592 if (str.compareTo("red;white") != 0) { 584 buoy = new BuoyUkn(this, "Parse-Error: Tonne mit falscher Farbe");593 buoy = new BuoyUkn(this, "Parse-Error: Invalid colour"); 585 594 buoy.setNode(node); 586 595 return; 587 596 } 588 597 598 buoy = new BuoySaw(this, SeaMark.SAFE_WATER); 589 599 buoy.setName(name); 590 600 buoy.setColour(SeaMark.RED_WHITE); 601 602 if (buoy.parseTopMark(node) == false) { 603 str = buoy.getErrMsg(); 604 if (str == null) 605 buoy.setValid(false); 606 } 607 608 if (buoy.parseLight(node) == false) { 609 str = buoy.getErrMsg(); 610 if (str == null) 611 buoy.setValid(false); 612 } 613 614 if (buoy.parseShape(node) == false) { 615 str = buoy.getErrMsg(); 616 if (str == null) 617 buoy = new BuoyUkn(this, str); 618 buoy.setNode(node); 619 return; 620 } 621 622 buoy.setValid(true); 623 buoy.setNode(node); 624 buoy.setBuoyIndex(5); 625 cbM01StyleOfMark.setSelectedIndex(buoy.getStyleIndex()); 626 buoy.paintSign(); 627 628 return; 629 630 } 631 632 // Test buoy_special_purpose 633 if (keys.containsKey("seamark:buoy_special_purpose:shape") == true) { 634 635 if (keys.containsKey("seamark:buoy_special_purpose:colour") == false) { 636 buoy = new BuoyUkn(this, "Parse-Error: No colour set"); 637 buoy.setNode(node); 638 return; 639 } 640 641 str = keys.get("seamark:buoy_special_purpose:colour"); 642 if (str.compareTo("yellow") != 0) { 643 buoy = new BuoyUkn(this, "Parse-Error: Invalid colour"); 644 buoy.setNode(node); 645 return; 646 } 647 648 buoy = new BuoySpec(this, SeaMark.SPECIAL_PURPOSE); 649 buoy.setName(name); 650 buoy.setColour(SeaMark.YELLOW); 651 652 if (buoy.parseTopMark(node) == false) { 653 str = buoy.getErrMsg(); 654 if (str == null) 655 buoy.setValid(false); 656 } 657 658 if (buoy.parseLight(node) == false) { 659 str = buoy.getErrMsg(); 660 if (str == null) 661 buoy.setValid(false); 662 } 663 664 if (buoy.parseShape(node) == false) { 665 str = buoy.getErrMsg(); 666 if (str == null) 667 buoy = new BuoyUkn(this, str); 668 buoy.setNode(node); 669 return; 670 } 671 672 buoy.setValid(true); 673 buoy.setNode(node); 674 buoy.setBuoyIndex(5); 675 cbM01StyleOfMark.setSelectedIndex(buoy.getStyleIndex()); 676 buoy.paintSign(); 677 678 return; 679 680 } 681 682 // Test buoy_isolated_danger 683 if ((keys.containsKey("seamark:buoy_isolated_danger:shape") == true) 684 || (keys.containsKey("seamark:beacon_isolated_danger:shape") == true)) { 685 686 if ((keys.containsKey("seamark:buoy_isolated_danger:colour") == false) 687 && (keys.containsKey("seamark:beacon_isolated_danger:colour") == false)) { 688 buoy = new BuoyUkn(this, "Parse-Error: No colour set"); 689 buoy.setNode(node); 690 return; 691 } 692 693 if (keys.containsKey("seamark:buoy_isolated_danger:shape") == true) 694 str = keys.get("seamark:buoy_isolated_danger:colour"); 695 else 696 str = keys.get("seamark:beacon_isolated_danger:colour"); 697 if (str.compareTo("black;red;black") != 0) { 698 buoy = new BuoyUkn(this, "Parse-Error: Invalid colour"); 699 buoy.setNode(node); 700 return; 701 } 702 703 buoy = new BuoyIsol(this, SeaMark.ISOLATED_DANGER); 704 buoy.setName(name); 705 buoy.setColour(SeaMark.BLACK_RED_BLACK); 591 706 592 707 if (buoy.parseTopMark(node) == false) {
Note:
See TracChangeset
for help on using the changeset viewer.