Changeset 32767 in osm for applications/editors/josm/plugins/smed/src/panels/PanelRadar.java
- Timestamp:
- 2016-08-04T02:27:43+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/panels/PanelRadar.java
r30738 r32767 1 1 package panels; 2 2 3 import java.awt.*; 4 import java.awt.event.*; 5 6 import javax.swing.*; 7 8 import java.util.*; 3 import java.awt.Rectangle; 4 import java.awt.event.ActionEvent; 5 import java.awt.event.ActionListener; 6 import java.awt.event.FocusAdapter; 7 import java.awt.event.FocusEvent; 8 import java.awt.event.FocusListener; 9 import java.util.EnumMap; 10 11 import javax.swing.BorderFactory; 12 import javax.swing.ButtonGroup; 13 import javax.swing.ImageIcon; 14 import javax.swing.JComboBox; 15 import javax.swing.JLabel; 16 import javax.swing.JPanel; 17 import javax.swing.JRadioButton; 18 import javax.swing.JTextField; 19 import javax.swing.JToggleButton; 20 import javax.swing.SwingConstants; 9 21 10 22 import messages.Messages; 23 import seamarks.SeaMark.Cat; 24 import seamarks.SeaMark.Rtb; 11 25 import smed.SmedAction; 12 import seamarks.SeaMark.*;13 26 14 27 public class PanelRadar extends JPanel { 15 28 16 private SmedAction 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<String> radioCatBox; 31 private EnumMap<Cat, Integer> radioCats = new EnumMap<>(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 SmedAction.panelMain.mark.setRadio(cat); 38 } 39 } 40 } 41 }; 42 private ButtonGroup radarButtons = new ButtonGroup(); 43 public JRadioButton noRadButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 44 public JRadioButton reflButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarReflectorButton.png"))); 45 public JRadioButton ramarkButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RamarkButton.png"))); 46 public JRadioButton raconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RaconButton.png"))); 47 public JRadioButton leadingButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LeadingRaconButton.png"))); 48 private EnumMap<Rtb, JRadioButton> rads = new EnumMap<>(Rtb.class); 49 private ActionListener alRad = new ActionListener() { 50 public void actionPerformed(java.awt.event.ActionEvent e) { 51 for (Rtb rtb : rads.keySet()) { 52 JRadioButton button = rads.get(rtb); 53 if (button.isSelected()) { 54 SmedAction.panelMain.mark.setRadar(rtb); 55 } 56 } 57 syncPanel(); 58 } 59 }; 60 public JLabel groupLabel; 61 public JTextField groupBox; 62 private FocusListener flGroup = new FocusAdapter() { 63 public void focusLost(java.awt.event.FocusEvent e) { 64 SmedAction.panelMain.mark.setRaconGroup(groupBox.getText()); 65 } 66 }; 67 public JLabel periodLabel; 68 public JTextField periodBox; 69 private FocusListener flPeriod = new FocusAdapter() { 70 public void focusLost(java.awt.event.FocusEvent e) { 71 SmedAction.panelMain.mark.setRaconPeriod(periodBox.getText()); 72 } 73 }; 74 public JLabel seqLabel; 75 public JTextField seqBox; 76 private FocusListener flSeq = new FocusAdapter() { 77 public void focusLost(java.awt.event.FocusEvent e) { 78 SmedAction.panelMain.mark.setRaconSequence(seqBox.getText()); 79 } 80 }; 81 public JLabel rangeLabel; 82 public JTextField rangeBox; 83 private FocusListener flRange = new FocusAdapter() { 84 public void focusLost(java.awt.event.FocusEvent e) { 85 SmedAction.panelMain.mark.setRaconRange(rangeBox.getText()); 86 } 87 }; 88 public JLabel sector1Label; 89 public JTextField sector1Box; 90 private FocusListener flSector1 = new FocusAdapter() { 91 public void focusLost(java.awt.event.FocusEvent e) { 92 SmedAction.panelMain.mark.setRaconSector1(sector1Box.getText()); 93 } 94 }; 95 public JLabel sector2Label; 96 public JTextField sector2Box; 97 private FocusListener flSector2 = new FocusAdapter() { 98 public void focusLost(java.awt.event.FocusEvent e) { 99 SmedAction.panelMain.mark.setRaconSector2(sector2Box.getText()); 100 } 101 }; 102 public JLabel sectorsLabel; 103 104 public PanelRadar(SmedAction dia) { 105 dlg = dia; 106 setLayout(null); 107 add(getRadButton(noRadButton, 0, 3, 27, 27, "NoRadar", Rtb.NORTB)); 108 add(getRadButton(reflButton, 0, 33, 27, 27, "RadarReflector", Rtb.REFLECTOR)); 109 add(getRadButton(ramarkButton, 0, 63, 27, 27, "Ramark", Rtb.RAMARK)); 110 add(getRadButton(raconButton, 0, 93, 27, 27, "Racon", Rtb.RACON)); 111 add(getRadButton(leadingButton, 0, 123, 27, 27, "LeadingRacon", Rtb.LEADING)); 112 113 groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER); 114 groupLabel.setBounds(new Rectangle(30, 0, 100, 20)); 115 add(groupLabel); 116 groupBox = new JTextField(); 117 groupBox.setBounds(new Rectangle(55, 20, 50, 20)); 118 groupBox.setHorizontalAlignment(SwingConstants.CENTER); 119 add(groupBox); 120 groupBox.addFocusListener(flGroup); 121 122 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); 123 periodLabel.setBounds(new Rectangle(130, 0, 100, 20)); 124 add(periodLabel); 125 periodBox = new JTextField(); 126 periodBox.setBounds(new Rectangle(155, 20, 50, 20)); 127 periodBox.setHorizontalAlignment(SwingConstants.CENTER); 128 add(periodBox); 129 periodBox.addFocusListener(flPeriod); 130 131 seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); 132 seqLabel.setBounds(new Rectangle(30, 40, 100, 20)); 133 add(seqLabel); 134 seqBox = new JTextField(); 135 seqBox.setBounds(new Rectangle(55, 60, 50, 20)); 136 seqBox.setHorizontalAlignment(SwingConstants.CENTER); 137 add(seqBox); 138 seqBox.addFocusListener(flSeq); 139 140 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); 141 rangeLabel.setBounds(new Rectangle(130, 40, 100, 20)); 142 add(rangeLabel); 143 rangeBox = new JTextField(); 144 rangeBox.setBounds(new Rectangle(155, 60, 50, 20)); 145 rangeBox.setHorizontalAlignment(SwingConstants.CENTER); 146 add(rangeBox); 147 rangeBox.addFocusListener(flRange); 148 149 sectorsLabel = new JLabel(Messages.getString("VisibleSector"), SwingConstants.CENTER); 150 sectorsLabel.setBounds(new Rectangle(75, 85, 100, 20)); 151 add(sectorsLabel); 152 153 sector1Label = new JLabel(Messages.getString("Start"), SwingConstants.CENTER); 154 sector1Label.setBounds(new Rectangle(30, 100, 100, 20)); 155 add(sector1Label); 156 sector1Box = new JTextField(); 157 sector1Box.setBounds(new Rectangle(55, 120, 50, 20)); 158 sector1Box.setHorizontalAlignment(SwingConstants.CENTER); 159 add(sector1Box); 160 sector1Box.addFocusListener(flSector1); 161 162 sector2Label = new JLabel(Messages.getString("End"), SwingConstants.CENTER); 163 sector2Label.setBounds(new Rectangle(130, 100, 100, 20)); 164 add(sector2Label); 165 sector2Box = new JTextField(); 166 sector2Box.setBounds(new Rectangle(155, 120, 50, 20)); 167 sector2Box.setHorizontalAlignment(SwingConstants.CENTER); 168 add(sector2Box); 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); 203 } 204 205 public void syncPanel() { 206 boolean rad = ((SmedAction.panelMain.mark.getRadar() != Rtb.NORTB) && (SmedAction.panelMain.mark.getRadar() != Rtb.REFLECTOR)); 207 groupLabel.setVisible(rad); 208 groupBox.setVisible(rad); 209 periodLabel.setVisible(rad); 210 periodBox.setVisible(rad); 211 seqLabel.setVisible(rad); 212 seqBox.setVisible(rad); 213 rangeLabel.setVisible(rad); 214 rangeBox.setVisible(rad); 215 sector1Label.setVisible(rad); 216 sector1Box.setVisible(rad); 217 sector2Label.setVisible(rad); 218 sector2Box.setVisible(rad); 219 sectorsLabel.setVisible(rad); 220 for (Rtb rtb : rads.keySet()) { 221 rads.get(rtb).setBorderPainted(SmedAction.panelMain.mark.getRadar() == rtb); 222 } 223 groupBox.setText(SmedAction.panelMain.mark.getRaconGroup()); 224 seqBox.setText(SmedAction.panelMain.mark.getRaconSequence()); 225 periodBox.setText(SmedAction.panelMain.mark.getRaconPeriod()); 226 rangeBox.setText(SmedAction.panelMain.mark.getRaconRange()); 227 sector1Box.setText(SmedAction.panelMain.mark.getRaconSector1()); 228 sector2Box.setText(SmedAction.panelMain.mark.getRaconSector2()); 229 aisButton.setSelected(SmedAction.panelMain.mark.getRadio() != Cat.NOROS); 230 aisButton.setBorderPainted(aisButton.isSelected()); 231 radioCatBox.setVisible(SmedAction.panelMain.mark.getRadio() != Cat.NOROS); 232 } 233 234 private JRadioButton getRadButton(JRadioButton button, int x, int y, int w, int h, String tip, Rtb rtb) { 235 button.setBounds(new Rectangle(x, y, w, h)); 236 button.setBorder(BorderFactory.createLoweredBevelBorder()); 237 button.setToolTipText(Messages.getString(tip)); 238 button.addActionListener(alRad); 239 radarButtons.add(button); 240 rads.put(rtb, button); 241 return button; 242 } 243 244 private void addROItem(String str, Cat cat) { 245 radioCats.put(cat, radioCatBox.getItemCount()); 246 radioCatBox.addItem(str); 247 } 29 private SmedAction dlg; 30 private JToggleButton aisButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/AISButton.png"))); 31 private ActionListener alAis = new ActionListener() { 32 @Override 33 public void actionPerformed(ActionEvent e) { 34 if (aisButton.isSelected()) { 35 radioCatBox.setVisible(true); 36 aisButton.setBorderPainted(true); 37 } else { 38 radioCatBox.setSelectedIndex(0); 39 radioCatBox.setVisible(false); 40 aisButton.setBorderPainted(false); 41 } 42 } 43 }; 44 private JComboBox<String> radioCatBox; 45 private EnumMap<Cat, Integer> radioCats = new EnumMap<>(Cat.class); 46 private ActionListener alRadioCatBox = new ActionListener() { 47 @Override 48 public void actionPerformed(ActionEvent e) { 49 for (Cat cat : radioCats.keySet()) { 50 int idx = radioCats.get(cat); 51 if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) { 52 SmedAction.panelMain.mark.setRadio(cat); 53 } 54 } 55 } 56 }; 57 private ButtonGroup radarButtons = new ButtonGroup(); 58 public JRadioButton noRadButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 59 public JRadioButton reflButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarReflectorButton.png"))); 60 public JRadioButton ramarkButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RamarkButton.png"))); 61 public JRadioButton raconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RaconButton.png"))); 62 public JRadioButton leadingButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LeadingRaconButton.png"))); 63 private EnumMap<Rtb, JRadioButton> rads = new EnumMap<>(Rtb.class); 64 private ActionListener alRad = new ActionListener() { 65 @Override 66 public void actionPerformed(ActionEvent e) { 67 for (Rtb rtb : rads.keySet()) { 68 JRadioButton button = rads.get(rtb); 69 if (button.isSelected()) { 70 SmedAction.panelMain.mark.setRadar(rtb); 71 } 72 } 73 syncPanel(); 74 } 75 }; 76 public JLabel groupLabel; 77 public JTextField groupBox; 78 private FocusListener flGroup = new FocusAdapter() { 79 @Override 80 public void focusLost(FocusEvent e) { 81 SmedAction.panelMain.mark.setRaconGroup(groupBox.getText()); 82 } 83 }; 84 public JLabel periodLabel; 85 public JTextField periodBox; 86 private FocusListener flPeriod = new FocusAdapter() { 87 @Override 88 public void focusLost(FocusEvent e) { 89 SmedAction.panelMain.mark.setRaconPeriod(periodBox.getText()); 90 } 91 }; 92 public JLabel seqLabel; 93 public JTextField seqBox; 94 private FocusListener flSeq = new FocusAdapter() { 95 @Override 96 public void focusLost(FocusEvent e) { 97 SmedAction.panelMain.mark.setRaconSequence(seqBox.getText()); 98 } 99 }; 100 public JLabel rangeLabel; 101 public JTextField rangeBox; 102 private FocusListener flRange = new FocusAdapter() { 103 @Override 104 public void focusLost(FocusEvent e) { 105 SmedAction.panelMain.mark.setRaconRange(rangeBox.getText()); 106 } 107 }; 108 public JLabel sector1Label; 109 public JTextField sector1Box; 110 private FocusListener flSector1 = new FocusAdapter() { 111 @Override 112 public void focusLost(FocusEvent e) { 113 SmedAction.panelMain.mark.setRaconSector1(sector1Box.getText()); 114 } 115 }; 116 public JLabel sector2Label; 117 public JTextField sector2Box; 118 private FocusListener flSector2 = new FocusAdapter() { 119 @Override 120 public void focusLost(FocusEvent e) { 121 SmedAction.panelMain.mark.setRaconSector2(sector2Box.getText()); 122 } 123 }; 124 public JLabel sectorsLabel; 125 126 public PanelRadar(SmedAction dia) { 127 dlg = dia; 128 setLayout(null); 129 add(getRadButton(noRadButton, 0, 3, 27, 27, "NoRadar", Rtb.NORTB)); 130 add(getRadButton(reflButton, 0, 33, 27, 27, "RadarReflector", Rtb.REFLECTOR)); 131 add(getRadButton(ramarkButton, 0, 63, 27, 27, "Ramark", Rtb.RAMARK)); 132 add(getRadButton(raconButton, 0, 93, 27, 27, "Racon", Rtb.RACON)); 133 add(getRadButton(leadingButton, 0, 123, 27, 27, "LeadingRacon", Rtb.LEADING)); 134 135 groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER); 136 groupLabel.setBounds(new Rectangle(30, 0, 100, 20)); 137 add(groupLabel); 138 groupBox = new JTextField(); 139 groupBox.setBounds(new Rectangle(55, 20, 50, 20)); 140 groupBox.setHorizontalAlignment(SwingConstants.CENTER); 141 add(groupBox); 142 groupBox.addFocusListener(flGroup); 143 144 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); 145 periodLabel.setBounds(new Rectangle(130, 0, 100, 20)); 146 add(periodLabel); 147 periodBox = new JTextField(); 148 periodBox.setBounds(new Rectangle(155, 20, 50, 20)); 149 periodBox.setHorizontalAlignment(SwingConstants.CENTER); 150 add(periodBox); 151 periodBox.addFocusListener(flPeriod); 152 153 seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); 154 seqLabel.setBounds(new Rectangle(30, 40, 100, 20)); 155 add(seqLabel); 156 seqBox = new JTextField(); 157 seqBox.setBounds(new Rectangle(55, 60, 50, 20)); 158 seqBox.setHorizontalAlignment(SwingConstants.CENTER); 159 add(seqBox); 160 seqBox.addFocusListener(flSeq); 161 162 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); 163 rangeLabel.setBounds(new Rectangle(130, 40, 100, 20)); 164 add(rangeLabel); 165 rangeBox = new JTextField(); 166 rangeBox.setBounds(new Rectangle(155, 60, 50, 20)); 167 rangeBox.setHorizontalAlignment(SwingConstants.CENTER); 168 add(rangeBox); 169 rangeBox.addFocusListener(flRange); 170 171 sectorsLabel = new JLabel(Messages.getString("VisibleSector"), SwingConstants.CENTER); 172 sectorsLabel.setBounds(new Rectangle(75, 85, 100, 20)); 173 add(sectorsLabel); 174 175 sector1Label = new JLabel(Messages.getString("Start"), SwingConstants.CENTER); 176 sector1Label.setBounds(new Rectangle(30, 100, 100, 20)); 177 add(sector1Label); 178 sector1Box = new JTextField(); 179 sector1Box.setBounds(new Rectangle(55, 120, 50, 20)); 180 sector1Box.setHorizontalAlignment(SwingConstants.CENTER); 181 add(sector1Box); 182 sector1Box.addFocusListener(flSector1); 183 184 sector2Label = new JLabel(Messages.getString("End"), SwingConstants.CENTER); 185 sector2Label.setBounds(new Rectangle(130, 100, 100, 20)); 186 add(sector2Label); 187 sector2Box = new JTextField(); 188 sector2Box.setBounds(new Rectangle(155, 120, 50, 20)); 189 sector2Box.setHorizontalAlignment(SwingConstants.CENTER); 190 add(sector2Box); 191 sector2Box.addFocusListener(flSector2); 192 193 aisButton.setBounds(new Rectangle(270, 3, 27, 27)); 194 aisButton.setBorder(BorderFactory.createLoweredBevelBorder()); 195 aisButton.setToolTipText("AIS"); 196 aisButton.addActionListener(alAis); 197 add(aisButton); 198 199 radioCatBox = new JComboBox<>(); 200 radioCatBox.setBounds(new Rectangle(210, 40, 150, 20)); 201 add(radioCatBox); 202 radioCatBox.addActionListener(alRadioCatBox); 203 addROItem("", Cat.NOROS); 204 addROItem(Messages.getString("CircularBeacon"), Cat.ROS_OMNI); 205 addROItem(Messages.getString("DirectionalBeacon"), Cat.ROS_DIRL); 206 addROItem(Messages.getString("RotatingBeacon"), Cat.ROS_ROTP); 207 addROItem(Messages.getString("ConsolBeacon"), Cat.ROS_CNSL); 208 addROItem(Messages.getString("DirectionFinding"), Cat.ROS_RDF); 209 addROItem(Messages.getString("QTGService"), Cat.ROS_QTG); 210 addROItem(Messages.getString("AeronaticalBeacon"), Cat.ROS_AERO); 211 addROItem(Messages.getString("Decca"), Cat.ROS_DECA); 212 addROItem(Messages.getString("LoranC"), Cat.ROS_LORN); 213 addROItem(Messages.getString("DGPS"), Cat.ROS_DGPS); 214 addROItem(Messages.getString("Toran"), Cat.ROS_TORN); 215 addROItem(Messages.getString("Omega"), Cat.ROS_OMGA); 216 addROItem(Messages.getString("Syledis"), Cat.ROS_SYLD); 217 addROItem(Messages.getString("Chiaka"), Cat.ROS_CHKA); 218 addROItem(Messages.getString("PublicCommunication"), Cat.ROS_PCOM); 219 addROItem(Messages.getString("CommercialBroadcast"), Cat.ROS_COMB); 220 addROItem(Messages.getString("Facsimile"), Cat.ROS_FACS); 221 addROItem(Messages.getString("TimeSignal"), Cat.ROS_TIME); 222 addROItem(Messages.getString("AIS"), Cat.ROS_PAIS); 223 addROItem(Messages.getString("S-AIS"), Cat.ROS_SAIS); 224 radioCatBox.setVisible(false); 225 } 226 227 public void syncPanel() { 228 boolean rad = ((SmedAction.panelMain.mark.getRadar() != Rtb.NORTB) && (SmedAction.panelMain.mark.getRadar() != Rtb.REFLECTOR)); 229 groupLabel.setVisible(rad); 230 groupBox.setVisible(rad); 231 periodLabel.setVisible(rad); 232 periodBox.setVisible(rad); 233 seqLabel.setVisible(rad); 234 seqBox.setVisible(rad); 235 rangeLabel.setVisible(rad); 236 rangeBox.setVisible(rad); 237 sector1Label.setVisible(rad); 238 sector1Box.setVisible(rad); 239 sector2Label.setVisible(rad); 240 sector2Box.setVisible(rad); 241 sectorsLabel.setVisible(rad); 242 for (Rtb rtb : rads.keySet()) { 243 rads.get(rtb).setBorderPainted(SmedAction.panelMain.mark.getRadar() == rtb); 244 } 245 groupBox.setText(SmedAction.panelMain.mark.getRaconGroup()); 246 seqBox.setText(SmedAction.panelMain.mark.getRaconSequence()); 247 periodBox.setText(SmedAction.panelMain.mark.getRaconPeriod()); 248 rangeBox.setText(SmedAction.panelMain.mark.getRaconRange()); 249 sector1Box.setText(SmedAction.panelMain.mark.getRaconSector1()); 250 sector2Box.setText(SmedAction.panelMain.mark.getRaconSector2()); 251 aisButton.setSelected(SmedAction.panelMain.mark.getRadio() != Cat.NOROS); 252 aisButton.setBorderPainted(aisButton.isSelected()); 253 radioCatBox.setVisible(SmedAction.panelMain.mark.getRadio() != Cat.NOROS); 254 } 255 256 private JRadioButton getRadButton(JRadioButton button, int x, int y, int w, int h, String tip, Rtb rtb) { 257 button.setBounds(new Rectangle(x, y, w, h)); 258 button.setBorder(BorderFactory.createLoweredBevelBorder()); 259 button.setToolTipText(Messages.getString(tip)); 260 button.addActionListener(alRad); 261 radarButtons.add(button); 262 rads.put(rtb, button); 263 return button; 264 } 265 266 private void addROItem(String str, Cat cat) { 267 radioCats.put(cat, radioCatBox.getItemCount()); 268 radioCatBox.addItem(str); 269 } 248 270 }
Note:
See TracChangeset
for help on using the changeset viewer.