Changeset 27008 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-11-04T20:02:13+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r27005 r27008 21 21 private ActionListener alGroup = new ActionListener() { 22 22 public void actionPerformed(java.awt.event.ActionEvent e) { 23 String str = groupBox.getText();23 dlg.mark.setLightGroup(groupBox.getText()); 24 24 } 25 25 }; … … 28 28 private ActionListener alPeriod = new ActionListener() { 29 29 public void actionPerformed(java.awt.event.ActionEvent e) { 30 String str = periodBox.getText();30 dlg.mark.setLightPeriod(periodBox.getText()); 31 31 } 32 32 }; … … 35 35 private ActionListener alSequence = new ActionListener() { 36 36 public void actionPerformed(java.awt.event.ActionEvent e) { 37 String str = sequenceBox.getText();37 dlg.mark.setLightSeq(sequenceBox.getText()); 38 38 } 39 39 }; … … 43 43 private ActionListener alVisibility = new ActionListener() { 44 44 public void actionPerformed(java.awt.event.ActionEvent e) { 45 for (Vis vis : visibilities.keySet()) { 46 int idx = visibilities.get(vis); 47 if (idx == visibilityBox.getSelectedIndex()) 48 dlg.mark.setLightVisibility(vis); 49 } 45 50 } 46 51 }; … … 49 54 private ActionListener alHeight = new ActionListener() { 50 55 public void actionPerformed(java.awt.event.ActionEvent e) { 51 String str = heightBox.getText();56 dlg.mark.setLightHeight(heightBox.getText()); 52 57 } 53 58 }; … … 56 61 private ActionListener alRange = new ActionListener() { 57 62 public void actionPerformed(java.awt.event.ActionEvent e) { 58 String str = rangeBox.getText();63 dlg.mark.setLightRange(rangeBox.getText()); 59 64 } 60 65 }; … … 63 68 private ActionListener alOrientation = new ActionListener() { 64 69 public void actionPerformed(java.awt.event.ActionEvent e) { 65 String str = orientationBox.getText();70 dlg.mark.setLightOrientation(orientationBox.getText()); 66 71 } 67 72 }; 68 73 public JLabel categoryLabel; 69 74 public JComboBox categoryBox; 75 public EnumMap<Lit, Integer> categories = new EnumMap<Lit, Integer>(Lit.class); 70 76 private ActionListener alCategory = new ActionListener() { 71 77 public void actionPerformed(java.awt.event.ActionEvent e) { 78 for (Lit lit : categories.keySet()) { 79 int idx = categories.get(lit); 80 if (idx == categoryBox.getSelectedIndex()) 81 dlg.mark.setLightCategory(lit); 82 } 72 83 } 73 84 }; … … 77 88 private ActionListener alExhibition = new ActionListener() { 78 89 public void actionPerformed(java.awt.event.ActionEvent e) { 90 for (Exh exh : exhibitions.keySet()) { 91 int idx = exhibitions.get(exh); 92 if (idx == exhibitionBox.getSelectedIndex()) 93 dlg.mark.setLightExhibition(exh); 94 } 79 95 } 80 96 }; … … 171 187 categoryBox.setBounds(new Rectangle(185, 20, 165, 20)); 172 188 this.add(categoryBox, null); 189 addCatItem(Messages.getString("NoneSpecified"), Lit.UNKNOWN); 190 addCatItem(Messages.getString("NoneSpecified"), Lit.VERT); 191 addCatItem(Messages.getString("NoneSpecified"), Lit.HORIZ); 192 addCatItem(Messages.getString("NoneSpecified"), Lit.UPPER); 193 addCatItem(Messages.getString("NoneSpecified"), Lit.LOWER); 194 addCatItem(Messages.getString("NoneSpecified"), Lit.REAR); 195 addCatItem(Messages.getString("NoneSpecified"), Lit.FRONT); 196 addCatItem(Messages.getString("NoneSpecified"), Lit.AERO); 197 addCatItem(Messages.getString("NoneSpecified"), Lit.AIROBS); 198 addCatItem(Messages.getString("NoneSpecified"), Lit.FOGDET); 199 addCatItem(Messages.getString("NoneSpecified"), Lit.FLOOD); 200 addCatItem(Messages.getString("NoneSpecified"), Lit.STRIP); 201 addCatItem(Messages.getString("NoneSpecified"), Lit.SUBS); 202 addCatItem(Messages.getString("NoneSpecified"), Lit.SPOT); 203 addCatItem(Messages.getString("NoneSpecified"), Lit.MOIRE); 204 addCatItem(Messages.getString("NoneSpecified"), Lit.EMERG); 205 addCatItem(Messages.getString("NoneSpecified"), Lit.BEAR); 173 206 categoryBox.addActionListener(alCategory); 174 categoryBox.addItem(Messages.getString("NoneSpecified"));175 categoryBox.addItem(Messages.getString("Vert2"));176 207 177 208 visibilityLabel = new JLabel(Messages.getString("Visibility"), SwingConstants.CENTER); … … 181 212 visibilityBox.setBounds(new Rectangle(185, 60, 165, 20)); 182 213 this.add(visibilityBox, null); 183 visibilityBox.addActionListener(alVisibility);184 214 addVisibItem(Messages.getString("NoneSpecified"), Vis.UNKNOWN); 185 215 addVisibItem(Messages.getString("Intensified"), Vis.INTEN); 186 216 addVisibItem(Messages.getString("Unintensified"), Vis.UNINTEN); 187 217 addVisibItem(Messages.getString("PartiallyObscured"), Vis.PARTOBS); 218 visibilityBox.addActionListener(alVisibility); 188 219 189 220 exhibitionLabel = new JLabel(Messages.getString("Exhibition"), SwingConstants.CENTER); … … 193 224 exhibitionBox.setBounds(new Rectangle(280, 100, 70, 20)); 194 225 this.add(exhibitionBox, null); 195 exhibitionBox.addActionListener(alExhibition);196 226 addExhibItem(Messages.getString("NotSet"), Exh.UNKNOWN); 197 227 addExhibItem(Messages.getString("24h"), Exh.H24); … … 199 229 addExhibItem(Messages.getString("Night"), Exh.NIGHT); 200 230 addExhibItem(Messages.getString("Fog"), Exh.FOG); 231 exhibitionBox.addActionListener(alExhibition); 201 232 202 233 orientationLabel = new JLabel(Messages.getString("Orientation"), SwingConstants.CENTER); … … 213 244 } 214 245 246 private void addCatItem(String str, Lit lit) { 247 categories.put(lit, categoryBox.getItemCount()); 248 categoryBox.addItem(str); 249 } 250 215 251 private void addVisibItem(String str, Vis vis) { 216 252 visibilities.put(vis, visibilityBox.getItemCount()); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27005 r27008 50 50 } 51 51 52 public void setName(String nam) {53 name = nam.trim();52 public void setName(String str) { 53 name = str.trim(); 54 54 } 55 55 … … 772 772 VisMAP.put(EnumSet.of(Vis.PARTOBS), "part_obscured"); 773 773 } 774 774 775 private Vis lightVisibility = Vis.UNKNOWN; 776 777 public Vis getLightVisibility() { 778 return lightVisibility; 779 } 780 781 public void setLightVisibility(Vis vis) { 782 lightVisibility = vis; 783 } 784 785 private String lightOrientation = ""; 786 787 public String getLightOrientation() { 788 return lightOrientation; 789 } 790 791 public void setLightOrientation(String str) { 792 lightOrientation = validDecimal(str); 793 } 794 775 795 public enum Lit { 776 UNKNOWN, VERT, VERT2, VERT3, VERT4, HORIZ, HORIZ2, HORIZ3, HORIZ4, UPPER, LOWER, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR 796 UNKNOWN, VERT, HORIZ, UPPER, LOWER, REAR, FRONT, AERO, AIROBS, 797 FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR 777 798 } 778 799 … … 782 803 } 783 804 805 private Lit lightCategory = Lit.UNKNOWN; 806 807 public Lit getLightCategory() { 808 return lightCategory; 809 } 810 811 public void setLightCategory(Lit lit) { 812 lightCategory = lit; 813 } 814 784 815 public enum Exh { UNKNOWN, H24, DAY, NIGHT, FOG } 785 816 public static final Map<EnumSet<Exh>, String> ExhMAP = new HashMap<EnumSet<Exh>, String>(); … … 790 821 ExhMAP.put(EnumSet.of(Exh.NIGHT), "night"); 791 822 ExhMAP.put(EnumSet.of(Exh.FOG), "fog"); 823 } 824 825 private Exh lightExhibition = Exh.UNKNOWN; 826 827 public Exh getLightExhibition() { 828 return lightExhibition; 829 } 830 831 public void setLightExhibition(Exh exh) { 832 lightExhibition = exh; 792 833 } 793 834
Note:
See TracChangeset
for help on using the changeset viewer.