Changeset 22561 in osm for applications/editors/josm
- Timestamp:
- 2010-08-04T10:41:59+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
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) { -
applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java
r22557 r22561 86 86 public final static int SPEC_PILLAR = 1; 87 87 public final static int SPEC_SPAR = 2; 88 public final static int SPEC_BEACON = 3; 89 public final static int SPEC_SPHERE = 4; 90 public final static int SPEC_BARREL = 5; 91 public final static int LIGHT_MAJOR = 1; 92 public final static int LIGHT_MINOR = 2; 93 public final static int LIGHT_FLOAT = 3; 94 public final static int LIGHT_HOUSE = 4; 88 public final static int SPEC_SPHERE = 3; 89 public final static int SPEC_BARREL = 4; 90 public final static int LIGHT_HOUSE = 1; 91 public final static int LIGHT_MAJOR = 2; 92 public final static int LIGHT_MINOR = 3; 93 public final static int LIGHT_FLOAT = 4; 95 94 96 95 /** -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r22527 r22561 311 311 312 312 String c = keys.get("seamark:light:character"); 313 String ce = c;314 313 315 314 if (c.contains("+")) { … … 320 319 321 320 if (getLightGroup() != "") 322 ce = c + "(" + getLightGroup() + ")";323 321 if (tmp != null) { 324 322 c = c + tmp; 325 ce = ce + tmp;326 323 } 327 324 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r22557 r22561 121 121 default: 122 122 } 123 if (getStyleIndex() == ISOL_BEACON) { 123 124 Main.main.undoRedo.add(new ChangePropertyCommand(node, 124 "seamark:b uoy_isolated_danger:colour_pattern", "horizontal stripes"));125 "seamark:beacon_isolated_danger:colour_pattern", "horizontal stripes")); 125 126 Main.main.undoRedo.add(new ChangePropertyCommand(node, 126 "seamark:buoy_isolated_danger:colour", "black;red;black")); 127 "seamark:beacon_isolated_danger:colour", "black;red;black")); 128 } else { 129 Main.main.undoRedo.add(new ChangePropertyCommand(node, 130 "seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes")); 131 Main.main.undoRedo.add(new ChangePropertyCommand(node, 132 "seamark:buoy_isolated_danger:colour", "black;red;black")); 133 } 127 134 128 135 saveTopMarkData("2 spheres", "black"); … … 172 179 if (keys.containsKey("seamark:light:character")) { 173 180 setLightGroup(keys); 174 175 181 String c = keys.get("seamark:light:character"); 176 String ce = c;177 178 182 setLightChar(c); 179 183 setLightPeriod(keys); … … 186 190 } else { 187 191 if (getErrMsg() == null) 188 setErrMsg("Parse-Error: Licht falsch");192 setErrMsg("Parse-Error: Invalid light"); 189 193 else 190 setErrMsg(getErrMsg() + " / Licht falsch");194 setErrMsg(getErrMsg() + " / Invalid light"); 191 195 192 196 ret = false; … … 216 220 else if (str.compareTo("spar") == 0) 217 221 setStyleIndex(ISOL_SPAR); 218 else if (str.compareTo("beacon") == 0) 222 else 223 ret = false; 224 } 225 if (keys.containsKey("seamark:beacon_isolated_danger:shape")) { 226 str = keys.get("seamark:beacon_isolated_danger:shape"); 227 228 if (str.compareTo("stake") == 0) 219 229 setStyleIndex(ISOL_BEACON); 220 230 else -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r22557 r22561 488 488 super.saveSign("beacon_lateral"); 489 489 Main.main.undoRedo.add(new ChangePropertyCommand(node, 490 "seamark:b uoy_lateral:shape", "stake"));490 "seamark:beacon_lateral:shape", "stake")); 491 491 break; 492 492 case LAT_TOWER: 493 493 super.saveSign("beacon_lateral"); 494 494 Main.main.undoRedo.add(new ChangePropertyCommand(node, 495 "seamark:b uoy_lateral:shape", "tower"));495 "seamark:beacon_lateral:shape", "tower")); 496 496 break; 497 497 case LAT_FLOAT: … … 563 563 super.saveSign("beacon_lateral"); 564 564 Main.main.undoRedo.add(new ChangePropertyCommand(node, 565 "seamark:b uoy_lateral:shape", "stake"));565 "seamark:beacon_lateral:shape", "stake")); 566 566 break; 567 567 case LAT_TOWER: 568 568 super.saveSign("beacon_lateral"); 569 569 Main.main.undoRedo.add(new ChangePropertyCommand(node, 570 "seamark:b uoy_lateral:shape", "tower"));570 "seamark:beacon_lateral:shape", "tower")); 571 571 break; 572 572 case LAT_FLOAT: … … 636 636 super.saveSign("beacon_lateral"); 637 637 Main.main.undoRedo.add(new ChangePropertyCommand(node, 638 "seamark:b uoy_lateral:shape", "stake"));638 "seamark:beacon_lateral:shape", "stake")); 639 639 break; 640 640 case LAT_TOWER: 641 641 super.saveSign("beacon_lateral"); 642 642 Main.main.undoRedo.add(new ChangePropertyCommand(node, 643 "seamark:b uoy_lateral:shape", "tower"));643 "seamark:beacon_lateral:shape", "tower")); 644 644 break; 645 645 case LAT_FLOAT: … … 710 710 super.saveSign("beacon_lateral"); 711 711 Main.main.undoRedo.add(new ChangePropertyCommand(node, 712 "seamark:b uoy_lateral:shape", "stake"));712 "seamark:beacon_lateral:shape", "stake")); 713 713 break; 714 714 case LAT_TOWER: 715 715 super.saveSign("beacon_lateral"); 716 716 Main.main.undoRedo.add(new ChangePropertyCommand(node, 717 "seamark:b uoy_lateral:shape", "tower"));717 "seamark:beacon_lateral:shape", "tower")); 718 718 break; 719 719 default: … … 832 832 if (keys.containsKey("seamark:light:character")) { 833 833 setLightGroup(keys); 834 835 834 String c = keys.get("seamark:light:character"); 836 String ce = c;837 835 setLightChar(c); 838 836 setLightPeriod(keys); … … 973 971 switch (cat) { 974 972 case PORT_HAND: 975 if (str.compareTo(" beacon") == 0)973 if (str.compareTo("stake") == 0) 976 974 setStyleIndex(LAT_BEACON); 977 975 else if (str.compareTo("tower") == 0) … … 982 980 983 981 case PREF_PORT_HAND: 984 if (str.compareTo(" beacon") == 0)982 if (str.compareTo("stake") == 0) 985 983 setStyleIndex(LAT_BEACON); 986 984 else if (str.compareTo("tower") == 0) … … 991 989 992 990 case STARBOARD_HAND: 993 if (str.compareTo(" beacon") == 0)991 if (str.compareTo("stake") == 0) 994 992 setStyleIndex(LAT_BEACON); 995 993 else if (str.compareTo("tower") == 0) … … 1000 998 1001 999 case PREF_STARBOARD_HAND: 1002 if (str.compareTo(" beacon") == 0)1000 if (str.compareTo("stake") == 0) 1003 1001 setStyleIndex(LAT_BEACON); 1004 1002 else if (str.compareTo("tower") == 0) -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r22557 r22561 55 55 dlg.cbM01StyleOfMark.removeAllItems(); 56 56 dlg.cbM01StyleOfMark.addItem("Not set"); 57 dlg.cbM01StyleOfMark.addItem("Lighthouse"); 57 58 dlg.cbM01StyleOfMark.addItem("Major Light"); 58 59 dlg.cbM01StyleOfMark.addItem("Minor Light"); 59 60 dlg.cbM01StyleOfMark.addItem("Light Float"); 60 dlg.cbM01StyleOfMark.addItem("Lighthouse");61 61 62 62 if (style >= dlg.cbM01StyleOfMark.getItemCount()) … … 80 80 81 81 switch (getStyleIndex()) { 82 case SeaMark.LIGHT_HOUSE: 82 83 case SeaMark.LIGHT_MAJOR: 83 case SeaMark.LIGHT_HOUSE:84 84 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 85 85 "/images/Light_Major.png"))); … … 119 119 120 120 switch (getStyleIndex()) { 121 case LIGHT_HOUSE: 122 super.saveSign("lighthouse"); 123 break; 121 124 case LIGHT_MAJOR: 122 125 super.saveSign("major_light"); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r22527 r22561 160 160 161 161 } else { 162 setErrMsg("Parse-Error: Topmark unbekannt");162 setErrMsg("Parse-Error: Unknown topmark"); 163 163 ret = false; 164 164 } … … 181 181 if (keys.containsKey("seamark:light:character")) { 182 182 setLightGroup(keys); 183 184 183 String c = keys.get("seamark:light:character"); 185 String ce = c;186 187 184 setLightChar(c); 188 185 setLightPeriod(keys); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r22557 r22561 23 23 dlg.cbM01StyleOfMark.addItem("Pillar Buoy"); 24 24 dlg.cbM01StyleOfMark.addItem("Spar Buoy"); 25 dlg.cbM01StyleOfMark.addItem("Beacon");26 25 dlg.cbM01StyleOfMark.addItem("Sphere Buoy"); 27 26 dlg.cbM01StyleOfMark.addItem("Barrel"); … … 63 62 "/images/Special_Purpose_Spar.png"))); 64 63 break; 65 case SPEC_BEACON:66 if (isFired())67 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(68 "/images/Special_Purpose_Beacon_Lit.png")));69 else70 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(71 "/images/Special_Purpose_Beacon.png")));72 break;73 64 case SPEC_SPHERE: 74 65 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( … … 97 88 Checker("/images/Cross_Top_Buoy_Yellow.png", "/images/Light_White.png"); 98 89 break; 99 case SPEC_BEACON:100 Checker("/images/Cross_Top_Post_Yellow.png", "/images/Light_White.png");101 break;102 90 case SPEC_SPHERE: 103 91 case SPEC_BARREL: … … 115 103 } 116 104 117 if (getStyleIndex() == SPEC_BEACON) 118 super.saveSign("beacon_special_purpose"); 119 else 120 super.saveSign("buoy_special_purpose"); 105 super.saveSign("buoy_special_purpose"); 121 106 122 107 switch (getStyleIndex()) { … … 132 117 Main.main.undoRedo.add(new ChangePropertyCommand(node, 133 118 "seamark:buoy_special_purpose:shape", "sphere")); 134 break;135 case SPEC_BEACON:136 Main.main.undoRedo.add(new ChangePropertyCommand(node,137 "seamark:beacon_special_purpose:shape", "stake"));138 119 break; 139 120 case SPEC_BARREL: … … 194 175 195 176 String c = keys.get("seamark:light:character"); 196 String ce = c;197 177 198 178 setLightChar(c);
Note:
See TracChangeset
for help on using the changeset viewer.