Changeset 23194 in osm for applications/editors/josm/plugins/toms
- Timestamp:
- 2010-09-15T19:08:30+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23193 r23194 23 23 abstract public class Buoy extends SeaMark { 24 24 25 public abstract void setLightColour(); 26 27 /** 28 * private Variablen 29 */ 30 31 private int BuoyIndex = 0; 32 33 public int getBuoyIndex() { 34 return BuoyIndex; 35 } 36 37 public void setBuoyIndex(int buoyIndex) { 38 BuoyIndex = buoyIndex; 39 } 40 41 private int StyleIndex = 0; 42 43 public int getStyleIndex() { 44 return StyleIndex; 45 } 46 47 public void setStyleIndex(int styleIndex) { 48 StyleIndex = styleIndex; 49 } 50 51 private boolean Region = false; 52 53 public boolean getRegion() { 54 return Region; 55 } 56 57 public void setRegion(boolean region) { 58 Region = region; 59 } 60 61 private boolean Radar = false; 62 63 public boolean hasRadar() { 64 return Radar; 65 } 66 67 public void setRadar(boolean radar) { 68 Radar = radar; 69 } 70 71 private boolean Racon = false; 72 73 public boolean hasRacon() { 74 return Racon; 75 } 76 77 public void setRacon(boolean racon) { 78 Racon = racon; 79 } 80 81 private int RaType = 0; 82 83 public int getRaType() { 84 return RaType; 85 } 86 87 public void setRaType(int type) { 88 RaType = type; 89 } 90 91 private String RaconGroup = ""; 92 93 public String getRaconGroup() { 94 return RaconGroup; 95 } 96 97 public void setRaconGroup(String raconGroup) { 98 RaconGroup = raconGroup; 99 } 100 101 private boolean Fog = false; 102 103 public boolean hasFog() { 104 return Fog; 105 } 106 107 public void setFog(boolean fog) { 108 Fog = fog; 109 } 110 111 private int FogSound = 0; 112 113 public int getFogSound() { 114 return FogSound; 115 } 116 117 public void setFogSound(int sound) { 118 FogSound = sound; 119 } 120 121 private String FogGroup = ""; 122 123 public String getFogGroup() { 124 return FogGroup; 125 } 126 127 public void setFogGroup(String group) { 128 FogGroup = group; 129 } 130 131 private String FogPeriod = ""; 132 133 public String getFogPeriod() { 134 return FogPeriod; 135 } 136 137 public void setFogPeriod(String period) { 138 FogPeriod = period; 139 } 140 141 private boolean Fired = false; 142 143 public boolean isFired() { 144 return Fired; 145 } 146 147 public void setFired(boolean fired) { 148 Fired = fired; 149 } 150 151 private boolean Sectored = false; 152 153 public boolean isSectored() { 154 return Sectored; 155 } 156 157 public void setSectored(boolean sectored) { 158 Sectored = sectored; 159 } 160 161 private int SectorIndex = 0; 162 163 public int getSectorIndex() { 164 return SectorIndex; 165 } 166 167 public void setSectorIndex(int sector) { 168 SectorIndex = sector; 169 } 170 171 private String[] LightChar = new String[10]; 172 173 public String getLightChar() { 174 if (LightChar[SectorIndex] == null) 175 return (LightChar[0]); 176 return LightChar[SectorIndex]; 177 } 178 179 public void setLightChar(String lightChar) { 180 if (SectorIndex == 0) 181 LightChar = new String[10]; 182 LightChar[SectorIndex] = lightChar; 183 } 184 185 private String[] LightColour = new String[10]; 186 187 public String getLightColour() { 188 if (LightColour[SectorIndex] == null) 189 return (LightColour[0]); 190 return LightColour[SectorIndex]; 191 } 192 193 public void setLightColour(String lightColour) { 194 if (SectorIndex == 0) 195 LightColour = new String[10]; 196 LightColour[SectorIndex] = lightColour; 197 } 198 199 private String[] LightGroup = new String[10]; 200 201 public String getLightGroup() { 202 if (LightGroup[SectorIndex] == null) 203 return (LightGroup[0]); 204 return LightGroup[SectorIndex]; 205 } 206 207 public void setLightGroup(String lightGroup) { 208 if (SectorIndex == 0) 209 LightGroup = new String[10]; 210 LightGroup[SectorIndex] = lightGroup; 211 } 212 213 protected void setLightGroup(Map<String, String> k) { 214 String s = ""; 215 if (k.containsKey("seamark:light:group")) { 216 s = k.get("seamark:light:group"); 217 setLightGroup(s); 218 } 219 } 220 221 private String[] Height = new String[10]; 222 223 public String getHeight() { 224 if (Height[SectorIndex] == null) 225 return (Height[0]); 226 return Height[SectorIndex]; 227 } 228 229 public void setHeight(String height) { 230 if (SectorIndex == 0) 231 Height = new String[10]; 232 Height[SectorIndex] = height; 233 } 234 235 private String[] Range = new String[10]; 236 237 public String getRange() { 238 if (Range[SectorIndex] == null) 239 return (Range[0]); 240 return Range[SectorIndex]; 241 } 242 243 public void setRange(String range) { 244 if (SectorIndex == 0) 245 Range = new String[10]; 246 Range[SectorIndex] = range; 247 } 248 249 private String[] Bearing1 = new String[10]; 250 251 public String getBearing1() { 252 if (Bearing1[SectorIndex] == null) 253 return (Bearing1[0]); 254 return Bearing1[SectorIndex]; 255 } 256 257 public void setBearing1(String bearing) { 258 if (SectorIndex == 0) 259 Bearing1 = new String[10]; 260 Bearing1[SectorIndex] = bearing; 261 } 262 263 private String[] Bearing2 = new String[10]; 264 265 public String getBearing2() { 266 if (Bearing2[SectorIndex] == null) 267 return (Bearing2[0]); 268 return Bearing2[SectorIndex]; 269 } 270 271 public void setBearing2(String bearing) { 272 if (SectorIndex == 0) 273 Bearing2 = new String[10]; 274 Bearing2[SectorIndex] = bearing; 275 } 276 277 private String[] Radius = new String[10]; 278 279 public String getRadius() { 280 if (Radius[SectorIndex] == null) 281 return (Radius[0]); 282 return Radius[SectorIndex]; 283 } 284 285 public void setRadius(String radius) { 286 if (SectorIndex == 0) 287 Radius = new String[10]; 288 Radius[SectorIndex] = radius; 289 } 290 291 private String[] LightPeriod = new String[10]; 292 293 public String getLightPeriod() { 294 if (LightPeriod[SectorIndex] == null) 295 return (LightPeriod[0]); 296 return LightPeriod[SectorIndex]; 297 } 298 299 public void setLightPeriod(String lightPeriod) { 300 String regex = "^[\\d\\s.]+$"; 301 302 if (!lightPeriod.isEmpty()) { 303 304 Pattern pat = Pattern.compile(regex); 305 Matcher matcher = pat.matcher(lightPeriod); 306 307 if (matcher.find()) { 308 setErrMsg(null); 309 } else { 310 setErrMsg("Must be a number"); 311 lightPeriod = ""; 312 dlg.tfM01RepeatTime.requestFocus(); 313 } 314 } 315 if (SectorIndex == 0) 316 LightPeriod = new String[10]; 317 LightPeriod[SectorIndex] = lightPeriod; 318 } 319 320 private Node Node = null; 321 322 public Node getNode() { 323 return Node; 324 } 325 326 public void setNode(Node node) { 327 Node = node; 328 } 329 330 private boolean TopMark = false; 331 332 public boolean hasTopMark() { 333 return TopMark; 334 } 335 336 public void setTopMark(boolean topMark) { 337 TopMark = topMark; 338 /* 339 * if (dlg.cM01TopMark == null) { return; } 340 */ 341 dlg.cM01TopMark.setSelected(topMark); 342 } 343 344 protected SmpDialogAction dlg = null; // hier wird der Dialog referenziert 345 346 public SmpDialogAction getDlg() { 347 return dlg; 348 } 349 350 public void setDlg(SmpDialogAction dlg) { 351 this.dlg = dlg; 352 } 353 354 protected Buoy(SmpDialogAction dia) { 355 dlg = dia; 356 } 357 358 public boolean isValid() { 359 return false; 360 } 361 362 public void parseLights(Map<String, String> k) { 363 setFired(false); 364 setSectored(false); 365 Iterator it = k.entrySet().iterator(); 366 while (it.hasNext()) { 367 Map.Entry entry = (Map.Entry) it.next(); 368 String key = (String) entry.getKey(); 369 String value = ((String) entry.getValue()).trim(); 370 if (key.contains("seamark:light:")) { 371 setFired(true); 372 int index = 0; 373 key = key.substring(14); 374 if (key.matches("^\\d:.*")) { 375 index = key.charAt(0) - '0'; 376 key = key.substring(2); 377 } else if (key.matches("^\\d$")) { 378 index = key.charAt(0) - '0'; 379 String values[] = value.split(":"); 380 if (values[0].equals("red")) 381 LightColour[index] = "R"; 382 else if (values[0].equals("green")) 383 LightColour[index] = "G"; 384 else if (values[0].equals("white")) 385 LightColour[index] = "W"; 386 Bearing1[index] = values[1]; 387 Bearing2[index] = values[2]; 388 Radius[index] = values[3]; 389 } else { 390 index = 0; 391 } 392 if (index != 0) 393 setSectored(true); 394 if (key.equals("colour")) { 395 if (value.equals("red")) 396 LightColour[index] = "R"; 397 else if (value.equals("green")) 398 LightColour[index] = "G"; 399 else if (value.equals("white")) 400 LightColour[index] = "W"; 401 } else if (key.equals("character")) { 402 LightChar[index] = value; 403 } else if (key.equals("group")) { 404 LightGroup[index] = value; 405 } else if (key.equals("period")) { 406 LightPeriod[index] = value; 407 } else if (key.equals("height")) { 408 Height[index] = value; 409 } else if (key.equals("range")) { 410 Range[index] = value; 411 } 412 } 413 } 414 setSectorIndex(0); 415 dlg.cbM01Sector.setSelectedIndex(0); 416 dlg.cM01Fired.setSelected(isFired()); 417 dlg.rbM01Fired1.setSelected(!isSectored()); 418 dlg.rbM01FiredN.setSelected(isSectored()); 419 dlg.cbM01Kennung.setSelectedItem(getLightChar()); 420 dlg.tfM01Height.setText(getHeight()); 421 dlg.tfM01Range.setText(getRange()); 422 dlg.tfM01Group.setText(getLightGroup()); 423 dlg.tfM01RepeatTime.setText(getLightPeriod()); 424 dlg.cbM01Colour.setSelectedItem(getLightColour()); 425 } 426 427 public void parseFogRadar(Map<String, String> k) { 428 String str; 429 setFog(false); 430 setRadar(false); 431 setRacon(false); 432 if (k.containsKey("seamark:fog_signal") 433 || k.containsKey("seamark:fog_signal:category") 434 || k.containsKey("seamark:fog_signal:group") 435 || k.containsKey("seamark:fog_signal:period")) { 436 setFog(true); 437 if (k.containsKey("seamark:fog_signal:category")) { 438 str = k.get("seamark:fog_signal:category"); 439 if (str.equals("horn")) 440 setFogSound(FOG_HORN); 441 else if (str.equals("siren")) 442 setFogSound(FOG_SIREN); 443 else if (str.equals("diaphone")) 444 setFogSound(FOG_DIA); 445 else if (str.equals("bell")) 446 setFogSound(FOG_BELL); 447 else if (str.equals("whis")) 448 setFogSound(FOG_WHIS); 449 else if (str.equals("gong")) 450 setFogSound(FOG_GONG); 451 else if (str.equals("explosive")) 452 setFogSound(FOG_EXPLOS); 453 else 454 setFogSound(UNKNOWN_FOG); 455 } 456 if (k.containsKey("seamark:fog_signal:group")) 457 setFogGroup(k.get("seamark:fog_signal:group")); 458 if (k.containsKey("seamark:fog_signal:period")) 459 setFogPeriod(k.get("seamark:fog_signal:period")); 460 } 461 dlg.cM01Fog.setSelected(hasFog()); 462 dlg.cbM01Fog.setSelectedIndex(getFogSound()); 463 dlg.tfM01FogGroup.setText(getFogGroup()); 464 dlg.tfM01FogPeriod.setText(getFogPeriod()); 465 466 if (k.containsKey("seamark:radar_transponder") 467 || k.containsKey("seamark:radar_transponder:category") 468 || k.containsKey("seamark:radar_transponder:group")) { 469 setRacon(true); 470 if (k.containsKey("seamark:radar_transponder:category")) { 471 str = k.get("seamark:radar_transponder:category"); 472 if (str.equals("racon")) 473 setRaType(RATYPE_RACON); 474 else if (str.equals("ramark")) 475 setRaType(RATYPE_RAMARK); 476 else if (str.equals("leading")) 477 setRaType(RATYPE_LEADING); 478 else 479 setRaType(UNKNOWN_RATYPE); 480 } 481 if (k.containsKey("seamark:radar_transponder:group")) 482 setRaconGroup(k.get("seamark:radar_transponder:group")); 483 } else if (k.containsKey("seamark:radar_reflector")) 484 setRadar(true); 485 dlg.cM01Radar.setSelected(hasRadar()); 486 dlg.cM01Racon.setSelected(hasRacon()); 487 dlg.cbM01Racon.setSelectedIndex(getRaType()); 488 dlg.tfM01Racon.setText(getRaconGroup()); 489 } 490 491 public void paintSign() { 492 493 if (dlg.paintlock) 494 return; 495 else 496 dlg.paintlock = true; 497 498 dlg.lM01Icon.setIcon(null); 499 dlg.lM02Icon.setIcon(null); 500 dlg.lM03Icon.setIcon(null); 501 dlg.lM04Icon.setIcon(null); 502 dlg.lM05Icon.setIcon(null); 503 504 dlg.rbM01RegionA.setSelected(!getRegion()); 505 dlg.rbM01RegionB.setSelected(getRegion()); 506 507 if (isValid()) { 508 dlg.bM01Save.setEnabled(true); 509 510 dlg.cM01TopMark.setSelected(hasTopMark()); 511 dlg.cM01Fired.setSelected(isFired()); 512 513 dlg.tfM01RepeatTime.setText(getLightPeriod()); 514 515 dlg.tfM01Name.setText(getName()); 516 dlg.tfM01Name.setEnabled(true); 517 518 if (hasRadar()) { 519 dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource( 520 "/images/Radar_Reflector.png"))); 521 } 522 523 if (hasRacon()) { 524 dlg.lM04Icon.setIcon(new ImageIcon(getClass().getResource( 525 "/images/Radar_Station.png"))); 526 dlg.cbM01Racon.setVisible(true); 527 if (getRaType() == RATYPE_RACON) { 528 dlg.lM01Racon.setVisible(true); 529 dlg.tfM01Racon.setVisible(true); 530 dlg.tfM01Racon.setEnabled(true); 531 } else { 532 dlg.lM01Racon.setVisible(false); 533 dlg.tfM01Racon.setVisible(false); 534 } 535 } else { 536 dlg.cbM01Racon.setVisible(false); 537 dlg.lM01Racon.setVisible(false); 538 dlg.tfM01Racon.setVisible(false); 539 } 540 541 if (hasFog()) { 542 dlg.lM05Icon.setIcon(new ImageIcon(getClass().getResource( 543 "/images/Fog_Signal.png"))); 544 dlg.cbM01Fog.setVisible(true); 545 if (getFogSound() == 0) { 546 dlg.lM01FogGroup.setVisible(false); 547 dlg.tfM01FogGroup.setVisible(false); 548 dlg.lM01FogPeriod.setVisible(false); 549 dlg.tfM01FogPeriod.setVisible(false); 550 } else { 551 dlg.lM01FogGroup.setVisible(true); 552 dlg.tfM01FogGroup.setVisible(true); 553 dlg.lM01FogPeriod.setVisible(true); 554 dlg.tfM01FogPeriod.setVisible(true); 555 } 556 } else { 557 dlg.cbM01Fog.setVisible(false); 558 dlg.lM01FogGroup.setVisible(false); 559 dlg.tfM01FogGroup.setVisible(false); 560 dlg.lM01FogPeriod.setVisible(false); 561 dlg.tfM01FogPeriod.setVisible(false); 562 } 563 564 if (isFired()) { 565 String lp, c; 566 String tmp = null; 567 int i1; 568 569 String col = getLightColour(); 570 if (col.equals("W")) { 571 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 572 "/images/Light_White_120.png"))); 573 dlg.cbM01Colour.setSelectedIndex(WHITE_LIGHT); 574 } else if (col.equals("R")) { 575 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 576 "/images/Light_Red_120.png"))); 577 dlg.cbM01Colour.setSelectedIndex(RED_LIGHT); 578 } else if (col.equals("G")) { 579 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 580 "/images/Light_Green_120.png"))); 581 dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT); 582 } else { 583 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 584 "/images/Light_Magenta_120.png"))); 585 dlg.cbM01Colour.setSelectedIndex(UNKNOWN_COLOUR); 586 } 587 588 c = getLightChar(); 589 if (c.contains("+")) { 590 i1 = c.indexOf("+"); 591 tmp = c.substring(i1, c.length()); 592 c = c.substring(0, i1); 593 if (!getLightGroup().isEmpty()) { 594 c = c + "(" + getLightGroup() + ")"; 595 } 596 if (tmp != null) 597 c = c + tmp; 598 } 599 dlg.cbM01Kennung.setSelectedItem(c); 600 if (((dlg.cbM01Kennung.getSelectedIndex() == 0) && !getLightGroup() 601 .isEmpty()) 602 || (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) 603 && !(((String) dlg.cbM01Kennung.getSelectedItem()).contains("+"))) { 604 c = c + "(" + getLightGroup() + ")"; 605 dlg.cbM01Kennung.setSelectedItem(c); 606 } 607 c = c + " " + getLightColour(); 608 lp = getLightPeriod(); 609 if (!lp.isEmpty()) 610 c = c + " " + lp + "s"; 611 dlg.lM01FireMark.setText(c); 612 dlg.cM01Fired.setVisible(true); 613 dlg.lM01Kennung.setVisible(true); 614 dlg.cbM01Kennung.setVisible(true); 615 if (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) { 616 dlg.tfM01Group.setVisible(false); 617 dlg.lM01Group.setVisible(false); 618 } else { 619 dlg.lM01Group.setVisible(true); 620 dlg.tfM01Group.setVisible(true); 621 } 622 dlg.tfM01Group.setText(getLightGroup()); 623 dlg.lM01RepeatTime.setVisible(true); 624 dlg.tfM01RepeatTime.setVisible(true); 625 if (isSectored()) { 626 dlg.rbM01Fired1.setSelected(false); 627 dlg.rbM01FiredN.setSelected(true); 628 if ((getSectorIndex() != 0) && (!LightChar[0].isEmpty())) 629 dlg.cbM01Kennung.setEnabled(false); 630 else 631 dlg.cbM01Kennung.setEnabled(true); 632 dlg.cbM01Kennung.setSelectedItem(getLightChar()); 633 if ((getSectorIndex() != 0) && (!LightGroup[0].isEmpty())) 634 dlg.tfM01Group.setEnabled(false); 635 else 636 dlg.tfM01Group.setEnabled(true); 637 dlg.tfM01Group.setText(getLightGroup()); 638 if ((getSectorIndex() != 0) && (!LightPeriod[0].isEmpty())) 639 dlg.tfM01RepeatTime.setEnabled(false); 640 else 641 dlg.tfM01RepeatTime.setEnabled(true); 642 dlg.tfM01RepeatTime.setText(getLightPeriod()); 643 if ((getSectorIndex() != 0) && (!Height[0].isEmpty())) 644 dlg.tfM01Height.setEnabled(false); 645 else 646 dlg.tfM01Height.setEnabled(true); 647 dlg.tfM01Height.setText(getHeight()); 648 if ((getSectorIndex() != 0) && (!Range[0].isEmpty())) 649 dlg.tfM01Range.setEnabled(false); 650 else 651 dlg.tfM01Range.setEnabled(true); 652 dlg.tfM01Range.setText(getRange()); 653 dlg.lM01Sector.setVisible(true); 654 dlg.cbM01Sector.setVisible(true); 655 if (getSectorIndex() == 0) { 656 dlg.lM01Colour.setVisible(false); 657 dlg.cbM01Colour.setVisible(false); 658 dlg.lM01Bearing.setVisible(false); 659 dlg.tfM01Bearing.setVisible(false); 660 dlg.tfM02Bearing.setVisible(false); 661 dlg.tfM01Radius.setVisible(false); 662 } else { 663 dlg.lM01Colour.setVisible(true); 664 dlg.cbM01Colour.setVisible(true); 665 dlg.lM01Bearing.setVisible(true); 666 dlg.tfM01Bearing.setVisible(true); 667 dlg.tfM01Bearing.setText(getBearing1()); 668 dlg.tfM02Bearing.setVisible(true); 669 dlg.tfM02Bearing.setText(getBearing2()); 670 dlg.tfM01Radius.setVisible(true); 671 dlg.tfM01Radius.setText(getRadius()); 672 } 673 } else { 674 dlg.rbM01FiredN.setSelected(false); 675 dlg.rbM01Fired1.setSelected(true); 676 dlg.cbM01Kennung.setEnabled(true); 677 dlg.tfM01Group.setEnabled(true); 678 dlg.tfM01RepeatTime.setEnabled(true); 679 dlg.tfM01Height.setEnabled(true); 680 dlg.tfM01Range.setEnabled(true); 681 dlg.lM01Colour.setVisible(true); 682 dlg.cbM01Colour.setVisible(true); 683 dlg.lM01Sector.setVisible(false); 684 dlg.cbM01Sector.setVisible(false); 685 dlg.lM01Bearing.setVisible(false); 686 dlg.tfM01Bearing.setVisible(false); 687 dlg.tfM02Bearing.setVisible(false); 688 dlg.tfM01Radius.setVisible(false); 689 } 690 } else { 691 dlg.lM01FireMark.setText(""); 692 dlg.rbM01Fired1.setVisible(false); 693 dlg.rbM01FiredN.setVisible(false); 694 dlg.cbM01Kennung.setVisible(false); 695 dlg.lM01Kennung.setVisible(false); 696 dlg.tfM01Height.setVisible(false); 697 dlg.lM01Height.setVisible(false); 698 dlg.tfM01Range.setVisible(false); 699 dlg.lM01Range.setVisible(false); 700 dlg.cbM01Colour.setVisible(false); 701 dlg.lM01Colour.setVisible(false); 702 dlg.cbM01Sector.setVisible(false); 703 dlg.lM01Sector.setVisible(false); 704 dlg.tfM01Group.setVisible(false); 705 dlg.lM01Group.setVisible(false); 706 dlg.tfM01RepeatTime.setVisible(false); 707 dlg.lM01RepeatTime.setVisible(false); 708 dlg.tfM01Bearing.setVisible(false); 709 dlg.lM01Bearing.setVisible(false); 710 dlg.tfM02Bearing.setVisible(false); 711 dlg.tfM01Radius.setVisible(false); 712 } 713 } else { 714 dlg.bM01Save.setEnabled(false); 715 dlg.tfM01Name.setEnabled(false); 716 dlg.cM01TopMark.setVisible(false); 717 dlg.cbM01TopMark.setVisible(false); 718 dlg.cM01Radar.setVisible(false); 719 dlg.cM01Racon.setVisible(false); 720 dlg.cbM01Racon.setVisible(false); 721 dlg.tfM01Racon.setVisible(false); 722 dlg.lM01Racon.setVisible(false); 723 dlg.cM01Fog.setVisible(false); 724 dlg.cbM01Fog.setVisible(false); 725 dlg.tfM01FogGroup.setVisible(false); 726 dlg.lM01FogGroup.setVisible(false); 727 dlg.tfM01FogPeriod.setVisible(false); 728 dlg.lM01FogPeriod.setVisible(false); 729 dlg.cM01Fired.setVisible(false); 730 dlg.rbM01Fired1.setVisible(false); 731 dlg.rbM01FiredN.setVisible(false); 732 dlg.cbM01Kennung.setVisible(false); 733 dlg.lM01Kennung.setVisible(false); 734 dlg.tfM01Height.setVisible(false); 735 dlg.lM01Height.setVisible(false); 736 dlg.tfM01Range.setVisible(false); 737 dlg.lM01Range.setVisible(false); 738 dlg.cbM01Colour.setVisible(false); 739 dlg.lM01Colour.setVisible(false); 740 dlg.cbM01Sector.setVisible(false); 741 dlg.lM01Sector.setVisible(false); 742 dlg.tfM01Group.setVisible(false); 743 dlg.lM01Group.setVisible(false); 744 dlg.tfM01RepeatTime.setVisible(false); 745 dlg.lM01RepeatTime.setVisible(false); 746 dlg.tfM01Bearing.setVisible(false); 747 dlg.lM01Bearing.setVisible(false); 748 dlg.tfM02Bearing.setVisible(false); 749 dlg.tfM01Radius.setVisible(false); 750 } 751 dlg.paintlock = false; 752 } 753 754 public void saveSign(String type) { 755 delSeaMarkKeys(Node); 756 757 String str = dlg.tfM01Name.getText(); 758 if (!str.isEmpty()) 759 Main.main.undoRedo.add(new ChangePropertyCommand(Node, "seamark:name", 760 str)); 761 Main.main.undoRedo 762 .add(new ChangePropertyCommand(Node, "seamark:type", type)); 763 } 764 765 protected void saveLightData() { 766 String colour; 767 if (dlg.cM01Fired.isSelected()) { 768 if (!(colour = LightColour[0]).isEmpty()) 769 if (colour.equals("R")) { 770 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 771 "seamark:light:colour", "red")); 772 } else if (colour.equals("G")) { 773 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 774 "seamark:light:colour", "green")); 775 } else if (colour.equals("W")) { 776 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 777 "seamark:light:colour", "white")); 778 } 779 780 if (!LightPeriod[0].isEmpty()) 781 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 782 "seamark:light:period", LightPeriod[0])); 783 784 if (!LightChar[0].isEmpty()) 785 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 786 "seamark:light:character", LightChar[0])); 787 788 if (!LightGroup[0].isEmpty()) 789 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 790 "seamark:light:group", LightGroup[0])); 791 792 if (!Height[0].isEmpty()) 793 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 794 "seamark:light:height", Height[0])); 795 796 if (!Range[0].isEmpty()) 797 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 798 "seamark:light:range", Range[0])); 799 800 for (int i = 1; i < 10; i++) { 801 if ((colour = LightColour[i]) != null) 802 if (colour.equals("R")) { 803 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 804 "seamark:light:" + i + ":colour", "red")); 805 if ((Bearing1[i] != null) && (Bearing2[i] != null) 806 && (Radius[i] != null)) 807 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 808 "seamark:light:" + i, "red:" + Bearing1[i] + ":" 809 + Bearing2[i] + ":" + Radius[i])); 810 } else if (colour.equals("G")) { 811 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 812 "seamark:light:" + i + ":colour", "green")); 813 if ((Bearing1[i] != null) && (Bearing2[i] != null) 814 && (Radius[i] != null)) 815 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 816 "seamark:light:" + i, "green:" + Bearing1[i] + ":" 817 + Bearing2[i] + ":" + Radius[i])); 818 } else if (colour.equals("W")) { 819 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 820 "seamark:light:" + i + ":colour", "white")); 821 if ((Bearing1[i] != null) && (Bearing2[i] != null) 822 && (Radius[i] != null)) 823 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 824 "seamark:light:" + i, "white:" + Bearing1[i] + ":" 825 + Bearing2[i] + ":" + Radius[i])); 826 } 827 828 if (LightPeriod[i] != null) 829 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 830 "seamark:light:" + i + ":period", LightPeriod[i])); 831 832 if (LightChar[i] != null) 833 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 834 "seamark:light:" + i + ":character", LightChar[i])); 835 836 if (LightGroup[i] != null) 837 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 838 "seamark:light:" + i + ":group", LightGroup[i])); 839 840 if (Height[i] != null) 841 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 842 "seamark:light:" + i + ":height", Height[i])); 843 844 if (Range[i] != null) 845 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 846 "seamark:light:" + i + ":range", Range[i])); 847 848 if (Bearing1[i] != null) 849 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 850 "seamark:light:" + i + ":sector_start", Bearing1[i])); 851 852 if (Bearing2[i] != null) 853 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 854 "seamark:light:" + i + ":sector_end", Bearing2[i])); 855 } 856 } 857 } 858 859 protected void saveTopMarkData(String shape, String colour) { 860 if (dlg.cM01TopMark.isSelected()) { 861 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 862 "seamark:topmark:shape", shape)); 863 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 864 "seamark:topmark:colour", colour)); 865 } 866 } 867 868 protected void saveRadarFogData() { 869 if (hasRadar()) { 870 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 871 "seamark:radar_reflector", "yes")); 872 } 873 if (hasRacon()) { 874 switch (RaType) { 875 case RATYPE_RACON: 876 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 877 "seamark:radar_transponder:category", "racon")); 878 if (!getRaconGroup().isEmpty()) 879 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 880 "seamark:radar_transponder:group", getRaconGroup())); 881 break; 882 case RATYPE_RAMARK: 883 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 884 "seamark:radar_transponder:category", "ramark")); 885 break; 886 case RATYPE_LEADING: 887 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 888 "seamark:radar_transponder:category", "leading")); 889 break; 890 default: 891 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 892 "seamark:radar_transponder", "yes")); 893 } 894 } 895 if (hasFog()) { 896 if (getFogSound() == 0) { 897 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 898 "seamark:fog_signal", "yes")); 899 } else { 900 switch (getFogSound()) { 901 case FOG_HORN: 902 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 903 "seamark:fog_signal:category", "horn")); 904 break; 905 case FOG_SIREN: 906 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 907 "seamark:fog_signal:category", "siren")); 908 break; 909 case FOG_DIA: 910 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 911 "seamark:fog_signal:category", "diaphone")); 912 break; 913 case FOG_BELL: 914 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 915 "seamark:fog_signal:category", "bell")); 916 break; 917 case FOG_WHIS: 918 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 919 "seamark:fog_signal:category", "whistle")); 920 break; 921 case FOG_GONG: 922 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 923 "seamark:fog_signal:category", "gong")); 924 break; 925 case FOG_EXPLOS: 926 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 927 "seamark:fog_signal:category", "explosive")); 928 break; 929 } 930 if (!getFogGroup().isEmpty()) 931 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 932 "seamark:fog_signal:group", getFogGroup())); 933 if (!getFogPeriod().isEmpty()) 934 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 935 "seamark:fog_signal:period", getFogPeriod())); 936 } 937 } 938 } 939 940 public void refreshStyles() { 941 } 942 943 public void refreshLights() { 944 dlg.cbM01Kennung.removeAllItems(); 945 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 946 dlg.cbM01Kennung.addItem("Fl"); //$NON-NLS-1$ 947 dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$ 948 dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$ 949 dlg.cbM01Kennung.addItem("F"); //$NON-NLS-1$ 950 dlg.cbM01Kennung.addItem("FFl"); //$NON-NLS-1$ 951 dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$ 952 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ 953 dlg.cbM01Kennung.addItem("IQ"); //$NON-NLS-1$ 954 dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$ 955 dlg.cbM01Kennung.addItem("IVQ"); //$NON-NLS-1$ 956 dlg.cbM01Kennung.addItem("UQ"); //$NON-NLS-1$ 957 dlg.cbM01Kennung.addItem("IUQ"); //$NON-NLS-1$ 958 dlg.cbM01Kennung.addItem("Mo"); //$NON-NLS-1$ 959 dlg.cbM01Kennung.setSelectedIndex(0); 960 } 961 962 public void resetMask() { 963 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 964 965 dlg.lM01Icon.setIcon(null); 966 dlg.lM02Icon.setIcon(null); 967 dlg.lM03Icon.setIcon(null); 968 dlg.lM04Icon.setIcon(null); 969 970 dlg.rbM01RegionA.setEnabled(false); 971 dlg.rbM01RegionB.setEnabled(false); 972 dlg.lM01FireMark.setText(""); 973 dlg.cbM01CatOfMark.removeAllItems(); 974 dlg.cbM01CatOfMark.setVisible(false); 975 dlg.lM01CatOfMark.setVisible(false); 976 setBuoyIndex(0); 977 dlg.cbM01StyleOfMark.removeAllItems(); 978 dlg.cbM01StyleOfMark.setVisible(false); 979 dlg.lM01StyleOfMark.setVisible(false); 980 setStyleIndex(0); 981 dlg.tfM01Name.setText(""); 982 dlg.tfM01Name.setEnabled(false); 983 setName(""); 984 dlg.cM01TopMark.setSelected(false); 985 dlg.cM01TopMark.setVisible(false); 986 dlg.cbM01TopMark.removeAllItems(); 987 dlg.cbM01TopMark.setVisible(false); 988 setTopMark(false); 989 dlg.cM01Radar.setSelected(false); 990 dlg.cM01Radar.setVisible(false); 991 setRadar(false); 992 dlg.cM01Racon.setSelected(false); 993 dlg.cM01Racon.setVisible(false); 994 dlg.cbM01Racon.setVisible(false); 995 dlg.tfM01Racon.setText(""); 996 dlg.tfM01Racon.setVisible(false); 997 dlg.lM01Racon.setVisible(false); 998 setRacon(false); 999 setRaType(0); 1000 dlg.cM01Fog.setSelected(false); 1001 dlg.cM01Fog.setVisible(false); 1002 dlg.cbM01Fog.setVisible(false); 1003 setFogSound(0); 1004 dlg.tfM01FogGroup.setText(""); 1005 dlg.tfM01FogGroup.setVisible(false); 1006 dlg.lM01FogGroup.setVisible(false); 1007 dlg.tfM01FogPeriod.setText(""); 1008 dlg.tfM01FogPeriod.setVisible(false); 1009 dlg.lM01FogPeriod.setVisible(false); 1010 setFog(false); 1011 dlg.cM01Fired.setSelected(false); 1012 dlg.cM01Fired.setVisible(false); 1013 setFired(false); 1014 dlg.rbM01Fired1.setVisible(false); 1015 dlg.rbM01Fired1.setSelected(true); 1016 dlg.rbM01FiredN.setVisible(false); 1017 dlg.rbM01FiredN.setSelected(false); 1018 setSectored(false); 1019 dlg.cbM01Kennung.removeAllItems(); 1020 dlg.cbM01Kennung.setVisible(false); 1021 dlg.lM01Kennung.setVisible(false); 1022 setLightChar(""); 1023 dlg.tfM01Height.setText(""); 1024 dlg.tfM01Height.setVisible(false); 1025 dlg.lM01Height.setVisible(false); 1026 setHeight(""); 1027 dlg.tfM01Range.setText(""); 1028 dlg.tfM01Range.setVisible(false); 1029 dlg.lM01Range.setVisible(false); 1030 setRange(""); 1031 dlg.cbM01Colour.setVisible(false); 1032 dlg.lM01Colour.setVisible(false); 1033 setLightColour(""); 1034 dlg.cbM01Sector.setVisible(false); 1035 dlg.lM01Sector.setVisible(false); 1036 setSectorIndex(0); 1037 dlg.tfM01Group.setText(""); 1038 dlg.tfM01Group.setVisible(false); 1039 dlg.lM01Group.setVisible(false); 1040 setLightGroup(""); 1041 dlg.tfM01RepeatTime.setText(""); 1042 dlg.tfM01RepeatTime.setVisible(false); 1043 dlg.lM01RepeatTime.setVisible(false); 1044 setLightPeriod(""); 1045 dlg.tfM01Bearing.setText(""); 1046 dlg.tfM01Bearing.setVisible(false); 1047 dlg.lM01Bearing.setVisible(false); 1048 setBearing1(""); 1049 dlg.tfM02Bearing.setText(""); 1050 dlg.tfM02Bearing.setVisible(false); 1051 setBearing2(""); 1052 dlg.tfM01Radius.setText(""); 1053 dlg.tfM01Radius.setVisible(false); 1054 setRadius(""); 1055 1056 dlg.bM01Save.setEnabled(false); 1057 } 25 public abstract void setLightColour(); 26 27 /** 28 * private Variablen 29 */ 30 31 private int BuoyIndex = 0; 32 33 public int getBuoyIndex() { 34 return BuoyIndex; 35 } 36 37 public void setBuoyIndex(int buoyIndex) { 38 BuoyIndex = buoyIndex; 39 } 40 41 private int StyleIndex = 0; 42 43 public int getStyleIndex() { 44 return StyleIndex; 45 } 46 47 public void setStyleIndex(int styleIndex) { 48 StyleIndex = styleIndex; 49 } 50 51 private boolean Region = false; 52 53 public boolean getRegion() { 54 return Region; 55 } 56 57 public void setRegion(boolean region) { 58 Region = region; 59 } 60 61 private boolean Radar = false; 62 63 public boolean hasRadar() { 64 return Radar; 65 } 66 67 public void setRadar(boolean radar) { 68 Radar = radar; 69 } 70 71 private boolean Racon = false; 72 73 public boolean hasRacon() { 74 return Racon; 75 } 76 77 public void setRacon(boolean racon) { 78 Racon = racon; 79 } 80 81 private int RaType = 0; 82 83 public int getRaType() { 84 return RaType; 85 } 86 87 public void setRaType(int type) { 88 RaType = type; 89 } 90 91 private String RaconGroup = ""; 92 93 public String getRaconGroup() { 94 return RaconGroup; 95 } 96 97 public void setRaconGroup(String raconGroup) { 98 RaconGroup = raconGroup; 99 } 100 101 private boolean Fog = false; 102 103 public boolean hasFog() { 104 return Fog; 105 } 106 107 public void setFog(boolean fog) { 108 Fog = fog; 109 } 110 111 private int FogSound = 0; 112 113 public int getFogSound() { 114 return FogSound; 115 } 116 117 public void setFogSound(int sound) { 118 FogSound = sound; 119 } 120 121 private String FogGroup = ""; 122 123 public String getFogGroup() { 124 return FogGroup; 125 } 126 127 public void setFogGroup(String group) { 128 FogGroup = group; 129 } 130 131 private String FogPeriod = ""; 132 133 public String getFogPeriod() { 134 return FogPeriod; 135 } 136 137 public void setFogPeriod(String period) { 138 FogPeriod = period; 139 } 140 141 private boolean Fired = false; 142 143 public boolean isFired() { 144 return Fired; 145 } 146 147 public void setFired(boolean fired) { 148 Fired = fired; 149 } 150 151 private boolean Sectored = false; 152 153 public boolean isSectored() { 154 return Sectored; 155 } 156 157 public void setSectored(boolean sectored) { 158 Sectored = sectored; 159 } 160 161 private int SectorIndex = 0; 162 163 public int getSectorIndex() { 164 return SectorIndex; 165 } 166 167 public void setSectorIndex(int sector) { 168 SectorIndex = sector; 169 } 170 171 private String[] LightChar = new String[10]; 172 173 public String getLightChar() { 174 if (LightChar[SectorIndex] == null) 175 return (LightChar[0]); 176 return LightChar[SectorIndex]; 177 } 178 179 public void setLightChar(String lightChar) { 180 if (SectorIndex == 0) 181 LightChar = new String[10]; 182 LightChar[SectorIndex] = lightChar; 183 } 184 185 private String[] LightColour = new String[10]; 186 187 public String getLightColour() { 188 if (LightColour[SectorIndex] == null) 189 return (LightColour[0]); 190 return LightColour[SectorIndex]; 191 } 192 193 public void setLightColour(String lightColour) { 194 LightColour[SectorIndex] = lightColour; 195 } 196 197 private String[] LightGroup = new String[10]; 198 199 public String getLightGroup() { 200 if (LightGroup[SectorIndex] == null) 201 return (LightGroup[0]); 202 return LightGroup[SectorIndex]; 203 } 204 205 public void setLightGroup(String lightGroup) { 206 if (SectorIndex == 0) 207 LightGroup = new String[10]; 208 LightGroup[SectorIndex] = lightGroup; 209 } 210 211 protected void setLightGroup(Map<String, String> k) { 212 String s = ""; 213 if (k.containsKey("seamark:light:group")) { 214 s = k.get("seamark:light:group"); 215 setLightGroup(s); 216 } 217 } 218 219 private String[] Height = new String[10]; 220 221 public String getHeight() { 222 if (Height[SectorIndex] == null) 223 return (Height[0]); 224 return Height[SectorIndex]; 225 } 226 227 public void setHeight(String height) { 228 if (SectorIndex == 0) 229 Height = new String[10]; 230 Height[SectorIndex] = height; 231 } 232 233 private String[] Range = new String[10]; 234 235 public String getRange() { 236 if (Range[SectorIndex] == null) 237 return (Range[0]); 238 return Range[SectorIndex]; 239 } 240 241 public void setRange(String range) { 242 if (SectorIndex == 0) 243 Range = new String[10]; 244 Range[SectorIndex] = range; 245 } 246 247 private String[] Bearing1 = new String[10]; 248 249 public String getBearing1() { 250 if (Bearing1[SectorIndex] == null) 251 return (Bearing1[0]); 252 return Bearing1[SectorIndex]; 253 } 254 255 public void setBearing1(String bearing) { 256 if (SectorIndex == 0) 257 Bearing1 = new String[10]; 258 Bearing1[SectorIndex] = bearing; 259 } 260 261 private String[] Bearing2 = new String[10]; 262 263 public String getBearing2() { 264 if (Bearing2[SectorIndex] == null) 265 return (Bearing2[0]); 266 return Bearing2[SectorIndex]; 267 } 268 269 public void setBearing2(String bearing) { 270 if (SectorIndex == 0) 271 Bearing2 = new String[10]; 272 Bearing2[SectorIndex] = bearing; 273 } 274 275 private String[] Radius = new String[10]; 276 277 public String getRadius() { 278 if (Radius[SectorIndex] == null) 279 return (Radius[0]); 280 return Radius[SectorIndex]; 281 } 282 283 public void setRadius(String radius) { 284 if (SectorIndex == 0) 285 Radius = new String[10]; 286 Radius[SectorIndex] = radius; 287 } 288 289 private String[] LightPeriod = new String[10]; 290 291 public String getLightPeriod() { 292 if (LightPeriod[SectorIndex] == null) 293 return (LightPeriod[0]); 294 return LightPeriod[SectorIndex]; 295 } 296 297 public void setLightPeriod(String lightPeriod) { 298 String regex = "^[\\d\\s.]+$"; 299 300 if (!lightPeriod.isEmpty()) { 301 302 Pattern pat = Pattern.compile(regex); 303 Matcher matcher = pat.matcher(lightPeriod); 304 305 if (matcher.find()) { 306 setErrMsg(null); 307 } else { 308 setErrMsg("Must be a number"); 309 lightPeriod = ""; 310 dlg.tfM01RepeatTime.requestFocus(); 311 } 312 } 313 if (SectorIndex == 0) 314 LightPeriod = new String[10]; 315 LightPeriod[SectorIndex] = lightPeriod; 316 } 317 318 private Node Node = null; 319 320 public Node getNode() { 321 return Node; 322 } 323 324 public void setNode(Node node) { 325 Node = node; 326 } 327 328 private boolean TopMark = false; 329 330 public boolean hasTopMark() { 331 return TopMark; 332 } 333 334 public void setTopMark(boolean topMark) { 335 TopMark = topMark; 336 /* 337 * if (dlg.cM01TopMark == null) { return; } 338 */ 339 dlg.cM01TopMark.setSelected(topMark); 340 } 341 342 protected SmpDialogAction dlg = null; // hier wird der Dialog referenziert 343 344 public SmpDialogAction getDlg() { 345 return dlg; 346 } 347 348 public void setDlg(SmpDialogAction dlg) { 349 this.dlg = dlg; 350 } 351 352 protected Buoy(SmpDialogAction dia) { 353 dlg = dia; 354 } 355 356 public boolean isValid() { 357 return false; 358 } 359 360 public void parseLights(Map<String, String> k) { 361 setFired(false); 362 setSectored(false); 363 Iterator it = k.entrySet().iterator(); 364 while (it.hasNext()) { 365 Map.Entry entry = (Map.Entry) it.next(); 366 String key = (String) entry.getKey(); 367 String value = ((String) entry.getValue()).trim(); 368 if (key.contains("seamark:light:")) { 369 setFired(true); 370 int index = 0; 371 key = key.substring(14); 372 if (key.matches("^\\d:.*")) { 373 index = key.charAt(0) - '0'; 374 key = key.substring(2); 375 } else if (key.matches("^\\d$")) { 376 index = key.charAt(0) - '0'; 377 String values[] = value.split(":"); 378 if (values[0].equals("red")) 379 LightColour[index] = "R"; 380 else if (values[0].equals("green")) 381 LightColour[index] = "G"; 382 else if (values[0].equals("white")) 383 LightColour[index] = "W"; 384 Bearing1[index] = values[1]; 385 Bearing2[index] = values[2]; 386 Radius[index] = values[3]; 387 } else { 388 index = 0; 389 } 390 if (index != 0) 391 setSectored(true); 392 if (key.equals("colour")) { 393 if (value.equals("red")) 394 LightColour[index] = "R"; 395 else if (value.equals("green")) 396 LightColour[index] = "G"; 397 else if (value.equals("white")) 398 LightColour[index] = "W"; 399 } else if (key.equals("character")) { 400 LightChar[index] = value; 401 } else if (key.equals("group")) { 402 LightGroup[index] = value; 403 } else if (key.equals("period")) { 404 LightPeriod[index] = value; 405 } else if (key.equals("height")) { 406 Height[index] = value; 407 } else if (key.equals("range")) { 408 Range[index] = value; 409 } 410 } 411 } 412 setSectorIndex(0); 413 dlg.cbM01Sector.setSelectedIndex(0); 414 dlg.cM01Fired.setSelected(isFired()); 415 dlg.rbM01Fired1.setSelected(!isSectored()); 416 dlg.rbM01FiredN.setSelected(isSectored()); 417 dlg.cbM01Kennung.setSelectedItem(getLightChar()); 418 dlg.tfM01Height.setText(getHeight()); 419 dlg.tfM01Range.setText(getRange()); 420 dlg.tfM01Group.setText(getLightGroup()); 421 dlg.tfM01RepeatTime.setText(getLightPeriod()); 422 dlg.cbM01Colour.setSelectedItem(getLightColour()); 423 } 424 425 public void parseFogRadar(Map<String, String> k) { 426 String str; 427 setFog(false); 428 setRadar(false); 429 setRacon(false); 430 if (k.containsKey("seamark:fog_signal") 431 || k.containsKey("seamark:fog_signal:category") 432 || k.containsKey("seamark:fog_signal:group") 433 || k.containsKey("seamark:fog_signal:period")) { 434 setFog(true); 435 if (k.containsKey("seamark:fog_signal:category")) { 436 str = k.get("seamark:fog_signal:category"); 437 if (str.equals("horn")) 438 setFogSound(FOG_HORN); 439 else if (str.equals("siren")) 440 setFogSound(FOG_SIREN); 441 else if (str.equals("diaphone")) 442 setFogSound(FOG_DIA); 443 else if (str.equals("bell")) 444 setFogSound(FOG_BELL); 445 else if (str.equals("whis")) 446 setFogSound(FOG_WHIS); 447 else if (str.equals("gong")) 448 setFogSound(FOG_GONG); 449 else if (str.equals("explosive")) 450 setFogSound(FOG_EXPLOS); 451 else 452 setFogSound(UNKNOWN_FOG); 453 } 454 if (k.containsKey("seamark:fog_signal:group")) 455 setFogGroup(k.get("seamark:fog_signal:group")); 456 if (k.containsKey("seamark:fog_signal:period")) 457 setFogPeriod(k.get("seamark:fog_signal:period")); 458 } 459 dlg.cM01Fog.setSelected(hasFog()); 460 dlg.cbM01Fog.setSelectedIndex(getFogSound()); 461 dlg.tfM01FogGroup.setText(getFogGroup()); 462 dlg.tfM01FogPeriod.setText(getFogPeriod()); 463 464 if (k.containsKey("seamark:radar_transponder") 465 || k.containsKey("seamark:radar_transponder:category") 466 || k.containsKey("seamark:radar_transponder:group")) { 467 setRacon(true); 468 if (k.containsKey("seamark:radar_transponder:category")) { 469 str = k.get("seamark:radar_transponder:category"); 470 if (str.equals("racon")) 471 setRaType(RATYPE_RACON); 472 else if (str.equals("ramark")) 473 setRaType(RATYPE_RAMARK); 474 else if (str.equals("leading")) 475 setRaType(RATYPE_LEADING); 476 else 477 setRaType(UNKNOWN_RATYPE); 478 } 479 if (k.containsKey("seamark:radar_transponder:group")) 480 setRaconGroup(k.get("seamark:radar_transponder:group")); 481 } else if (k.containsKey("seamark:radar_reflector")) 482 setRadar(true); 483 dlg.cM01Radar.setSelected(hasRadar()); 484 dlg.cM01Racon.setSelected(hasRacon()); 485 dlg.cbM01Racon.setSelectedIndex(getRaType()); 486 dlg.tfM01Racon.setText(getRaconGroup()); 487 } 488 489 public void paintSign() { 490 491 if (dlg.paintlock) 492 return; 493 else 494 dlg.paintlock = true; 495 496 dlg.lM01Icon.setIcon(null); 497 dlg.lM02Icon.setIcon(null); 498 dlg.lM03Icon.setIcon(null); 499 dlg.lM04Icon.setIcon(null); 500 dlg.lM05Icon.setIcon(null); 501 502 dlg.rbM01RegionA.setSelected(!getRegion()); 503 dlg.rbM01RegionB.setSelected(getRegion()); 504 505 if (isValid()) { 506 dlg.bM01Save.setEnabled(true); 507 508 dlg.cM01TopMark.setSelected(hasTopMark()); 509 dlg.cM01Fired.setSelected(isFired()); 510 511 dlg.tfM01RepeatTime.setText(getLightPeriod()); 512 513 dlg.tfM01Name.setText(getName()); 514 dlg.tfM01Name.setEnabled(true); 515 516 if (hasRadar()) { 517 dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource( 518 "/images/Radar_Reflector.png"))); 519 } 520 521 if (hasRacon()) { 522 dlg.lM04Icon.setIcon(new ImageIcon(getClass().getResource( 523 "/images/Radar_Station.png"))); 524 dlg.cbM01Racon.setVisible(true); 525 if (getRaType() == RATYPE_RACON) { 526 dlg.lM01Racon.setVisible(true); 527 dlg.tfM01Racon.setVisible(true); 528 dlg.tfM01Racon.setEnabled(true); 529 } else { 530 dlg.lM01Racon.setVisible(false); 531 dlg.tfM01Racon.setVisible(false); 532 } 533 } else { 534 dlg.cbM01Racon.setVisible(false); 535 dlg.lM01Racon.setVisible(false); 536 dlg.tfM01Racon.setVisible(false); 537 } 538 539 if (hasFog()) { 540 dlg.lM05Icon.setIcon(new ImageIcon(getClass().getResource( 541 "/images/Fog_Signal.png"))); 542 dlg.cbM01Fog.setVisible(true); 543 if (getFogSound() == 0) { 544 dlg.lM01FogGroup.setVisible(false); 545 dlg.tfM01FogGroup.setVisible(false); 546 dlg.lM01FogPeriod.setVisible(false); 547 dlg.tfM01FogPeriod.setVisible(false); 548 } else { 549 dlg.lM01FogGroup.setVisible(true); 550 dlg.tfM01FogGroup.setVisible(true); 551 dlg.lM01FogPeriod.setVisible(true); 552 dlg.tfM01FogPeriod.setVisible(true); 553 } 554 } else { 555 dlg.cbM01Fog.setVisible(false); 556 dlg.lM01FogGroup.setVisible(false); 557 dlg.tfM01FogGroup.setVisible(false); 558 dlg.lM01FogPeriod.setVisible(false); 559 dlg.tfM01FogPeriod.setVisible(false); 560 } 561 562 if (isFired()) { 563 String lp, c; 564 String tmp = null; 565 int i1; 566 567 String col = getLightColour(); 568 if (col.equals("W")) { 569 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 570 "/images/Light_White_120.png"))); 571 dlg.cbM01Colour.setSelectedIndex(WHITE_LIGHT); 572 } else if (col.equals("R")) { 573 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 574 "/images/Light_Red_120.png"))); 575 dlg.cbM01Colour.setSelectedIndex(RED_LIGHT); 576 } else if (col.equals("G")) { 577 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 578 "/images/Light_Green_120.png"))); 579 dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT); 580 } else { 581 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 582 "/images/Light_Magenta_120.png"))); 583 dlg.cbM01Colour.setSelectedIndex(UNKNOWN_COLOUR); 584 } 585 586 c = getLightChar(); 587 if (c.contains("+")) { 588 i1 = c.indexOf("+"); 589 tmp = c.substring(i1, c.length()); 590 c = c.substring(0, i1); 591 if (!getLightGroup().isEmpty()) { 592 c = c + "(" + getLightGroup() + ")"; 593 } 594 if (tmp != null) 595 c = c + tmp; 596 } 597 dlg.cbM01Kennung.setSelectedItem(c); 598 if (((dlg.cbM01Kennung.getSelectedIndex() == 0) && !getLightGroup() 599 .isEmpty()) 600 || (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) 601 && !(((String) dlg.cbM01Kennung.getSelectedItem()).contains("+"))) { 602 c = c + "(" + getLightGroup() + ")"; 603 dlg.cbM01Kennung.setSelectedItem(c); 604 } 605 c = c + " " + getLightColour(); 606 lp = getLightPeriod(); 607 if (!lp.isEmpty()) 608 c = c + " " + lp + "s"; 609 dlg.lM01FireMark.setText(c); 610 dlg.cM01Fired.setVisible(true); 611 dlg.lM01Kennung.setVisible(true); 612 dlg.cbM01Kennung.setVisible(true); 613 if (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) { 614 dlg.tfM01Group.setVisible(false); 615 dlg.lM01Group.setVisible(false); 616 } else { 617 dlg.lM01Group.setVisible(true); 618 dlg.tfM01Group.setVisible(true); 619 } 620 dlg.tfM01Group.setText(getLightGroup()); 621 dlg.lM01RepeatTime.setVisible(true); 622 dlg.tfM01RepeatTime.setVisible(true); 623 if (isSectored()) { 624 dlg.rbM01Fired1.setSelected(false); 625 dlg.rbM01FiredN.setSelected(true); 626 if ((getSectorIndex() != 0) && (!LightChar[0].isEmpty())) 627 dlg.cbM01Kennung.setEnabled(false); 628 else 629 dlg.cbM01Kennung.setEnabled(true); 630 dlg.cbM01Kennung.setSelectedItem(getLightChar()); 631 if ((getSectorIndex() != 0) && (!LightGroup[0].isEmpty())) 632 dlg.tfM01Group.setEnabled(false); 633 else 634 dlg.tfM01Group.setEnabled(true); 635 dlg.tfM01Group.setText(getLightGroup()); 636 if ((getSectorIndex() != 0) && (!LightPeriod[0].isEmpty())) 637 dlg.tfM01RepeatTime.setEnabled(false); 638 else 639 dlg.tfM01RepeatTime.setEnabled(true); 640 dlg.tfM01RepeatTime.setText(getLightPeriod()); 641 if ((getSectorIndex() != 0) && (!Height[0].isEmpty())) 642 dlg.tfM01Height.setEnabled(false); 643 else 644 dlg.tfM01Height.setEnabled(true); 645 dlg.tfM01Height.setText(getHeight()); 646 if ((getSectorIndex() != 0) && (!Range[0].isEmpty())) 647 dlg.tfM01Range.setEnabled(false); 648 else 649 dlg.tfM01Range.setEnabled(true); 650 dlg.tfM01Range.setText(getRange()); 651 dlg.lM01Sector.setVisible(true); 652 dlg.cbM01Sector.setVisible(true); 653 if (getSectorIndex() == 0) { 654 dlg.lM01Colour.setVisible(false); 655 dlg.cbM01Colour.setVisible(false); 656 dlg.lM01Bearing.setVisible(false); 657 dlg.tfM01Bearing.setVisible(false); 658 dlg.tfM02Bearing.setVisible(false); 659 dlg.tfM01Radius.setVisible(false); 660 } else { 661 dlg.lM01Colour.setVisible(true); 662 dlg.cbM01Colour.setVisible(true); 663 dlg.lM01Bearing.setVisible(true); 664 dlg.tfM01Bearing.setVisible(true); 665 dlg.tfM01Bearing.setText(getBearing1()); 666 dlg.tfM02Bearing.setVisible(true); 667 dlg.tfM02Bearing.setText(getBearing2()); 668 dlg.tfM01Radius.setVisible(true); 669 dlg.tfM01Radius.setText(getRadius()); 670 } 671 } else { 672 dlg.rbM01FiredN.setSelected(false); 673 dlg.rbM01Fired1.setSelected(true); 674 dlg.cbM01Kennung.setEnabled(true); 675 dlg.tfM01Group.setEnabled(true); 676 dlg.tfM01RepeatTime.setEnabled(true); 677 dlg.tfM01Height.setEnabled(true); 678 dlg.tfM01Range.setEnabled(true); 679 dlg.lM01Colour.setVisible(true); 680 dlg.cbM01Colour.setVisible(true); 681 dlg.lM01Sector.setVisible(false); 682 dlg.cbM01Sector.setVisible(false); 683 dlg.lM01Bearing.setVisible(false); 684 dlg.tfM01Bearing.setVisible(false); 685 dlg.tfM02Bearing.setVisible(false); 686 dlg.tfM01Radius.setVisible(false); 687 } 688 } else { 689 dlg.lM01FireMark.setText(""); 690 dlg.rbM01Fired1.setVisible(false); 691 dlg.rbM01FiredN.setVisible(false); 692 dlg.cbM01Kennung.setVisible(false); 693 dlg.lM01Kennung.setVisible(false); 694 dlg.tfM01Height.setVisible(false); 695 dlg.lM01Height.setVisible(false); 696 dlg.tfM01Range.setVisible(false); 697 dlg.lM01Range.setVisible(false); 698 dlg.cbM01Colour.setVisible(false); 699 dlg.lM01Colour.setVisible(false); 700 dlg.cbM01Sector.setVisible(false); 701 dlg.lM01Sector.setVisible(false); 702 dlg.tfM01Group.setVisible(false); 703 dlg.lM01Group.setVisible(false); 704 dlg.tfM01RepeatTime.setVisible(false); 705 dlg.lM01RepeatTime.setVisible(false); 706 dlg.tfM01Bearing.setVisible(false); 707 dlg.lM01Bearing.setVisible(false); 708 dlg.tfM02Bearing.setVisible(false); 709 dlg.tfM01Radius.setVisible(false); 710 } 711 } else { 712 dlg.bM01Save.setEnabled(false); 713 dlg.tfM01Name.setEnabled(false); 714 dlg.cM01TopMark.setVisible(false); 715 dlg.cbM01TopMark.setVisible(false); 716 dlg.cM01Radar.setVisible(false); 717 dlg.cM01Racon.setVisible(false); 718 dlg.cbM01Racon.setVisible(false); 719 dlg.tfM01Racon.setVisible(false); 720 dlg.lM01Racon.setVisible(false); 721 dlg.cM01Fog.setVisible(false); 722 dlg.cbM01Fog.setVisible(false); 723 dlg.tfM01FogGroup.setVisible(false); 724 dlg.lM01FogGroup.setVisible(false); 725 dlg.tfM01FogPeriod.setVisible(false); 726 dlg.lM01FogPeriod.setVisible(false); 727 dlg.cM01Fired.setVisible(false); 728 dlg.rbM01Fired1.setVisible(false); 729 dlg.rbM01FiredN.setVisible(false); 730 dlg.cbM01Kennung.setVisible(false); 731 dlg.lM01Kennung.setVisible(false); 732 dlg.tfM01Height.setVisible(false); 733 dlg.lM01Height.setVisible(false); 734 dlg.tfM01Range.setVisible(false); 735 dlg.lM01Range.setVisible(false); 736 dlg.cbM01Colour.setVisible(false); 737 dlg.lM01Colour.setVisible(false); 738 dlg.cbM01Sector.setVisible(false); 739 dlg.lM01Sector.setVisible(false); 740 dlg.tfM01Group.setVisible(false); 741 dlg.lM01Group.setVisible(false); 742 dlg.tfM01RepeatTime.setVisible(false); 743 dlg.lM01RepeatTime.setVisible(false); 744 dlg.tfM01Bearing.setVisible(false); 745 dlg.lM01Bearing.setVisible(false); 746 dlg.tfM02Bearing.setVisible(false); 747 dlg.tfM01Radius.setVisible(false); 748 } 749 dlg.paintlock = false; 750 } 751 752 public void saveSign(String type) { 753 delSeaMarkKeys(Node); 754 755 String str = dlg.tfM01Name.getText(); 756 if (!str.isEmpty()) 757 Main.main.undoRedo.add(new ChangePropertyCommand(Node, "seamark:name", 758 str)); 759 Main.main.undoRedo 760 .add(new ChangePropertyCommand(Node, "seamark:type", type)); 761 } 762 763 protected void saveLightData() { 764 String colour; 765 if (dlg.cM01Fired.isSelected()) { 766 if (!(colour = LightColour[0]).isEmpty()) 767 if (colour.equals("R")) { 768 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 769 "seamark:light:colour", "red")); 770 } else if (colour.equals("G")) { 771 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 772 "seamark:light:colour", "green")); 773 } else if (colour.equals("W")) { 774 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 775 "seamark:light:colour", "white")); 776 } 777 778 if (!LightPeriod[0].isEmpty()) 779 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 780 "seamark:light:period", LightPeriod[0])); 781 782 if (!LightChar[0].isEmpty()) 783 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 784 "seamark:light:character", LightChar[0])); 785 786 if (!LightGroup[0].isEmpty()) 787 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 788 "seamark:light:group", LightGroup[0])); 789 790 if (!Height[0].isEmpty()) 791 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 792 "seamark:light:height", Height[0])); 793 794 if (!Range[0].isEmpty()) 795 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 796 "seamark:light:range", Range[0])); 797 798 for (int i = 1; i < 10; i++) { 799 if ((colour = LightColour[i]) != null) 800 if (colour.equals("R")) { 801 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 802 "seamark:light:" + i + ":colour", "red")); 803 if ((Bearing1[i] != null) && (Bearing2[i] != null) 804 && (Radius[i] != null)) 805 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 806 "seamark:light:" + i, "red:" + Bearing1[i] + ":" 807 + Bearing2[i] + ":" + Radius[i])); 808 } else if (colour.equals("G")) { 809 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 810 "seamark:light:" + i + ":colour", "green")); 811 if ((Bearing1[i] != null) && (Bearing2[i] != null) 812 && (Radius[i] != null)) 813 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 814 "seamark:light:" + i, "green:" + Bearing1[i] + ":" 815 + Bearing2[i] + ":" + Radius[i])); 816 } else if (colour.equals("W")) { 817 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 818 "seamark:light:" + i + ":colour", "white")); 819 if ((Bearing1[i] != null) && (Bearing2[i] != null) 820 && (Radius[i] != null)) 821 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 822 "seamark:light:" + i, "white:" + Bearing1[i] + ":" 823 + Bearing2[i] + ":" + Radius[i])); 824 } 825 826 if (LightPeriod[i] != null) 827 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 828 "seamark:light:" + i + ":period", LightPeriod[i])); 829 830 if (LightChar[i] != null) 831 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 832 "seamark:light:" + i + ":character", LightChar[i])); 833 834 if (LightGroup[i] != null) 835 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 836 "seamark:light:" + i + ":group", LightGroup[i])); 837 838 if (Height[i] != null) 839 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 840 "seamark:light:" + i + ":height", Height[i])); 841 842 if (Range[i] != null) 843 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 844 "seamark:light:" + i + ":range", Range[i])); 845 846 if (Bearing1[i] != null) 847 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 848 "seamark:light:" + i + ":sector_start", Bearing1[i])); 849 850 if (Bearing2[i] != null) 851 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 852 "seamark:light:" + i + ":sector_end", Bearing2[i])); 853 } 854 } 855 } 856 857 protected void saveTopMarkData(String shape, String colour) { 858 if (dlg.cM01TopMark.isSelected()) { 859 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 860 "seamark:topmark:shape", shape)); 861 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 862 "seamark:topmark:colour", colour)); 863 } 864 } 865 866 protected void saveRadarFogData() { 867 if (hasRadar()) { 868 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 869 "seamark:radar_reflector", "yes")); 870 } 871 if (hasRacon()) { 872 switch (RaType) { 873 case RATYPE_RACON: 874 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 875 "seamark:radar_transponder:category", "racon")); 876 if (!getRaconGroup().isEmpty()) 877 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 878 "seamark:radar_transponder:group", getRaconGroup())); 879 break; 880 case RATYPE_RAMARK: 881 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 882 "seamark:radar_transponder:category", "ramark")); 883 break; 884 case RATYPE_LEADING: 885 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 886 "seamark:radar_transponder:category", "leading")); 887 break; 888 default: 889 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 890 "seamark:radar_transponder", "yes")); 891 } 892 } 893 if (hasFog()) { 894 if (getFogSound() == 0) { 895 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 896 "seamark:fog_signal", "yes")); 897 } else { 898 switch (getFogSound()) { 899 case FOG_HORN: 900 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 901 "seamark:fog_signal:category", "horn")); 902 break; 903 case FOG_SIREN: 904 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 905 "seamark:fog_signal:category", "siren")); 906 break; 907 case FOG_DIA: 908 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 909 "seamark:fog_signal:category", "diaphone")); 910 break; 911 case FOG_BELL: 912 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 913 "seamark:fog_signal:category", "bell")); 914 break; 915 case FOG_WHIS: 916 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 917 "seamark:fog_signal:category", "whistle")); 918 break; 919 case FOG_GONG: 920 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 921 "seamark:fog_signal:category", "gong")); 922 break; 923 case FOG_EXPLOS: 924 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 925 "seamark:fog_signal:category", "explosive")); 926 break; 927 } 928 if (!getFogGroup().isEmpty()) 929 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 930 "seamark:fog_signal:group", getFogGroup())); 931 if (!getFogPeriod().isEmpty()) 932 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 933 "seamark:fog_signal:period", getFogPeriod())); 934 } 935 } 936 } 937 938 public void refreshStyles() { 939 } 940 941 public void refreshLights() { 942 dlg.cbM01Kennung.removeAllItems(); 943 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 944 dlg.cbM01Kennung.addItem("Fl"); //$NON-NLS-1$ 945 dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$ 946 dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$ 947 dlg.cbM01Kennung.addItem("F"); //$NON-NLS-1$ 948 dlg.cbM01Kennung.addItem("FFl"); //$NON-NLS-1$ 949 dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$ 950 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ 951 dlg.cbM01Kennung.addItem("IQ"); //$NON-NLS-1$ 952 dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$ 953 dlg.cbM01Kennung.addItem("IVQ"); //$NON-NLS-1$ 954 dlg.cbM01Kennung.addItem("UQ"); //$NON-NLS-1$ 955 dlg.cbM01Kennung.addItem("IUQ"); //$NON-NLS-1$ 956 dlg.cbM01Kennung.addItem("Mo"); //$NON-NLS-1$ 957 dlg.cbM01Kennung.setSelectedIndex(0); 958 } 959 960 public void resetMask() { 961 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 962 963 dlg.lM01Icon.setIcon(null); 964 dlg.lM02Icon.setIcon(null); 965 dlg.lM03Icon.setIcon(null); 966 dlg.lM04Icon.setIcon(null); 967 968 dlg.rbM01RegionA.setEnabled(false); 969 dlg.rbM01RegionB.setEnabled(false); 970 dlg.lM01FireMark.setText(""); 971 dlg.cbM01CatOfMark.removeAllItems(); 972 dlg.cbM01CatOfMark.setVisible(false); 973 dlg.lM01CatOfMark.setVisible(false); 974 setBuoyIndex(0); 975 dlg.cbM01StyleOfMark.removeAllItems(); 976 dlg.cbM01StyleOfMark.setVisible(false); 977 dlg.lM01StyleOfMark.setVisible(false); 978 setStyleIndex(0); 979 dlg.tfM01Name.setText(""); 980 dlg.tfM01Name.setEnabled(false); 981 setName(""); 982 dlg.cM01TopMark.setSelected(false); 983 dlg.cM01TopMark.setVisible(false); 984 dlg.cbM01TopMark.removeAllItems(); 985 dlg.cbM01TopMark.setVisible(false); 986 setTopMark(false); 987 dlg.cM01Radar.setSelected(false); 988 dlg.cM01Radar.setVisible(false); 989 setRadar(false); 990 dlg.cM01Racon.setSelected(false); 991 dlg.cM01Racon.setVisible(false); 992 dlg.cbM01Racon.setVisible(false); 993 dlg.tfM01Racon.setText(""); 994 dlg.tfM01Racon.setVisible(false); 995 dlg.lM01Racon.setVisible(false); 996 setRacon(false); 997 setRaType(0); 998 dlg.cM01Fog.setSelected(false); 999 dlg.cM01Fog.setVisible(false); 1000 dlg.cbM01Fog.setVisible(false); 1001 setFogSound(0); 1002 dlg.tfM01FogGroup.setText(""); 1003 dlg.tfM01FogGroup.setVisible(false); 1004 dlg.lM01FogGroup.setVisible(false); 1005 dlg.tfM01FogPeriod.setText(""); 1006 dlg.tfM01FogPeriod.setVisible(false); 1007 dlg.lM01FogPeriod.setVisible(false); 1008 setFog(false); 1009 dlg.cM01Fired.setSelected(false); 1010 dlg.cM01Fired.setVisible(false); 1011 setFired(false); 1012 dlg.rbM01Fired1.setVisible(false); 1013 dlg.rbM01Fired1.setSelected(true); 1014 dlg.rbM01FiredN.setVisible(false); 1015 dlg.rbM01FiredN.setSelected(false); 1016 setSectored(false); 1017 dlg.cbM01Kennung.removeAllItems(); 1018 dlg.cbM01Kennung.setVisible(false); 1019 dlg.lM01Kennung.setVisible(false); 1020 setLightChar(""); 1021 dlg.tfM01Height.setText(""); 1022 dlg.tfM01Height.setVisible(false); 1023 dlg.lM01Height.setVisible(false); 1024 setHeight(""); 1025 dlg.tfM01Range.setText(""); 1026 dlg.tfM01Range.setVisible(false); 1027 dlg.lM01Range.setVisible(false); 1028 setRange(""); 1029 dlg.cbM01Colour.setVisible(false); 1030 dlg.lM01Colour.setVisible(false); 1031 setLightColour(""); 1032 dlg.cbM01Sector.setVisible(false); 1033 dlg.lM01Sector.setVisible(false); 1034 setSectorIndex(0); 1035 dlg.tfM01Group.setText(""); 1036 dlg.tfM01Group.setVisible(false); 1037 dlg.lM01Group.setVisible(false); 1038 setLightGroup(""); 1039 dlg.tfM01RepeatTime.setText(""); 1040 dlg.tfM01RepeatTime.setVisible(false); 1041 dlg.lM01RepeatTime.setVisible(false); 1042 setLightPeriod(""); 1043 dlg.tfM01Bearing.setText(""); 1044 dlg.tfM01Bearing.setVisible(false); 1045 dlg.lM01Bearing.setVisible(false); 1046 setBearing1(""); 1047 dlg.tfM02Bearing.setText(""); 1048 dlg.tfM02Bearing.setVisible(false); 1049 setBearing2(""); 1050 dlg.tfM01Radius.setText(""); 1051 dlg.tfM01Radius.setVisible(false); 1052 setRadius(""); 1053 1054 dlg.bM01Save.setEnabled(false); 1055 } 1058 1056 1059 1057 }
Note:
See TracChangeset
for help on using the changeset viewer.