Changeset 29491 in osm for applications/editors/josm/plugins/smed/plugs
- Timestamp:
- 2013-04-09T18:25:26+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r27955 r29491 15 15 16 16 private OSeaMAction dlg; 17 private JToggleButton aisButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/AISButton.png"))); 18 private ActionListener alAis = new ActionListener() { 19 public void actionPerformed(java.awt.event.ActionEvent e) { 20 if (aisButton.isSelected()) { 21 radioCatBox.setVisible(true); 22 aisButton.setBorderPainted(true); 23 } else { 24 radioCatBox.setSelectedIndex(0); 25 radioCatBox.setVisible(false); 26 aisButton.setBorderPainted(false); 27 } 28 } 29 }; 30 private JComboBox radioCatBox; 31 private EnumMap<Cat, Integer> radioCats = new EnumMap<Cat, Integer>(Cat.class); 32 private ActionListener alRadioCatBox = new ActionListener() { 33 public void actionPerformed(java.awt.event.ActionEvent e) { 34 for (Cat cat : radioCats.keySet()) { 35 int idx = radioCats.get(cat); 36 if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) { 37 dlg.panelMain.mark.setRadio(cat); 38 } 39 } 40 } 41 }; 17 42 private ButtonGroup radarButtons = new ButtonGroup(); 18 43 public JRadioButton noRadButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); … … 85 110 add(getRadButton(raconButton, 0, 93, 27, 27, "Racon", Rtb.RACON)); 86 111 add(getRadButton(leadingButton, 0, 123, 27, 27, "LeadingRacon", Rtb.LEADING)); 87 112 88 113 groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER); 89 114 groupLabel.setBounds(new Rectangle(30, 0, 100, 20)); … … 143 168 add(sector2Box); 144 169 sector2Box.addFocusListener(flSector2); 170 171 aisButton.setBounds(new Rectangle(270, 3, 27, 27)); 172 aisButton.setBorder(BorderFactory.createLoweredBevelBorder()); 173 aisButton.setToolTipText("AIS"); 174 aisButton.addActionListener(alAis); 175 add(aisButton); 176 177 radioCatBox = new JComboBox(); 178 radioCatBox.setBounds(new Rectangle(210, 40, 150, 20)); 179 add(radioCatBox); 180 radioCatBox.addActionListener(alRadioCatBox); 181 addROItem("", Cat.NOROS); 182 addROItem(Messages.getString("CircularBeacon"), Cat.ROS_OMNI); 183 addROItem(Messages.getString("DirectionalBeacon"), Cat.ROS_DIRL); 184 addROItem(Messages.getString("RotatingBeacon"), Cat.ROS_ROTP); 185 addROItem(Messages.getString("ConsolBeacon"), Cat.ROS_CNSL); 186 addROItem(Messages.getString("DirectionFinding"), Cat.ROS_RDF); 187 addROItem(Messages.getString("QTGService"), Cat.ROS_QTG); 188 addROItem(Messages.getString("AeronaticalBeacon"), Cat.ROS_AERO); 189 addROItem(Messages.getString("Decca"), Cat.ROS_DECA); 190 addROItem(Messages.getString("LoranC"), Cat.ROS_LORN); 191 addROItem(Messages.getString("DGPS"), Cat.ROS_DGPS); 192 addROItem(Messages.getString("Toran"), Cat.ROS_TORN); 193 addROItem(Messages.getString("Omega"), Cat.ROS_OMGA); 194 addROItem(Messages.getString("Syledis"), Cat.ROS_SYLD); 195 addROItem(Messages.getString("Chiaka"), Cat.ROS_CHKA); 196 addROItem(Messages.getString("PublicCommunication"), Cat.ROS_PCOM); 197 addROItem(Messages.getString("CommercialBroadcast"), Cat.ROS_COMB); 198 addROItem(Messages.getString("Facsimile"), Cat.ROS_FACS); 199 addROItem(Messages.getString("TimeSignal"), Cat.ROS_TIME); 200 addROItem(Messages.getString("AIS"), Cat.ROS_PAIS); 201 addROItem(Messages.getString("S-AIS"), Cat.ROS_SAIS); 202 radioCatBox.setVisible(false); 145 203 } 146 204 … … 169 227 sector1Box.setText(dlg.panelMain.mark.getRaconSector1()); 170 228 sector2Box.setText(dlg.panelMain.mark.getRaconSector2()); 229 aisButton.setSelected(dlg.panelMain.mark.getRadio() != Cat.NOROS); 230 aisButton.setBorderPainted(aisButton.isSelected()); 231 radioCatBox.setVisible(dlg.panelMain.mark.getRadio() != Cat.NOROS); 171 232 } 172 233 … … 181 242 } 182 243 244 private void addROItem(String str, Cat cat) { 245 radioCats.put(cat, radioCatBox.getItemCount()); 246 radioCatBox.addItem(str); 247 } 183 248 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r29489 r29491 348 348 CatSTR.put(Cat.ROS_OMGA, "omega"); 349 349 CatSTR.put(Cat.ROS_SYLD, "syledis"); 350 CatSTR.put(Cat.ROS_CHKA, "ch aika");350 CatSTR.put(Cat.ROS_CHKA, "chiaka"); 351 351 CatSTR.put(Cat.ROS_PCOM, "public_communication"); 352 352 CatSTR.put(Cat.ROS_COMB, "commercial_broadcast"); … … 2572 2572 } 2573 2573 } 2574 2575 if (RoType != Cat.NOROS) { 2576 g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null); 2577 g2.drawString("AIS", 0, 30); 2578 } 2574 2579 } 2575 2580
Note:
See TracChangeset
for help on using the changeset viewer.