Changeset 26999 in osm
- Timestamp:
- 2011-11-03T17:41:47+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r26970 r26999 12 12 import oseam.Messages; 13 13 import oseam.dialogs.OSeaMAction; 14 import oseam.seamarks. *;15 import oseam.seamarks. Light.*;14 import oseam.seamarks.SeaMark; 15 import oseam.seamarks.SeaMark.*; 16 16 17 17 public class PanelChr extends JPanel { 18 // System.out.println(map);19 18 20 19 private OSeaMAction dlg; … … 57 56 } 58 57 } 59 if ( Light.ChrMAP.containsKey(combo)) {60 charBox.setText( Light.ChrMAP.get(combo));58 if (SeaMark.ChrMAP.containsKey(combo)) { 59 charBox.setText(SeaMark.ChrMAP.get(combo)); 61 60 } else { 62 61 for (Chr chr : buttons.keySet()) { 63 62 JToggleButton button = buttons.get(chr); 64 63 if (button == source) { 65 charBox.setText( Light.ChrMAP.get(EnumSet.of(chr)));64 charBox.setText(SeaMark.ChrMAP.get(EnumSet.of(chr))); 66 65 button.setSelected(true); 67 66 button.setBorderPainted(true); … … 78 77 String str = charBox.getText(); 79 78 EnumSet<Chr> set = EnumSet.noneOf(Chr.class); 80 for (EnumSet<Chr> map : Light.ChrMAP.keySet()) {81 if (str.equals( Light.ChrMAP.get(map))) {79 for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) { 80 if (str.equals(SeaMark.ChrMAP.get(map))) { 82 81 set = map; 83 82 break; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r26998 r26999 10 10 import oseam.Messages; 11 11 import oseam.dialogs.OSeaMAction; 12 import oseam.seamarks.SeaMark; 12 13 import oseam.seamarks.SeaMark.*; 13 14 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r26949 r26999 4 4 import javax.swing.*; 5 5 6 import oseam.seamarks. Light;6 import oseam.seamarks.*; 7 7 8 8 public class PanelSectors extends JFrame { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/Light.java
r26561 r26999 52 52 ((Object[])lights.get(row+1))[col+1] = value; 53 53 } 54 54 55 public void addSector(int idx) { 55 56 lights.add(idx, new Object[]{null, null, null, null, null, null, null, null, null, null, null, null}); … … 104 105 } 105 106 106 public enum Chr {107 UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK,108 ISOPHASED, OCCULTING, MORSE, ALTERNATING, INTERRUPTEDQUICK, INTERRUPTEDVERYQUICK, INTERRUPTEDULTRAQUICK109 }110 111 public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<EnumSet<Chr>, String>();112 static {113 ChrMAP.put(EnumSet.of(Chr.UNKNOWN), "");114 ChrMAP.put(EnumSet.of(Chr.FIXED), "F");115 ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");116 ChrMAP.put(EnumSet.of(Chr.LONGFLASH), "LFl");117 ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");118 ChrMAP.put(EnumSet.of(Chr.VERYQUICK), "VQ");119 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK), "UQ");120 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDQUICK), "IQ");121 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDVERYQUICK), "IVQ");122 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDULTRAQUICK), "IUQ");123 ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");124 ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");125 ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo");126 ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al");127 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F");128 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");129 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "F.Al.Fl");130 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LONGFLASH), "Al.LFl");131 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");132 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");133 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");134 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LONGFLASH), "FLFl");135 ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");136 ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LONGFLASH), "FlLFl");137 ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LONGFLASH), "Q+LFl");138 ChrMAP.put(EnumSet.of(Chr.VERYQUICK, Chr.LONGFLASH), "VQ+LFl");139 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK, Chr.LONGFLASH), "UQ+LFl");140 }141 142 107 public Chr getLightChar(int idx) { 143 108 return (Chr)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 4); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26998 r26999 10 10 11 11 import oseam.dialogs.OSeaMAction; 12 import oseam.seamarks.Light;13 12 14 13 public class SeaMark { … … 19 18 dlg = dia; 20 19 } 20 21 public Light light = new Light(dlg); 21 22 22 23 public String validDecimal(String str) { … … 160 161 161 162 public enum Cat { 162 NONE, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST, 163 ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM, 164 SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY, 165 SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH, 166 MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY, 167 SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC, 168 SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE, 169 SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG 163 NONE, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST, ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM, SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY, SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH, MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY, SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC, SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE, SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG 170 164 } 171 165 … … 434 428 } 435 429 430 public enum Chr { 431 UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, INTERRUPTEDQUICK, INTERRUPTEDVERYQUICK, INTERRUPTEDULTRAQUICK 432 } 433 434 public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<EnumSet<Chr>, String>(); 435 static { 436 ChrMAP.put(EnumSet.of(Chr.UNKNOWN), ""); 437 ChrMAP.put(EnumSet.of(Chr.FIXED), "F"); 438 ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl"); 439 ChrMAP.put(EnumSet.of(Chr.LONGFLASH), "LFl"); 440 ChrMAP.put(EnumSet.of(Chr.QUICK), "Q"); 441 ChrMAP.put(EnumSet.of(Chr.VERYQUICK), "VQ"); 442 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK), "UQ"); 443 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDQUICK), "IQ"); 444 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDVERYQUICK), "IVQ"); 445 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDULTRAQUICK), "IUQ"); 446 ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso"); 447 ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc"); 448 ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo"); 449 ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al"); 450 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F"); 451 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl"); 452 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "F.Al.Fl"); 453 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LONGFLASH), "Al.LFl"); 454 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso"); 455 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc"); 456 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl"); 457 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LONGFLASH), "FLFl"); 458 ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl"); 459 ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LONGFLASH), "FlLFl"); 460 ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LONGFLASH), "Q+LFl"); 461 ChrMAP.put(EnumSet.of(Chr.VERYQUICK, Chr.LONGFLASH), "VQ+LFl"); 462 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK, Chr.LONGFLASH), "UQ+LFl"); 463 } 464 465 private ArrayList<Chr> lightCharacter = new ArrayList<Chr>(); 466 467 public Chr getLightChar(int i) { 468 if (i < lightCharacter.size()) 469 return lightCharacter.get(i); 470 else 471 return Chr.UNKNOWN; 472 } 473 474 public void setLightChar(Chr chr) { 475 lightCharacter.clear(); 476 lightCharacter.add(chr); 477 } 478 479 public void setLightChar(int i, Chr chr) { 480 if (lightCharacter.size() > i) 481 lightCharacter.set(i, chr); 482 } 483 484 public void addLightChar(int i, Chr chr) { 485 if (lightCharacter.size() >= i) 486 lightCharacter.add(i, chr); 487 } 488 489 public void addLightChar(Chr chr) { 490 lightCharacter.add(chr); 491 } 492 493 public void subLightChar(int i) { 494 if (lightCharacter.size() > i) 495 lightCharacter.remove(i); 496 } 497 498 private ArrayList<String> lightGroup = new ArrayList<String>(); 499 500 public String getLightGroup(int i) { 501 if (i < lightGroup.size()) 502 return lightGroup.get(i); 503 else 504 return ""; 505 } 506 507 public void setLightGroup(String str) { 508 lightGroup.clear(); 509 lightGroup.add(str); 510 } 511 512 public void setLightGroup(int i, String str) { 513 if (lightGroup.size() > i) 514 lightGroup.set(i, str); 515 } 516 517 public void addLightGroup(int i, String str) { 518 if (lightGroup.size() >= i) 519 lightGroup.add(i, str); 520 } 521 522 public void addLightGroup(String str) { 523 lightGroup.add(str); 524 } 525 526 public void subLightGroup(int i) { 527 if (lightGroup.size() > i) 528 lightGroup.remove(i); 529 } 530 531 private ArrayList<String> lightSequence = new ArrayList<String>(); 532 533 public String getLightSeq(int i) { 534 if (i < lightSequence.size()) 535 return lightSequence.get(i); 536 else 537 return ""; 538 } 539 540 public void setLightSeq(String str) { 541 lightSequence.clear(); 542 lightSequence.add(str); 543 } 544 545 public void setLightSeq(int i, String str) { 546 if (lightSequence.size() > i) 547 lightSequence.set(i, str); 548 } 549 550 public void addLightSeq(int i, String str) { 551 if (lightSequence.size() >= i) 552 lightSequence.add(i, str); 553 } 554 555 public void addLightSeq(String str) { 556 lightSequence.add(str); 557 } 558 559 public void subLightSeq(int i) { 560 if (lightSequence.size() > i) 561 lightSequence.remove(i); 562 } 563 564 private ArrayList<String> lightPeriod = new ArrayList<String>(); 565 566 public String getLightPeriod(int i) { 567 if (i < lightPeriod.size()) 568 return lightPeriod.get(i); 569 else 570 return ""; 571 } 572 573 public void setLightPeriod(String str) { 574 lightPeriod.clear(); 575 lightGroup.add(validDecimal(str)); 576 } 577 578 public void setLightPeriod(int i, String str) { 579 if (lightPeriod.size() > i) 580 lightPeriod.set(i, validDecimal(str)); 581 } 582 583 public void addLightPeriod(int i, String str) { 584 if (lightPeriod.size() >= i) 585 lightPeriod.add(i, validDecimal(str)); 586 } 587 588 public void addLightPeriod(String str) { 589 lightPeriod.add(validDecimal(str)); 590 } 591 592 public void subLightPeriod(int i) { 593 if (lightPeriod.size() > i) 594 lightPeriod.remove(i); 595 } 596 597 private ArrayList<String> lightHeight = new ArrayList<String>(); 598 599 public String getLightHeight(int i) { 600 if (i < lightHeight.size()) 601 return lightHeight.get(i); 602 else 603 return ""; 604 } 605 606 public void setLightHeight(String str) { 607 lightHeight.clear(); 608 lightHeight.add(validDecimal(str)); 609 } 610 611 public void setLightHeight(int i, String str) { 612 if (lightHeight.size() > i) 613 lightHeight.set(i, validDecimal(str)); 614 } 615 616 public void addLightHeight(int i, String str) { 617 if (lightHeight.size() >= i) 618 lightHeight.add(i, validDecimal(str)); 619 } 620 621 public void addLightHeight(String str) { 622 lightHeight.add(validDecimal(str)); 623 } 624 625 public void subLightHeight(int i) { 626 if (lightHeight.size() > i) 627 lightHeight.remove(i); 628 } 629 630 private ArrayList<String> lightRange = new ArrayList<String>(); 631 632 public String getLightRange(int i) { 633 if (i < lightRange.size()) 634 return lightRange.get(i); 635 else 636 return ""; 637 } 638 639 public void setLightRange(String str) { 640 lightRange.clear(); 641 lightRange.add(validDecimal(str)); 642 } 643 644 public void setLightRange(int i, String str) { 645 if (lightRange.size() > i) 646 lightRange.set(i, validDecimal(str)); 647 } 648 649 public void addLightRange(int i, String str) { 650 if (lightRange.size() >= i) 651 lightRange.add(i, validDecimal(str)); 652 } 653 654 public void addLightRange(String str) { 655 lightRange.add(validDecimal(str)); 656 } 657 658 public void subLightRange(int i) { 659 if (lightRange.size() > i) 660 lightRange.remove(i); 661 } 662 663 private ArrayList<String> lightSector1 = new ArrayList<String>(); 664 665 public String getLightSector1(int i) { 666 if (i < lightSector1.size()) 667 return lightSector1.get(i); 668 else 669 return ""; 670 } 671 672 public void setLightSector1(String str) { 673 lightSector1.clear(); 674 lightSector1.add(validDecimal(str)); 675 } 676 677 public void setLightSector1(int i, String str) { 678 if (lightSector1.size() > i) 679 lightSector1.set(i, validDecimal(str)); 680 } 681 682 public void addLightSector1(int i, String str) { 683 if (lightSector1.size() >= i) 684 lightSector1.add(i, validDecimal(str)); 685 } 686 687 public void addLightSector1(String str) { 688 lightSector1.add(validDecimal(str)); 689 } 690 691 public void subLightSector1(int i) { 692 if (lightSector1.size() > i) 693 lightSector1.remove(i); 694 } 695 696 private ArrayList<String> lightSector2 = new ArrayList<String>(); 697 698 public String getLightSector2(int i) { 699 if (i < lightSector2.size()) 700 return lightSector2.get(i); 701 else 702 return ""; 703 } 704 705 public void setLightSector2(String str) { 706 lightSector2.clear(); 707 lightSector2.add(validDecimal(str)); 708 } 709 710 public void setLightSector2(int i, String str) { 711 if (lightSector2.size() > i) 712 lightSector2.set(i, validDecimal(str)); 713 } 714 715 public void addLightSector2(int i, String str) { 716 if (lightSector2.size() >= i) 717 lightSector2.add(i, validDecimal(str)); 718 } 719 720 public void addLightSector2(String str) { 721 lightSector2.add(validDecimal(str)); 722 } 723 724 public void subLightSector2(int i) { 725 if (lightSector2.size() > i) 726 lightSector2.remove(i); 727 } 728 436 729 public enum Pat { 437 730 NONE, HORIZ, VERT, DIAG, SQUARE, BORDER … … 858 1151 return false; 859 1152 } 860 861 // **********************!!!!!!!!!862 public Light light = new Light(dlg);863 1153 864 1154 private boolean paintlock = false; … … 1209 1499 } 1210 1500 } 1211 1501 1212 1502 dlg.panelMain.syncPanel(); 1213 1503 … … 1504 1794 dlg.panelMain.topIcon.setIcon(null); 1505 1795 } 1506 1796 1507 1797 if (hasFog()) { 1508 1798 dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")));
Note:
See TracChangeset
for help on using the changeset viewer.