Changeset 23060 in osm for applications/editors/josm/plugins/toms
- Timestamp:
- 2010-09-07T17:34:34+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms/seamarks/buoys
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23058 r23060 301 301 int i1; 302 302 303 String col = getLightColour(); 304 if (col.equals("W")) 305 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 306 else if (col.equals("R")) 307 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Red_120.png"))); 308 else if (col.equals("G")) 309 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Green_120.png"))); 310 else 311 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png"))); 312 303 313 dlg.cbM01Kennung.setEnabled(true); 304 314 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r23058 r23060 24 24 keys = node.getKeys(); 25 25 setNode(node); 26 26 27 27 resetMask(); 28 28 dlg.cbM01CatOfMark.setEnabled(true); … … 188 188 189 189 public void paintSign() { 190 if (dlg.paintlock) return; 190 if (dlg.paintlock) 191 return; 191 192 super.paintSign(); 192 193 193 194 dlg.sM01StatusBar.setText(getErrMsg()); 194 195 195 dlg.tfM01Name.setEnabled(true); 196 dlg.tfM01Name.setText(getName()); 197 198 dlg.cM01TopMark.setSelected(true); 199 dlg.cM01TopMark.setVisible(true); 200 dlg.cM01TopMark.setEnabled(false); 201 dlg.cM01Radar.setEnabled(true); 202 dlg.cM01Radar.setVisible(true); 203 dlg.cM01Racon.setEnabled(true); 204 dlg.cM01Racon.setVisible(true); 205 dlg.cM01Fog.setEnabled(true); 206 dlg.cM01Fog.setVisible(true); 207 208 dlg.cM01Fired.setEnabled(true); 209 dlg.cM01Fired.setVisible(true); 210 211 String image = "/images/Cardinal"; 212 213 switch (getStyleIndex()) { 214 case SeaMark.CARD_PILLAR: 215 image += "_Pillar"; 216 break; 217 218 case SeaMark.CARD_SPAR: 219 image += "_Spar"; 220 break; 221 222 case SeaMark.CARD_BEACON: 223 image += "_Beacon"; 224 break; 225 226 case SeaMark.CARD_TOWER: 227 image += "_Tower"; 228 break; 229 230 case SeaMark.CARD_FLOAT: 231 image += "_Float"; 232 break; 233 234 default: 235 return; 236 } 237 238 switch (getBuoyIndex()) { 239 case CARD_NORTH: 240 image += "_North"; 241 break; 242 case CARD_EAST: 243 image += "_East"; 244 break; 245 case CARD_SOUTH: 246 image += "_South"; 247 break; 248 case CARD_WEST: 249 image += "_West"; 250 break; 251 default: 252 return; 253 } 254 255 if (!image.equals("/images/Cardinal")) { 256 image += ".png"; 257 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 258 259 if (isFired()) { 260 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 261 262 if (getLightChar() != "") { 263 String tmp = null; 264 String c; 265 int i1; 266 267 c = getLightChar(); 268 if (c.contains("+")) { 269 i1 = c.indexOf("+"); 270 tmp = c.substring(i1, c.length()); 271 c = c.substring(0, i1); 272 } 273 274 if (getLightGroup() != "") 275 c = c + "(" + getLightGroup() + ")"; 276 if (tmp != null) 277 c = c + tmp; 278 279 dlg.cbM01Kennung.setSelectedItem(c); 280 if (dlg.cbM01Kennung.getSelectedItem().equals("Not set")) 281 c = ""; 282 } 283 } 284 285 } else 286 dlg.lM01Icon.setIcon(null); 196 if ((getBuoyIndex() != 0) && (getStyleIndex() != 0)) { 197 dlg.tfM01Name.setEnabled(true); 198 dlg.tfM01Name.setText(getName()); 199 dlg.cM01TopMark.setSelected(true); 200 dlg.cM01TopMark.setVisible(true); 201 dlg.cM01TopMark.setEnabled(false); 202 dlg.cM01Radar.setEnabled(true); 203 dlg.cM01Radar.setVisible(true); 204 dlg.cM01Racon.setEnabled(true); 205 dlg.cM01Racon.setVisible(true); 206 dlg.cM01Fog.setEnabled(true); 207 dlg.cM01Fog.setVisible(true); 208 dlg.cM01Fired.setEnabled(true); 209 dlg.cM01Fired.setVisible(true); 210 211 String image = "/images/Cardinal"; 212 213 switch (getStyleIndex()) { 214 case SeaMark.CARD_PILLAR: 215 image += "_Pillar"; 216 break; 217 218 case SeaMark.CARD_SPAR: 219 image += "_Spar"; 220 break; 221 222 case SeaMark.CARD_BEACON: 223 image += "_Beacon"; 224 break; 225 226 case SeaMark.CARD_TOWER: 227 image += "_Tower"; 228 break; 229 230 case SeaMark.CARD_FLOAT: 231 image += "_Float"; 232 break; 233 234 default: 235 return; 236 } 237 238 switch (getBuoyIndex()) { 239 case CARD_NORTH: 240 image += "_North"; 241 break; 242 case CARD_EAST: 243 image += "_East"; 244 break; 245 case CARD_SOUTH: 246 image += "_South"; 247 break; 248 case CARD_WEST: 249 image += "_West"; 250 break; 251 default: 252 return; 253 } 254 255 if (!image.equals("/images/Cardinal")) { 256 image += ".png"; 257 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 258 259 } else 260 dlg.lM01Icon.setIcon(null); 261 } 287 262 } 288 263 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r23058 r23060 104 104 105 105 public void paintSign() { 106 if (dlg.paintlock) return; 106 if (dlg.paintlock) 107 return; 107 108 super.paintSign(); 108 109 109 110 dlg.sM01StatusBar.setText(getErrMsg()); 110 111 111 dlg.tfM01Name.setEnabled(true); 112 dlg.tfM01Name.setText(getName()); 113 dlg.cM01TopMark.setEnabled(false); 114 dlg.cM01TopMark.setVisible(true); 115 dlg.cM01Radar.setEnabled(true); 116 dlg.cM01Radar.setVisible(true); 117 dlg.cM01Racon.setEnabled(true); 118 dlg.cM01Racon.setVisible(true); 119 dlg.cM01Fog.setEnabled(true); 120 dlg.cM01Fog.setVisible(true); 121 122 dlg.cM01Fired.setVisible(true); 123 dlg.cM01Fired.setEnabled(true); 124 125 String image = "/images/Cardinal"; 126 127 switch (getStyleIndex()) { 128 case ISOL_PILLAR: 129 image += "_Pillar_Single"; 130 break; 131 case ISOL_SPAR: 132 image += "_Spar_Single"; 133 break; 134 case ISOL_BEACON: 135 image += "_Beacon_Single"; 136 break; 137 case ISOL_TOWER: 138 image += "_Tower_Single"; 139 break; 140 case ISOL_FLOAT: 141 image += "_Float_Single"; 142 break; 143 default: 144 } 145 146 if (!image.equals("/images/Cardinal")) { 147 image += ".png"; 148 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 149 150 if (isFired()) { 151 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 152 "/images/Light_White_120.png"))); 153 if (getLightChar() != "") { 154 String c; 155 156 c = getLightChar(); 157 if (getLightGroup() != "") 158 c = c + "(" + getLightGroup() + ")"; 159 dlg.cbM01Kennung.setSelectedItem(c); 160 } 112 if ((getBuoyIndex() != 0) && (getStyleIndex() != 0)) { 113 dlg.tfM01Name.setEnabled(true); 114 dlg.tfM01Name.setText(getName()); 115 dlg.cM01TopMark.setEnabled(false); 116 dlg.cM01TopMark.setVisible(true); 117 dlg.cM01Radar.setEnabled(true); 118 dlg.cM01Radar.setVisible(true); 119 dlg.cM01Racon.setEnabled(true); 120 dlg.cM01Racon.setVisible(true); 121 dlg.cM01Fog.setEnabled(true); 122 dlg.cM01Fog.setVisible(true); 123 124 dlg.cM01Fired.setVisible(true); 125 dlg.cM01Fired.setEnabled(true); 126 127 String image = "/images/Cardinal"; 128 129 switch (getStyleIndex()) { 130 case ISOL_PILLAR: 131 image += "_Pillar_Single"; 132 break; 133 case ISOL_SPAR: 134 image += "_Spar_Single"; 135 break; 136 case ISOL_BEACON: 137 image += "_Beacon_Single"; 138 break; 139 case ISOL_TOWER: 140 image += "_Tower_Single"; 141 break; 142 case ISOL_FLOAT: 143 image += "_Float_Single"; 144 break; 145 default: 161 146 } 162 } else 163 dlg.lM01Icon.setIcon(null); 147 148 if (!image.equals("/images/Cardinal")) { 149 image += ".png"; 150 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 151 } else 152 dlg.lM01Icon.setIcon(null); 153 } 164 154 } 165 155 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r23058 r23060 22 22 keys = node.getKeys(); 23 23 setNode(node); 24 24 25 25 resetMask(); 26 26 … … 345 345 346 346 public void paintSign() { 347 if (dlg.paintlock) return; 347 if (dlg.paintlock) 348 return; 348 349 super.paintSign(); 349 350 350 351 dlg.sM01StatusBar.setText(getErrMsg()); 351 352 352 dlg.tfM01Name.setEnabled(true); 353 dlg.tfM01Name.setText(getName()); 354 dlg.cM01TopMark.setEnabled(true); 355 dlg.cM01TopMark.setVisible(true); 356 dlg.cM01Radar.setEnabled(true); 357 dlg.cM01Radar.setVisible(true); 358 dlg.cM01Racon.setEnabled(true); 359 dlg.cM01Racon.setVisible(true); 360 dlg.cM01Fog.setEnabled(true); 361 dlg.cM01Fog.setVisible(true); 362 363 dlg.cM01Fired.setVisible(true); 364 dlg.cM01Fired.setEnabled(true); 365 366 String image = "/images/Lateral"; 367 368 int cat = getBuoyIndex(); 369 boolean region = getRegion(); 370 int style = getStyleIndex(); 371 372 if (style == LAT_PERCH) { 373 dlg.cM01Fired.setSelected(false); 374 dlg.cM01TopMark.setSelected(false); 375 dlg.cM01Fired.setEnabled(false); 376 dlg.cM01TopMark.setEnabled(false); 377 } else { 353 if ((getBuoyIndex() != 0) && (getStyleIndex() != 0)) { 354 dlg.tfM01Name.setEnabled(true); 355 dlg.tfM01Name.setText(getName()); 356 dlg.cM01TopMark.setEnabled(true); 357 dlg.cM01TopMark.setVisible(true); 358 dlg.cM01Radar.setEnabled(true); 359 dlg.cM01Radar.setVisible(true); 360 dlg.cM01Racon.setEnabled(true); 361 dlg.cM01Racon.setVisible(true); 362 dlg.cM01Fog.setEnabled(true); 363 dlg.cM01Fog.setVisible(true); 364 365 dlg.cM01Fired.setVisible(true); 378 366 dlg.cM01Fired.setEnabled(true); 379 dlg.cM01TopMark.setEnabled(true); 380 } 381 382 switch (getBuoyIndex()) { 383 case PORT_HAND: 384 if (region == IALA_A) 385 switch (style) { 386 case LAT_CAN: 387 image += "_Can_Red"; 388 break; 389 case LAT_PILLAR: 390 image += "_Pillar_Red"; 391 break; 392 case LAT_SPAR: 393 image += "_Spar_Red"; 394 break; 395 case LAT_BEACON: 396 image += "_Beacon_Red"; 397 break; 398 case LAT_TOWER: 399 image += "_Tower_Red"; 400 break; 401 case LAT_FLOAT: 402 image += "_Float_Red"; 403 break; 404 case LAT_PERCH: 405 image += "_Perch_Port"; 406 break; 407 default: 408 } 409 else 410 switch (style) { 411 case LAT_CAN: 412 image += "_Can_Green"; 413 break; 414 case LAT_PILLAR: 415 image += "_Pillar_Green"; 416 break; 417 case LAT_SPAR: 418 image += "_Spar_Green"; 419 break; 420 case LAT_BEACON: 421 image += "_Beacon_Green"; 422 break; 423 case LAT_TOWER: 424 image += "_Tower_Green"; 425 break; 426 case LAT_FLOAT: 427 image += "_Float_Green"; 428 break; 429 case LAT_PERCH: 430 image += "_Perch_Port"; 431 break; 432 default: 433 } 434 break; 435 436 case STARBOARD_HAND: 437 if (region == IALA_A) 438 switch (style) { 439 case LAT_CONE: 440 image += "_Cone_Green"; 441 break; 442 case LAT_PILLAR: 443 image += "_Pillar_Green"; 444 break; 445 case LAT_SPAR: 446 image += "_Spar_Green"; 447 break; 448 case LAT_BEACON: 449 image += "_Beacon_Green"; 450 break; 451 case LAT_TOWER: 452 image += "_Tower_Green"; 453 break; 454 case LAT_FLOAT: 455 image += "_Float_Green"; 456 break; 457 case LAT_PERCH: 458 image += "_Perch_Starboard"; 459 break; 460 default: 461 } 462 else 463 switch (style) { 464 case LAT_CONE: 465 image += "_Cone_Red"; 466 break; 467 case LAT_PILLAR: 468 image += "_Pillar_Red"; 469 break; 470 case LAT_SPAR: 471 image += "_Spar_Red"; 472 break; 473 case LAT_BEACON: 474 image += "_Beacon_Red"; 475 break; 476 case LAT_TOWER: 477 image += "_Tower_Red"; 478 break; 479 case LAT_FLOAT: 480 image += "_Float_Red"; 481 break; 482 case LAT_PERCH: 483 image += "_Perch_Starboard"; 484 break; 485 default: 486 } 487 break; 488 489 case PREF_PORT_HAND: 490 if (region == IALA_A) 491 switch (style) { 492 case LAT_CAN: 493 image += "_Can_Red_Green_Red"; 494 break; 495 case LAT_PILLAR: 496 image += "_Pillar_Red_Green_Red"; 497 break; 498 case LAT_SPAR: 499 image += "_Spar_Red_Green_Red"; 500 break; 501 case LAT_BEACON: 502 image += "_Beacon_Red_Green_Red"; 503 break; 504 case LAT_TOWER: 505 image += "_Tower_Red_Green_Red"; 506 break; 507 case LAT_FLOAT: 508 image += "_Float_Red_Green_Red"; 509 break; 510 default: 511 } 512 else 513 switch (style) { 514 case LAT_CAN: 515 image += "_Can_Green_Red_Green"; 516 break; 517 case LAT_PILLAR: 518 image += "_Pillar_Green_Red_Green"; 519 break; 520 case LAT_SPAR: 521 image += "_Spar_Green_Red_Green"; 522 break; 523 case LAT_BEACON: 524 image += "_Beacon_Green_Red_Green"; 525 break; 526 case LAT_TOWER: 527 image += "_Tower_Green_Red_Green"; 528 break; 529 case LAT_FLOAT: 530 image += "_Float_Green_Red_Green"; 531 break; 532 default: 533 } 534 break; 535 536 case PREF_STARBOARD_HAND: 537 if (region == IALA_A) 538 switch (style) { 539 case LAT_CONE: 540 image += "_Cone_Green_Red_Green"; 541 break; 542 case LAT_PILLAR: 543 image += "_Pillar_Green_Red_Green"; 544 break; 545 case LAT_SPAR: 546 image += "_Spar_Green_Red_Green"; 547 break; 548 case LAT_BEACON: 549 image += "_Beacon_Green_Red_Green"; 550 break; 551 case LAT_TOWER: 552 image += "_Tower_Green_Red_Green"; 553 break; 554 case LAT_FLOAT: 555 image += "_Float_Green_Red_Green"; 556 break; 557 default: 558 } 559 else 560 switch (style) { 561 case LAT_CONE: 562 image += "_Cone_Red_Green_Red"; 563 break; 564 case LAT_PILLAR: 565 image += "_Pillar_Red_Green_Red"; 566 break; 567 case LAT_SPAR: 568 image += "_Spar_Red_Green_Red"; 569 break; 570 case LAT_BEACON: 571 image += "_Beacon_Red_Green_Red"; 572 break; 573 case LAT_TOWER: 574 image += "_Tower_Red_Green_Red"; 575 break; 576 case LAT_FLOAT: 577 image += "_Float_Red_Green_Red"; 578 break; 579 default: 580 } 581 break; 582 583 default: 584 } 585 586 if (!image.equals("/images/Lateral")) { 587 588 if (hasTopMark()) { 589 if (cat == PORT_HAND || cat == PREF_PORT_HAND) 590 image += "_Can"; 367 368 String image = "/images/Lateral"; 369 370 int cat = getBuoyIndex(); 371 boolean region = getRegion(); 372 int style = getStyleIndex(); 373 374 if (style == LAT_PERCH) { 375 dlg.cM01Fired.setSelected(false); 376 dlg.cM01TopMark.setSelected(false); 377 dlg.cM01Fired.setEnabled(false); 378 dlg.cM01TopMark.setEnabled(false); 379 } else { 380 dlg.cM01Fired.setEnabled(true); 381 dlg.cM01TopMark.setEnabled(true); 382 } 383 384 switch (getBuoyIndex()) { 385 case PORT_HAND: 386 if (region == IALA_A) 387 switch (style) { 388 case LAT_CAN: 389 image += "_Can_Red"; 390 break; 391 case LAT_PILLAR: 392 image += "_Pillar_Red"; 393 break; 394 case LAT_SPAR: 395 image += "_Spar_Red"; 396 break; 397 case LAT_BEACON: 398 image += "_Beacon_Red"; 399 break; 400 case LAT_TOWER: 401 image += "_Tower_Red"; 402 break; 403 case LAT_FLOAT: 404 image += "_Float_Red"; 405 break; 406 case LAT_PERCH: 407 image += "_Perch_Port"; 408 break; 409 default: 410 } 591 411 else 592 image += "_Cone"; 593 } 594 image += ".png"; 595 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 596 597 if (hasRadar()) { 598 dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector.png"))); 599 } 600 601 if (isFired()) 602 if (getLightColour().equals("R")) 603 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 604 "/images/Light_Red_120.png"))); 412 switch (style) { 413 case LAT_CAN: 414 image += "_Can_Green"; 415 break; 416 case LAT_PILLAR: 417 image += "_Pillar_Green"; 418 break; 419 case LAT_SPAR: 420 image += "_Spar_Green"; 421 break; 422 case LAT_BEACON: 423 image += "_Beacon_Green"; 424 break; 425 case LAT_TOWER: 426 image += "_Tower_Green"; 427 break; 428 case LAT_FLOAT: 429 image += "_Float_Green"; 430 break; 431 case LAT_PERCH: 432 image += "_Perch_Port"; 433 break; 434 default: 435 } 436 break; 437 438 case STARBOARD_HAND: 439 if (region == IALA_A) 440 switch (style) { 441 case LAT_CONE: 442 image += "_Cone_Green"; 443 break; 444 case LAT_PILLAR: 445 image += "_Pillar_Green"; 446 break; 447 case LAT_SPAR: 448 image += "_Spar_Green"; 449 break; 450 case LAT_BEACON: 451 image += "_Beacon_Green"; 452 break; 453 case LAT_TOWER: 454 image += "_Tower_Green"; 455 break; 456 case LAT_FLOAT: 457 image += "_Float_Green"; 458 break; 459 case LAT_PERCH: 460 image += "_Perch_Starboard"; 461 break; 462 default: 463 } 605 464 else 606 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 607 "/images/Light_Green_120.png"))); 608 if (getLightChar() != "") { 609 String c; 610 611 c = getLightChar(); 612 if (getLightGroup() != "") 613 c = c + "(" + getLightGroup() + ")"; 614 615 dlg.cbM01Kennung.setSelectedItem(c); 616 if (dlg.cbM01Kennung.getSelectedItem().equals("Not set")) 617 c = ""; 618 } 619 620 } else 621 dlg.lM01Icon.setIcon(null); 465 switch (style) { 466 case LAT_CONE: 467 image += "_Cone_Red"; 468 break; 469 case LAT_PILLAR: 470 image += "_Pillar_Red"; 471 break; 472 case LAT_SPAR: 473 image += "_Spar_Red"; 474 break; 475 case LAT_BEACON: 476 image += "_Beacon_Red"; 477 break; 478 case LAT_TOWER: 479 image += "_Tower_Red"; 480 break; 481 case LAT_FLOAT: 482 image += "_Float_Red"; 483 break; 484 case LAT_PERCH: 485 image += "_Perch_Starboard"; 486 break; 487 default: 488 } 489 break; 490 491 case PREF_PORT_HAND: 492 if (region == IALA_A) 493 switch (style) { 494 case LAT_CAN: 495 image += "_Can_Red_Green_Red"; 496 break; 497 case LAT_PILLAR: 498 image += "_Pillar_Red_Green_Red"; 499 break; 500 case LAT_SPAR: 501 image += "_Spar_Red_Green_Red"; 502 break; 503 case LAT_BEACON: 504 image += "_Beacon_Red_Green_Red"; 505 break; 506 case LAT_TOWER: 507 image += "_Tower_Red_Green_Red"; 508 break; 509 case LAT_FLOAT: 510 image += "_Float_Red_Green_Red"; 511 break; 512 default: 513 } 514 else 515 switch (style) { 516 case LAT_CAN: 517 image += "_Can_Green_Red_Green"; 518 break; 519 case LAT_PILLAR: 520 image += "_Pillar_Green_Red_Green"; 521 break; 522 case LAT_SPAR: 523 image += "_Spar_Green_Red_Green"; 524 break; 525 case LAT_BEACON: 526 image += "_Beacon_Green_Red_Green"; 527 break; 528 case LAT_TOWER: 529 image += "_Tower_Green_Red_Green"; 530 break; 531 case LAT_FLOAT: 532 image += "_Float_Green_Red_Green"; 533 break; 534 default: 535 } 536 break; 537 538 case PREF_STARBOARD_HAND: 539 if (region == IALA_A) 540 switch (style) { 541 case LAT_CONE: 542 image += "_Cone_Green_Red_Green"; 543 break; 544 case LAT_PILLAR: 545 image += "_Pillar_Green_Red_Green"; 546 break; 547 case LAT_SPAR: 548 image += "_Spar_Green_Red_Green"; 549 break; 550 case LAT_BEACON: 551 image += "_Beacon_Green_Red_Green"; 552 break; 553 case LAT_TOWER: 554 image += "_Tower_Green_Red_Green"; 555 break; 556 case LAT_FLOAT: 557 image += "_Float_Green_Red_Green"; 558 break; 559 default: 560 } 561 else 562 switch (style) { 563 case LAT_CONE: 564 image += "_Cone_Red_Green_Red"; 565 break; 566 case LAT_PILLAR: 567 image += "_Pillar_Red_Green_Red"; 568 break; 569 case LAT_SPAR: 570 image += "_Spar_Red_Green_Red"; 571 break; 572 case LAT_BEACON: 573 image += "_Beacon_Red_Green_Red"; 574 break; 575 case LAT_TOWER: 576 image += "_Tower_Red_Green_Red"; 577 break; 578 case LAT_FLOAT: 579 image += "_Float_Red_Green_Red"; 580 break; 581 default: 582 } 583 break; 584 585 default: 586 } 587 588 if (!image.equals("/images/Lateral")) { 589 590 if (hasTopMark()) { 591 if (cat == PORT_HAND || cat == PREF_PORT_HAND) 592 image += "_Can"; 593 else 594 image += "_Cone"; 595 } 596 image += ".png"; 597 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 598 599 if (hasRadar()) { 600 dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource( 601 "/images/Radar_Reflector.png"))); 602 } 603 604 } else 605 dlg.lM01Icon.setIcon(null); 606 } 622 607 } 623 608 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r23058 r23060 18 18 public BuoyNota(SmpDialogAction dia, Node node) { 19 19 super(dia); 20 20 21 21 String str; 22 22 Map<String, String> keys; 23 23 keys = node.getKeys(); 24 24 setNode(node); 25 25 26 26 resetMask(); 27 27 … … 41 41 setLightColour(); 42 42 43 setFired(true);44 43 setTopMark(false); 45 44 paintSign(); … … 47 46 48 47 public void paintSign() { 49 if (dlg.paintlock) return; 48 if (dlg.paintlock) 49 return; 50 50 super.paintSign(); 51 51 52 52 dlg.sM01StatusBar.setText(getErrMsg()); 53 53 54 dlg.cM01Radar.setEnabled(true); 55 dlg.cM01Radar.setVisible(true); 56 dlg.cM01Racon.setEnabled(true); 57 dlg.cM01Racon.setVisible(true); 54 if (getBuoyIndex() != 0) { 55 dlg.cM01Radar.setEnabled(true); 56 dlg.cM01Radar.setVisible(true); 57 dlg.cM01Racon.setEnabled(true); 58 dlg.cM01Racon.setVisible(true); 58 59 59 dlg.cM01Fog.setEnabled(true);60 dlg.cM01Fog.setVisible(true);60 dlg.cM01Fog.setEnabled(true); 61 dlg.cM01Fog.setVisible(true); 61 62 62 dlg.cM01Fired.setVisible(true); 63 dlg.cM01Fired.setEnabled(false); 64 dlg.cM01Fired.setSelected(true); 63 setFired(true); 64 dlg.cM01Fired.setVisible(true); 65 dlg.cM01Fired.setEnabled(false); 66 dlg.cM01Fired.setSelected(true); 65 67 66 switch (getBuoyIndex()) {67 case SeaMark.LIGHT_HOUSE:68 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(69 "/images/Light_House.png")));70 break;68 switch (getBuoyIndex()) { 69 case SeaMark.LIGHT_HOUSE: 70 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource( 71 "/images/Light_House.png"))); 72 break; 71 73 72 case SeaMark.LIGHT_MAJOR:73 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(74 "/images/Light_Major.png")));75 break;74 case SeaMark.LIGHT_MAJOR: 75 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource( 76 "/images/Light_Major.png"))); 77 break; 76 78 77 case SeaMark.LIGHT_MINOR:78 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(79 "/images/Light_Minor.png")));80 break;79 case SeaMark.LIGHT_MINOR: 80 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource( 81 "/images/Light_Minor.png"))); 82 break; 81 83 82 default: 84 default: 85 } 83 86 } 84 85 87 } 86 88 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r23058 r23060 16 16 17 17 public class BuoySaw extends Buoy { 18 public BuoySaw(SmpDialogAction dia, 18 public BuoySaw(SmpDialogAction dia, Node node) { 19 19 super(dia); 20 20 … … 23 23 keys = node.getKeys(); 24 24 setNode(node); 25 25 26 26 resetMask(); 27 27 … … 98 98 if (keys.containsKey("seamark:topmark:shape") 99 99 || keys.containsKey("seamark:topmark:colour")) { 100 100 setTopMark(true); 101 101 } 102 102 } 103 103 104 104 public void paintSign() { 105 if (dlg.paintlock) return; 105 if (dlg.paintlock) 106 return; 106 107 super.paintSign(); 107 108 108 109 dlg.sM01StatusBar.setText(getErrMsg()); 109 110 110 dlg.tfM01Name.setEnabled(true); 111 dlg.tfM01Name.setText(getName()); 112 dlg.cM01TopMark.setEnabled(true); 113 dlg.cM01TopMark.setVisible(true); 114 dlg.cM01Radar.setEnabled(true); 115 dlg.cM01Radar.setVisible(true); 116 dlg.cM01Racon.setEnabled(true); 117 dlg.cM01Racon.setVisible(true); 118 dlg.cM01Fired.setEnabled(true); 119 120 dlg.cM01Fog.setEnabled(true); 121 dlg.cM01Fog.setVisible(true); 122 123 dlg.cM01Fired.setVisible(true); 124 dlg.cM01Fired.setEnabled(true); 125 126 String image = "/images/Safe_Water"; 127 128 switch (getStyleIndex()) { 129 case SAFE_PILLAR: 130 image += "_Pillar"; 131 break; 132 case SAFE_SPAR: 133 image += "_Spar"; 134 break; 135 case SAFE_SPHERE: 136 image += "_Sphere"; 137 break; 138 case SAFE_BEACON: 139 image += "_Beacon"; 140 break; 141 case SAFE_FLOAT: 142 image += "_Float"; 143 break; 144 default: 145 } 146 147 if (!image.equals("/images/Safe_Water")) { 148 if (hasTopMark()) 111 if ((getBuoyIndex() != 0) && (getStyleIndex() != 0)) { 112 dlg.tfM01Name.setEnabled(true); 113 dlg.tfM01Name.setText(getName()); 114 dlg.cM01TopMark.setEnabled(true); 115 dlg.cM01TopMark.setVisible(true); 116 dlg.cM01Radar.setEnabled(true); 117 dlg.cM01Radar.setVisible(true); 118 dlg.cM01Racon.setEnabled(true); 119 dlg.cM01Racon.setVisible(true); 120 dlg.cM01Fired.setEnabled(true); 121 122 dlg.cM01Fog.setEnabled(true); 123 dlg.cM01Fog.setVisible(true); 124 125 dlg.cM01Fired.setVisible(true); 126 dlg.cM01Fired.setEnabled(true); 127 128 String image = "/images/Safe_Water"; 129 130 switch (getStyleIndex()) { 131 case SAFE_PILLAR: 132 image += "_Pillar"; 133 break; 134 case SAFE_SPAR: 135 image += "_Spar"; 136 break; 137 case SAFE_SPHERE: 149 138 image += "_Sphere"; 150 image += ".png"; 151 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 152 153 if (isFired()) { 154 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 155 if (getLightChar() != "") { 156 String c; 157 158 c = getLightChar(); 159 160 dlg.cbM01Kennung.setSelectedItem(c); 161 if (dlg.cbM01Kennung.getSelectedItem().equals("Not set")) 162 c = ""; 163 } 139 break; 140 case SAFE_BEACON: 141 image += "_Beacon"; 142 break; 143 case SAFE_FLOAT: 144 image += "_Float"; 145 break; 146 default: 164 147 } 165 } else 166 dlg.lM01Icon.setIcon(null); 148 149 if (!image.equals("/images/Safe_Water")) { 150 if (hasTopMark()) 151 image += "_Sphere"; 152 image += ".png"; 153 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 154 } else 155 dlg.lM01Icon.setIcon(null); 156 } 167 157 } 168 158 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r23058 r23060 137 137 138 138 public void paintSign() { 139 if (dlg.paintlock) return; 139 if (dlg.paintlock) 140 return; 140 141 super.paintSign(); 141 142 142 143 dlg.sM01StatusBar.setText(getErrMsg()); 143 144 144 dlg.tfM01Name.setEnabled(true); 145 dlg.tfM01Name.setText(getName()); 146 dlg.cM01Radar.setEnabled(true); 147 dlg.cM01Radar.setVisible(true); 148 dlg.cM01Racon.setEnabled(true); 149 dlg.cM01Racon.setVisible(true); 150 151 dlg.cM01TopMark.setEnabled(true); 152 dlg.cM01TopMark.setVisible(true); 153 if (hasTopMark()) { 154 dlg.cbM01TopMark.setEnabled(true); 155 dlg.cbM01TopMark.setVisible(true); 156 } else { 157 dlg.cbM01TopMark.setVisible(false); 158 } 159 160 dlg.cM01Fog.setEnabled(true); 161 dlg.cM01Fog.setVisible(true); 162 163 dlg.cM01Fired.setVisible(true); 164 dlg.cM01Fired.setEnabled(true); 165 166 String image = "/images/Special_Purpose"; 145 if ((getBuoyIndex() != 0) && (getStyleIndex() != 0)) { 146 dlg.tfM01Name.setEnabled(true); 147 dlg.tfM01Name.setText(getName()); 148 dlg.cM01Radar.setEnabled(true); 149 dlg.cM01Radar.setVisible(true); 150 dlg.cM01Racon.setEnabled(true); 151 dlg.cM01Racon.setVisible(true); 152 153 dlg.cM01TopMark.setEnabled(true); 154 dlg.cM01TopMark.setVisible(true); 155 if (hasTopMark()) { 156 dlg.cbM01TopMark.setEnabled(true); 157 dlg.cbM01TopMark.setVisible(true); 158 } else { 159 dlg.cbM01TopMark.setVisible(false); 160 } 161 162 dlg.cM01Fog.setEnabled(true); 163 dlg.cM01Fog.setVisible(true); 164 165 dlg.cM01Fired.setVisible(true); 166 dlg.cM01Fired.setEnabled(true); 167 168 String image = "/images/Special_Purpose"; 169 170 switch (getStyleIndex()) { 171 case SPEC_PILLAR: 172 image += "_Pillar"; 173 break; 174 case SPEC_SPAR: 175 image += "_Spar"; 176 break; 177 case SPEC_SPHERE: 178 image += "_Sphere"; 179 break; 180 case SPEC_BARREL: 181 image += "_Barrel"; 182 break; 183 case SPEC_FLOAT: 184 image += "_Float"; 185 break; 186 case SPEC_BEACON: 187 image += "_Beacon"; 188 break; 189 case SPEC_TOWER: 190 image += "_Tower"; 191 break; 192 default: 193 } 194 195 if (!image.equals("/images/Special_Purpose")) { 196 if (hasTopMark()) 197 image += "_CrossY"; 198 image += ".png"; 199 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 200 } else 201 dlg.lM01Icon.setIcon(null); 202 } 203 } 204 205 public void saveSign() { 206 Node node = getNode(); 207 208 if (node == null) { 209 return; 210 } 167 211 168 212 switch (getStyleIndex()) { 169 213 case SPEC_PILLAR: 170 image += "_Pillar";171 break;172 case SPEC_SPAR:173 image += "_Spar";174 break;175 case SPEC_SPHERE:176 image += "_Sphere";177 break;178 case SPEC_BARREL:179 image += "_Barrel";180 break;181 case SPEC_FLOAT:182 image += "_Float";183 break;184 case SPEC_BEACON:185 image += "_Beacon";186 break;187 case SPEC_TOWER:188 image += "_Tower";189 break;190 default:191 }192 193 if (!image.equals("/images/Special_Purpose")) {194 if (hasTopMark())195 image += "_CrossY";196 image += ".png";197 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));198 199 if (isFired()) {200 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(201 "/images/Light_White_120.png")));202 if (getLightChar() != "") {203 String c;204 205 c = getLightChar();206 207 dlg.cbM01Kennung.setSelectedItem(c);208 if (dlg.cbM01Kennung.getSelectedItem().equals("Not set"))209 c = "";210 }211 }212 } else213 dlg.lM01Icon.setIcon(null);214 }215 216 217 public void saveSign() {218 Node node = getNode();219 220 if (node == null) {221 return;222 }223 224 switch (getStyleIndex()) {225 case SPEC_PILLAR:226 214 super.saveSign("buoy_special_purpose"); 227 215 Main.main.undoRedo.add(new ChangePropertyCommand(node,
Note:
See TracChangeset
for help on using the changeset viewer.