Changeset 24824 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-12-20T18:15:14+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24808 r24824 116 116 */ 117 117 if (isValid()) { 118 /*119 dlg.tfM01Name.setEnabled(true); dlg.tfM01Name.setText(getName());120 dlg.cM01TopMark.setSelected(true);121 dlg.cM01TopMark.setVisible(true);122 dlg.cM01TopMark.setEnabled(false);123 dlg.cM01Radar.setVisible(true); dlg.cM01Racon.setVisible(true);124 dlg.cM01Fog.setVisible(true); dlg.cM01Fired.setEnabled(true);125 dlg.cM01Fired.setVisible(true); dlg.tfM01Group.setVisible(false);126 dlg.lM01Group.setVisible(false); if (!isSectored()) {127 dlg.cbM01Colour.setVisible(false);128 dlg.lM01Colour.setVisible(false); }129 dlg.rbM01Fired1.setVisible(false);130 dlg.rbM01FiredN.setVisible(false);131 dlg.lM01Height.setVisible(false);132 dlg.tfM01Height.setVisible(false);133 dlg.lM01Range.setVisible(false);134 dlg.tfM01Range.setVisible(false);135 136 if (isFired()) { switch (getStyleIndex()) { case CARD_BEACON:137 case CARD_TOWER: case CARD_FLOAT:138 dlg.lM01Height.setVisible(true);139 dlg.tfM01Height.setVisible(true); dlg.lM01Range.setVisible(true);140 dlg.tfM01Range.setVisible(true); break; default: } }141 */142 118 String image = "/images/Cardinal"; 143 119 switch (getShape()) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24823 r24824 2 2 3 3 import java.util.Map; 4 5 import javax.swing.ImageIcon; 4 6 5 7 import org.openstreetmap.josm.Main; … … 82 84 83 85 super.paintSign(); 84 85 dlg.sM01StatusBar.setText(getErrMsg()); 86 86 */ 87 87 if (isValid()) { 88 dlg.tfM01Name.setEnabled(true);89 dlg.tfM01Name.setText(getName());90 dlg.cM01TopMark.setVisible(true);91 dlg.cM01Radar.setVisible(true);92 dlg.cM01Racon.setVisible(true);93 dlg.cM01Fog.setVisible(true);94 dlg.cM01Fired.setVisible(true);95 if (!isSectored()) {96 dlg.cbM01Colour.setVisible(false);97 dlg.lM01Colour.setVisible(false);98 }99 dlg.rbM01Fired1.setVisible(false);100 dlg.rbM01FiredN.setVisible(false);101 dlg.lM01Height.setVisible(false);102 dlg.tfM01Height.setVisible(false);103 dlg.lM01Range.setVisible(false);104 dlg.tfM01Range.setVisible(false);105 106 if (isFired()) {107 switch (getStyleIndex()) {108 case ISOL_BEACON:109 case ISOL_TOWER:110 dlg.lM01Height.setVisible(true);111 dlg.tfM01Height.setVisible(true);112 dlg.lM01Range.setVisible(true);113 dlg.tfM01Range.setVisible(true);114 break;115 default:116 }117 }118 88 119 89 String image = "/images/Cardinal"; 120 90 121 switch (getS tyleIndex()) {122 case ISOL_PILLAR:91 switch (getShape()) { 92 case PILLAR: 123 93 image += "_Pillar_Single"; 124 94 break; 125 case ISOL_SPAR:95 case SPAR: 126 96 image += "_Spar_Single"; 127 97 break; 128 case ISOL_BEACON:98 case BEACON: 129 99 image += "_Beacon_Single"; 130 100 break; 131 case ISOL_TOWER:101 case TOWER: 132 102 image += "_Tower_Single"; 133 103 break; 134 case ISOL_FLOAT:104 case FLOAT: 135 105 image += "_Float_Single"; 136 106 break; … … 140 110 if (!image.equals("/images/Cardinal")) { 141 111 image += ".png"; 142 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 112 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 113 .getResource(image))); 143 114 } else 144 dlg.lM01Icon.setIcon(null); 145 } else { 146 dlg.tfM01Name.setEnabled(false); 147 dlg.tfM01Name.setText(""); 148 dlg.cM01TopMark.setVisible(false); 149 dlg.cM01Radar.setVisible(false); 150 dlg.cM01Racon.setVisible(false); 151 dlg.cM01Fog.setVisible(false); 152 dlg.cM01Fired.setVisible(false); 115 dlg.panelMain.shapeIcon.setIcon(null); 153 116 } 154 */}117 } 155 118 156 119 public void saveSign() { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24823 r24824 2 2 3 3 import java.util.Map; 4 5 import javax.swing.ImageIcon; 4 6 5 7 import org.openstreetmap.josm.data.osm.Node; … … 8 10 9 11 import oseam.dialogs.OSeaMAction; 12 import oseam.seamarks.SeaMark.Cat; 13 import oseam.seamarks.SeaMark.Styl; 10 14 11 15 public class MarkLat extends SeaMark { … … 200 204 case PORT_HAND: 201 205 if (str.equals("can")) 202 setStyleIndex( LAT_CAN);206 setStyleIndex(CAN); 203 207 else if (str.equals("pillar")) 204 setStyleIndex( LAT_PILLAR);208 setStyleIndex(PILLAR); 205 209 else if (str.equals("spar")) 206 setStyleIndex( LAT_SPAR);210 setStyleIndex(SPAR); 207 211 break; 208 212 209 213 case PREF_PORT_HAND: 210 214 if (str.equals("can")) 211 setStyleIndex( LAT_CAN);215 setStyleIndex(CAN); 212 216 else if (str.equals("pillar")) 213 setStyleIndex( LAT_PILLAR);217 setStyleIndex(PILLAR); 214 218 else if (str.equals("spar")) 215 setStyleIndex( LAT_SPAR);219 setStyleIndex(SPAR); 216 220 break; 217 221 218 222 case STARBOARD_HAND: 219 223 if (str.equals("conical")) 220 setStyleIndex( LAT_CONE);224 setStyleIndex(CONE); 221 225 else if (str.equals("pillar")) 222 setStyleIndex( LAT_PILLAR);226 setStyleIndex(PILLAR); 223 227 else if (str.equals("spar")) 224 setStyleIndex( LAT_SPAR);228 setStyleIndex(SPAR); 225 229 break; 226 230 227 231 case PREF_STARBOARD_HAND: 228 232 if (str.equals("conical")) 229 setStyleIndex( LAT_CONE);233 setStyleIndex(CONE); 230 234 else if (str.equals("pillar")) 231 setStyleIndex( LAT_PILLAR);235 setStyleIndex(PILLAR); 232 236 else if (str.equals("spar")) 233 setStyleIndex( LAT_SPAR);237 setStyleIndex(SPAR); 234 238 break; 235 239 } … … 237 241 str = keys.get("seamark:beacon_lateral:shape"); 238 242 if (str.equals("tower")) 239 setStyleIndex( LAT_TOWER);243 setStyleIndex(TOWER); 240 244 else if (str.equals("perch")) 241 setStyleIndex( LAT_PERCH);245 setStyleIndex(PERCH); 242 246 else 243 setStyleIndex( LAT_BEACON);247 setStyleIndex(BEACON); 244 248 } else if (keys.containsKey("seamark:type") 245 249 && (keys.get("seamark:type").equals("beacon_lateral"))) { 246 setStyleIndex( LAT_BEACON);250 setStyleIndex(BEACON); 247 251 } else if (keys.containsKey("seamark:type") 248 252 && (keys.get("seamark:type").equals("light_float"))) { 249 setStyleIndex( LAT_FLOAT);253 setStyleIndex(FLOAT); 250 254 } 251 255 252 refreshStyles();253 refreshLights();254 256 parseLights(keys); 255 257 parseFogRadar(keys); 256 258 setLightColour(); 257 259 258 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());259 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());260 dlg.tfM01Name.setText(getName());261 dlg.cM01TopMark.setSelected(hasTopMark());262 260 */ } 263 /*264 public void refreshStyles() {265 int type = getBuoyIndex();266 int style = getStyleIndex();267 268 dlg.cbM01StyleOfMark.removeAllItems();269 dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.213"));270 271 switch (type) {272 case PORT_HAND:273 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02"));274 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01"));275 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04"));276 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05"));277 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06"));278 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07"));279 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10"));280 break;281 case STARBOARD_HAND:282 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03"));283 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01"));284 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04"));285 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05"));286 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06"));287 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07"));288 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10"));289 break;290 case PREF_PORT_HAND:291 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02"));292 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01"));293 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04"));294 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05"));295 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06"));296 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07"));297 break;298 case PREF_STARBOARD_HAND:299 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03"));300 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01"));301 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04"));302 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05"));303 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06"));304 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07"));305 break;306 }307 308 if (style >= dlg.cbM01StyleOfMark.getItemCount())309 style = 0;310 setStyleIndex(style);311 dlg.cbM01StyleOfMark.setSelectedIndex(style);312 dlg.cbM01StyleOfMark.setVisible(true);313 dlg.lM01StyleOfMark.setVisible(true);314 }315 316 public void refreshLights() {317 super.refreshLights();318 }319 261 320 262 public boolean isValid() { 321 return (getBuoyIndex() > 0) && (getStyleIndex() > 0); 263 return (getCategory() != Cat.UNKNOWN_CAT) 264 && (getShape() != Styl.UNKNOWN_SHAPE); 322 265 } 323 266 324 267 public void setLightColour() { 325 268 if (getRegion() == IALA_A) { 326 if (get BuoyIndex() == PORT_HAND || getBuoyIndex() ==PREF_PORT_HAND)269 if (getCategory() == Cat.PORT_HAND || getCategory() == Cat.PREF_PORT_HAND) 327 270 super.setLightColour("R"); 328 271 else 329 272 super.setLightColour("G"); 330 273 } else { 331 if (get BuoyIndex() == PORT_HAND || getBuoyIndex() ==PREF_PORT_HAND)274 if (getCategory() == Cat.PORT_HAND || getCategory() == Cat.PREF_PORT_HAND) 332 275 super.setLightColour("G"); 333 276 else … … 335 278 } 336 279 } 337 */ 280 338 281 public void paintSign() { 339 282 /* if (dlg.paintlock) 340 283 return; 341 284 super.paintSign(); 342 343 dlg.sM01StatusBar.setText(getErrMsg()); 344 285 */ 345 286 if (isValid()) { 346 dlg.tfM01Name.setEnabled(true); 347 dlg.tfM01Name.setText(getName()); 348 349 boolean region = getRegion(); 350 int style = getStyleIndex(); 351 352 if (style == LAT_PERCH) { 353 dlg.cM01TopMark.setVisible(false); 354 dlg.cM01TopMark.setSelected(false); 355 dlg.cM01Radar.setVisible(false); 356 dlg.cM01Racon.setVisible(false); 357 dlg.cM01Fog.setVisible(false); 358 dlg.cM01Fired.setVisible(false); 359 dlg.cM01Fired.setSelected(false); 360 } else { 361 dlg.cM01TopMark.setEnabled(true); 362 dlg.cM01TopMark.setVisible(true); 363 dlg.cM01Radar.setVisible(true); 364 dlg.cM01Racon.setVisible(true); 365 dlg.cM01Fog.setVisible(true); 366 dlg.cM01Fired.setVisible(true); 367 dlg.cM01Fired.setEnabled(true); 368 dlg.cM01TopMark.setEnabled(true); 369 } 370 if (!isSectored()) { 371 dlg.cbM01Colour.setVisible(false); 372 dlg.lM01Colour.setVisible(false); 373 } 374 dlg.rbM01Fired1.setVisible(false); 375 dlg.rbM01FiredN.setVisible(false); 376 dlg.lM01Height.setVisible(false); 377 dlg.tfM01Height.setVisible(false); 378 dlg.lM01Range.setVisible(false); 379 dlg.tfM01Range.setVisible(false); 380 381 if (isFired()) { 382 switch (style) { 383 case LAT_BEACON: 384 case LAT_TOWER: 385 case LAT_FLOAT: 386 dlg.lM01Height.setVisible(true); 387 dlg.tfM01Height.setVisible(true); 388 dlg.lM01Range.setVisible(true); 389 dlg.tfM01Range.setVisible(true); 390 break; 391 default: 392 } 393 } 287 boolean region = getRegion(); 288 Styl style = getShape(); 394 289 395 290 String image = "/images/Lateral"; 396 291 397 switch (get BuoyIndex()) {292 switch (getCategory()) { 398 293 case PORT_HAND: 399 294 if (region == IALA_A) 400 295 switch (style) { 401 case LAT_CAN:296 case CAN: 402 297 image += "_Can_Red"; 403 298 break; 404 case LAT_PILLAR:299 case PILLAR: 405 300 image += "_Pillar_Red"; 406 301 break; 407 case LAT_SPAR:302 case SPAR: 408 303 image += "_Spar_Red"; 409 304 break; 410 case LAT_BEACON:305 case BEACON: 411 306 image += "_Beacon_Red"; 412 307 break; 413 case LAT_TOWER:308 case TOWER: 414 309 image += "_Tower_Red"; 415 310 break; 416 case LAT_FLOAT:311 case FLOAT: 417 312 image += "_Float_Red"; 418 313 break; 419 case LAT_PERCH:314 case PERCH: 420 315 image += "_Perch_Port"; 421 316 break; … … 424 319 else 425 320 switch (style) { 426 case LAT_CAN:321 case CAN: 427 322 image += "_Can_Green"; 428 323 break; 429 case LAT_PILLAR:324 case PILLAR: 430 325 image += "_Pillar_Green"; 431 326 break; 432 case LAT_SPAR:327 case SPAR: 433 328 image += "_Spar_Green"; 434 329 break; 435 case LAT_BEACON:330 case BEACON: 436 331 image += "_Beacon_Green"; 437 332 break; 438 case LAT_TOWER:333 case TOWER: 439 334 image += "_Tower_Green"; 440 335 break; 441 case LAT_FLOAT:336 case FLOAT: 442 337 image += "_Float_Green"; 443 338 break; 444 case LAT_PERCH:339 case PERCH: 445 340 image += "_Perch_Port"; 446 341 break; … … 452 347 if (region == IALA_A) 453 348 switch (style) { 454 case LAT_CONE:349 case CONE: 455 350 image += "_Cone_Green"; 456 351 break; 457 case LAT_PILLAR:352 case PILLAR: 458 353 image += "_Pillar_Green"; 459 354 break; 460 case LAT_SPAR:355 case SPAR: 461 356 image += "_Spar_Green"; 462 357 break; 463 case LAT_BEACON:358 case BEACON: 464 359 image += "_Beacon_Green"; 465 360 break; 466 case LAT_TOWER:361 case TOWER: 467 362 image += "_Tower_Green"; 468 363 break; 469 case LAT_FLOAT:364 case FLOAT: 470 365 image += "_Float_Green"; 471 366 break; 472 case LAT_PERCH:367 case PERCH: 473 368 image += "_Perch_Starboard"; 474 369 break; … … 477 372 else 478 373 switch (style) { 479 case LAT_CONE:374 case CONE: 480 375 image += "_Cone_Red"; 481 376 break; 482 case LAT_PILLAR:377 case PILLAR: 483 378 image += "_Pillar_Red"; 484 379 break; 485 case LAT_SPAR:380 case SPAR: 486 381 image += "_Spar_Red"; 487 382 break; 488 case LAT_BEACON:383 case BEACON: 489 384 image += "_Beacon_Red"; 490 385 break; 491 case LAT_TOWER:386 case TOWER: 492 387 image += "_Tower_Red"; 493 388 break; 494 case LAT_FLOAT:389 case FLOAT: 495 390 image += "_Float_Red"; 496 391 break; 497 case LAT_PERCH:392 case PERCH: 498 393 image += "_Perch_Starboard"; 499 394 break; … … 505 400 if (region == IALA_A) 506 401 switch (style) { 507 case LAT_CAN:402 case CAN: 508 403 image += "_Can_Red_Green_Red"; 509 404 break; 510 case LAT_PILLAR:405 case PILLAR: 511 406 image += "_Pillar_Red_Green_Red"; 512 407 break; 513 case LAT_SPAR:408 case SPAR: 514 409 image += "_Spar_Red_Green_Red"; 515 410 break; 516 case LAT_BEACON:411 case BEACON: 517 412 image += "_Beacon_Red_Green_Red"; 518 413 break; 519 case LAT_TOWER:414 case TOWER: 520 415 image += "_Tower_Red_Green_Red"; 521 416 break; 522 case LAT_FLOAT:417 case FLOAT: 523 418 image += "_Float_Red_Green_Red"; 524 419 break; … … 527 422 else 528 423 switch (style) { 529 case LAT_CAN:424 case CAN: 530 425 image += "_Can_Green_Red_Green"; 531 426 break; 532 case LAT_PILLAR:427 case PILLAR: 533 428 image += "_Pillar_Green_Red_Green"; 534 429 break; 535 case LAT_SPAR:430 case SPAR: 536 431 image += "_Spar_Green_Red_Green"; 537 432 break; 538 case LAT_BEACON:433 case BEACON: 539 434 image += "_Beacon_Green_Red_Green"; 540 435 break; 541 case LAT_TOWER:436 case TOWER: 542 437 image += "_Tower_Green_Red_Green"; 543 438 break; 544 case LAT_FLOAT:439 case FLOAT: 545 440 image += "_Float_Green_Red_Green"; 546 441 break; … … 552 447 if (region == IALA_A) 553 448 switch (style) { 554 case LAT_CONE:449 case CONE: 555 450 image += "_Cone_Green_Red_Green"; 556 451 break; 557 case LAT_PILLAR:452 case PILLAR: 558 453 image += "_Pillar_Green_Red_Green"; 559 454 break; 560 case LAT_SPAR:455 case SPAR: 561 456 image += "_Spar_Green_Red_Green"; 562 457 break; 563 case LAT_BEACON:458 case BEACON: 564 459 image += "_Beacon_Green_Red_Green"; 565 460 break; 566 case LAT_TOWER:461 case TOWER: 567 462 image += "_Tower_Green_Red_Green"; 568 463 break; 569 case LAT_FLOAT:464 case FLOAT: 570 465 image += "_Float_Green_Red_Green"; 571 466 break; … … 574 469 else 575 470 switch (style) { 576 case LAT_CONE:471 case CONE: 577 472 image += "_Cone_Red_Green_Red"; 578 473 break; 579 case LAT_PILLAR:474 case PILLAR: 580 475 image += "_Pillar_Red_Green_Red"; 581 476 break; 582 case LAT_SPAR:477 case SPAR: 583 478 image += "_Spar_Red_Green_Red"; 584 479 break; 585 case LAT_BEACON:480 case BEACON: 586 481 image += "_Beacon_Red_Green_Red"; 587 482 break; 588 case LAT_TOWER:483 case TOWER: 589 484 image += "_Tower_Red_Green_Red"; 590 485 break; 591 case LAT_FLOAT:486 case FLOAT: 592 487 image += "_Float_Red_Green_Red"; 593 488 break; … … 602 497 603 498 image += ".png"; 604 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 499 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 500 .getResource(image))); 605 501 606 502 if (hasTopMark()) { 607 503 image = ""; 608 switch (get BuoyIndex()) {504 switch (getCategory()) { 609 505 case PORT_HAND: 610 506 case PREF_PORT_HAND: 611 507 if (region == IALA_A) 612 508 switch (style) { 613 case LAT_CAN:509 case CAN: 614 510 image = "/images/Top_Can_Red_Buoy_Small.png"; 615 511 break; 616 case LAT_PILLAR:617 case LAT_SPAR:512 case PILLAR: 513 case SPAR: 618 514 image = "/images/Top_Can_Red_Buoy.png"; 619 515 break; 620 case LAT_BEACON:621 case LAT_TOWER:516 case BEACON: 517 case TOWER: 622 518 image = "/images/Top_Can_Red_Beacon.png"; 623 519 break; 624 case LAT_FLOAT:520 case FLOAT: 625 521 image = "/images/Top_Can_Red_Float.png"; 626 522 break; … … 628 524 else 629 525 switch (style) { 630 case LAT_CAN:526 case CAN: 631 527 image = "/images/Top_Can_Green_Buoy_Small.png"; 632 528 break; 633 case LAT_PILLAR:634 case LAT_SPAR:529 case PILLAR: 530 case SPAR: 635 531 image = "/images/Top_Can_Green_Buoy.png"; 636 532 break; 637 case LAT_BEACON:638 case LAT_TOWER:533 case BEACON: 534 case TOWER: 639 535 image = "/images/Top_Can_Green_Beacon.png"; 640 536 break; 641 case LAT_FLOAT:537 case FLOAT: 642 538 image = "/images/Top_Can_Green_Float.png"; 643 539 break; … … 649 545 if (region == IALA_A) 650 546 switch (style) { 651 case LAT_CONE:547 case CONE: 652 548 image = "/images/Top_Cone_Green_Buoy_Small.png"; 653 549 break; 654 case LAT_PILLAR:655 case LAT_SPAR:550 case PILLAR: 551 case SPAR: 656 552 image = "/images/Top_Cone_Green_Buoy.png"; 657 553 break; 658 case LAT_BEACON:659 case LAT_TOWER:554 case BEACON: 555 case TOWER: 660 556 image = "/images/Top_Cone_Green_Beacon.png"; 661 557 break; 662 case LAT_FLOAT:558 case FLOAT: 663 559 image = "/images/Top_Cone_Green_Float.png"; 664 560 break; … … 666 562 else 667 563 switch (style) { 668 case LAT_CONE:564 case CONE: 669 565 image = "/images/Top_Cone_Red_Buoy_Small.png"; 670 566 break; 671 case LAT_PILLAR:672 case LAT_SPAR:567 case PILLAR: 568 case SPAR: 673 569 image = "/images/Top_Cone_Red_Buoy.png"; 674 570 break; 675 case LAT_BEACON:676 case LAT_TOWER:571 case BEACON: 572 case TOWER: 677 573 image = "/images/Top_Cone_Red_Beacon.png"; 678 574 break; 679 case LAT_FLOAT:575 case FLOAT: 680 576 image = "/images/Top_Cone_Red_Float.png"; 681 577 break; … … 684 580 } 685 581 if (!image.isEmpty()) 686 dlg.lM06Icon.setIcon(new ImageIcon(getClass().getResource(image))); 582 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 583 .getResource(image))); 687 584 } 688 585 } else 689 dlg. lM01Icon.setIcon(null);586 dlg.panelMain.shapeIcon.setIcon(null); 690 587 } 691 */}588 } 692 589 693 590 public void saveSign() { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24823 r24824 2 2 3 3 import java.util.Map; 4 5 import javax.swing.ImageIcon; 4 6 5 7 import org.openstreetmap.josm.data.osm.Node; … … 70 72 return; 71 73 super.paintSign(); 74 */ 75 if (isValid()) { 72 76 73 dlg.sM01StatusBar.setText(getErrMsg()); 74 75 if (isValid()) { 76 dlg.cM01Radar.setVisible(true); 77 dlg.cM01Racon.setVisible(true); 78 dlg.cM01Fog.setVisible(true); 79 80 dlg.rbM01Fired1.setVisible(true); 81 dlg.rbM01FiredN.setVisible(true); 82 dlg.lM01Height.setVisible(true); 83 dlg.tfM01Height.setVisible(true); 84 dlg.lM01Range.setVisible(true); 85 dlg.tfM01Range.setVisible(true); 86 87 switch (getBuoyIndex()) { 88 case SeaMark.LIGHT_HOUSE: 89 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource( 77 switch (getCategory()) { 78 case LIGHT_HOUSE: 79 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 90 80 "/images/Light_House.png"))); 91 81 break; 92 82 93 case SeaMark.LIGHT_MAJOR:94 dlg. lM01Icon.setIcon(new ImageIcon(getClass().getResource(83 case LIGHT_MAJOR: 84 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 95 85 "/images/Light_Major.png"))); 96 86 break; 97 87 98 case SeaMark.LIGHT_MINOR:99 dlg. lM01Icon.setIcon(new ImageIcon(getClass().getResource(88 case LIGHT_MINOR: 89 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 100 90 "/images/Light_Minor.png"))); 101 91 break; 102 92 103 case SeaMark.LIGHT_VESSEL:104 dlg. lM01Icon.setIcon(new ImageIcon(getClass().getResource(93 case LIGHT_VESSEL: 94 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 105 95 "/images/Major_Float.png"))); 106 96 break; … … 109 99 } 110 100 } 111 */}101 } 112 102 113 103 public void saveSign() { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24823 r24824 2 2 3 3 import java.util.Map; 4 5 import javax.swing.ImageIcon; 4 6 5 7 import org.openstreetmap.josm.data.osm.Node; … … 14 16 super(dia, node); 15 17 } 16 18 17 19 public void parseMark() { 18 20 … … 39 41 setName(keys.get("seamark:light_float:name")); 40 42 41 /* 42 43 setBuoyIndex(SAFE_WATER); 44 setColour(SeaMark.RED_WHITE); 45 setLightColour("W"); 46 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 47 48 if (keys.containsKey("seamark:buoy_safe_water:shape")) { 49 str = keys.get("seamark:buoy_safe_water:shape"); 50 51 if (str.equals("pillar")) 52 setStyleIndex(SAFE_PILLAR); 53 else if (str.equals("spar")) 54 setStyleIndex(SAFE_SPAR); 55 else if (str.equals("sphere")) 56 setStyleIndex(SAFE_SPHERE); 57 } else if ((keys.containsKey("seamark:type")) 58 && (keys.get("seamark:type").equals("light_float"))) { 59 setStyleIndex(SAFE_FLOAT); 60 } else if ((keys.containsKey("seamark:type")) 61 && (keys.get("seamark:type").equals("beacon_safe_water"))) { 62 setStyleIndex(SAFE_BEACON); 63 } 64 65 if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) 66 setStyleIndex(0); 67 68 if (keys.containsKey("seamark:topmark:shape") 69 || keys.containsKey("seamark:topmark:colour")) { 70 setTopMark(true); 71 } 72 73 refreshLights(); 74 parseLights(keys); 75 parseFogRadar(keys); 76 77 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 78 dlg.tfM01Name.setText(getName()); 79 dlg.cM01TopMark.setSelected(hasTopMark()); 80 */ } 81 /* 82 public void refreshLights() { 83 dlg.cbM01Kennung.removeAllItems(); 84 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); 85 dlg.cbM01Kennung.addItem("Iso"); 86 dlg.cbM01Kennung.addItem("Oc"); 87 dlg.cbM01Kennung.addItem("LFl"); 88 dlg.cbM01Kennung.addItem("Mo"); 89 dlg.cbM01Kennung.setSelectedIndex(0); 90 } 91 92 public boolean isValid() { 93 return (getBuoyIndex() > 0) && (getStyleIndex() > 0); 94 } 95 96 public void setLightColour() { 97 super.setLightColour("W"); 98 } 99 */ 43 /* 44 * 45 * setBuoyIndex(SAFE_WATER); 46 * setColour(SeaMark.RED_WHITE); 47 * setLightColour("W"); 48 * setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 49 * 50 * if (keys.containsKey("seamark:buoy_safe_water:shape")) { 51 * str = keys.get("seamark:buoy_safe_water:shape"); 52 * 53 * if (str.equals("pillar")) setStyleIndex(SAFE_PILLAR); 54 * else if 55 * (str.equals("spar")) setStyleIndex(SAFE_SPAR); 56 * else if (str.equals("sphere")) setStyleIndex(SAFE_SPHERE); 57 * } else if ((keys.containsKey("seamark:type")) && 58 * (keys.get("seamark:type").equals("light_float"))) { 59 * setStyleIndex(SAFE_FLOAT); 60 * } else if ((keys.containsKey("seamark:type")) && 61 * (keys.get("seamark:type").equals("beacon_safe_water"))) { 62 * setStyleIndex(SAFE_BEACON); } 63 * 64 * if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) 65 * setStyleIndex(0); 66 * 67 * if (keys.containsKey("seamark:topmark:shape") || 68 * keys.containsKey("seamark:topmark:colour")) { setTopMark(true); } 69 * 70 * refreshLights(); 71 * parseLights(keys); 72 * parseFogRadar(keys); 73 * 74 * dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 75 * dlg.tfM01Name.setText(getName()); 76 * dlg.cM01TopMark.setSelected(hasTopMark()); 77 */} 78 79 /* 80 * public void refreshLights() { dlg.cbM01Kennung.removeAllItems(); 81 * dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); 82 * dlg.cbM01Kennung.addItem("Iso"); dlg.cbM01Kennung.addItem("Oc"); 83 * dlg.cbM01Kennung.addItem("LFl"); dlg.cbM01Kennung.addItem("Mo"); 84 * dlg.cbM01Kennung.setSelectedIndex(0); } 85 * 86 * public boolean isValid() { return (getBuoyIndex() > 0) && 87 * (getStyleIndex() > 0); } 88 * 89 * public void setLightColour() { super.setLightColour("W"); } 90 */ 100 91 public void paintSign() { 101 /* if (dlg.paintlock) 102 return; 103 super.paintSign(); 104 105 dlg.sM01StatusBar.setText(getErrMsg()); 106 92 /* 93 * if (dlg.paintlock) return; super.paintSign(); 94 */ 107 95 if (isValid()) { 108 dlg.tfM01Name.setEnabled(true);109 dlg.tfM01Name.setText(getName());110 dlg.cM01TopMark.setEnabled(true);111 dlg.cM01TopMark.setVisible(true);112 dlg.cM01Radar.setVisible(true);113 dlg.cM01Racon.setVisible(true);114 dlg.cM01Fog.setVisible(true);115 dlg.cM01Fired.setVisible(true);116 dlg.cM01Fired.setEnabled(true);117 if (!isSectored()) {118 dlg.cbM01Colour.setVisible(false);119 dlg.lM01Colour.setVisible(false);120 }121 dlg.rbM01Fired1.setVisible(false);122 dlg.rbM01FiredN.setVisible(false);123 dlg.lM01Height.setVisible(false);124 dlg.tfM01Height.setVisible(false);125 dlg.lM01Range.setVisible(false);126 dlg.tfM01Range.setVisible(false);127 128 if (isFired()) {129 switch (getStyleIndex()) {130 case SAFE_FLOAT:131 case SAFE_BEACON:132 dlg.lM01Height.setVisible(true);133 dlg.tfM01Height.setVisible(true);134 dlg.lM01Range.setVisible(true);135 dlg.tfM01Range.setVisible(true);136 break;137 default:138 }139 }140 96 141 97 String image = "/images/Safe_Water"; 142 98 143 switch (getS tyleIndex()) {144 case SAFE_PILLAR:99 switch (getShape()) { 100 case PILLAR: 145 101 image += "_Pillar"; 146 102 break; 147 case S AFE_SPAR:103 case SPAR: 148 104 image += "_Spar"; 149 105 break; 150 case S AFE_SPHERE:106 case SPHERE: 151 107 image += "_Sphere"; 152 108 break; 153 case SAFE_BEACON:109 case BEACON: 154 110 image += "_Beacon"; 155 111 break; 156 case SAFE_FLOAT:112 case FLOAT: 157 113 image += "_Float"; 158 114 break; … … 162 118 if (!image.equals("/images/Safe_Water")) { 163 119 image += ".png"; 164 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 120 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 121 .getResource(image))); 165 122 if (hasTopMark()) { 166 123 image = ""; 167 switch (getS tyleIndex()) {168 case SAFE_PILLAR:169 case S AFE_SPAR:124 switch (getShape()) { 125 case PILLAR: 126 case SPAR: 170 127 image = "/images/Top_Sphere_Red_Buoy.png"; 171 128 break; 172 case S AFE_SPHERE:129 case SPHERE: 173 130 image = "/images/Top_Sphere_Red_Buoy_Small.png"; 174 131 break; 175 case SAFE_BEACON:132 case BEACON: 176 133 image = "/images/Top_Sphere_Red_Beacon.png"; 177 134 break; 178 case SAFE_FLOAT:135 case FLOAT: 179 136 image = "/images/Top_Sphere_Red_Float.png"; 180 137 break; 181 138 } 182 139 if (!image.isEmpty()) 183 dlg.lM06Icon.setIcon(new ImageIcon(getClass().getResource(image))); 184 } 185 } else 186 dlg.lM01Icon.setIcon(null); 187 } 188 */ } 140 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 141 .getResource(image))); 142 } else 143 dlg.panelMain.topIcon.setIcon(null); 144 } else { 145 dlg.panelMain.shapeIcon.setIcon(null); 146 dlg.panelMain.topIcon.setIcon(null); 147 } 148 } 149 } 189 150 190 151 public void saveSign() { … … 225 186 case SPHERE: 226 187 Main.main.undoRedo.add(new ChangePropertyCommand(node, 227 "seamark:buoy_safe_water:colour_pattern", "vertical stripes")); 188 "seamark:buoy_safe_water:colour_pattern", 189 "vertical stripes")); 228 190 Main.main.undoRedo.add(new ChangePropertyCommand(node, 229 191 "seamark:buoy_safe_water:colour", "red;white")); … … 231 193 case BEACON: 232 194 Main.main.undoRedo.add(new ChangePropertyCommand(node, 233 "seamark:beacon_safe_water:colour_pattern", "vertical stripes")); 195 "seamark:beacon_safe_water:colour_pattern", 196 "vertical stripes")); 234 197 Main.main.undoRedo.add(new ChangePropertyCommand(node, 235 198 "seamark:beacon_safe_water:colour", "red;white")); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24823 r24824 2 2 3 3 import java.util.Map; 4 5 import javax.swing.ImageIcon; 4 6 5 7 import org.openstreetmap.josm.data.osm.Node; … … 9 11 import oseam.dialogs.OSeaMAction; 10 12 import oseam.seamarks.SeaMark; 13 import oseam.seamarks.SeaMark.Cat; 14 import oseam.seamarks.SeaMark.Styl; 11 15 12 16 public class MarkSpec extends SeaMark { … … 49 53 50 54 if (str.equals("pillar")) 51 setStyleIndex( SPEC_PILLAR);55 setStyleIndex(PILLAR); 52 56 else if (str.equals("can")) 53 setStyleIndex( SPEC_CAN);57 setStyleIndex(CAN); 54 58 else if (str.equals("conical")) 55 setStyleIndex( SPEC_CONE);59 setStyleIndex(CONE); 56 60 else if (str.equals("spar")) 57 setStyleIndex(SP EC_SPAR);61 setStyleIndex(SPAR); 58 62 else if (str.equals("sphere")) 59 setStyleIndex(SP EC_SPHERE);63 setStyleIndex(SPHERE); 60 64 else if (str.equals("barrel")) 61 setStyleIndex( SPEC_BARREL);65 setStyleIndex(BARREL); 62 66 } 63 67 … … 65 69 str = keys.get("seamark:beacon_special_purpose:shape"); 66 70 if (str.equals("tower")) 67 setStyleIndex( SPEC_TOWER);71 setStyleIndex(TOWER); 68 72 else 69 setStyleIndex( SPEC_BEACON);73 setStyleIndex(BEACON); 70 74 } 71 75 72 76 if (keys.containsKey("seamark:light_float:colour")) { 73 setStyleIndex( SPEC_FLOAT);77 setStyleIndex(FLOAT); 74 78 } 75 79 … … 80 84 if (keys.containsKey("seamark:beacon_special_purpose:shape") 81 85 && keys.get("seamark:beacon_special_purpose:shape").equals("tower")) 82 setStyleIndex( SPEC_TOWER);86 setStyleIndex(TOWER); 83 87 else 84 setStyleIndex( SPEC_BEACON);88 setStyleIndex(BEACON); 85 89 } else if (keys.containsKey("seamark:light_float:colour") 86 90 && keys.get("seamark:light_float:colour").equals("yellow")) 87 setStyleIndex( SPEC_FLOAT);91 setStyleIndex(FLOAT); 88 92 89 93 if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) … … 108 112 } 109 113 110 refreshLights();111 114 parseLights(keys); 112 115 parseFogRadar(keys); … … 116 119 dlg.cM01TopMark.setSelected(hasTopMark()); 117 120 */ } 118 /*119 public void refreshLights() {120 super.refreshLights();121 122 switch (getStyleIndex()) {123 case SPEC_BARREL:124 dlg.cM01Fired.setSelected(false);125 dlg.cM01Fired.setEnabled(false);126 dlg.cM01TopMark.setEnabled(true);127 break;128 default:129 dlg.cM01Fired.setEnabled(true);130 dlg.cM01TopMark.setEnabled(true);131 }132 }133 121 134 122 public boolean isValid() { 135 return (getBuoyIndex() > 0) && (getStyleIndex() > 0); 123 return (getCategory() != Cat.UNKNOWN_CAT) 124 && (getShape() != Styl.UNKNOWN_SHAPE); 136 125 } 137 126 … … 139 128 super.setLightColour("W"); 140 129 } 141 */ 130 142 131 public void paintSign() { 143 132 /* if (dlg.paintlock) 144 133 return; 145 134 super.paintSign(); 146 147 dlg.sM01StatusBar.setText(getErrMsg()); 148 135 */ 149 136 if (isValid()) { 150 dlg.tfM01Name.setEnabled(true);151 dlg.tfM01Name.setText(getName());152 dlg.cM01Radar.setVisible(true);153 dlg.cM01Racon.setVisible(true);154 dlg.cM01TopMark.setEnabled(true);155 dlg.cM01TopMark.setVisible(true);156 if (hasTopMark()) {157 dlg.cbM01TopMark.setEnabled(true);158 dlg.cbM01TopMark.setVisible(true);159 } else {160 dlg.cbM01TopMark.setVisible(false);161 }162 dlg.cM01Fog.setVisible(true);163 dlg.cM01Fired.setVisible(true);164 dlg.cM01Fired.setEnabled(true);165 if (!isSectored()) {166 dlg.cbM01Colour.setVisible(false);167 dlg.lM01Colour.setVisible(false);168 }169 dlg.rbM01Fired1.setVisible(false);170 dlg.rbM01FiredN.setVisible(false);171 dlg.lM01Height.setVisible(false);172 dlg.tfM01Height.setVisible(false);173 dlg.lM01Range.setVisible(false);174 dlg.tfM01Range.setVisible(false);175 176 if (isFired()) {177 switch (getStyleIndex()) {178 case SPEC_FLOAT:179 case SPEC_BEACON:180 case SPEC_TOWER:181 dlg.lM01Height.setVisible(true);182 dlg.tfM01Height.setVisible(true);183 dlg.lM01Range.setVisible(true);184 dlg.tfM01Range.setVisible(true);185 break;186 default:187 }188 }189 137 190 138 String image = "/images/Special_Purpose"; 191 139 192 switch (getS tyleIndex()) {193 case SPEC_PILLAR:140 switch (getShape()) { 141 case PILLAR: 194 142 image += "_Pillar"; 195 143 break; 196 case SPEC_CAN:144 case CAN: 197 145 image += "_Can"; 198 146 break; 199 case SPEC_CONE:147 case CONE: 200 148 image += "_Cone"; 201 149 break; 202 case SP EC_SPAR:150 case SPAR: 203 151 image += "_Spar"; 204 152 break; 205 case SP EC_SPHERE:153 case SPHERE: 206 154 image += "_Sphere"; 207 155 break; 208 case SPEC_BARREL:156 case BARREL: 209 157 image += "_Barrel"; 210 158 break; 211 case SPEC_FLOAT:159 case FLOAT: 212 160 image += "_Float"; 213 161 break; 214 case SPEC_BEACON:162 case BEACON: 215 163 image += "_Beacon"; 216 164 break; 217 case SPEC_TOWER:165 case TOWER: 218 166 image += "_Tower"; 219 167 break; … … 223 171 if (!image.equals("/images/Special_Purpose")) { 224 172 image += ".png"; 225 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 226 if (hasTopMark()) { 173 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 174 .getResource(image))); 175 /* if (hasTopMark()) { 227 176 image = ""; 228 switch (getS tyleIndex()) {229 case SPEC_PILLAR:230 case SP EC_SPAR:177 switch (getShape()) { 178 case PILLAR: 179 case SPAR: 231 180 switch (getTopMarkIndex()) { 232 181 case TOP_YELLOW_X: … … 244 193 } 245 194 break; 246 case SPEC_CAN:247 case SPEC_CONE:248 case SP EC_SPHERE:249 case SPEC_BARREL:195 case CAN: 196 case CONE: 197 case SPHERE: 198 case BARREL: 250 199 switch (getTopMarkIndex()) { 251 200 case TOP_YELLOW_X: … … 263 212 } 264 213 break; 265 case SPEC_BEACON:266 case SPEC_TOWER:214 case BEACON: 215 case TOWER: 267 216 switch (getTopMarkIndex()) { 268 217 case TOP_YELLOW_X: … … 280 229 } 281 230 break; 282 case SPEC_FLOAT:231 case FLOAT: 283 232 switch (getTopMarkIndex()) { 284 233 case TOP_YELLOW_X: … … 300 249 dlg.lM06Icon.setIcon(new ImageIcon(getClass().getResource(image))); 301 250 } 302 } else303 dlg. lM01Icon.setIcon(null);304 } 305 */}251 */ } else 252 dlg.panelMain.shapeIcon.setIcon(null); 253 } 254 } 306 255 307 256 public void saveSign() { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24808 r24824 162 162 public void setValid(boolean val) { 163 163 valid = val; 164 } 165 166 private boolean TopMark = false; 167 168 public boolean hasTopMark() { 169 return TopMark; 170 } 171 172 public void setTopMark(boolean topMark) { 173 TopMark = topMark; 164 174 } 165 175
Note:
See TracChangeset
for help on using the changeset viewer.