Changeset 26572 in osm for applications/editors/josm
- Timestamp:
- 2011-08-25T16:24:48+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 4 added
- 5 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26561 r26572 27 27 shp = dlg.mark.getShape(); 28 28 if (portButton.isSelected()) { 29 dlg.mark.setCategory(Cat.LA T_PORT);29 dlg.mark.setCategory(Cat.LAM_PORT); 30 30 if (panelPort.shapes.containsKey(shp)) { 31 31 panelPort.shapes.get(shp).doClick(); … … 50 50 } 51 51 if (prefPortButton.isSelected()) { 52 dlg.mark.setCategory(Cat.LA T_PREF_PORT);52 dlg.mark.setCategory(Cat.LAM_PPORT); 53 53 if (panelPort.shapes.containsKey(shp)) { 54 54 panelPort.shapes.get(shp).doClick(); … … 72 72 } 73 73 if (stbdButton.isSelected()) { 74 dlg.mark.setCategory(Cat.LA T_STBD);74 dlg.mark.setCategory(Cat.LAM_STBD); 75 75 if (panelStbd.shapes.containsKey(shp)) { 76 76 panelStbd.shapes.get(shp).doClick(); … … 95 95 } 96 96 if (prefStbdButton.isSelected()) { 97 dlg.mark.setCategory(Cat.LA T_PREF_STBD);97 dlg.mark.setCategory(Cat.LAM_PSTBD); 98 98 if (panelStbd.shapes.containsKey(shp)) { 99 99 panelStbd.shapes.get(shp).doClick(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26561 r26572 25 25 shp = dlg.mark.getShape(); 26 26 if (northButton.isSelected()) { 27 dlg.mark.setCategory(Cat.CA RD_NORTH);27 dlg.mark.setCategory(Cat.CAM_NORTH); 28 28 dlg.mark.setColour(Ent.BODY, Col.BLACK); 29 29 dlg.mark.addColour(Ent.BODY, Col.YELLOW); … … 36 36 } 37 37 if (southButton.isSelected()) { 38 dlg.mark.setCategory(Cat.CA RD_SOUTH);38 dlg.mark.setCategory(Cat.CAM_SOUTH); 39 39 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 40 40 dlg.mark.addColour(Ent.BODY, Col.BLACK); … … 47 47 } 48 48 if (eastButton.isSelected()) { 49 dlg.mark.setCategory(Cat.CA RD_EAST);49 dlg.mark.setCategory(Cat.CAM_EAST); 50 50 dlg.mark.setColour(Ent.BODY, Col.BLACK); 51 51 dlg.mark.addColour(Ent.BODY, Col.YELLOW); … … 59 59 } 60 60 if (westButton.isSelected()) { 61 dlg.mark.setCategory(Cat.CA RD_WEST);61 dlg.mark.setCategory(Cat.CAM_WEST); 62 62 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 63 63 dlg.mark.addColour(Ent.BODY, Col.BLACK); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r26569 r26572 38 38 public JRadioButton trafficButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TrafficButton.png"))); 39 39 public JRadioButton warningButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WarningButton.png"))); 40 p rivateEnumMap<Obj, JRadioButton> objects = new EnumMap<Obj, JRadioButton>(Obj.class);40 public EnumMap<Obj, JRadioButton> objects = new EnumMap<Obj, JRadioButton>(Obj.class); 41 41 private ActionListener alObj = new ActionListener() { 42 42 public void actionPerformed(java.awt.event.ActionEvent e) { … … 49 49 button.setBorderPainted(false); 50 50 } 51 if (trafficButton.isSelected()) { 52 categoryLabel.setVisible(true); 53 trafficCatBox.setVisible(true); 54 warningCatBox.setVisible(false); 55 } else if (warningButton.isSelected()) { 56 categoryLabel.setVisible(true); 57 warningCatBox.setVisible(true); 58 trafficCatBox.setVisible(false); 59 } else { 60 categoryLabel.setVisible(false); 61 trafficCatBox.setVisible(false); 62 warningCatBox.setVisible(false); 63 } 64 if (dlg.mark != null) 65 dlg.mark.paintSign(); 51 66 } 52 67 }; … … 63 78 this.add(getObjButton(warningButton, 90, 35, 34, 32, "SSWarning", Obj.SISTAW), null); 64 79 65 categoryLabel = new JLabel(Messages.getString(" Category"), SwingConstants.CENTER);80 categoryLabel = new JLabel(Messages.getString("SSCategory"), SwingConstants.CENTER); 66 81 categoryLabel.setBounds(new Rectangle(20, 80, 140, 20)); 67 82 this.add(categoryLabel, null); 83 categoryLabel.setVisible(false); 68 84 69 85 trafficCatBox = new JComboBox(); 70 trafficCatBox.setBounds(new Rectangle(20, 1 10, 140, 20));86 trafficCatBox.setBounds(new Rectangle(20, 100, 140, 20)); 71 87 this.add(trafficCatBox, null); 72 88 trafficCatBox.addActionListener(alTrafficCatBox); 73 89 trafficCatBox.addItem(Messages.getString("NoneSpecified")); 90 trafficCatBox.addItem(Messages.getString("Lock")); 91 trafficCatBox.setVisible(false); 74 92 75 93 warningCatBox = new JComboBox(); 76 warningCatBox.setBounds(new Rectangle(20, 1 10, 140, 20));77 //this.add(warningCatBox, null);94 warningCatBox.setBounds(new Rectangle(20, 100, 140, 20)); 95 this.add(warningCatBox, null); 78 96 warningCatBox.addActionListener(alWarningCatBox); 79 97 warningCatBox.addItem(Messages.getString("NoneSpecified")); 98 warningCatBox.addItem(Messages.getString("Storm")); 99 warningCatBox.setVisible(false); 80 100 81 101 } 82 102 83 103 public void clearSelections() { 84 104 objButtons.clearSelection(); 105 alObj.actionPerformed(null); 85 106 } 86 107 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26562 r26572 156 156 } 157 157 if (lightsButton.isSelected()) { 158 litButton.setEnabled(true); 159 litButton.doClick(); 158 if (dlg.mark != null) { 159 if (dlg.mark.getObject() == Obj.UNKNOWN) { 160 panelLights.clearSelections(); 161 } else { 162 panelLights.objects.get(dlg.mark.getObject()).doClick(); 163 } 164 } 160 165 lightsButton.setBorderPainted(true); 161 166 panelLights.setVisible(true); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26561 r26572 23 23 dlg.mark.setColour(Ent.BODY, Col.RED); 24 24 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 25 if (dlg.mark.getCategory() == Cat.LA T_PREF_PORT) {25 if (dlg.mark.getCategory() == Cat.LAM_PPORT) { 26 26 dlg.mark.addColour(Ent.BODY, Col.GREEN); 27 27 dlg.mark.addColour(Ent.BODY, Col.RED); … … 36 36 dlg.mark.setColour(Ent.BODY, Col.GREEN); 37 37 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 38 if (dlg.mark.getCategory() == Cat.LA T_PREF_PORT) {38 if (dlg.mark.getCategory() == Cat.LAM_PPORT) { 39 39 dlg.mark.addColour(Ent.BODY, Col.RED); 40 40 dlg.mark.addColour(Ent.BODY, Col.GREEN); … … 47 47 if (regionCButton.isSelected()) { 48 48 dlg.mark.setRegion(Reg.C); 49 if (dlg.mark.getCategory() == Cat.LA T_PREF_PORT) {49 if (dlg.mark.getCategory() == Cat.LAM_PPORT) { 50 50 dlg.mark.setColour(Ent.BODY, Col.RED); 51 51 dlg.mark.addColour(Ent.BODY, Col.GREEN); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26561 r26572 23 23 dlg.mark.setColour(Ent.BODY, Col.GREEN); 24 24 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 25 if (dlg.mark.getCategory() == Cat.LA T_PREF_STBD) {25 if (dlg.mark.getCategory() == Cat.LAM_PSTBD) { 26 26 dlg.mark.addColour(Ent.BODY, Col.RED); 27 27 dlg.mark.addColour(Ent.BODY, Col.GREEN); … … 36 36 dlg.mark.setColour(Ent.BODY, Col.RED); 37 37 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 38 if (dlg.mark.getCategory() == Cat.LA T_PREF_STBD) {38 if (dlg.mark.getCategory() == Cat.LAM_PSTBD) { 39 39 dlg.mark.addColour(Ent.BODY, Col.GREEN); 40 40 dlg.mark.addColour(Ent.BODY, Col.RED); … … 47 47 if (regionCButton.isSelected()) { 48 48 dlg.mark.setRegion(Reg.C); 49 if (dlg.mark.getCategory() == Cat.LA T_PREF_STBD) {49 if (dlg.mark.getCategory() == Cat.LAM_PSTBD) { 50 50 dlg.mark.setColour(Ent.BODY, Col.RED); 51 51 dlg.mark.addColour(Ent.BODY, Col.GREEN); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26568 r26572 47 47 48 48 public enum Obj { 49 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP, 50 LITMAJ, LITMIN, LITFLT, LITVES, LNDMRK, MORFAC, SISTAW, SISTAT 49 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP, LITMAJ, LITMIN, LITFLT, LITVES, LNDMRK, MORFAC, SISTAW, SISTAT 51 50 } 52 51 … … 141 140 142 141 public enum Cat { 143 UNKNOWN, LA T_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, MOORING_BUOY142 UNKNOWN, 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_CHBF, SPM_YCHT, MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY, SIS_DOCK, SIS_LOCK, SIS_STRM, SIS_TIDE, LIT_DIRF, LIT_LEDG 144 143 } 145 144 146 145 public static final EnumMap<Cat, String> CatSTR = new EnumMap<Cat, String>(Cat.class); 147 146 static { 148 CatSTR.put(Cat.LA T_PORT, "port");149 CatSTR.put(Cat.LA T_STBD, "starboard");150 CatSTR.put(Cat.LA T_PREF_PORT, "preferred_channel_port");151 CatSTR.put(Cat.LA T_PREF_STBD, "preferred_channel_starboard");152 CatSTR.put(Cat.CA RD_NORTH, "north");153 CatSTR.put(Cat.CA RD_EAST, "east");154 CatSTR.put(Cat.CA RD_SOUTH, "south");155 CatSTR.put(Cat.CA RD_WEST, "west");156 CatSTR.put(Cat.MO ORING_BUOY, "mooring_buoy");147 CatSTR.put(Cat.LAM_PORT, "port"); 148 CatSTR.put(Cat.LAM_STBD, "starboard"); 149 CatSTR.put(Cat.LAM_PPORT, "preferred_channel_port"); 150 CatSTR.put(Cat.LAM_PSTBD, "preferred_channel_starboard"); 151 CatSTR.put(Cat.CAM_NORTH, "north"); 152 CatSTR.put(Cat.CAM_EAST, "east"); 153 CatSTR.put(Cat.CAM_SOUTH, "south"); 154 CatSTR.put(Cat.CAM_WEST, "west"); 155 CatSTR.put(Cat.MOR_BUOY, "buoy"); 157 156 } 158 157 … … 201 200 202 201 public enum Col { 203 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, 202 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK 204 203 } 205 204 … … 215 214 ColSTR.put(Col.VIOLET, "violet"); 216 215 ColSTR.put(Col.BLACK, "black"); 216 ColSTR.put(Col.GREY, "grey"); 217 ColSTR.put(Col.BROWN, "brown"); 218 ColSTR.put(Col.MAGENTA, "magenta"); 219 ColSTR.put(Col.PINK, "pink"); 217 220 } 218 221 … … 643 646 } else if (GrpMAP.get(object) == Grp.LAT) { 644 647 switch (getCategory()) { 645 case LA T_PORT:648 case LAM_PORT: 646 649 if (getColour(Ent.BODY, 0) == Col.RED) { 647 650 if (getColour(Ent.BODY, 1) == Col.WHITE) … … 653 656 setRegion(Reg.B); 654 657 break; 655 case LA T_PREF_PORT:658 case LAM_PPORT: 656 659 if (getColour(Ent.BODY, 0) == Col.RED) { 657 660 if (getColour(Ent.BODY, 3) == Col.GREEN) … … 663 666 setRegion(Reg.B); 664 667 break; 665 case LA T_STBD:668 case LAM_STBD: 666 669 if (getColour(Ent.BODY, 0) == Col.GREEN) { 667 670 if (getColour(Ent.BODY, 1) == Col.WHITE) … … 673 676 setRegion(Reg.B); 674 677 break; 675 case LA T_PREF_STBD:678 case LAM_PSTBD: 676 679 if (getColour(Ent.BODY, 0) == Col.GREEN) 677 680 setRegion(Reg.A); … … 694 697 dlg.panelMain.chanButton.doClick(); 695 698 switch (getCategory()) { 696 case LA T_PORT:699 case LAM_PORT: 697 700 dlg.panelMain.panelChan.portButton.doClick(); 698 701 break; 699 case LA T_STBD:702 case LAM_STBD: 700 703 dlg.panelMain.panelChan.stbdButton.doClick(); 701 704 break; 702 case LA T_PREF_PORT:705 case LAM_PPORT: 703 706 dlg.panelMain.panelChan.prefPortButton.doClick(); 704 707 break; 705 case LA T_PREF_STBD:708 case LAM_PSTBD: 706 709 dlg.panelMain.panelChan.prefStbdButton.doClick(); 707 710 break; … … 715 718 dlg.panelMain.hazButton.doClick(); 716 719 switch (getCategory()) { 717 case CA RD_NORTH:720 case CAM_NORTH: 718 721 dlg.panelMain.panelHaz.northButton.doClick(); 719 722 break; 720 case CA RD_SOUTH:723 case CAM_SOUTH: 721 724 dlg.panelMain.panelHaz.southButton.doClick(); 722 725 break; 723 case CA RD_EAST:726 case CAM_EAST: 724 727 dlg.panelMain.panelHaz.eastButton.doClick(); 725 728 break; 726 case CA RD_WEST:729 case CAM_WEST: 727 730 dlg.panelMain.panelHaz.westButton.doClick(); 728 731 break; … … 737 740 break; 738 741 case LIT: 742 case SIS: 739 743 dlg.panelMain.lightsButton.doClick(); 740 744 break; … … 810 814 } 811 815 break; 816 default: 817 dlg.panelMain.lightsButton.doClick(); 812 818 } 813 819 break; … … 825 831 dlg.panelMain.topIcon.setIcon(null); 826 832 dlg.panelMain.radarIcon.setIcon(null); 827 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png")));828 833 dlg.panelMain.fogIcon.setIcon(null); 829 834 830 835 String imgStr = "/images/"; 831 switch (getShape()) { 832 case TOWER: 833 imgStr += "Tower"; 834 break; 835 case BUOY: 836 case PILLAR: 837 imgStr += "Pillar"; 838 break; 839 case SPAR: 840 imgStr += "Spar"; 841 break; 842 case CAN: 843 imgStr += "Can"; 844 break; 845 case CONE: 846 imgStr += "Cone"; 847 break; 848 case SPHERE: 849 imgStr += "Sphere"; 850 break; 851 case BARREL: 852 imgStr += "Barrel"; 853 break; 854 case CAIRN: 855 imgStr += "Cairn"; 856 break; 857 case FLOAT: 858 imgStr += "Float"; 859 break; 860 case BEACON: 861 case PILE: 862 case LATTICE: 863 case BUOYANT: 864 imgStr += "Beacon"; 865 break; 866 case SUPER: 867 imgStr += "Float_Major"; 868 break; 869 case STAKE: 870 case POLE: 871 case POST: 872 imgStr += "Stake"; 873 break; 874 } 875 String colStr = imgStr; 876 for (Col col : bodyColour) { 877 switch (col) { 878 case WHITE: 879 colStr += "_White"; 880 break; 881 case RED: 882 colStr += "_Red"; 883 break; 884 case ORANGE: 885 colStr += "_Orange"; 886 break; 887 case AMBER: 888 colStr += "_Amber"; 889 break; 890 case YELLOW: 891 colStr += "_Yellow"; 892 break; 893 case GREEN: 894 colStr += "_Green"; 895 break; 896 case BLUE: 897 colStr += "_Blue"; 898 break; 899 case VIOLET: 900 colStr += "_Violet"; 901 break; 902 case BLACK: 903 colStr += "_Black"; 904 break; 905 } 906 } 907 if (getShape() == Shp.PERCH) { 908 if (getCategory() == Cat.LAT_PORT) { 909 colStr = "/images/Perch_Port"; 836 if (getShape() != Shp.UNKNOWN) { 837 switch (getShape()) { 838 case TOWER: 839 imgStr += "Tower"; 840 break; 841 case BUOY: 842 case PILLAR: 843 imgStr += "Pillar"; 844 break; 845 case SPAR: 846 imgStr += "Spar"; 847 break; 848 case CAN: 849 imgStr += "Can"; 850 break; 851 case CONE: 852 imgStr += "Cone"; 853 break; 854 case SPHERE: 855 imgStr += "Sphere"; 856 break; 857 case BARREL: 858 imgStr += "Barrel"; 859 break; 860 case CAIRN: 861 imgStr += "Cairn"; 862 break; 863 case FLOAT: 864 imgStr += "Float"; 865 break; 866 case BEACON: 867 case PILE: 868 case LATTICE: 869 case BUOYANT: 870 imgStr += "Beacon"; 871 break; 872 case SUPER: 873 imgStr += "Super"; 874 break; 875 case STAKE: 876 case POLE: 877 case POST: 878 imgStr += "Stake"; 879 break; 880 } 881 String colStr = imgStr; 882 for (Col col : bodyColour) { 883 switch (col) { 884 case WHITE: 885 colStr += "_White"; 886 break; 887 case RED: 888 colStr += "_Red"; 889 break; 890 case ORANGE: 891 colStr += "_Orange"; 892 break; 893 case AMBER: 894 colStr += "_Amber"; 895 break; 896 case YELLOW: 897 colStr += "_Yellow"; 898 break; 899 case GREEN: 900 colStr += "_Green"; 901 break; 902 case BLUE: 903 colStr += "_Blue"; 904 break; 905 case VIOLET: 906 colStr += "_Violet"; 907 break; 908 case BLACK: 909 colStr += "_Black"; 910 break; 911 } 912 } 913 if (getShape() == Shp.PERCH) { 914 if (getCategory() == Cat.LAM_PORT) { 915 colStr = "/images/Perch_Port"; 916 } else { 917 colStr = "/images/Perch_Starboard"; 918 } 919 } 920 if (!imgStr.equals("/images/")) { 921 colStr += ".png"; 922 if (getClass().getResource(colStr) == null) { 923 System.out.println("Missing image: " + colStr); 924 imgStr += ".png"; 925 if (getClass().getResource(imgStr) == null) { 926 System.out.println("Missing image: " + imgStr); 927 return; 928 } else { 929 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 930 } 931 } else { 932 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(colStr))); 933 } 910 934 } else { 911 colStr = "/images/Perch_Starboard"; 912 } 913 } 914 if (!imgStr.equals("/images/")) { 915 colStr += ".png"; 916 if (getClass().getResource(colStr) == null) { 917 System.out.println("Missing image: " + colStr); 935 dlg.panelMain.shapeIcon.setIcon(null); 936 } 937 } else if (getObject() != Obj.UNKNOWN) { 938 switch (getObject()) { 939 case LNDMRK: 940 imgStr += "Light_House"; 941 break; 942 case LITMAJ: 943 imgStr += "Light_Major"; 944 break; 945 case LITMIN: 946 imgStr += "Light_Minor"; 947 break; 948 case LITFLT: 949 imgStr += "Float"; 950 break; 951 case LITVES: 952 imgStr += "Super"; 953 break; 954 case SISTAW: 955 imgStr += "Signal_Station"; 956 break; 957 case SISTAT: 958 imgStr += "Signal_Station"; 959 break; 960 } 961 if (!imgStr.equals("/images/")) { 918 962 imgStr += ".png"; 919 963 if (getClass().getResource(imgStr) == null) { … … 924 968 } 925 969 } else { 926 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(colStr))); 927 } 928 } else { 929 dlg.panelMain.shapeIcon.setIcon(null); 970 dlg.panelMain.shapeIcon.setIcon(null); 971 } 930 972 } 931 973 }
Note:
See TracChangeset
for help on using the changeset viewer.