Changeset 26989 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-10-30T19:03:59+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26988 r26989 61 61 } 62 62 if (safeWaterButton.isSelected()) { 63 dlg.mark.setCategory(Cat. UNKNOWN);63 dlg.mark.setCategory(Cat.NONE); 64 64 if (panelSaw.shapes.containsKey(shp)) { 65 65 panelSaw.shapes.get(shp).doClick(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r26970 r26989 2 2 3 3 import javax.swing.*; 4 4 5 import java.awt.*; 5 6 import java.awt.event.*; 7 import java.util.EnumMap; 6 8 7 9 import oseam.Messages; 8 10 import oseam.dialogs.OSeaMAction; 9 11 import oseam.seamarks.SeaMark.*; 10 12 11 13 public class PanelFog extends JPanel { 12 14 13 15 private OSeaMAction dlg; 16 private ButtonGroup fogButtons = new ButtonGroup(); 17 public JRadioButton noFogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 18 public JRadioButton yesFogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 19 public JRadioButton hornButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 20 public JRadioButton sirenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 21 public JRadioButton diaButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 22 public JRadioButton bellButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 23 public JRadioButton whisButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 24 public JRadioButton gongButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 25 public JRadioButton explosButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 26 private EnumMap<Fog, JRadioButton> fogs = new EnumMap<Fog, JRadioButton>(Fog.class); 27 private ActionListener alFog = new ActionListener() { 28 public void actionPerformed(java.awt.event.ActionEvent e) { 29 if (dlg.mark != null) { 30 for (Fog fog : fogs.keySet()) { 31 JRadioButton button = fogs.get(fog); 32 if (button.isSelected()) { 33 dlg.mark.setFogSound(fog); 34 button.setBorderPainted(true); 35 } else 36 button.setBorderPainted(false); 37 } 38 dlg.mark.setFog(!noFogButton.isSelected()); 39 dlg.mark.paintSign(); 40 } 41 } 42 }; 43 public JLabel groupLabel; 44 public JTextField groupBox; 45 private ActionListener alGroup = new ActionListener() { 46 public void actionPerformed(java.awt.event.ActionEvent e) { 47 if (dlg.mark != null) 48 dlg.mark.setFogGroup(groupBox.getText()); 49 } 50 }; 51 public JLabel periodLabel; 52 public JTextField periodBox; 53 private ActionListener alPeriod = new ActionListener() { 54 public void actionPerformed(java.awt.event.ActionEvent e) { 55 if (dlg.mark != null) 56 dlg.mark.setFogPeriod(periodBox.getText()); 57 } 58 }; 59 public JLabel seqLabel; 60 public JTextField seqBox; 61 private ActionListener alSeq = new ActionListener() { 62 public void actionPerformed(java.awt.event.ActionEvent e) { 63 if (dlg.mark != null) 64 dlg.mark.setFogSequence(seqBox.getText()); 65 } 66 }; 67 public JLabel rangeLabel; 68 public JTextField rangeBox; 69 private ActionListener alRange = new ActionListener() { 70 public void actionPerformed(java.awt.event.ActionEvent e) { 71 if (dlg.mark != null) 72 dlg.mark.setFogRange(rangeBox.getText()); 73 } 74 }; 14 75 15 76 public PanelFog(OSeaMAction dia) { 16 77 dlg = dia; 17 78 this.setLayout(null); 79 this.add(getFogButton(noFogButton, 0, 5, 27, 27, "NoFog", Fog.NONE), null); 80 this.add(getFogButton(yesFogButton, 0, 35, 27, 27, "FogSignal", Fog.UNKNOWN), null); 81 this.add(getFogButton(hornButton, 0, 65, 27, 27, "Horn", Fog.HORN), null); 82 this.add(getFogButton(sirenButton, 0, 95, 27, 27, "Siren", Fog.SIREN), null); 83 this.add(getFogButton(diaButton, 30, 5, 27, 27, "Diaphone", Fog.DIA), null); 84 this.add(getFogButton(bellButton, 30, 35, 27, 27, "Bell", Fog.BELL), null); 85 this.add(getFogButton(whisButton, 30, 65, 27, 27, "Whistle", Fog.WHIS), null); 86 this.add(getFogButton(explosButton, 30, 95, 27, 27, "Explosion", Fog.EXPLOS), null); 87 88 groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER); 89 groupLabel.setBounds(new Rectangle(75, 0, 100, 20)); 90 this.add(groupLabel, null); 91 groupBox = new JTextField(); 92 groupBox.setBounds(new Rectangle(100, 20, 50, 20)); 93 this.add(groupBox, null); 94 groupBox.addActionListener(alGroup); 95 96 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); 97 periodLabel.setBounds(new Rectangle(75, 40, 100, 20)); 98 this.add(periodLabel, null); 99 periodBox = new JTextField(); 100 periodBox.setBounds(new Rectangle(100, 60, 50, 20)); 101 this.add(periodBox, null); 102 periodBox.addActionListener(alPeriod); 103 104 seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); 105 seqLabel.setBounds(new Rectangle(75, 80, 100, 20)); 106 this.add(seqLabel, null); 107 seqBox = new JTextField(); 108 seqBox.setBounds(new Rectangle(100, 100, 50, 20)); 109 this.add(seqBox, null); 110 seqBox.addActionListener(alSeq); 111 112 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); 113 rangeLabel.setBounds(new Rectangle(75, 120, 100, 20)); 114 this.add(rangeLabel, null); 115 rangeBox = new JTextField(); 116 rangeBox.setBounds(new Rectangle(100, 140, 50, 20)); 117 this.add(rangeBox, null); 118 rangeBox.addActionListener(alRange); 119 120 } 121 122 public void syncPanel() { 123 for (Fog fog : fogs.keySet()) { 124 JRadioButton button = fogs.get(fog); 125 if (dlg.mark.getFogSound() == fog) { 126 button.setBorderPainted(true); 127 } else 128 button.setBorderPainted(false); 129 } 130 groupBox.setText(dlg.mark.getFogGroup()); 131 seqBox.setText(dlg.mark.getFogSequence()); 132 periodBox.setText(dlg.mark.getFogPeriod()); 133 rangeBox.setText(dlg.mark.getFogRange()); 134 } 135 136 private JRadioButton getFogButton(JRadioButton button, int x, int y, int w, int h, String tip, Fog fog) { 137 button.setBounds(new Rectangle(x, y, w, h)); 138 button.setBorder(BorderFactory.createLoweredBevelBorder()); 139 button.setToolTipText(Messages.getString(tip)); 140 button.addActionListener(alFog); 141 fogButtons.add(button); 142 fogs.put(fog, button); 143 return button; 18 144 } 19 145 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26988 r26989 70 70 } 71 71 if (isolButton.isSelected()) { 72 dlg.mark.setCategory(Cat. UNKNOWN);72 dlg.mark.setCategory(Cat.NONE); 73 73 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 74 74 dlg.mark.setColour(Ent.BODY, Col.BLACK); … … 198 198 eastButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_EAST); 199 199 westButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_WEST); 200 isolButton.setBorderPainted(dlg.mark.getCategory() == Cat. UNKNOWN);200 isolButton.setBorderPainted(dlg.mark.getCategory() == Cat.NONE); 201 201 for (Shp shp : shapes.keySet()) { 202 202 JRadioButton button = shapes.get(shp); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r26970 r26989 100 100 this.add(trafficCatBox, null); 101 101 trafficCatBox.addActionListener(alTrafficCatBox); 102 addTCItem(Messages.getString("UKCategory"), Cat. UNKNOWN);102 addTCItem(Messages.getString("UKCategory"), Cat.NONE); 103 103 addTCItem(Messages.getString("Traffic"), Cat.SIS_TRFC); 104 104 addTCItem(Messages.getString("PortControl"), Cat.SIS_PTCL); … … 117 117 this.add(warningCatBox, null); 118 118 warningCatBox.addActionListener(alWarningCatBox); 119 addWCItem(Messages.getString("UKCategory"), Cat. UNKNOWN);119 addWCItem(Messages.getString("UKCategory"), Cat.NONE); 120 120 addWCItem(Messages.getString("Danger"), Cat.SIS_DNGR); 121 121 addWCItem(Messages.getString("Storm"), Cat.SIS_STRM); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r26970 r26989 2 2 3 3 import javax.swing.*; 4 4 5 import java.awt.*; 5 6 import java.awt.event.*; … … 17 18 public JLabel groupLabel; 18 19 public JTextField groupBox; 20 private ActionListener alGroup = new ActionListener() { 21 public void actionPerformed(java.awt.event.ActionEvent e) { 22 String str = groupBox.getText(); 23 } 24 }; 19 25 public JLabel periodLabel; 20 26 public JTextField periodBox; 27 private ActionListener alPeriod = new ActionListener() { 28 public void actionPerformed(java.awt.event.ActionEvent e) { 29 String str = periodBox.getText(); 30 } 31 }; 21 32 public JLabel sequenceLabel; 22 33 public JTextField sequenceBox; 34 private ActionListener alSequence = new ActionListener() { 35 public void actionPerformed(java.awt.event.ActionEvent e) { 36 String str = sequenceBox.getText(); 37 } 38 }; 23 39 public JLabel visibilityLabel; 24 40 public JComboBox visibilityBox; 41 private ActionListener alVisibility = new ActionListener() { 42 public void actionPerformed(java.awt.event.ActionEvent e) { 43 } 44 }; 25 45 public JLabel heightLabel; 26 46 public JTextField heightBox; 47 private ActionListener alHeight = new ActionListener() { 48 public void actionPerformed(java.awt.event.ActionEvent e) { 49 String str = heightBox.getText(); 50 } 51 }; 27 52 public JLabel rangeLabel; 28 53 public JTextField rangeBox; 54 private ActionListener alRange = new ActionListener() { 55 public void actionPerformed(java.awt.event.ActionEvent e) { 56 String str = rangeBox.getText(); 57 } 58 }; 29 59 public JLabel orientationLabel; 30 60 public JTextField orientationBox; 61 private ActionListener alOrientation = new ActionListener() { 62 public void actionPerformed(java.awt.event.ActionEvent e) { 63 String str = orientationBox.getText(); 64 } 65 }; 31 66 public JLabel categoryLabel; 32 67 public JComboBox categoryBox; 68 private ActionListener alCategory = new ActionListener() { 69 public void actionPerformed(java.awt.event.ActionEvent e) { 70 } 71 }; 33 72 public JLabel exhibitionLabel; 34 73 public JComboBox exhibitionBox; 74 private ActionListener alExhibition = new ActionListener() { 75 public void actionPerformed(java.awt.event.ActionEvent e) { 76 } 77 }; 35 78 private ButtonGroup typeButtons; 36 79 public JRadioButton singleButton; 37 80 public JRadioButton sectorButton; 38 private ActionListener alType; 39 private ActionListener alGroupBox; 40 private ActionListener alPeriodBox; 41 private ActionListener alSequenceBox; 42 private ActionListener alVisibilityBox; 43 private ActionListener alHeightBox; 44 private ActionListener alRangeBox; 45 private ActionListener alOrientationBox; 46 private ActionListener alCategoryBox; 47 private ActionListener alExhibitionBox; 81 private ActionListener alType = new ActionListener() { 82 public void actionPerformed(java.awt.event.ActionEvent e) { 83 singleButton.setBorderPainted(singleButton.isSelected()); 84 sectorButton.setBorderPainted(sectorButton.isSelected()); 85 if (sectorButton.isSelected()) { 86 if (panelSector == null) { 87 panelSector = new PanelSectors(dlg.mark.light); 88 panelSector.setAlwaysOnTop(true); 89 panelSector.setLocation(450, 0); 90 } 91 if (panelSector.getSectorCount() == 0) { 92 panelSector.addSector(1); 93 panelSector.light.setSectored(true); 94 } 95 panelSector.setVisible(true); 96 } else { 97 dlg.mark.light.setSectored(false); 98 panelSector.setVisible(false); 99 } 100 } 101 }; 48 102 49 103 public PanelLit(OSeaMAction dia) { … … 57 111 this.add(panelCol, null); 58 112 59 alType = new ActionListener() {60 public void actionPerformed(java.awt.event.ActionEvent e) {61 singleButton.setBorderPainted(singleButton.isSelected());62 sectorButton.setBorderPainted(sectorButton.isSelected());63 if (sectorButton.isSelected()) {64 if (panelSector == null) {65 panelSector = new PanelSectors(dlg.mark.light);66 panelSector.setAlwaysOnTop(true);67 panelSector.setLocation(450, 0);68 }69 if (panelSector.getSectorCount() == 0) {70 panelSector.addSector(1);71 panelSector.light.setSectored(true);72 }73 panelSector.setVisible(true);74 } else {75 dlg.mark.light.setSectored(false);76 panelSector.setVisible(false);77 }78 }79 };80 113 typeButtons = new ButtonGroup(); 81 114 singleButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SingleButton.png"))); … … 84 117 this.add(getTypeButton(sectorButton, 315, 125, 34, 30, "Sector"), null); 85 118 86 alGroupBox = new ActionListener() {87 public void actionPerformed(java.awt.event.ActionEvent e) {88 String str = groupBox.getText();89 }90 };91 119 groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER); 92 120 groupLabel.setBounds(new Rectangle(123, 0, 65, 20)); … … 96 124 groupBox.setHorizontalAlignment(SwingConstants.CENTER); 97 125 this.add(groupBox, null); 98 groupBox.addActionListener(alGroupBox); 99 100 alPeriodBox = new ActionListener() { 101 public void actionPerformed(java.awt.event.ActionEvent e) { 102 String str = periodBox.getText(); 103 } 104 }; 126 groupBox.addActionListener(alGroup); 127 105 128 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); 106 129 periodLabel.setBounds(new Rectangle(123, 40, 65, 20)); … … 110 133 periodBox.setHorizontalAlignment(SwingConstants.CENTER); 111 134 this.add(periodBox, null); 112 periodBox.addActionListener(alPeriodBox); 113 114 alHeightBox = new ActionListener() { 115 public void actionPerformed(java.awt.event.ActionEvent e) { 116 String str = heightBox.getText(); 117 } 118 }; 135 periodBox.addActionListener(alPeriod); 136 119 137 heightLabel = new JLabel(Messages.getString("Height"), SwingConstants.CENTER); 120 138 heightLabel.setBounds(new Rectangle(123, 80, 65, 20)); … … 124 142 heightBox.setHorizontalAlignment(SwingConstants.CENTER); 125 143 this.add(heightBox, null); 126 heightBox.addActionListener(alHeightBox); 127 128 alRangeBox = new ActionListener() { 129 public void actionPerformed(java.awt.event.ActionEvent e) { 130 String str = rangeBox.getText(); 131 } 132 }; 144 heightBox.addActionListener(alHeight); 145 133 146 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); 134 147 rangeLabel.setBounds(new Rectangle(123, 120, 65, 20)); … … 138 151 rangeBox.setHorizontalAlignment(SwingConstants.CENTER); 139 152 this.add(rangeBox, null); 140 rangeBox.addActionListener(alRangeBox); 141 142 alSequenceBox = new ActionListener() { 143 public void actionPerformed(java.awt.event.ActionEvent e) { 144 String str = sequenceBox.getText(); 145 } 146 }; 153 rangeBox.addActionListener(alRange); 154 147 155 sequenceLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); 148 156 sequenceLabel.setBounds(new Rectangle(188, 120, 80, 20)); … … 152 160 sequenceBox.setHorizontalAlignment(SwingConstants.CENTER); 153 161 this.add(sequenceBox, null); 154 sequenceBox.addActionListener(alSequenceBox); 155 156 alCategoryBox = new ActionListener() { 157 public void actionPerformed(java.awt.event.ActionEvent e) { 158 } 159 }; 162 sequenceBox.addActionListener(alSequence); 163 160 164 categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER); 161 165 categoryLabel.setBounds(new Rectangle(185, 0, 165, 20)); … … 164 168 categoryBox.setBounds(new Rectangle(185, 20, 165, 20)); 165 169 this.add(categoryBox, null); 166 categoryBox.addActionListener(alCategory Box);170 categoryBox.addActionListener(alCategory); 167 171 categoryBox.addItem(Messages.getString("NoneSpecified")); 168 172 categoryBox.addItem(Messages.getString("Vert2")); 169 173 170 alVisibilityBox = new ActionListener() {171 public void actionPerformed(java.awt.event.ActionEvent e) {172 }173 };174 174 visibilityLabel = new JLabel(Messages.getString("Visibility"), SwingConstants.CENTER); 175 175 visibilityLabel.setBounds(new Rectangle(185, 40, 165, 20)); … … 178 178 visibilityBox.setBounds(new Rectangle(185, 60, 165, 20)); 179 179 this.add(visibilityBox, null); 180 visibilityBox.addActionListener(alVisibility Box);180 visibilityBox.addActionListener(alVisibility); 181 181 visibilityBox.addItem(Messages.getString("NoneSpecified")); 182 182 visibilityBox.addItem(Messages.getString("Intensified")); … … 184 184 visibilityBox.addItem(Messages.getString("PartiallyObscured")); 185 185 186 alExhibitionBox = new ActionListener() {187 public void actionPerformed(java.awt.event.ActionEvent e) {188 }189 };190 186 exhibitionLabel = new JLabel(Messages.getString("Exhibition"), SwingConstants.CENTER); 191 187 exhibitionLabel.setBounds(new Rectangle(280, 80, 70, 20)); … … 194 190 exhibitionBox.setBounds(new Rectangle(280, 100, 70, 20)); 195 191 this.add(exhibitionBox, null); 196 exhibitionBox.addActionListener(alExhibition Box);192 exhibitionBox.addActionListener(alExhibition); 197 193 exhibitionBox.addItem("-"); 198 194 exhibitionBox.addItem(Messages.getString("24h")); … … 201 197 exhibitionBox.addItem(Messages.getString("Fog")); 202 198 203 alOrientationBox = new ActionListener() {204 public void actionPerformed(java.awt.event.ActionEvent e) {205 String str = orientationBox.getText();206 }207 };208 199 orientationLabel = new JLabel(Messages.getString("Orientation"), SwingConstants.CENTER); 209 200 orientationLabel.setBounds(new Rectangle(188, 80, 80, 20)); … … 213 204 orientationBox.setHorizontalAlignment(SwingConstants.CENTER); 214 205 this.add(orientationBox, null); 215 orientationBox.addActionListener(alOrientationBox); 206 orientationBox.addActionListener(alOrientation); 207 } 208 209 public void syncPanel() { 216 210 } 217 211 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26988 r26989 14 14 15 15 private OSeaMAction dlg; 16 public JLabel shapeIcon = null;17 public JLabel lightIcon = null;18 public JLabel topIcon = null;19 public JLabel radarIcon = null;20 public JLabel fogIcon = null;21 public JLabel colLabel = null;22 public JLabel nameLabel = null;23 public JTextField nameBox = null;24 private JButton saveButton = null;25 private ActionListener alSave = null;26 public JButton moreButton = null;27 private ActionListener alMore = null;28 public ButtonGroup typeButtons = null;29 public JRadioButton chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png")));30 public JRadioButton hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png")));31 public JRadioButton specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png")));32 public JRadioButton lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png")));33 private ActionListener alType = null;34 private ButtonGroup miscButtons = null;35 public JRadioButton topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png")));36 public JRadioButton fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png")));37 public JRadioButton radButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png")));38 public JRadioButton litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png")));39 private ActionListener alMisc = null;40 private ActionListener alName = null;41 16 public PanelChan panelChan = null; 42 17 public PanelHaz panelHaz = null; … … 48 23 public PanelRadar panelRadar = null; 49 24 public PanelLit panelLit = null; 25 public JLabel shapeIcon = null; 26 public JLabel lightIcon = null; 27 public JLabel topIcon = null; 28 public JLabel radarIcon = null; 29 public JLabel fogIcon = null; 30 public JLabel colLabel = null; 31 public JLabel nameLabel = null; 32 public JTextField nameBox = null; 33 private ActionListener alName = new ActionListener() { 34 public void actionPerformed(java.awt.event.ActionEvent e) { 35 if (dlg.mark != null) 36 dlg.mark.setName(nameBox.getText()); 37 } 38 }; 39 private JButton saveButton = null; 40 private ActionListener alSave = new ActionListener() { 41 public void actionPerformed(java.awt.event.ActionEvent e) { 42 if (dlg.mark != null) { 43 dlg.mark.saveSign(dlg.node); 44 } 45 } 46 }; 47 public JButton moreButton = null; 48 private ActionListener alMore = new ActionListener() { 49 public void actionPerformed(java.awt.event.ActionEvent e) { 50 if (panelMore.isVisible()) { 51 moreButton.setText("v v v"); 52 panelMore.setVisible(false); 53 topButton.setEnabled(true); 54 radButton.setEnabled(true); 55 fogButton.setEnabled(true); 56 litButton.setEnabled(true); 57 } else { 58 panelMore.setVisible(true); 59 moreButton.setText("^ ^ ^"); 60 miscButtons.clearSelection(); 61 panelTop.setVisible(false); 62 topButton.setBorderPainted(false); 63 topButton.setEnabled(false); 64 panelRadar.setVisible(false); 65 radButton.setBorderPainted(false); 66 radButton.setEnabled(false); 67 panelFog.setVisible(false); 68 fogButton.setBorderPainted(false); 69 fogButton.setEnabled(false); 70 panelLit.setVisible(false); 71 litButton.setBorderPainted(false); 72 litButton.setEnabled(false); 73 } 74 } 75 }; 76 public ButtonGroup typeButtons = null; 77 public JRadioButton chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png"))); 78 public JRadioButton hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png"))); 79 public JRadioButton specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png"))); 80 public JRadioButton lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png"))); 81 private ActionListener alType = new ActionListener() { 82 public void actionPerformed(java.awt.event.ActionEvent e) { 83 if (dlg.node == null) 84 typeButtons.clearSelection(); 85 if (chanButton.isSelected()) { 86 chanButton.setBorderPainted(true); 87 panelChan.setVisible(true); 88 } else { 89 chanButton.setBorderPainted(false); 90 panelChan.setVisible(false); 91 } 92 if (hazButton.isSelected()) { 93 hazButton.setBorderPainted(true); 94 panelHaz.setVisible(true); 95 } else { 96 hazButton.setBorderPainted(false); 97 panelHaz.setVisible(false); 98 } 99 if (specButton.isSelected()) { 100 specButton.setBorderPainted(true); 101 panelSpec.setVisible(true); 102 } else { 103 specButton.setBorderPainted(false); 104 panelSpec.setVisible(false); 105 } 106 if (lightsButton.isSelected()) { 107 lightsButton.setBorderPainted(true); 108 panelLights.setVisible(true); 109 } else { 110 lightsButton.setBorderPainted(false); 111 panelLights.setVisible(false); 112 } 113 } 114 }; 115 private ButtonGroup miscButtons = null; 116 public JRadioButton topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png"))); 117 public JRadioButton fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png"))); 118 public JRadioButton radButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png"))); 119 public JRadioButton litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png"))); 120 private ActionListener alMisc = new ActionListener() { 121 public void actionPerformed(java.awt.event.ActionEvent e) { 122 if (dlg.mark == null) { 123 miscButtons.clearSelection(); 124 } 125 if (topButton.isSelected()) { 126 moreButton.setText("v v v"); 127 panelMore.setVisible(false); 128 topButton.setBorderPainted(true); 129 panelTop.setVisible(true); 130 } else { 131 topButton.setBorderPainted(false); 132 panelTop.setVisible(false); 133 } 134 if (fogButton.isSelected()) { 135 moreButton.setText("v v v"); 136 panelMore.setVisible(false); 137 fogButton.setBorderPainted(true); 138 panelFog.setVisible(true); 139 } else { 140 fogButton.setBorderPainted(false); 141 panelFog.setVisible(false); 142 } 143 if (radButton.isSelected()) { 144 moreButton.setText("v v v"); 145 panelMore.setVisible(false); 146 radButton.setBorderPainted(true); 147 panelRadar.setVisible(true); 148 } else { 149 radButton.setBorderPainted(false); 150 panelRadar.setVisible(false); 151 } 152 if (litButton.isSelected()) { 153 moreButton.setText("v v v"); 154 panelMore.setVisible(false); 155 litButton.setBorderPainted(true); 156 panelLit.setVisible(true); 157 } else { 158 litButton.setBorderPainted(false); 159 panelLit.setVisible(false); 160 } 161 } 162 }; 50 163 51 164 public PanelMain(OSeaMAction dia) { … … 117 230 typeButtons.add(specButton); 118 231 typeButtons.add(lightsButton); 119 alType = new ActionListener() {120 public void actionPerformed(java.awt.event.ActionEvent e) {121 if (dlg.node == null)122 typeButtons.clearSelection();123 if (chanButton.isSelected()) {124 chanButton.setBorderPainted(true);125 panelChan.setVisible(true);126 } else {127 chanButton.setBorderPainted(false);128 panelChan.setVisible(false);129 }130 if (hazButton.isSelected()) {131 hazButton.setBorderPainted(true);132 panelHaz.setVisible(true);133 } else {134 hazButton.setBorderPainted(false);135 panelHaz.setVisible(false);136 }137 if (specButton.isSelected()) {138 specButton.setBorderPainted(true);139 panelSpec.setVisible(true);140 } else {141 specButton.setBorderPainted(false);142 panelSpec.setVisible(false);143 }144 if (lightsButton.isSelected()) {145 lightsButton.setBorderPainted(true);146 panelLights.setVisible(true);147 } else {148 lightsButton.setBorderPainted(false);149 panelLights.setVisible(false);150 }151 }152 };153 232 chanButton.addActionListener(alType); 154 233 hazButton.addActionListener(alType); … … 165 244 miscButtons.add(radButton); 166 245 miscButtons.add(litButton); 167 alMisc = new ActionListener() {168 public void actionPerformed(java.awt.event.ActionEvent e) {169 if (dlg.mark == null) {170 miscButtons.clearSelection();171 }172 if (topButton.isSelected()) {173 moreButton.setText("v v v");174 panelMore.setVisible(false);175 topButton.setBorderPainted(true);176 panelTop.setVisible(true);177 } else {178 topButton.setBorderPainted(false);179 panelTop.setVisible(false);180 }181 if (fogButton.isSelected()) {182 moreButton.setText("v v v");183 panelMore.setVisible(false);184 fogButton.setBorderPainted(true);185 panelFog.setVisible(true);186 } else {187 fogButton.setBorderPainted(false);188 panelFog.setVisible(false);189 }190 if (radButton.isSelected()) {191 moreButton.setText("v v v");192 panelMore.setVisible(false);193 radButton.setBorderPainted(true);194 panelRadar.setVisible(true);195 } else {196 radButton.setBorderPainted(false);197 panelRadar.setVisible(false);198 }199 if (litButton.isSelected()) {200 moreButton.setText("v v v");201 panelMore.setVisible(false);202 litButton.setBorderPainted(true);203 panelLit.setVisible(true);204 } else {205 litButton.setBorderPainted(false);206 panelLit.setVisible(false);207 }208 }209 };210 246 topButton.addActionListener(alMisc); 211 247 fogButton.addActionListener(alMisc); … … 220 256 nameBox.setBounds(new Rectangle(60, 330, 200, 20)); 221 257 this.add(nameBox, null); 222 alName = new ActionListener() {223 public void actionPerformed(java.awt.event.ActionEvent e) {224 if (dlg.mark != null)225 dlg.mark.setName(nameBox.getText());226 }227 };228 258 nameBox.addActionListener(alName); 229 259 … … 232 262 saveButton.setText(tr("Save")); 233 263 this.add(saveButton, null); 234 alSave = new ActionListener() {235 public void actionPerformed(java.awt.event.ActionEvent e) {236 if (dlg.mark != null) {237 dlg.mark.saveSign(dlg.node);238 }239 }240 };241 264 saveButton.addActionListener(alSave); 242 265 … … 246 269 moreButton.setText("v v v"); 247 270 this.add(moreButton, null); 248 alMore = new ActionListener() {249 public void actionPerformed(java.awt.event.ActionEvent e) {250 if (panelMore.isVisible()) {251 moreButton.setText("v v v");252 panelMore.setVisible(false);253 if (topButton.isSelected())254 panelTop.setVisible(true);255 if (radButton.isSelected())256 panelRadar.setVisible(true);257 if (fogButton.isSelected())258 panelFog.setVisible(true);259 if (litButton.isSelected())260 panelLit.setVisible(true);261 } else {262 panelMore.setVisible(true);263 moreButton.setText("^ ^ ^");264 miscButtons.clearSelection();265 panelTop.setVisible(false);266 topButton.setBorderPainted(false);267 panelRadar.setVisible(false);268 radButton.setBorderPainted(false);269 panelFog.setVisible(false);270 fogButton.setBorderPainted(false);271 panelLit.setVisible(false);272 litButton.setBorderPainted(false);273 }274 }275 };276 271 moreButton.addActionListener(alMore); 277 272 … … 308 303 dlg.panelMain.panelMore.setVisible(false); 309 304 dlg.panelMain.panelMore.syncPanel(); 305 moreButton.setVisible(dlg.mark.isValid()); 310 306 dlg.panelMain.panelTop.syncPanel(); 311 moreButton.setVisible(dlg.mark.isValid()); 307 dlg.panelMain.panelFog.syncPanel(); 308 dlg.panelMain.panelRadar.syncPanel(); 309 dlg.panelMain.panelLit.syncPanel(); 312 310 } 313 311 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r26970 r26989 3 3 import java.awt.*; 4 4 import java.awt.event.*; 5 5 6 import javax.swing.*; 7 6 8 import java.util.*; 7 9 10 import oseam.Messages; 8 11 import oseam.dialogs.OSeaMAction; 12 import oseam.seamarks.SeaMark.*; 9 13 10 14 public class PanelRadar extends JPanel { 11 15 12 16 private OSeaMAction dlg; 17 private ButtonGroup radarButtons = new ButtonGroup(); 18 public JRadioButton noRadButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 19 public JRadioButton reflButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 20 public JRadioButton raconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 21 public JRadioButton ramarkButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 22 public JRadioButton leadingButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 23 private EnumMap<Rtb, JRadioButton> rads = new EnumMap<Rtb, JRadioButton>(Rtb.class); 24 private ActionListener alRad = new ActionListener() { 25 public void actionPerformed(java.awt.event.ActionEvent e) { 26 if (dlg.mark != null) { 27 for (Rtb rtb : rads.keySet()) { 28 JRadioButton button = rads.get(rtb); 29 if (button.isSelected()) { 30 dlg.mark.setRaType(rtb); 31 button.setBorderPainted(true); 32 } else 33 button.setBorderPainted(false); 34 } 35 dlg.mark.paintSign(); 36 } 37 } 38 }; 39 public JLabel groupLabel; 40 public JTextField groupBox; 41 private ActionListener alGroup = new ActionListener() { 42 public void actionPerformed(java.awt.event.ActionEvent e) { 43 if (dlg.mark != null) 44 dlg.mark.setRaconGroup(groupBox.getText()); 45 } 46 }; 47 public JLabel periodLabel; 48 public JTextField periodBox; 49 private ActionListener alPeriod = new ActionListener() { 50 public void actionPerformed(java.awt.event.ActionEvent e) { 51 if (dlg.mark != null) 52 dlg.mark.setRaconPeriod(periodBox.getText()); 53 } 54 }; 55 public JLabel seqLabel; 56 public JTextField seqBox; 57 private ActionListener alSeq = new ActionListener() { 58 public void actionPerformed(java.awt.event.ActionEvent e) { 59 if (dlg.mark != null) 60 dlg.mark.setRaconSequence(seqBox.getText()); 61 } 62 }; 63 public JLabel rangeLabel; 64 public JTextField rangeBox; 65 private ActionListener alRange = new ActionListener() { 66 public void actionPerformed(java.awt.event.ActionEvent e) { 67 if (dlg.mark != null) 68 dlg.mark.setRaconRange(rangeBox.getText()); 69 } 70 }; 71 public JLabel sector1Label; 72 public JTextField sector1Box; 73 private ActionListener alSector1 = new ActionListener() { 74 public void actionPerformed(java.awt.event.ActionEvent e) { 75 if (dlg.mark != null) 76 dlg.mark.setRaconSector1(rangeBox.getText()); 77 } 78 }; 79 public JLabel sector2Label; 80 public JTextField sector2Box; 81 private ActionListener alSector2 = new ActionListener() { 82 public void actionPerformed(java.awt.event.ActionEvent e) { 83 if (dlg.mark != null) 84 dlg.mark.setRaconSector2(rangeBox.getText()); 85 } 86 }; 13 87 14 88 public PanelRadar(OSeaMAction dia) { 15 89 dlg = dia; 16 90 this.setLayout(null); 91 this.add(getRadButton(noRadButton, 0, 3, 27, 27, "NoRadar", Rtb.NONE), null); 92 this.add(getRadButton(reflButton, 0, 33, 27, 27, "RadarReflector", Rtb.REFLECTOR), null); 93 this.add(getRadButton(raconButton, 0, 63, 27, 27, "Racon", Rtb.RACON), null); 94 this.add(getRadButton(ramarkButton, 0, 93, 27, 27, "Ramark", Rtb.RAMARK), null); 95 this.add(getRadButton(leadingButton, 0, 123, 27, 27, "LeadingBeacon", Rtb.LEADING), null); 96 97 groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER); 98 groupLabel.setBounds(new Rectangle(75, 0, 100, 20)); 99 this.add(groupLabel, null); 100 groupBox = new JTextField(); 101 groupBox.setBounds(new Rectangle(100, 20, 50, 20)); 102 this.add(groupBox, null); 103 groupBox.addActionListener(alGroup); 104 105 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); 106 periodLabel.setBounds(new Rectangle(75, 40, 100, 20)); 107 this.add(periodLabel, null); 108 periodBox = new JTextField(); 109 periodBox.setBounds(new Rectangle(100, 60, 50, 20)); 110 this.add(periodBox, null); 111 periodBox.addActionListener(alPeriod); 112 113 seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); 114 seqLabel.setBounds(new Rectangle(75, 80, 100, 20)); 115 this.add(seqLabel, null); 116 seqBox = new JTextField(); 117 seqBox.setBounds(new Rectangle(100, 100, 50, 20)); 118 this.add(seqBox, null); 119 seqBox.addActionListener(alSeq); 120 121 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); 122 rangeLabel.setBounds(new Rectangle(75, 120, 100, 20)); 123 this.add(rangeLabel, null); 124 rangeBox = new JTextField(); 125 rangeBox.setBounds(new Rectangle(100, 140, 50, 20)); 126 this.add(rangeBox, null); 127 rangeBox.addActionListener(alRange); 128 129 sector1Label = new JLabel(Messages.getString("SectorStart"), SwingConstants.CENTER); 130 sector1Label.setBounds(new Rectangle(175, 40, 100, 20)); 131 this.add(sector1Label, null); 132 sector1Box = new JTextField(); 133 sector1Box.setBounds(new Rectangle(200, 60, 50, 20)); 134 this.add(sector1Box, null); 135 sector1Box.addActionListener(alSector1); 136 137 sector2Label = new JLabel(Messages.getString("SectorEnd"), SwingConstants.CENTER); 138 sector2Label.setBounds(new Rectangle(175, 80, 100, 20)); 139 this.add(sector2Label, null); 140 sector2Box = new JTextField(); 141 sector2Box.setBounds(new Rectangle(200, 100, 50, 20)); 142 this.add(sector2Box, null); 143 sector2Box.addActionListener(alSector1); 144 } 145 146 public void syncPanel() { 147 for (Rtb rtb : rads.keySet()) { 148 JRadioButton button = rads.get(rtb); 149 if (dlg.mark.getRaType() == rtb) { 150 button.setBorderPainted(true); 151 } else 152 button.setBorderPainted(false); 153 } 154 groupBox.setText(dlg.mark.getRaconGroup()); 155 seqBox.setText(dlg.mark.getRaconSequence()); 156 periodBox.setText(dlg.mark.getRaconPeriod()); 157 rangeBox.setText(dlg.mark.getRaconRange()); 158 sector1Box.setText(dlg.mark.getRaconSector1()); 159 sector2Box.setText(dlg.mark.getRaconSector2()); 160 } 161 162 private JRadioButton getRadButton(JRadioButton button, int x, int y, int w, int h, String tip, Rtb rtb) { 163 button.setBounds(new Rectangle(x, y, w, h)); 164 button.setBorder(BorderFactory.createLoweredBevelBorder()); 165 button.setToolTipText(Messages.getString(tip)); 166 button.addActionListener(alRad); 167 radarButtons.add(button); 168 rads.put(rtb, button); 169 return button; 17 170 } 18 171 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r26988 r26989 100 100 this.add(categoryBox, null); 101 101 categoryBox.addActionListener(alCategoryBox); 102 addCatItem(Messages.getString("NotSet"), Cat.NONE); 102 103 addCatItem(Messages.getString("UKPurpose"), Cat.SPM_UNKN); 103 104 addCatItem(Messages.getString("Warning"), Cat.SPM_WARN); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26988 r26989 160 160 161 161 public enum Cat { 162 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_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 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 170 } 164 171 … … 224 231 } 225 232 226 private Cat category = Cat. UNKNOWN;233 private Cat category = Cat.NONE; 227 234 228 235 public Cat getCategory() { … … 528 535 529 536 public enum Rtb { 530 UNKNOWN, RACON, RAMARK, LEADING531 } 532 533 private Rtb RaType = Rtb. UNKNOWN;537 NONE, REFLECTOR, RACON, RAMARK, LEADING 538 } 539 540 private Rtb RaType = Rtb.NONE; 534 541 535 542 public Rtb getRaType() { … … 547 554 } 548 555 549 public void setRaconGroup(String raconGroup) { 550 RaconGroup = raconGroup; 556 public void setRaconGroup(String grp) { 557 RaconGroup = grp; 558 } 559 560 private String RaconSequence = ""; 561 562 public String getRaconSequence() { 563 return RaconSequence; 564 } 565 566 public void setRaconSequence(String seq) { 567 RaconSequence = seq; 568 } 569 570 private String RaconPeriod = ""; 571 572 public String getRaconPeriod() { 573 return RaconPeriod; 574 } 575 576 public void setRaconPeriod(String per) { 577 RaconPeriod = validDecimal(per); 578 } 579 580 private String RaconRange = ""; 581 582 public String getRaconRange() { 583 return RaconRange; 584 } 585 586 public void setRaconRange(String rng) { 587 RaconRange = validDecimal(rng); 588 } 589 590 private String RaconSector1 = ""; 591 592 public String getRaconSector1() { 593 return RaconSector1; 594 } 595 596 public void setRaconSector1(String sec) { 597 RaconSector1 = validDecimal(sec); 598 } 599 600 private String RaconSector2 = ""; 601 602 public String getRaconSector2() { 603 return RaconSector2; 604 } 605 606 public void setRaconSector2(String sec) { 607 RaconSector2 = validDecimal(sec); 551 608 } 552 609 … … 767 824 case BOYCAR: 768 825 case BOYLAT: 769 if ((getCategory() != Cat. UNKNOWN) && (getShape() != Shp.UNKNOWN))826 if ((getCategory() != Cat.NONE) && (getShape() != Shp.UNKNOWN)) 770 827 return true; 771 828 break; … … 859 916 if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":category")) { 860 917 str = keys.get("seamark:" + ObjSTR.get(obj) + ":category"); 861 setCategory(Cat. UNKNOWN);918 setCategory(Cat.NONE); 862 919 for (Cat cat : CatSTR.keySet()) { 863 920 if (CatSTR.get(cat).equals(str)) { … … 919 976 if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.UNKNOWN)) { 920 977 setObject(Obj.FLTSAW); 921 setCategory(Cat. UNKNOWN);978 setCategory(Cat.NONE); 922 979 } else if (getColour(Ent.BODY, 1) == Col.UNKNOWN) { 923 980 setObject(Obj.FLTLAT); … … 939 996 } else { 940 997 setObject(Obj.FLTSPP); 941 setCategory(Cat. UNKNOWN);998 setCategory(Cat.NONE); 942 999 } 943 1000 break; … … 962 1019 } else { 963 1020 setObject(Obj.FLTSPP); 964 setCategory(Cat. UNKNOWN);1021 setCategory(Cat.NONE); 965 1022 } 966 1023 break; … … 975 1032 } else { 976 1033 setObject(Obj.FLTSPP); 977 setCategory(Cat. UNKNOWN);1034 setCategory(Cat.NONE); 978 1035 } 979 1036 break; … … 981 1038 if (getColour(Ent.BODY, 1) == Col.RED) { 982 1039 setObject(Obj.FLTISD); 983 setCategory(Cat. UNKNOWN);1040 setCategory(Cat.NONE); 984 1041 } else if (getColour(Ent.BODY, 1) == Col.YELLOW) { 985 1042 if (getColour(Ent.BODY, 2) == Col.BLACK) { … … 990 1047 } else { 991 1048 setObject(Obj.FLTSPP); 992 setCategory(Cat. UNKNOWN);1049 setCategory(Cat.NONE); 993 1050 } 994 1051 break; 995 1052 default: 996 1053 setObject(Obj.FLTSPP); 997 setCategory(Cat. UNKNOWN);1054 setCategory(Cat.NONE); 998 1055 } 999 1056 } … … 1478 1535 dlg.panelMain.topIcon.setIcon(null); 1479 1536 } 1537 1538 if (hasFog()) { 1539 dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png"))); 1540 } 1480 1541 } 1481 1542 … … 1546 1607 } 1547 1608 } 1609 if (hasFog()) { 1610 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", FogSTR.get(getFogSound()))); 1611 if (!getFogGroup().isEmpty()) { 1612 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:group", getFogGroup())); 1613 } 1614 if (!getFogPeriod().isEmpty()) { 1615 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:period", getFogPeriod())); 1616 } 1617 if (!getFogSequence().isEmpty()) { 1618 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:sequence", getFogSequence())); 1619 } 1620 if (!getFogRange().isEmpty()) { 1621 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:range", getFogRange())); 1622 } 1623 } 1624 if (!getInfo().isEmpty()) { 1625 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo())); 1626 } 1627 if (!getSource().isEmpty()) { 1628 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource())); 1629 } 1630 if (!getHeight().isEmpty()) { 1631 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:height", getHeight())); 1632 } 1633 if (!getElevation().isEmpty()) { 1634 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:elevation", getElevation())); 1635 } 1636 if (getStatus() != Sts.UNKNOWN) { 1637 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus()))); 1638 } 1639 if (getConstr() != Cns.UNKNOWN) { 1640 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr()))); 1641 } 1642 if (getVis() != Vis.UNKNOWN) { 1643 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:visibility", VisSTR.get(getVis()))); 1644 } 1645 if (getRvis() != Vis.UNKNOWN) { 1646 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", VisSTR.get(getRvis()))); 1647 } 1548 1648 } 1549 1649 }
Note:
See TracChangeset
for help on using the changeset viewer.