Changeset 24870 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-12-24T21:56:55+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r24839 r24870 30 30 private boolean region; 31 31 private ButtonGroup catButtons = null; 32 public JRadioButton portButton = n ull;33 public JRadioButton stbdButton = n ull;34 public JRadioButton prefPortButton = n ull;35 public JRadioButton prefStbdButton = n ull;36 public JRadioButton safeWaterButton = n ull;32 public JRadioButton portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png"))); 33 public JRadioButton stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png"))); 34 public JRadioButton prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefPortButton.png"))); 35 public JRadioButton prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefStbdButton.png"))); 36 public JRadioButton safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SafeWaterButton.png"))); 37 37 private ActionListener alCat = null; 38 38 public PanelPort panelPort = null; … … 65 65 this.add(panelPrefStbd, null); 66 66 this.add(panelSafeWater, null); 67 this.add(get PortButton(), null);68 this.add(get StbdButton(), null);69 this.add(get PrefPortButton(), null);70 this.add(get PrefStbdButton(), null);71 this.add(get SafeWaterButton(), null);67 this.add(getButton(portButton, 0, 0, 52, 32, "PortTip"), null); 68 this.add(getButton(stbdButton, 0, 32, 52, 32, "StbdTip"), null); 69 this.add(getButton(prefPortButton, 0, 64, 52, 32, "PrefPortTip"), null); 70 this.add(getButton(prefStbdButton, 0, 96, 52, 32, "PrefStbdTip"), null); 71 this.add(getButton(safeWaterButton, 0, 128, 52, 32, "SafeWaterTip"), null); 72 72 catButtons = new ButtonGroup(); 73 73 catButtons.add(portButton); … … 182 182 } 183 183 184 private JRadioButton getPortButton() { 185 if (portButton == null) { 186 portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png"))); 187 portButton.setBounds(new Rectangle(0, 0, 52, 32)); 188 portButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 189 portButton.setToolTipText(Messages.getString("PortTip")); 190 } 191 return portButton; 192 } 193 194 private JRadioButton getStbdButton() { 195 if (stbdButton == null) { 196 stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png"))); 197 stbdButton.setBounds(new Rectangle(0, 32, 52, 32)); 198 stbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 199 stbdButton.setToolTipText(Messages.getString("StbdTip")); 200 } 201 return stbdButton; 202 } 203 204 private JRadioButton getPrefPortButton() { 205 if (prefPortButton == null) { 206 prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefPortButton.png"))); 207 prefPortButton.setBounds(new Rectangle(0, 64, 52, 32)); 208 prefPortButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 209 prefPortButton.setToolTipText(Messages.getString("PrefPortTip")); 210 } 211 return prefPortButton; 212 } 213 214 private JRadioButton getPrefStbdButton() { 215 if (prefStbdButton == null) { 216 prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefStbdButton.png"))); 217 prefStbdButton.setBounds(new Rectangle(0, 96, 52, 32)); 218 prefStbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 219 prefStbdButton.setToolTipText(Messages.getString("PrefStbdTip")); 220 } 221 return prefStbdButton; 222 } 223 224 private JRadioButton getSafeWaterButton() { 225 if (safeWaterButton == null) { 226 safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SafeWaterButton.png"))); 227 safeWaterButton.setBounds(new Rectangle(0, 128, 52, 32)); 228 safeWaterButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 229 safeWaterButton.setToolTipText(Messages.getString("SafeWaterTip")); 230 } 231 return safeWaterButton; 184 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 185 button.setBounds(new Rectangle(x, y, w, h)); 186 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 187 button.setToolTipText(Messages.getString(tip)); 188 return button; 232 189 } 233 190 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r24839 r24870 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.Color; 6 import java.awt.Rectangle; 7 import java.awt.event.ActionListener; 8 5 9 import javax.swing.BorderFactory; 6 10 import javax.swing.JPanel; 7 8 import java.awt.Color;9 import java.awt.Rectangle;10 11 11 import javax.swing.ButtonGroup; 12 12 import javax.swing.ImageIcon; 13 13 import javax.swing.JRadioButton; 14 14 15 import oseam.Messages; 15 16 import java.util.EnumMap; 17 import java.util.Iterator; 18 16 19 import oseam.dialogs.OSeaMAction; 17 18 import java.awt.event.ActionListener; 20 import oseam.seamarks.SeaMark.Col; 19 21 20 22 public class PanelCol extends JPanel { … … 22 24 private OSeaMAction dlg; 23 25 private ButtonGroup colourButtons = null; 24 public JRadioButton offButton = n ull;25 public JRadioButton whiteButton = n ull;26 public JRadioButton redButton = n ull;27 public JRadioButton orangeButton = n ull;28 public JRadioButton amberButton = n ull;29 public JRadioButton yellowButton = n ull;30 public JRadioButton greenButton = n ull;31 public JRadioButton blueButton = n ull;32 public JRadioButton violetButton = n ull;33 public JRadioButton blackButton = n ull;26 public JRadioButton offButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 27 public JRadioButton whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png"))); 28 public JRadioButton redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png"))); 29 public JRadioButton orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png"))); 30 public JRadioButton amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png"))); 31 public JRadioButton yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png"))); 32 public JRadioButton greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png"))); 33 public JRadioButton blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png"))); 34 public JRadioButton violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png"))); 35 public JRadioButton blackButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlackButton.png"))); 34 36 private ActionListener alColour = null; 37 private EnumMap<Col, JRadioButton> colours = new EnumMap<Col, JRadioButton>(Col.class); 35 38 36 39 public PanelCol(OSeaMAction dia) { 37 40 dlg = dia; 38 41 this.setLayout(null); 39 this.add(get OffButton(), null);40 this.add(get WhiteButton(), null);41 this.add(get RedButton(), null);42 this.add(get OrangeButton(), null);43 this.add(get AmberButton(), null);44 this.add(get YellowButton(), null);45 this.add(get GreenButton(), null);46 this.add(getB lueButton(), null);47 this.add(get VioletButton(), null);48 this.add(getB lackButton(), null);42 this.add(getButton(offButton, 0, 0, 34, 16, "No colour", Col.UNKNOWN), null); 43 this.add(getButton(whiteButton, 0, 16, 34, 16, "White", Col.WHITE), null); 44 this.add(getButton(redButton, 0, 32, 34, 16, "Red", Col.RED), null); 45 this.add(getButton(orangeButton, 0, 48, 34, 16, "Orange", Col.ORANGE), null); 46 this.add(getButton(amberButton, 0, 64, 34, 16, "Amber", Col.AMBER), null); 47 this.add(getButton(yellowButton, 0, 80, 34, 16, "Yellow", Col.YELLOW), null); 48 this.add(getButton(greenButton, 0, 96, 34, 16, "Green", Col.GREEN), null); 49 this.add(getButton(blueButton, 0, 112, 34, 16, "Blue", Col.BLUE), null); 50 this.add(getButton(violetButton, 0, 128, 34, 16, "Violet", Col.VIOLET), null); 51 this.add(getButton(blackButton, 0, 144, 34, 16, "Black", Col.BLACK), null); 49 52 colourButtons = new ButtonGroup(); 53 colourButtons.add(offButton); 50 54 colourButtons.add(whiteButton); 51 colourButtons.add(offButton);52 55 colourButtons.add(redButton); 53 56 colourButtons.add(orangeButton); … … 60 63 alColour = new ActionListener() { 61 64 public void actionPerformed(java.awt.event.ActionEvent e) { 62 offButton.setBorderPainted(offButton.isSelected()); 65 Iterator<Col> it = colours.keySet().iterator(); 66 while (it.hasNext()) { 67 Col col = it.next(); 68 JRadioButton button = colours.get(col); 69 if (button.isSelected()) { 70 switch (col) { 71 case UNKNOWN: { 72 break; 73 } 74 } 75 button.setBorderPainted(true); 76 } else button.setBorderPainted(false); 77 } 78 /* offButton.setBorderPainted(offButton.isSelected()); 63 79 whiteButton.setBorderPainted(whiteButton.isSelected()); 64 80 redButton.setBorderPainted(redButton.isSelected()); … … 70 86 violetButton.setBorderPainted(violetButton.isSelected()); 71 87 blackButton.setBorderPainted(blackButton.isSelected()); 72 }88 */ } 73 89 }; 74 90 offButton.addActionListener(alColour); … … 89 105 } 90 106 91 private JRadioButton getOffButton() { 92 if (offButton == null) { 93 offButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 94 offButton.setBounds(new Rectangle(0, 0, 34, 16)); 95 offButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 96 offButton.setToolTipText(tr("No colour")); 97 } 98 return offButton; 99 } 100 101 private JRadioButton getWhiteButton() { 102 if (whiteButton == null) { 103 whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png"))); 104 whiteButton.setBounds(new Rectangle(0, 16, 34, 16)); 105 whiteButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 106 whiteButton.setToolTipText(tr("White")); 107 } 108 return whiteButton; 109 } 110 111 private JRadioButton getRedButton() { 112 if (redButton == null) { 113 redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png"))); 114 redButton.setBounds(new Rectangle(0, 32, 34, 16)); 115 redButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 116 redButton.setToolTipText(tr("Red")); 117 } 118 return redButton; 119 } 120 121 private JRadioButton getOrangeButton() { 122 if (orangeButton == null) { 123 orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png"))); 124 orangeButton.setBounds(new Rectangle(0, 48, 34, 16)); 125 orangeButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 126 orangeButton.setToolTipText(tr("Orange")); 127 } 128 return orangeButton; 129 } 130 131 private JRadioButton getAmberButton() { 132 if (amberButton == null) { 133 amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png"))); 134 amberButton.setBounds(new Rectangle(0, 64, 34, 16)); 135 amberButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 136 amberButton.setToolTipText(tr("Amber")); 137 } 138 return amberButton; 139 } 140 141 private JRadioButton getYellowButton() { 142 if (yellowButton == null) { 143 yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png"))); 144 yellowButton.setBounds(new Rectangle(0, 80, 34, 16)); 145 yellowButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 146 yellowButton.setToolTipText(tr("Yellow")); 147 } 148 return yellowButton; 149 } 150 151 private JRadioButton getGreenButton() { 152 if (greenButton == null) { 153 greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png"))); 154 greenButton.setBounds(new Rectangle(0, 96, 34, 16)); 155 greenButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 156 greenButton.setToolTipText(tr("Green")); 157 } 158 return greenButton; 159 } 160 161 private JRadioButton getBlueButton() { 162 if (blueButton == null) { 163 blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png"))); 164 blueButton.setBounds(new Rectangle(0, 112, 34, 16)); 165 blueButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 166 blueButton.setToolTipText(tr("Blue")); 167 } 168 return blueButton; 169 } 170 171 private JRadioButton getVioletButton() { 172 if (violetButton == null) { 173 violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png"))); 174 violetButton.setBounds(new Rectangle(0, 128, 34, 16)); 175 violetButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 176 violetButton.setToolTipText(tr("Violet")); 177 } 178 return violetButton; 179 } 180 181 private JRadioButton getBlackButton() { 182 if (blackButton == null) { 183 blackButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlackButton.png"))); 184 blackButton.setBounds(new Rectangle(0, 144, 34, 16)); 185 blackButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 186 blackButton.setToolTipText(tr("Black")); 187 } 188 return blackButton; 107 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip, Col col) { 108 button.setBounds(new Rectangle(x, y, w, h)); 109 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 110 button.setToolTipText(tr(tip)); 111 colours.put(col, button); 112 return button; 189 113 } 190 114 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r24848 r24870 25 25 private OSeaMAction dlg; 26 26 private ButtonGroup catButtons = null; 27 public JRadioButton northButton = n ull;28 public JRadioButton southButton = n ull;29 public JRadioButton eastButton = n ull;30 public JRadioButton westButton = n ull;31 public JRadioButton isolButton = n ull;27 public JRadioButton northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png"))); 28 public JRadioButton southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png"))); 29 public JRadioButton eastButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardEButton.png"))); 30 public JRadioButton westButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardWButton.png"))); 31 public JRadioButton isolButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/IsolButton.png"))); 32 32 private ActionListener alCat = null; 33 33 34 34 private ButtonGroup shapeButtons = null; 35 public JRadioButton pillarButton = n ull;36 public JRadioButton sparButton = n ull;37 public JRadioButton floatButton = n ull;38 public JRadioButton beaconButton = n ull;39 public JRadioButton towerButton = n ull;35 public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 36 public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 37 public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 38 public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 39 public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 40 40 private ActionListener alShape = null; 41 41 … … 43 43 dlg = dia; 44 44 this.setLayout(null); 45 this.add(get NothButton(), null);46 this.add(get SouthButton(), null);47 this.add(get EastButton(), null);48 this.add(get WestButton(), null);49 this.add(get IsolButton(), null);45 this.add(getButton(northButton, 0, 0, 52, 32, "NorthTip"), null); 46 this.add(getButton(southButton, 0, 32, 52, 32, "SouthTip"), null); 47 this.add(getButton(eastButton, 0, 64, 52, 32, "EastTip"), null); 48 this.add(getButton(westButton, 0, 96, 52, 32, "WestTip"), null); 49 this.add(getButton(isolButton, 0, 128, 52, 32, "IsolTip"), null); 50 50 catButtons = new ButtonGroup(); 51 51 catButtons.add(northButton); … … 130 130 isolButton.addActionListener(alCat); 131 131 132 this.add(get PillarButton(), null);133 this.add(get SparButton(), null);134 this.add(get FloatButton(), null);135 this.add(getB eaconButton(), null);136 this.add(get TowerButton(), null);132 this.add(getButton(pillarButton, 55, 0, 34, 32, "PillarTip"), null); 133 this.add(getButton(sparButton, 55, 32, 34, 32, "SparTip"), null); 134 this.add(getButton(floatButton, 55, 64, 34, 32, "FloatTip"), null); 135 this.add(getButton(beaconButton, 55, 96, 34, 32, "BeaconTip"), null); 136 this.add(getButton(towerButton, 55, 128, 34, 32, "TowerTip"), null); 137 137 shapeButtons = new ButtonGroup(); 138 138 shapeButtons.add(pillarButton); … … 191 191 } 192 192 193 private JRadioButton getNothButton() { 194 if (northButton == null) { 195 northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png"))); 196 northButton.setBounds(new Rectangle(0, 0, 52, 32)); 197 northButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 198 northButton.setToolTipText(Messages.getString("NorthTip")); 199 } 200 return northButton; 193 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 194 button.setBounds(new Rectangle(x, y, w, h)); 195 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 196 button.setToolTipText(Messages.getString(tip)); 197 return button; 201 198 } 202 199 203 private JRadioButton getSouthButton() {204 if (southButton == null) {205 southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png")));206 southButton.setBounds(new Rectangle(0, 32, 52, 32));207 southButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));208 southButton.setToolTipText(Messages.getString("SouthTip"));209 }210 return southButton;211 }212 213 private JRadioButton getEastButton() {214 if (eastButton == null) {215 eastButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardEButton.png")));216 eastButton.setBounds(new Rectangle(0, 64, 52, 32));217 eastButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));218 eastButton.setToolTipText(Messages.getString("EastTip"));219 }220 return eastButton;221 }222 223 private JRadioButton getWestButton() {224 if (westButton == null) {225 westButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardWButton.png")));226 westButton.setBounds(new Rectangle(0, 96, 52, 32));227 westButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));228 westButton.setToolTipText(Messages.getString("WestTip"));229 }230 return westButton;231 }232 233 private JRadioButton getIsolButton() {234 if (isolButton == null) {235 isolButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/IsolButton.png")));236 isolButton.setBounds(new Rectangle(0, 128, 52, 32));237 isolButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));238 isolButton.setToolTipText(Messages.getString("IsolTip"));239 }240 return isolButton;241 }242 243 private JRadioButton getPillarButton() {244 if (pillarButton == null) {245 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));246 pillarButton.setBounds(new Rectangle(55, 0, 34, 32));247 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));248 pillarButton.setToolTipText(Messages.getString("PillarTip"));249 }250 return pillarButton;251 }252 253 private JRadioButton getSparButton() {254 if (sparButton == null) {255 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));256 sparButton.setBounds(new Rectangle(55, 32, 34, 32));257 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));258 sparButton.setToolTipText(Messages.getString("SparTip"));259 }260 return sparButton;261 }262 263 private JRadioButton getFloatButton() {264 if (floatButton == null) {265 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));266 floatButton.setBounds(new Rectangle(55, 64, 34, 32));267 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));268 floatButton.setToolTipText(Messages.getString("FloatTip"));269 }270 return floatButton;271 }272 273 private JRadioButton getBeaconButton() {274 if (beaconButton == null) {275 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));276 beaconButton.setBounds(new Rectangle(55, 96, 34, 32));277 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));278 beaconButton.setToolTipText(Messages.getString("BeaconTip"));279 }280 return beaconButton;281 }282 283 private JRadioButton getTowerButton() {284 if (towerButton == null) {285 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));286 towerButton.setBounds(new Rectangle(55, 128, 34, 32));287 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));288 towerButton.setToolTipText(Messages.getString("TowerTip"));289 }290 return towerButton;291 }292 293 200 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r24848 r24870 1 1 package oseam.panels; 2 3 import java.awt.Color; 4 import java.awt.Rectangle; 5 import java.awt.event.ActionListener; 2 6 3 7 import javax.swing.BorderFactory; 4 8 import javax.swing.JPanel; 5 6 import java.awt.Color;7 import java.awt.Dimension;8 import java.awt.Rectangle;9 import java.awt.Font;10 11 9 import javax.swing.ButtonGroup; 12 10 import javax.swing.ImageIcon; 13 import javax.swing.JLabel;14 import javax.swing.JTextField;15 import javax.swing.JComboBox;16 import javax.swing.JCheckBox;17 11 import javax.swing.JRadioButton; 12 13 import java.util.EnumMap; 14 import java.util.Iterator; 18 15 19 16 import oseam.Messages; … … 21 18 import oseam.seamarks.SeaMark.Cat; 22 19 23 import java.awt.Cursor;24 import java.awt.event.ActionListener;25 26 20 public class PanelLights extends JPanel { 27 21 28 22 private OSeaMAction dlg; 29 private ButtonGroup catButtons = null; 30 private JRadioButton houseButton = null; 31 private JRadioButton majorButton = null; 32 private JRadioButton minorButton = null; 33 private JRadioButton vesselButton = null; 34 private JRadioButton floatButton = null; 23 private ButtonGroup catButtons = new ButtonGroup(); 24 private JRadioButton houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png"))); 25 private JRadioButton majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png"))); 26 private JRadioButton minorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMinorButton.png"))); 27 private JRadioButton vesselButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightVesselButton.png"))); 28 private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png"))); 29 private EnumMap<Cat, JRadioButton> categories = new EnumMap<Cat, JRadioButton>(Cat.class); 30 private ActionListener alCat = new ActionListener() { 31 public void actionPerformed(java.awt.event.ActionEvent e) { 32 Iterator<Cat> it = categories.keySet().iterator(); 33 while (it.hasNext()) { 34 Cat cat = it.next(); 35 JRadioButton button = categories.get(cat); 36 if (button.isSelected()) { 37 dlg.mark.setCategory(cat); 38 button.setBorderPainted(true); 39 } else 40 button.setBorderPainted(false); 41 } 42 if (dlg.mark != null) 43 dlg.mark.paintSign(); 44 } 45 }; 35 46 36 47 public PanelLights(OSeaMAction dia) { 37 48 dlg = dia; 38 49 this.setLayout(null); 39 this.add(getHouseButton(), null); 40 this.add(getMajorButton(), null); 41 this.add(getMinorButton(), null); 42 this.add(getVesselButton(), null); 43 this.add(getFloatButton(), null); 44 catButtons = new ButtonGroup(); 45 catButtons.add(houseButton); 46 catButtons.add(majorButton); 47 catButtons.add(minorButton); 48 catButtons.add(vesselButton); 49 catButtons.add(floatButton); 50 ActionListener alCat = new ActionListener() { 51 public void actionPerformed(java.awt.event.ActionEvent e) { 52 if (houseButton.isSelected()) { 53 dlg.mark.setCategory(Cat.LIGHT_HOUSE); 54 houseButton.setBorderPainted(true); 55 } else { 56 houseButton.setBorderPainted(false); 57 } 58 if (majorButton.isSelected()) { 59 dlg.mark.setCategory(Cat.LIGHT_MAJOR); 60 majorButton.setBorderPainted(true); 61 } else { 62 majorButton.setBorderPainted(false); 63 } 64 if (minorButton.isSelected()) { 65 dlg.mark.setCategory(Cat.LIGHT_MINOR); 66 minorButton.setBorderPainted(true); 67 } else { 68 minorButton.setBorderPainted(false); 69 } 70 if (vesselButton.isSelected()) { 71 dlg.mark.setCategory(Cat.LIGHT_VESSEL); 72 vesselButton.setBorderPainted(true); 73 } else { 74 vesselButton.setBorderPainted(false); 75 } 76 if (floatButton.isSelected()) { 77 dlg.mark.setCategory(Cat.LIGHT_FLOAT); 78 floatButton.setBorderPainted(true); 79 } else { 80 floatButton.setBorderPainted(false); 81 } 82 if (dlg.mark != null) 83 dlg.mark.paintSign(); 84 } 85 }; 86 houseButton.addActionListener(alCat); 87 majorButton.addActionListener(alCat); 88 minorButton.addActionListener(alCat); 89 vesselButton.addActionListener(alCat); 90 floatButton.addActionListener(alCat); 50 this.add(getCatButton(houseButton, 0, 0, 34, 32, "LighthouseTip", Cat.LIGHT_HOUSE), null); 51 this.add(getCatButton(majorButton, 0, 32, 34, 32, "MajorLightTip", Cat.LIGHT_MAJOR), null); 52 this.add(getCatButton(minorButton, 0, 64, 34, 32, "MinorLightTip", Cat.LIGHT_MINOR), null); 53 this.add(getCatButton(vesselButton, 0, 96, 34, 32, "LightVesselTip", Cat.LIGHT_VESSEL), null); 54 this.add(getCatButton(floatButton, 0, 128, 34, 32, "LightFloatTip", Cat.LIGHT_FLOAT), null); 91 55 } 92 56 … … 95 59 } 96 60 97 private JRadioButton getHouseButton() { 98 if (houseButton == null) { 99 houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png"))); 100 houseButton.setBounds(new Rectangle(0, 0, 34, 32)); 101 houseButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 102 houseButton.setToolTipText(Messages.getString("LighthouseTip")); 103 } 104 return houseButton; 105 } 106 107 private JRadioButton getMajorButton() { 108 if (majorButton == null) { 109 majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png"))); 110 majorButton.setBounds(new Rectangle(0, 32, 34, 32)); 111 majorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 112 majorButton.setToolTipText(Messages.getString("MajorLightTip")); 113 } 114 return majorButton; 115 } 116 117 private JRadioButton getMinorButton() { 118 if (minorButton == null) { 119 minorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMinorButton.png"))); 120 minorButton.setBounds(new Rectangle(0, 64, 34, 32)); 121 minorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 122 minorButton.setToolTipText(Messages.getString("MinorLightTip")); 123 } 124 return minorButton; 125 } 126 127 private JRadioButton getVesselButton() { 128 if (vesselButton == null) { 129 vesselButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightVesselButton.png"))); 130 vesselButton.setBounds(new Rectangle(0, 96, 34, 32)); 131 vesselButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 132 vesselButton.setToolTipText(Messages.getString("LightVesselTip")); 133 } 134 return vesselButton; 135 } 136 137 private JRadioButton getFloatButton() { 138 if (floatButton == null) { 139 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png"))); 140 floatButton.setBounds(new Rectangle(0, 128, 34, 32)); 141 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 142 floatButton.setToolTipText(Messages.getString("LightFloatTip")); 143 } 144 return floatButton; 61 private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip, Cat cat) { 62 button.setBounds(new Rectangle(x, y, w, h)); 63 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 64 button.setToolTipText(Messages.getString(tip)); 65 button.addActionListener(alCat); 66 categories.put(cat, button); 67 catButtons.add(button); 68 return button; 145 69 } 146 70 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r24839 r24870 24 24 import oseam.seamarks.MarkSpec; 25 25 import oseam.seamarks.MarkLight; 26 import oseam.seamarks.SeaMark.Cat;27 26 28 27 public class PanelMain extends JPanel { … … 39 38 private JButton saveButton = null; 40 39 public ButtonGroup typeButtons = null; 41 public JRadioButton chanButton = n ull;42 public JRadioButton hazButton = n ull;43 public JRadioButton specButton = n ull;44 public JRadioButton lightsButton = n ull;40 public JRadioButton chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png"))); 41 public JRadioButton hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png"))); 42 public JRadioButton specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png"))); 43 public JRadioButton lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png"))); 45 44 private ActionListener alType = null; 46 45 private ButtonGroup miscButtons = null; 47 public JRadioButton topButton = n ull;48 public JRadioButton fogButton = n ull;49 public JRadioButton radarButton = n ull;50 public JRadioButton litButton = n ull;46 public JRadioButton topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png"))); 47 public JRadioButton fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png"))); 48 public JRadioButton radarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png"))); 49 public JRadioButton litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png"))); 51 50 private ActionListener alMisc = null; 52 51 public PanelChan panelChan = null; … … 106 105 this.add(fogIcon, null); 107 106 108 this.add(get ChanButton(), null);109 this.add(get HazButton(), null);110 this.add(get SpecButton(), null);111 this.add(get LightsButton(), null);107 this.add(getButton(chanButton, 0, 0, 62, 40, "ChanTip"), null); 108 this.add(getButton(hazButton, 0, 40, 62, 40, "HazTip"), null); 109 this.add(getButton(specButton, 0, 80, 62, 40, "SpecTip"), null); 110 this.add(getButton(lightsButton, 0, 120, 62, 40, "LightsTip"), null); 112 111 this.add(panelChan, null); 113 112 this.add(panelHaz, null); … … 183 182 lightsButton.addActionListener(alType); 184 183 185 this.add(get TopButton(), null);186 this.add(get FogButton(), null);187 this.add(get RadarButton(), null);188 this.add(get LitButton(), null);184 this.add(getButton(topButton, 0, 165, 34, 32, "TopmarksTip"), null); 185 this.add(getButton(fogButton, 0, 205, 34, 32, "FogSignalsTip"), null); 186 this.add(getButton(radarButton, 0, 245, 34, 32, "RadarTip"), null); 187 this.add(getButton(litButton, 0, 285, 34, 32, "LitTip"), null); 189 188 miscButtons = new ButtonGroup(); 190 189 miscButtons.add(topButton); … … 271 270 } 272 271 273 private JRadioButton getChanButton() { 274 if (chanButton == null) { 275 chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png"))); 276 chanButton.setBounds(new Rectangle(0, 0, 62, 40)); 277 chanButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 278 chanButton.setToolTipText(Messages.getString("ChanTip")); 279 } 280 return chanButton; 281 } 282 283 private JRadioButton getHazButton() { 284 if (hazButton == null) { 285 hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png"))); 286 hazButton.setBounds(new Rectangle(0, 40, 62, 40)); 287 hazButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 288 hazButton.setToolTipText(Messages.getString("HazTip")); 289 } 290 return hazButton; 291 } 292 293 private JRadioButton getSpecButton() { 294 if (specButton == null) { 295 specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png"))); 296 specButton.setBounds(new Rectangle(0, 80, 62, 40)); 297 specButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 298 specButton.setToolTipText(Messages.getString("SpecTip")); 299 } 300 return specButton; 301 } 302 303 private JRadioButton getLightsButton() { 304 if (lightsButton == null) { 305 lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png"))); 306 lightsButton.setBounds(new Rectangle(0, 120, 62, 40)); 307 lightsButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 308 lightsButton.setToolTipText(Messages.getString("LightsTip")); 309 } 310 return lightsButton; 311 } 312 313 private JRadioButton getTopButton() { 314 if (topButton == null) { 315 topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png"))); 316 topButton.setBounds(new Rectangle(0, 165, 34, 32)); 317 topButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 318 topButton.setToolTipText(Messages.getString("TopmarksTip")); 319 } 320 return topButton; 321 } 322 323 private JRadioButton getFogButton() { 324 if (fogButton == null) { 325 fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png"))); 326 fogButton.setBounds(new Rectangle(0, 205, 34, 32)); 327 fogButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 328 fogButton.setToolTipText(Messages.getString("FogSignalsTip")); 329 } 330 return fogButton; 331 } 332 333 private JRadioButton getRadarButton() { 334 if (radarButton == null) { 335 radarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png"))); 336 radarButton.setBounds(new Rectangle(0, 245, 34, 32)); 337 radarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 338 radarButton.setToolTipText(Messages.getString("RadarTip")); 339 } 340 return radarButton; 341 } 342 343 private JRadioButton getLitButton() { 344 if (litButton == null) { 345 litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png"))); 346 litButton.setBounds(new Rectangle(0, 285, 34, 32)); 347 litButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 348 litButton.setToolTipText(Messages.getString("LitTip")); 349 } 350 return litButton; 272 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 273 button.setBounds(new Rectangle(x, y, w, h)); 274 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 275 button.setToolTipText(Messages.getString(tip)); 276 return button; 351 277 } 352 278 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r24839 r24870 29 29 private OSeaMAction dlg; 30 30 private ButtonGroup regionButtons = null; 31 public JRadioButton regionAButton = n ull;32 public JRadioButton regionBButton = n ull;31 public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 32 public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 33 33 private ButtonGroup shapeButtons = null; 34 public JRadioButton pillarButton = n ull;35 public JRadioButton sparButton = n ull;36 public JRadioButton canButton = n ull;37 public JRadioButton floatButton = n ull;38 public JRadioButton beaconButton = n ull;39 public JRadioButton towerButton = n ull;40 public JRadioButton perchButton = n ull;34 public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 35 public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 36 public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 37 public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 38 public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 39 public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 40 public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png"))); 41 41 private ActionListener alShape = null; 42 42 … … 44 44 dlg = dia; 45 45 this.setLayout(null); 46 this.add(get RegionAButton(), null);47 this.add(get RegionBButton(), null);48 this.add(get PillarButton(), null);49 this.add(get SparButton(), null);50 this.add(get CanButton(), null);51 this.add(get FloatButton(), null);52 this.add(getB eaconButton(), null);53 this.add(get TowerButton(), null);54 this.add(get PerchButton(), null);46 this.add(getButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null); 47 this.add(getButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null); 48 this.add(getButton(pillarButton, 0, 64, 34, 32, "PillarTip"), null); 49 this.add(getButton(sparButton, 0, 96, 34, 32, "SparTip"), null); 50 this.add(getButton(canButton, 0, 128, 34, 32, "CanTip"), null); 51 this.add(getButton(floatButton, 35, 0, 34, 32, "FloatTip"), null); 52 this.add(getButton(beaconButton, 35, 32, 34, 32, "BeaconTip"), null); 53 this.add(getButton(towerButton, 35, 64, 34, 32, "TowerTip"), null); 54 this.add(getButton(perchButton, 35, 96, 34, 32, "PerchTip"), null); 55 55 56 56 regionButtons = new ButtonGroup(); … … 137 137 } 138 138 139 private JRadioButton getRegionAButton() { 140 if (regionAButton == null) { 141 regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 142 regionAButton.setBounds(new Rectangle(0, 2, 34, 30)); 143 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 144 regionAButton.setToolTipText(Messages.getString("RegionATip")); 145 } 146 return regionAButton; 147 } 148 149 private JRadioButton getRegionBButton() { 150 if (regionBButton == null) { 151 regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 152 regionBButton.setBounds(new Rectangle(0, 32, 34, 30)); 153 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 154 regionBButton.setToolTipText(Messages.getString("RegionBTip")); 155 } 156 return regionBButton; 157 } 158 159 private JRadioButton getPillarButton() { 160 if (pillarButton == null) { 161 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 162 pillarButton.setBounds(new Rectangle(0, 64, 34, 32)); 163 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 164 pillarButton.setToolTipText(Messages.getString("PillarTip")); 165 } 166 return pillarButton; 167 } 168 169 private JRadioButton getSparButton() { 170 if (sparButton == null) { 171 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 172 sparButton.setBounds(new Rectangle(0, 96, 34, 32)); 173 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 174 sparButton.setToolTipText(Messages.getString("SparTip")); 175 } 176 return sparButton; 177 } 178 179 private JRadioButton getCanButton() { 180 if (canButton == null) { 181 canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 182 canButton.setBounds(new Rectangle(0, 128, 34, 32)); 183 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 184 canButton.setToolTipText(Messages.getString("CanTip")); 185 } 186 return canButton; 187 } 188 189 private JRadioButton getFloatButton() { 190 if (floatButton == null) { 191 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 192 floatButton.setBounds(new Rectangle(35, 0, 34, 32)); 193 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 194 floatButton.setToolTipText(Messages.getString("FloatTip")); 195 } 196 return floatButton; 197 } 198 199 private JRadioButton getBeaconButton() { 200 if (beaconButton == null) { 201 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 202 beaconButton.setBounds(new Rectangle(35, 32, 34, 32)); 203 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 204 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 205 } 206 return beaconButton; 207 } 208 209 private JRadioButton getTowerButton() { 210 if (towerButton == null) { 211 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 212 towerButton.setBounds(new Rectangle(35, 64, 34, 32)); 213 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 214 towerButton.setToolTipText(Messages.getString("TowerTip")); 215 } 216 return towerButton; 217 } 218 219 private JRadioButton getPerchButton() { 220 if (perchButton == null) { 221 perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png"))); 222 perchButton.setBounds(new Rectangle(35, 96, 34, 32)); 223 perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 224 perchButton.setToolTipText(Messages.getString("PerchTip")); 225 } 226 return perchButton; 139 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 140 button.setBounds(new Rectangle(x, y, w, h)); 141 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 142 button.setToolTipText(Messages.getString(tip)); 143 return button; 227 144 } 228 145 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefPort.java
r24839 r24870 28 28 private OSeaMAction dlg; 29 29 private ButtonGroup regionButtons = null; 30 public JRadioButton regionAButton = n ull;31 public JRadioButton regionBButton = n ull;30 public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 31 public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 32 32 private ButtonGroup shapeButtons = null; 33 public JRadioButton pillarButton = n ull;34 public JRadioButton sparButton = n ull;35 public JRadioButton canButton = n ull;36 public JRadioButton floatButton = n ull;37 public JRadioButton beaconButton = n ull;38 public JRadioButton towerButton = n ull;33 public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 34 public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 35 public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 36 public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 37 public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 38 public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 39 39 private ActionListener alShape = null; 40 40 … … 42 42 dlg = dia; 43 43 this.setLayout(null); 44 this.add(get RegionAButton(), null);45 this.add(get RegionBButton(), null);46 this.add(get PillarButton(), null);47 this.add(get SparButton(), null);48 this.add(get CanButton(), null);49 this.add(get FloatButton(), null);50 this.add(getB eaconButton(), null);51 this.add(get TowerButton(), null);44 this.add(getButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null); 45 this.add(getButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null); 46 this.add(getButton(pillarButton, 0, 64, 34, 32, "PillarTip"), null); 47 this.add(getButton(sparButton, 0, 96, 34, 32, "SparTip"), null); 48 this.add(getButton(canButton, 0, 128, 34, 32, "CanTip"), null); 49 this.add(getButton(floatButton, 35, 0, 34, 32, "FloatTip"), null); 50 this.add(getButton(beaconButton, 35, 32, 34, 32, "BeaconTip"), null); 51 this.add(getButton(towerButton, 35, 64, 34, 32, "TowerTip"), null); 52 52 53 53 regionButtons = new ButtonGroup(); … … 126 126 } 127 127 128 private JRadioButton getRegionAButton() { 129 if (regionAButton == null) { 130 regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 131 regionAButton.setBounds(new Rectangle(0, 2, 34, 30)); 132 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 133 regionAButton.setToolTipText(Messages.getString("RegionATip")); 134 } 135 return regionAButton; 136 } 137 138 private JRadioButton getRegionBButton() { 139 if (regionBButton == null) { 140 regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 141 regionBButton.setBounds(new Rectangle(0, 32, 34, 30)); 142 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 143 regionBButton.setToolTipText(Messages.getString("RegionBTip")); 144 } 145 return regionBButton; 146 } 147 148 private JRadioButton getPillarButton() { 149 if (pillarButton == null) { 150 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 151 pillarButton.setBounds(new Rectangle(0, 64, 34, 32)); 152 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 153 pillarButton.setToolTipText(Messages.getString("PillarTip")); 154 } 155 return pillarButton; 156 } 157 158 private JRadioButton getSparButton() { 159 if (sparButton == null) { 160 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 161 sparButton.setBounds(new Rectangle(0, 96, 34, 32)); 162 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 163 sparButton.setToolTipText(Messages.getString("SparTip")); 164 } 165 return sparButton; 166 } 167 168 private JRadioButton getCanButton() { 169 if (canButton == null) { 170 canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 171 canButton.setBounds(new Rectangle(0, 128, 34, 32)); 172 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 173 canButton.setToolTipText(Messages.getString("CanTip")); 174 } 175 return canButton; 176 } 177 178 private JRadioButton getFloatButton() { 179 if (floatButton == null) { 180 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 181 floatButton.setBounds(new Rectangle(35, 0, 34, 32)); 182 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 183 floatButton.setToolTipText(Messages.getString("FloatTip")); 184 } 185 return floatButton; 186 } 187 188 private JRadioButton getBeaconButton() { 189 if (beaconButton == null) { 190 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 191 beaconButton.setBounds(new Rectangle(35, 32, 34, 32)); 192 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 193 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 194 } 195 return beaconButton; 196 } 197 198 private JRadioButton getTowerButton() { 199 if (towerButton == null) { 200 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 201 towerButton.setBounds(new Rectangle(35, 64, 34, 32)); 202 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 203 towerButton.setToolTipText(Messages.getString("TowerTip")); 204 } 205 return towerButton; 128 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 129 button.setBounds(new Rectangle(x, y, w, h)); 130 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 131 button.setToolTipText(Messages.getString(tip)); 132 return button; 206 133 } 207 134 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefStbd.java
r24839 r24870 28 28 private OSeaMAction dlg; 29 29 private ButtonGroup regionButtons = null; 30 public JRadioButton regionAButton = n ull;31 public JRadioButton regionBButton = n ull;30 public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 31 public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 32 32 private ButtonGroup shapeButtons = null; 33 public JRadioButton pillarButton = n ull;34 public JRadioButton sparButton = n ull;35 public JRadioButton coneButton = n ull;36 public JRadioButton floatButton = n ull;37 public JRadioButton beaconButton = n ull;38 public JRadioButton towerButton = n ull;33 public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 34 public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 35 public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 36 public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 37 public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 38 public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 39 39 private ActionListener alShape = null; 40 40 … … 42 42 dlg = dia; 43 43 this.setLayout(null); 44 this.add(get RegionAButton(), null);45 this.add(get RegionBButton(), null);46 this.add(get PillarButton(), null);47 this.add(get SparButton(), null);48 this.add(get ConeButton(), null);49 this.add(get FloatButton(), null);50 this.add(getB eaconButton(), null);51 this.add(get TowerButton(), null);44 this.add(getButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null); 45 this.add(getButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null); 46 this.add(getButton(pillarButton, 0, 64, 34, 32, "PillarTip"), null); 47 this.add(getButton(sparButton, 0, 96, 34, 32, "SparTip"), null); 48 this.add(getButton(coneButton, 0, 128, 34, 32, "ConeTip"), null); 49 this.add(getButton(floatButton, 35, 0, 34, 32, "FloatTip"), null); 50 this.add(getButton(beaconButton, 35, 32, 34, 32, "BeaconTip"), null); 51 this.add(getButton(towerButton, 35, 64, 34, 32, "TowerTip"), null); 52 52 53 53 regionButtons = new ButtonGroup(); … … 126 126 } 127 127 128 private JRadioButton getRegionAButton() { 129 if (regionAButton == null) { 130 regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 131 regionAButton.setBounds(new Rectangle(0, 2, 34, 30)); 132 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 133 regionAButton.setToolTipText(Messages.getString("RegionATip")); 134 } 135 return regionAButton; 136 } 137 138 private JRadioButton getRegionBButton() { 139 if (regionBButton == null) { 140 regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 141 regionBButton.setBounds(new Rectangle(0, 32, 34, 30)); 142 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 143 regionBButton.setToolTipText(Messages.getString("RegionBTip")); 144 } 145 return regionBButton; 146 } 147 148 private JRadioButton getPillarButton() { 149 if (pillarButton == null) { 150 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 151 pillarButton.setBounds(new Rectangle(0, 64, 34, 32)); 152 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 153 pillarButton.setToolTipText(Messages.getString("PillarTip")); 154 } 155 return pillarButton; 156 } 157 158 private JRadioButton getSparButton() { 159 if (sparButton == null) { 160 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 161 sparButton.setBounds(new Rectangle(0, 96, 34, 32)); 162 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 163 sparButton.setToolTipText(Messages.getString("SparTip")); 164 } 165 return sparButton; 166 } 167 168 private JRadioButton getConeButton() { 169 if (coneButton == null) { 170 coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 171 coneButton.setBounds(new Rectangle(0, 128, 34, 32)); 172 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 173 coneButton.setToolTipText(Messages.getString("ConeTip")); 174 } 175 return coneButton; 176 } 177 178 private JRadioButton getFloatButton() { 179 if (floatButton == null) { 180 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 181 floatButton.setBounds(new Rectangle(35, 0, 34, 32)); 182 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 183 floatButton.setToolTipText(Messages.getString("FloatTip")); 184 } 185 return floatButton; 186 } 187 188 private JRadioButton getBeaconButton() { 189 if (beaconButton == null) { 190 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 191 beaconButton.setBounds(new Rectangle(35, 32, 34, 32)); 192 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 193 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 194 } 195 return beaconButton; 196 } 197 198 private JRadioButton getTowerButton() { 199 if (towerButton == null) { 200 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 201 towerButton.setBounds(new Rectangle(35, 64, 34, 32)); 202 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 203 towerButton.setToolTipText(Messages.getString("TowerTip")); 204 } 205 return towerButton; 128 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 129 button.setBounds(new Rectangle(x, y, w, h)); 130 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 131 button.setToolTipText(Messages.getString(tip)); 132 return button; 206 133 } 207 134 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r24848 r24870 8 8 import java.awt.Color; 9 9 import java.awt.Rectangle; 10 import java.awt.event.ActionListener; 10 11 11 12 import javax.swing.ButtonGroup; … … 13 14 import javax.swing.JRadioButton; 14 15 16 import java.util.EnumMap; 17 import java.util.Iterator; 18 15 19 import oseam.Messages; 16 20 import oseam.dialogs.OSeaMAction; 17 21 import oseam.seamarks.SeaMark.Shp; 18 import oseam.seamarks.SeaMark.Col;19 20 import java.awt.event.ActionListener;21 22 22 23 public class PanelSpec extends JPanel { 23 24 24 25 private OSeaMAction dlg; 25 private ButtonGroup shapeButtons = null; 26 private JRadioButton pillarButton = null; 27 private JRadioButton sparButton = null; 28 private JRadioButton canButton = null; 29 private JRadioButton coneButton = null; 30 private JRadioButton sphereButton = null; 31 private JRadioButton barrelButton = null; 32 private JRadioButton superButton = null; 33 private JRadioButton floatButton = null; 34 private JRadioButton beaconButton = null; 35 private JRadioButton towerButton = null; 26 private ButtonGroup shapeButtons = new ButtonGroup(); 27 private JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 28 private JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 29 private JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 30 private JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 31 private JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png"))); 32 private JRadioButton barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png"))); 33 private JRadioButton superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png"))); 34 private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 35 private JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 36 private JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 37 private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class); 36 38 private PanelCol panelCol = null; 39 private ActionListener alShape = new ActionListener() { 40 public void actionPerformed(java.awt.event.ActionEvent e) { 41 Iterator<Shp> it = shapes.keySet().iterator(); 42 while (it.hasNext()) { 43 Shp shp = it.next(); 44 JRadioButton button = shapes.get(shp); 45 if (button.isSelected()) { 46 dlg.mark.setShape(shp); 47 button.setBorderPainted(true); 48 } else 49 button.setBorderPainted(false); 50 } 51 if (dlg.mark != null) 52 dlg.mark.paintSign(); 53 } 54 }; 37 55 38 56 public PanelSpec(OSeaMAction dia) { … … 43 61 this.setLayout(null); 44 62 this.add(panelCol, null); 45 this.add(getPillarButton(), null); 46 this.add(getSparButton(), null); 47 this.add(getCanButton(), null); 48 this.add(getConeButton(), null); 49 this.add(getSphereButton(), null); 50 this.add(getBarrelButton(), null); 51 this.add(getSuperButton(), null); 52 this.add(getFloatButton(), null); 53 this.add(getBeaconButton(), null); 54 this.add(getTowerButton(), null); 55 shapeButtons = new ButtonGroup(); 56 shapeButtons.add(pillarButton); 57 shapeButtons.add(sparButton); 58 shapeButtons.add(canButton); 59 shapeButtons.add(coneButton); 60 shapeButtons.add(sphereButton); 61 shapeButtons.add(barrelButton); 62 shapeButtons.add(superButton); 63 shapeButtons.add(floatButton); 64 shapeButtons.add(beaconButton); 65 shapeButtons.add(towerButton); 66 ActionListener alShape = new ActionListener() { 67 public void actionPerformed(java.awt.event.ActionEvent e) { 68 if (pillarButton.isSelected()) { 69 dlg.mark.setShape(Shp.PILLAR); 70 pillarButton.setBorderPainted(true); 71 } else { 72 pillarButton.setBorderPainted(false); 73 } 74 if (sparButton.isSelected()) { 75 dlg.mark.setShape(Shp.SPAR); 76 sparButton.setBorderPainted(true); 77 } else { 78 sparButton.setBorderPainted(false); 79 } 80 if (canButton.isSelected()) { 81 dlg.mark.setShape(Shp.CAN); 82 canButton.setBorderPainted(true); 83 } else { 84 canButton.setBorderPainted(false); 85 } 86 if (coneButton.isSelected()) { 87 dlg.mark.setShape(Shp.CONE); 88 coneButton.setBorderPainted(true); 89 } else { 90 coneButton.setBorderPainted(false); 91 } 92 if (sphereButton.isSelected()) { 93 dlg.mark.setShape(Shp.SPHERE); 94 sphereButton.setBorderPainted(true); 95 } else { 96 sphereButton.setBorderPainted(false); 97 } 98 if (barrelButton.isSelected()) { 99 dlg.mark.setShape(Shp.BARREL); 100 barrelButton.setBorderPainted(true); 101 } else { 102 barrelButton.setBorderPainted(false); 103 } 104 if (superButton.isSelected()) { 105 dlg.mark.setShape(Shp.SUPER); 106 superButton.setBorderPainted(true); 107 } else { 108 superButton.setBorderPainted(false); 109 } 110 if (floatButton.isSelected()) { 111 dlg.mark.setShape(Shp.FLOAT); 112 floatButton.setBorderPainted(true); 113 } else { 114 floatButton.setBorderPainted(false); 115 } 116 if (beaconButton.isSelected()) { 117 dlg.mark.setShape(Shp.BEACON); 118 beaconButton.setBorderPainted(true); 119 } else { 120 beaconButton.setBorderPainted(false); 121 } 122 if (towerButton.isSelected()) { 123 dlg.mark.setShape(Shp.TOWER); 124 towerButton.setBorderPainted(true); 125 } else { 126 towerButton.setBorderPainted(false); 127 } 128 if (dlg.mark != null) 129 dlg.mark.paintSign(); 130 } 131 }; 132 pillarButton.addActionListener(alShape); 133 sparButton.addActionListener(alShape); 134 canButton.addActionListener(alShape); 135 coneButton.addActionListener(alShape); 136 sphereButton.addActionListener(alShape); 137 barrelButton.addActionListener(alShape); 138 superButton.addActionListener(alShape); 139 floatButton.addActionListener(alShape); 140 beaconButton.addActionListener(alShape); 141 towerButton.addActionListener(alShape); 63 this.add(getShapeButton(pillarButton, 55, 0, 34, 32, "PillarTip", Shp.PILLAR), null); 64 this.add(getShapeButton(sparButton, 55, 32, 34, 32, "SparTip", Shp.SPAR), null); 65 this.add(getShapeButton(canButton, 55, 64, 34, 32, "CanTip", Shp.CAN), null); 66 this.add(getShapeButton(coneButton, 55, 96, 34, 32, "ConeTip", Shp.CONE), null); 67 this.add(getShapeButton(sphereButton, 55, 128, 34, 32, "SphereTip", Shp.SPHERE), null); 68 this.add(getShapeButton(barrelButton, 90, 0, 34, 32, "BarrelTip", Shp.BARREL), null); 69 this.add(getShapeButton(superButton, 90, 32, 34, 32, "SuperTip", Shp.SUPER), null); 70 this.add(getShapeButton(floatButton, 90, 64, 34, 32, "FloatTip", Shp.FLOAT), null); 71 this.add(getShapeButton(beaconButton, 90, 96, 34, 32, "BeaconTip", Shp.BEACON), null); 72 this.add(getShapeButton(towerButton, 90, 128, 34, 32, "TowerTip", Shp.TOWER), null); 142 73 } 143 74 … … 146 77 } 147 78 148 private JRadioButton getPillarButton() { 149 if (pillarButton == null) { 150 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 151 pillarButton.setBounds(new Rectangle(55, 0, 34, 32)); 152 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 153 pillarButton.setToolTipText(Messages.getString("PillarTip")); 154 } 155 return pillarButton; 156 } 157 158 private JRadioButton getSparButton() { 159 if (sparButton == null) { 160 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 161 sparButton.setBounds(new Rectangle(55, 32, 34, 32)); 162 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 163 sparButton.setToolTipText(Messages.getString("SparTip")); 164 } 165 return sparButton; 166 } 167 168 private JRadioButton getCanButton() { 169 if (canButton == null) { 170 canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 171 canButton.setBounds(new Rectangle(55, 64, 34, 32)); 172 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 173 canButton.setToolTipText(Messages.getString("CanTip")); 174 } 175 return canButton; 176 } 177 178 private JRadioButton getConeButton() { 179 if (coneButton == null) { 180 coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 181 coneButton.setBounds(new Rectangle(55, 96, 34, 32)); 182 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 183 coneButton.setToolTipText(Messages.getString("ConeTip")); 184 } 185 return coneButton; 186 } 187 188 private JRadioButton getSphereButton() { 189 if (sphereButton == null) { 190 sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png"))); 191 sphereButton.setBounds(new Rectangle(55, 128, 34, 32)); 192 sphereButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 193 sphereButton.setToolTipText(Messages.getString("SphereTip")); 194 } 195 return sphereButton; 196 } 197 198 private JRadioButton getBarrelButton() { 199 if (barrelButton == null) { 200 barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png"))); 201 barrelButton.setBounds(new Rectangle(90, 0, 34, 32)); 202 barrelButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 203 barrelButton.setToolTipText(Messages.getString("BarrelTip")); 204 } 205 return barrelButton; 206 } 207 208 private JRadioButton getSuperButton() { 209 if (superButton == null) { 210 superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png"))); 211 superButton.setBounds(new Rectangle(90, 32, 34, 32)); 212 superButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 213 superButton.setToolTipText(Messages.getString("SuperTip")); 214 } 215 return superButton; 216 } 217 218 private JRadioButton getFloatButton() { 219 if (floatButton == null) { 220 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 221 floatButton.setBounds(new Rectangle(90, 64, 34, 32)); 222 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 223 floatButton.setToolTipText(Messages.getString("FloatTip")); 224 } 225 return floatButton; 226 } 227 228 private JRadioButton getBeaconButton() { 229 if (beaconButton == null) { 230 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 231 beaconButton.setBounds(new Rectangle(90, 96, 34, 32)); 232 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 233 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 234 } 235 return beaconButton; 236 } 237 238 private JRadioButton getTowerButton() { 239 if (towerButton == null) { 240 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 241 towerButton.setBounds(new Rectangle(90, 128, 34, 32)); 242 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 243 towerButton.setToolTipText(Messages.getString("TowerTip")); 244 } 245 return towerButton; 79 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp) { 80 button.setBounds(new Rectangle(x, y, w, h)); 81 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 82 button.setToolTipText(Messages.getString(tip)); 83 button.addActionListener(alShape); 84 shapes.put(shp, button); 85 shapeButtons.add(button); 86 return button; 246 87 } 247 88 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r24839 r24870 28 28 private OSeaMAction dlg; 29 29 private ButtonGroup regionButtons = null; 30 public JRadioButton regionAButton = n ull;31 public JRadioButton regionBButton = n ull;30 public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 31 public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 32 32 private ButtonGroup shapeButtons = null; 33 public JRadioButton pillarButton = n ull;34 public JRadioButton sparButton = n ull;35 public JRadioButton coneButton = n ull;36 public JRadioButton floatButton = n ull;37 public JRadioButton beaconButton = n ull;38 public JRadioButton towerButton = n ull;39 public JRadioButton perchButton = n ull;33 public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 34 public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 35 public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 36 public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 37 public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 38 public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 39 public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png"))); 40 40 private ActionListener alShape = null; 41 41 … … 43 43 dlg = dia; 44 44 this.setLayout(null); 45 this.add(get RegionAButton(), null);46 this.add(get RegionBButton(), null);47 this.add(get PillarButton(), null);48 this.add(get SparButton(), null);49 this.add(get ConeButton(), null);50 this.add(get FloatButton(), null);51 this.add(getB eaconButton(), null);52 this.add(get TowerButton(), null);53 this.add(get PerchButton(), null);45 this.add(getButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null); 46 this.add(getButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null); 47 this.add(getButton(pillarButton, 0, 64, 34, 32, "PillarTip"), null); 48 this.add(getButton(sparButton, 0, 96, 34, 32, "SparTip"), null); 49 this.add(getButton(coneButton, 0, 128, 34, 32, "ConeTip"), null); 50 this.add(getButton(floatButton, 35, 0, 34, 32, "FloatTip"), null); 51 this.add(getButton(beaconButton, 35, 32, 34, 32, "BeaconTip"), null); 52 this.add(getButton(towerButton, 35, 64, 34, 32, "TowerTip"), null); 53 this.add(getButton(perchButton, 35, 96, 34, 32, "PerchTip"), null); 54 54 55 55 regionButtons = new ButtonGroup(); … … 136 136 } 137 137 138 private JRadioButton getRegionAButton() { 139 if (regionAButton == null) { 140 regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 141 regionAButton.setBounds(new Rectangle(0, 2, 34, 30)); 142 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 143 regionAButton.setToolTipText(Messages.getString("RegionATip")); 144 } 145 return regionAButton; 146 } 147 148 private JRadioButton getRegionBButton() { 149 if (regionBButton == null) { 150 regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 151 regionBButton.setBounds(new Rectangle(0, 32, 34, 30)); 152 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 153 regionBButton.setToolTipText(Messages.getString("RegionBTip")); 154 } 155 return regionBButton; 156 } 157 158 private JRadioButton getPillarButton() { 159 if (pillarButton == null) { 160 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 161 pillarButton.setBounds(new Rectangle(0, 64, 34, 32)); 162 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 163 pillarButton.setToolTipText(Messages.getString("PillarTip")); 164 } 165 return pillarButton; 166 } 167 168 private JRadioButton getSparButton() { 169 if (sparButton == null) { 170 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 171 sparButton.setBounds(new Rectangle(0, 96, 34, 32)); 172 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 173 sparButton.setToolTipText(Messages.getString("SparTip")); 174 } 175 return sparButton; 176 } 177 178 private JRadioButton getConeButton() { 179 if (coneButton == null) { 180 coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 181 coneButton.setBounds(new Rectangle(0, 128, 34, 32)); 182 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 183 coneButton.setToolTipText(Messages.getString("ConeTip")); 184 } 185 return coneButton; 186 } 187 188 private JRadioButton getFloatButton() { 189 if (floatButton == null) { 190 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 191 floatButton.setBounds(new Rectangle(35, 0, 34, 32)); 192 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 193 floatButton.setToolTipText(Messages.getString("FloatTip")); 194 } 195 return floatButton; 196 } 197 198 private JRadioButton getBeaconButton() { 199 if (beaconButton == null) { 200 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 201 beaconButton.setBounds(new Rectangle(35, 32, 34, 32)); 202 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 203 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 204 } 205 return beaconButton; 206 } 207 208 private JRadioButton getTowerButton() { 209 if (towerButton == null) { 210 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 211 towerButton.setBounds(new Rectangle(35, 64, 34, 32)); 212 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 213 towerButton.setToolTipText(Messages.getString("TowerTip")); 214 } 215 return towerButton; 216 } 217 218 private JRadioButton getPerchButton() { 219 if (perchButton == null) { 220 perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png"))); 221 perchButton.setBounds(new Rectangle(35, 96, 34, 32)); 222 perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 223 perchButton.setToolTipText(Messages.getString("PerchTip")); 224 } 225 return perchButton; 138 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 139 button.setBounds(new Rectangle(x, y, w, h)); 140 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 141 button.setToolTipText(Messages.getString(tip)); 142 return button; 226 143 } 227 144 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r24839 r24870 29 29 public PanelCol panelCol = null; 30 30 private ButtonGroup topButtons = null; 31 public JRadioButton noTopButton = n ull;32 public JRadioButton canTopButton = n ull;33 public JRadioButton coneTopButton = n ull;34 public JRadioButton sphereTopButton = n ull;35 public JRadioButton XTopButton = n ull;36 public JRadioButton northTopButton = n ull;37 public JRadioButton southTopButton = n ull;38 public JRadioButton eastTopButton = n ull;39 public JRadioButton westTopButton = n ull;40 public JRadioButton spheres2TopButton = n ull;41 public JRadioButton boardDayButton = n ull;42 public JRadioButton diamondDayButton = n ull;43 public JRadioButton triangleDayButton = n ull;44 public JRadioButton triangleInvDayButton = n ull;45 public JRadioButton squareDayButton = n ull;46 public JRadioButton mooringTopButton = n ull;31 public JRadioButton noTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NoTopButton.png"))); 32 public JRadioButton canTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanTopButton.png"))); 33 public JRadioButton coneTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeTopButton.png"))); 34 public JRadioButton sphereTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereTopButton.png"))); 35 public JRadioButton XTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/XTopButton.png"))); 36 public JRadioButton northTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NorthTopButton.png"))); 37 public JRadioButton southTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SouthTopButton.png"))); 38 public JRadioButton eastTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/EastTopButton.png"))); 39 public JRadioButton westTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WestTopButton.png"))); 40 public JRadioButton spheres2TopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/Spheres2TopButton.png"))); 41 public JRadioButton boardDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BoardDayButton.png"))); 42 public JRadioButton diamondDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png"))); 43 public JRadioButton triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png"))); 44 public JRadioButton triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png"))); 45 public JRadioButton squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png"))); 46 public JRadioButton mooringTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MooringTopButton.png"))); 47 47 ActionListener alTop = null; 48 48 … … 53 53 this.setLayout(null); 54 54 this.add(panelCol, null); 55 this.add(get NoTopButton(), null);56 this.add(get CanTopButton(), null);57 this.add(get ConeTopButton(), null);58 this.add(get SphereTopButton(), null);59 this.add(get XTopButton(), null);60 this.add(get NorthTopButton(), null);61 this.add(get SouthTopButton(), null);62 this.add(get EastTopButton(), null);63 this.add(get WestTopButton(), null);64 this.add(get Spheres2TopButton(), null);65 this.add(getB oardDayButton(), null);66 this.add(get DiamondDayButton(), null);67 this.add(get TriangleDayButton(), null);68 this.add(get TriangleInvDayButton(), null);69 this.add(get SquareDayButton(), null);70 this.add(get MooringTopButton(), null);55 this.add(getButton(noTopButton, 40, 5, 27, 27, "NoTopTip"), null); 56 this.add(getButton(canTopButton, 70, 5, 27, 27, "CanTopTip"), null); 57 this.add(getButton(coneTopButton, 100, 5, 27, 27, "ConeTopTip"), null); 58 this.add(getButton(sphereTopButton, 130, 5, 27, 27, "SphereTopTip"), null); 59 this.add(getButton(XTopButton, 160, 5, 27, 27, "XTopTip"), null); 60 this.add(getButton(northTopButton, 40, 35, 27, 27, "NorthTopTip"), null); 61 this.add(getButton(southTopButton, 70, 35, 27, 27, "SouthTopTip"), null); 62 this.add(getButton(eastTopButton, 100, 35, 27, 27, "EastTopTip"), null); 63 this.add(getButton(westTopButton, 130, 35, 27, 27, "WestTopTip"), null); 64 this.add(getButton(spheres2TopButton, 160, 35, 27, 27, "Spheres2TopTip"), null); 65 this.add(getButton(boardDayButton, 40, 65, 27, 27, "BoardDayTip"), null); 66 this.add(getButton(diamondDayButton, 70, 65, 27, 27, "DiamondDayTip"), null); 67 this.add(getButton(triangleDayButton, 100, 65, 27, 27, "TriangleDayTip"), null); 68 this.add(getButton(triangleInvDayButton, 130, 65, 27, 27, "TriangleInvDayTip"), null); 69 this.add(getButton(squareDayButton, 160, 65, 27, 27, "SquareDayTip"), null); 70 this.add(getButton(mooringTopButton, 40, 95, 27, 27, "MooringTopTip"), null); 71 71 topButtons = new ButtonGroup(); 72 72 topButtons.add(noTopButton); … … 130 130 } 131 131 132 private JRadioButton getNoTopButton() { 133 if (noTopButton == null) { 134 noTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NoTopButton.png"))); 135 noTopButton.setBounds(new Rectangle(40, 5, 27, 27)); 136 noTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 137 noTopButton.setToolTipText(Messages.getString("NoTopTip")); 138 } 139 return noTopButton; 140 } 141 142 private JRadioButton getCanTopButton() { 143 if (canTopButton == null) { 144 canTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanTopButton.png"))); 145 canTopButton.setBounds(new Rectangle(70, 5, 27, 27)); 146 canTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 147 canTopButton.setToolTipText(Messages.getString("CanTopTip")); 148 } 149 return canTopButton; 150 } 151 152 private JRadioButton getConeTopButton() { 153 if (coneTopButton == null) { 154 coneTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeTopButton.png"))); 155 coneTopButton.setBounds(new Rectangle(100, 5, 27, 27)); 156 coneTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 157 coneTopButton.setToolTipText(Messages.getString("ConeTopTip")); 158 } 159 return coneTopButton; 160 } 161 162 private JRadioButton getSphereTopButton() { 163 if (sphereTopButton == null) { 164 sphereTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereTopButton.png"))); 165 sphereTopButton.setBounds(new Rectangle(130, 5, 27, 27)); 166 sphereTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 167 sphereTopButton.setToolTipText(Messages.getString("SphereTopTip")); 168 } 169 return sphereTopButton; 170 } 171 172 private JRadioButton getXTopButton() { 173 if (XTopButton == null) { 174 XTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/XTopButton.png"))); 175 XTopButton.setBounds(new Rectangle(160, 5, 27, 27)); 176 XTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 177 XTopButton.setToolTipText(Messages.getString("XTopTip")); 178 } 179 return XTopButton; 180 } 181 182 private JRadioButton getNorthTopButton() { 183 if (northTopButton == null) { 184 northTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NorthTopButton.png"))); 185 northTopButton.setBounds(new Rectangle(40, 35, 27, 27)); 186 northTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 187 northTopButton.setToolTipText(Messages.getString("NorthTopTip")); 188 } 189 return northTopButton; 190 } 191 192 private JRadioButton getSouthTopButton() { 193 if (southTopButton == null) { 194 southTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SouthTopButton.png"))); 195 southTopButton.setBounds(new Rectangle(70, 35, 27, 27)); 196 southTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 197 southTopButton.setToolTipText(Messages.getString("SouthTopTip")); 198 } 199 return southTopButton; 200 } 201 202 private JRadioButton getEastTopButton() { 203 if (eastTopButton == null) { 204 eastTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/EastTopButton.png"))); 205 eastTopButton.setBounds(new Rectangle(100, 35, 27, 27)); 206 eastTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 207 eastTopButton.setToolTipText(Messages.getString("EastTopTip")); 208 } 209 return eastTopButton; 210 } 211 212 private JRadioButton getWestTopButton() { 213 if (westTopButton == null) { 214 westTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WestTopButton.png"))); 215 westTopButton.setBounds(new Rectangle(130, 35, 27, 27)); 216 westTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 217 westTopButton.setToolTipText(Messages.getString("WestTopTip")); 218 } 219 return westTopButton; 220 } 221 222 private JRadioButton getSpheres2TopButton() { 223 if (spheres2TopButton == null) { 224 spheres2TopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/Spheres2TopButton.png"))); 225 spheres2TopButton.setBounds(new Rectangle(160, 35, 27, 27)); 226 spheres2TopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 227 spheres2TopButton.setToolTipText(Messages.getString("Spheres2TopTip")); 228 } 229 return spheres2TopButton; 230 } 231 232 private JRadioButton getBoardDayButton() { 233 if (boardDayButton == null) { 234 boardDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BoardDayButton.png"))); 235 boardDayButton.setBounds(new Rectangle(40, 65, 27, 27)); 236 boardDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 237 boardDayButton.setToolTipText(Messages.getString("BoardDayTip")); 238 } 239 return boardDayButton; 240 } 241 242 private JRadioButton getDiamondDayButton() { 243 if (diamondDayButton == null) { 244 diamondDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png"))); 245 diamondDayButton.setBounds(new Rectangle(70, 65, 27, 27)); 246 diamondDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 247 diamondDayButton.setToolTipText(Messages.getString("DiamondDayTip")); 248 } 249 return diamondDayButton; 250 } 251 252 private JRadioButton getTriangleDayButton() { 253 if (triangleDayButton == null) { 254 triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png"))); 255 triangleDayButton.setBounds(new Rectangle(100, 65, 27, 27)); 256 triangleDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 257 triangleDayButton.setToolTipText(Messages.getString("TriangleDayTip")); 258 } 259 return triangleDayButton; 260 } 261 262 private JRadioButton getTriangleInvDayButton() { 263 if (triangleInvDayButton == null) { 264 triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png"))); 265 triangleInvDayButton.setBounds(new Rectangle(130, 65, 27, 27)); 266 triangleInvDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 267 triangleInvDayButton.setToolTipText(Messages.getString("TriangleInvDayTip")); 268 } 269 return triangleInvDayButton; 270 } 271 272 private JRadioButton getSquareDayButton() { 273 if (squareDayButton == null) { 274 squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png"))); 275 squareDayButton.setBounds(new Rectangle(160, 65, 27, 27)); 276 squareDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 277 squareDayButton.setToolTipText(Messages.getString("SquareDayTip")); 278 } 279 return squareDayButton; 280 } 281 282 private JRadioButton getMooringTopButton() { 283 if (mooringTopButton == null) { 284 mooringTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MooringTopButton.png"))); 285 mooringTopButton.setBounds(new Rectangle(40, 95, 27, 27)); 286 mooringTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 287 mooringTopButton.setToolTipText(Messages.getString("MooringTopTip")); 288 } 289 return mooringTopButton; 132 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 133 button.setBounds(new Rectangle(x, y, w, h)); 134 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 135 button.setToolTipText(Messages.getString(tip)); 136 return button; 290 137 } 291 138 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24839 r24870 153 153 if (dlg.node == null) 154 154 return; 155 else 156 super.saveSign(); 155 157 156 158 String shape = ""; … … 158 160 switch (getShape()) { 159 161 case PILLAR: 160 super.saveSign("buoy_cardinal");162 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_cardinal")); 161 163 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "pillar")); 162 164 break; 163 165 case SPAR: 164 super.saveSign("buoy_cardinal");166 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_cardinal")); 165 167 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "spar")); 166 168 break; 167 169 case BEACON: 168 super.saveSign("beacon_cardinal");170 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_cardinal")); 169 171 break; 170 172 case TOWER: 171 super.saveSign("beacon_cardinal");173 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_cardinal")); 172 174 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:shape", "tower")); 173 175 break; 174 176 case FLOAT: 175 super.saveSign("light_float");177 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 176 178 break; 177 179 default: … … 264 266 break; 265 267 } 266 saveTopMarkData(shape, "black"); 267 saveLightData(); 268 saveRadarFogData(); 268 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", shape)); 269 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "black")); 269 270 } 270 271 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24848 r24870 104 104 public void saveSign() { 105 105 106 if (dlg.node == null) {106 if (dlg.node == null) 107 107 return; 108 } 108 else 109 super.saveSign(); 109 110 110 111 switch (getShape()) { 111 112 case PILLAR: 112 super.saveSign("buoy_isolated_danger");113 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_isolated_danger")); 113 114 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "pillar")); 114 115 break; 115 116 case SPAR: 116 super.saveSign("buoy_isolated_danger");117 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_isolated_danger")); 117 118 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "spar")); 118 119 break; 119 120 case BEACON: 120 super.saveSign("beacon_isolated_danger");121 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_isolated_danger")); 121 122 break; 122 123 case TOWER: 123 super.saveSign("beacon_isolated_danger");124 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_isolated_danger")); 124 125 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:shape", "tower")); 125 126 break; 126 127 case FLOAT: 127 super.saveSign("light_float");128 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 128 129 break; 129 130 default: … … 149 150 } 150 151 151 saveTopMarkData("2 spheres", "black"); 152 saveLightData(); 153 saveRadarFogData(); 152 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 spheres")); 153 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "black")); 154 154 } 155 155 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24848 r24870 472 472 public void saveSign() { 473 473 474 if (dlg.node == null) {474 if (dlg.node == null) 475 475 return; 476 } 476 else 477 super.saveSign(); 477 478 478 479 Cat cat = getCategory(); … … 485 486 switch (getShape()) { 486 487 case CAN: 487 super.saveSign("buoy_lateral");488 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 488 489 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can")); 489 490 break; 490 491 case PILLAR: 491 super.saveSign("buoy_lateral");492 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 492 493 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar")); 493 494 break; 494 495 case SPAR: 495 super.saveSign("buoy_lateral");496 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 496 497 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar")); 497 498 break; 498 499 case BEACON: 499 super.saveSign("beacon_lateral");500 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 500 501 break; 501 502 case TOWER: 502 super.saveSign("beacon_lateral");503 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 503 504 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower")); 504 505 break; 505 506 case FLOAT: 506 super.saveSign("light_float");507 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 507 508 break; 508 509 case PERCH: 509 super.saveSign("beacon_lateral");510 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 510 511 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch")); 511 512 break; … … 555 556 switch (getShape()) { 556 557 case CAN: 557 super.saveSign("buoy_lateral");558 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 558 559 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can")); 559 560 break; 560 561 case PILLAR: 561 super.saveSign("buoy_lateral");562 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 562 563 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar")); 563 564 break; 564 565 case SPAR: 565 super.saveSign("buoy_lateral");566 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 566 567 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar")); 567 568 break; 568 569 case BEACON: 569 super.saveSign("beacon_lateral");570 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 570 571 break; 571 572 case TOWER: 572 super.saveSign("beacon_lateral");573 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 573 574 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower")); 574 575 break; 575 576 case FLOAT: 576 super.saveSign("light_float");577 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 577 578 break; 578 579 default: … … 621 622 switch (getShape()) { 622 623 case CONE: 623 super.saveSign("buoy_lateral");624 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 624 625 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical")); 625 626 break; 626 627 case PILLAR: 627 super.saveSign("buoy_lateral");628 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 628 629 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar")); 629 630 break; 630 631 case SPAR: 631 super.saveSign("buoy_lateral");632 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 632 633 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar")); 633 634 break; 634 635 case BEACON: 635 super.saveSign("beacon_lateral");636 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 636 637 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake")); 637 638 break; 638 639 case TOWER: 639 super.saveSign("beacon_lateral");640 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 640 641 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower")); 641 642 break; 642 643 case FLOAT: 643 super.saveSign("light_float");644 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 644 645 break; 645 646 case PERCH: 646 super.saveSign("beacon_lateral");647 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 647 648 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch")); 648 649 break; … … 692 693 switch (getShape()) { 693 694 case CONE: 694 super.saveSign("buoy_lateral");695 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 695 696 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical")); 696 697 break; 697 698 case PILLAR: 698 super.saveSign("buoy_lateral");699 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 699 700 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar")); 700 701 break; 701 702 case SPAR: 702 super.saveSign("buoy_lateral");703 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral")); 703 704 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar")); 704 705 break; 705 706 case BEACON: 706 super.saveSign("beacon_lateral");707 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 707 708 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake")); 708 709 break; 709 710 case TOWER: 710 super.saveSign("beacon_lateral");711 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral")); 711 712 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower")); 712 713 break; 713 714 case FLOAT: 714 super.saveSign("light_float");715 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 715 716 break; 716 717 default: … … 759 760 default: 760 761 } 761 saveTopMarkData(shape, colour); 762 saveLightData(); 763 saveRadarFogData(); 762 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", shape)); 763 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", colour)); 764 764 765 765 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24848 r24870 4 4 5 5 import javax.swing.ImageIcon; 6 7 import org.openstreetmap.josm.Main; 8 import org.openstreetmap.josm.command.ChangePropertyCommand; 6 9 7 10 import oseam.dialogs.OSeaMAction; … … 80 83 81 84 public void saveSign() { 82 if (dlg.node == null) {85 if (dlg.node == null) 83 86 return; 84 } 87 else 88 super.saveSign(); 85 89 86 90 switch (getCategory()) { 87 91 case LIGHT_HOUSE: 88 super.saveSign("landmark");92 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "landmark")); 89 93 break; 90 94 case LIGHT_MAJOR: 91 super.saveSign("light_major");95 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_major")); 92 96 break; 93 97 case LIGHT_MINOR: 94 super.saveSign("light_minor");98 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_minor")); 95 99 break; 96 100 case LIGHT_VESSEL: 97 super.saveSign("light_vessel");101 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_vessel")); 98 102 break; 99 103 case LIGHT_FLOAT: 100 super.saveSign("light_float");104 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 101 105 break; 102 106 default: 103 107 } 104 saveLightData();105 saveRadarFogData();106 108 } 107 109 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24848 r24870 135 135 136 136 public void saveSign() { 137 if (dlg.node == null) {137 if (dlg.node == null) 138 138 return; 139 } 139 else 140 super.saveSign(); 140 141 141 142 switch (getShape()) { 142 143 case PILLAR: 143 super.saveSign("buoy_safe_water");144 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water")); 144 145 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "pillar")); 145 146 break; 146 147 case SPAR: 147 super.saveSign("buoy_safe_water");148 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water")); 148 149 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "spar")); 149 150 break; 150 151 case SPHERE: 151 super.saveSign("buoy_safe_water");152 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water")); 152 153 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "sphere")); 153 154 break; 154 155 case BEACON: 155 super.saveSign("beacon_safe_water");156 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_safe_water")); 156 157 break; 157 158 case FLOAT: 158 super.saveSign("light_float");159 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 159 160 break; 160 161 default: … … 178 179 default: 179 180 } 180 saveTopMarkData("sphere", "red"); 181 saveLightData(); 182 saveRadarFogData(); 181 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "sphere")); 182 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "red")); 183 183 } 184 184 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24848 r24870 162 162 163 163 public void saveSign() { 164 if (dlg.node == null) {164 if (dlg.node == null) 165 165 return; 166 } 166 else 167 super.saveSign(); 167 168 168 169 switch (getShape()) { 169 170 case PILLAR: 170 super.saveSign("buoy_special_purpose");171 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 171 172 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "pillar")); 172 173 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 173 174 break; 174 175 case SPAR: 175 super.saveSign("buoy_special_purpose");176 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 176 177 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "spar")); 177 178 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 178 179 break; 179 180 case CAN: 180 super.saveSign("buoy_special_purpose");181 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 181 182 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "can")); 182 183 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 183 184 break; 184 185 case CONE: 185 super.saveSign("buoy_special_purpose");186 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 186 187 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "conical")); 187 188 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 188 189 break; 189 190 case SPHERE: 190 super.saveSign("buoy_special_purpose");191 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 191 192 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "sphere")); 192 193 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 193 194 break; 194 195 case BARREL: 195 super.saveSign("buoy_special_purpose");196 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 196 197 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "barrel")); 197 198 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 198 199 break; 199 200 case FLOAT: 200 super.saveSign("light_float");201 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 201 202 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow")); 202 203 break; 203 204 case BEACON: 204 super.saveSign("beacon_special_purpose");205 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_special_purpose")); 205 206 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow")); 206 207 break; 207 208 case TOWER: 208 super.saveSign("beacon_special_purpose");209 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_special_purpose")); 209 210 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:shape", "tower")); 210 211 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow")); … … 218 219 * saveTopMarkData("cylinder", "yellow"); break; case TOP_YELLOW_CONE: 219 220 * saveTopMarkData("cone, point up", "yellow"); break; } 220 */saveLightData(); 221 saveRadarFogData(); 221 * Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 222 * "seamark:topmark:shape", shape)); Main.main.undoRedo.add(new 223 * ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "yellow")); 224 */ 222 225 } 223 226 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24839 r24870 16 16 abstract public class SeaMark { 17 17 18 public final static boolean IALA_A = false;19 public final static boolean IALA_B = true;20 21 public enum Cat {22 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT23 }24 25 public enum Shp {26 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BEACON, TOWER, STAKE, PERCH27 }28 29 public enum Col {30 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE, BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK31 }32 33 public enum Top {34 UNKNOWN, X_SHAPE, CAN, CONE35 }36 37 public enum Rtb {38 UNKNOWN, RACON, RAMARK, LEADING39 }40 41 public enum Fog {42 UNKNOWN, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS43 }44 45 18 /** 46 19 * Variables … … 58 31 } 59 32 33 public final static boolean IALA_A = false; 34 public final static boolean IALA_B = true; 35 60 36 private boolean region = false; 61 37 … … 68 44 } 69 45 46 public enum Col { 47 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, 48 BLACK, RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE, 49 BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK 50 } 51 70 52 private Col colour = Col.UNKNOWN; 71 53 … … 88 70 } 89 71 72 public enum Cat { 73 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, 74 CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, 75 LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT 76 } 77 90 78 private Cat category = Cat.UNKNOWN; 91 79 … … 98 86 } 99 87 88 public enum Shp { 89 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BEACON, TOWER, STAKE, PERCH 90 } 91 100 92 private Shp shape = Shp.UNKNOWN; 101 93 … … 108 100 } 109 101 102 public enum Top { 103 UNKNOWN, X_SHAPE, CAN, CONE 104 } 105 110 106 private boolean TopMark = false; 111 107 … … 138 134 } 139 135 136 public enum Rtb { 137 UNKNOWN, RACON, RAMARK, LEADING 138 } 139 140 140 private Rtb RaType = Rtb.UNKNOWN; 141 141 … … 166 166 public void setFog(boolean fog) { 167 167 FogSignal = fog; 168 } 169 170 public enum Fog { 171 UNKNOWN, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS 168 172 } 169 173 … … 599 603 */} 600 604 601 public void saveSign( String type) {605 public void saveSign() { 602 606 Iterator<String> it = dlg.node.getKeys().keySet().iterator(); 603 607 String str; … … 613 617 if (!str.isEmpty()) 614 618 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:name", str)); 615 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", type));616 }617 618 protected void saveLightData() {619 619 /* 620 620 * String colour; if (dlg.cM01Fired.isSelected()) { if (!(colour = … … 686 686 * ChangePropertyCommand(Node, "seamark:light:" + i + ":sector_end", 687 687 * Bearing2[i])); } } 688 */}689 690 protected void saveTopMarkData(String shape, String colour) {691 /*692 688 * if (hasTopMark()) { Main.main.undoRedo.add(new 693 689 * ChangePropertyCommand(Node, "seamark:topmark:shape", shape)); 694 690 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 695 691 * "seamark:topmark:colour", colour)); } 696 */}697 698 protected void saveRadarFogData() {699 /*700 692 * if (hasRadar()) { Main.main.undoRedo.add(new ChangePropertyCommand(Node, 701 693 * "seamark:radar_reflector", "yes")); } if (hasRacon()) { switch (RaType) {
Note:
See TracChangeset
for help on using the changeset viewer.