Changeset 24839 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-12-22T15:09:12+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 1 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/Messages.java
r24545 r24839 5 5 6 6 public class Messages { 7 7 private static final String BUNDLE_NAME = "oseam.msg.messages"; 8 8 9 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle 10 .getBundle(BUNDLE_NAME); 9 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); 11 10 12 13 11 private Messages() { 12 } 14 13 15 16 17 18 19 20 21 14 public static String getString(String key) { 15 try { 16 return RESOURCE_BUNDLE.getString(key); 17 } catch (MissingResourceException e) { 18 return '!' + key + '!'; 19 } 20 } 22 21 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/OSeaM.java
r24823 r24839 29 29 @Override 30 30 public boolean stop() { 31 //DataSet.removeSelectionListener(oseam.SmpListener);31 // DataSet.removeSelectionListener(oseam.SmpListener); 32 32 return true; 33 33 } … … 35 35 @Override 36 36 public boolean hasFocus() { 37 //DataSet.addSelectionListener(oseam.SmpListener);37 // DataSet.addSelectionListener(oseam.SmpListener); 38 38 return true; 39 39 } … … 41 41 @Override 42 42 public boolean lostFocus() { 43 //DataSet.removeSelectionListener(oseam.SmpListener);43 // DataSet.removeSelectionListener(oseam.SmpListener); 44 44 return true; 45 45 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r24830 r24839 24 24 import oseam.seamarks.MarkLight; 25 25 import oseam.seamarks.MarkSpec; 26 import oseam.seamarks.MarkUkn;27 26 import oseam.seamarks.MarkSaw; 28 27 import smed.plug.ifc.SmedPluginManager; … … 36 35 public Node node = null; 37 36 private Collection<? extends OsmPrimitive> Selection = null; 38 private OsmPrimitive lastNode = null;39 37 40 38 public SelectionChangedListener SmpListener = new SelectionChangedListener() { 41 public void selectionChanged( 42 Collection<? extends OsmPrimitive> newSelection) { 39 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 43 40 Node nextNode = null; 44 41 Selection = newSelection; … … 49 46 nextNode = (Node) osm; 50 47 if (Selection.size() == 1) { 51 if (nextNode.compareTo( lastNode) != 0) {52 lastNode = nextNode;53 parseNode( nextNode);48 if (nextNode.compareTo(node) != 0) { 49 node = nextNode; 50 parseNode(); 54 51 } 55 52 } else … … 58 55 } 59 56 if (nextNode == null) { 57 node = null; 58 mark = null; 60 59 panelMain.clearSelections(); 61 lastNode = null;62 60 manager.showVisualMessage(Messages.getString("SelectNode")); 63 61 } … … 73 71 if (!str.isEmpty()) 74 72 str += new String(new char[] { 0x1e }); 75 Main.pref.put("mappaint.style.sources", str 76 + "http://dev.openseamap.org/josm/seamark_styles.xml"); 73 Main.pref.put("mappaint.style.sources", str + "http://dev.openseamap.org/josm/seamark_styles.xml"); 77 74 } 78 75 str = Main.pref.get("color.background"); … … 90 87 } 91 88 92 private void parseNode( Node newNode) {89 private void parseNode() { 93 90 94 91 Map<String, String> keys; 95 92 96 93 manager.showVisualMessage(""); 97 node = newNode;98 94 mark = null; 99 95 String type = ""; … … 106 102 if (type.equals("buoy_lateral") || type.equals("beacon_lateral")) { 107 103 mark = new MarkLat(this); 108 } else if (type.equals("buoy_cardinal") 109 || type.equals("beacon_cardinal")) { 104 } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal")) { 110 105 mark = new MarkCard(this); 111 } else if (type.equals("buoy_safe_water") 112 || type.equals("beacon_safe_water")) { 106 } else if (type.equals("buoy_safe_water") || type.equals("beacon_safe_water")) { 113 107 mark = new MarkSaw(this); 114 } else if (type.equals("buoy_special_purpose") 115 || type.equals("beacon_special_purpose")) { 108 } else if (type.equals("buoy_special_purpose") || type.equals("beacon_special_purpose")) { 116 109 mark = new MarkSpec(this); 117 } else if (type.equals("buoy_isolated_danger") 118 || type.equals("beacon_isolated_danger")) { 110 } else if (type.equals("buoy_isolated_danger") || type.equals("beacon_isolated_danger")) { 119 111 mark = new MarkIsol(this); 120 } else if (type.equals("landmark") || type.equals("light_vessel") 121 || type.equals("light_major") || type.equals("light_minor")) { 112 } else if (type.equals("landmark") || type.equals("light_vessel") || type.equals("light_major") || type.equals("light_minor")) { 122 113 mark = new MarkLight(this); 123 114 } else if (type.equals("light_float")) { 124 115 if (keys.containsKey("seamark:light_float:colour")) { 125 116 str = keys.get("seamark:light_float:colour"); 126 if (str.equals("red") || str.equals("green") 127 || str.equals("red;green;red") 128 || str.equals("green;red;green")) { 117 if (str.equals("red") || str.equals("green") || str.equals("red;green;red") || str.equals("green;red;green")) { 129 118 mark = new MarkLat(this); 130 } else if (str.equals("black;yellow") 131 || str.equals("black;yellow;black") 132 || str.equals("yellow;black") 119 } else if (str.equals("black;yellow") || str.equals("black;yellow;black") || str.equals("yellow;black") 133 120 || str.equals("yellow;black;yellow")) { 134 121 mark = new MarkCard(this); … … 151 138 } 152 139 } 153 } else if (keys.containsKey("buoy_lateral:category") 154 || keys.containsKey("beacon_lateral:category")) { 140 } else if (keys.containsKey("buoy_lateral:category") || keys.containsKey("beacon_lateral:category")) { 155 141 mark = new MarkLat(this); 156 } else if (keys.containsKey("buoy_cardinal:category") 157 || keys.containsKey("beacon_cardinal:category")) { 142 } else if (keys.containsKey("buoy_cardinal:category") || keys.containsKey("beacon_cardinal:category")) { 158 143 mark = new MarkCard(this); 159 } else if (keys.containsKey("buoy_isolated_danger:category") 160 || keys.containsKey("beacon_isolated_danger:category")) { 144 } else if (keys.containsKey("buoy_isolated_danger:category") || keys.containsKey("beacon_isolated_danger:category")) { 161 145 mark = new MarkIsol(this); 162 } else if (keys.containsKey("buoy_safe_water:category") 163 || keys.containsKey("beacon_safe_water:category")) { 146 } else if (keys.containsKey("buoy_safe_water:category") || keys.containsKey("beacon_safe_water:category")) { 164 147 mark = new MarkSaw(this); 165 } else if (keys.containsKey("buoy_special_purpose:category") 166 || keys.containsKey("beacon_special_purpose:category")) { 148 } else if (keys.containsKey("buoy_special_purpose:category") || keys.containsKey("beacon_special_purpose:category")) { 167 149 mark = new MarkSpec(this); 168 } else if (keys.containsKey("buoy_lateral:shape") 169 || keys.containsKey("beacon_lateral:shape")) { 150 } else if (keys.containsKey("buoy_lateral:shape") || keys.containsKey("beacon_lateral:shape")) { 170 151 mark = new MarkLat(this); 171 } else if (keys.containsKey("buoy_cardinal:shape") 172 || keys.containsKey("beacon_cardinal:shape")) { 152 } else if (keys.containsKey("buoy_cardinal:shape") || keys.containsKey("beacon_cardinal:shape")) { 173 153 mark = new MarkCard(this); 174 } else if (keys.containsKey("buoy_isolated_danger:shape") 175 || keys.containsKey("beacon_isolated_danger:shape")) { 154 } else if (keys.containsKey("buoy_isolated_danger:shape") || keys.containsKey("beacon_isolated_danger:shape")) { 176 155 mark = new MarkIsol(this); 177 } else if (keys.containsKey("buoy_safe_water:shape") 178 || keys.containsKey("beacon_safe_water:shape")) { 156 } else if (keys.containsKey("buoy_safe_water:shape") || keys.containsKey("beacon_safe_water:shape")) { 179 157 mark = new MarkSaw(this); 180 } else if (keys.containsKey("buoy_special_purpose:shape") 181 || keys.containsKey("beacon_special_purpose:shape")) { 158 } else if (keys.containsKey("buoy_special_purpose:shape") || keys.containsKey("beacon_special_purpose:shape")) { 182 159 mark = new MarkSpec(this); 183 } else if (keys.containsKey("buoy_lateral:colour") 184 || keys.containsKey("beacon_lateral:colour")) { 160 } else if (keys.containsKey("buoy_lateral:colour") || keys.containsKey("beacon_lateral:colour")) { 185 161 mark = new MarkLat(this); 186 } else if (keys.containsKey("buoy_cardinal:colour") 187 || keys.containsKey("beacon_cardinal:colour")) { 162 } else if (keys.containsKey("buoy_cardinal:colour") || keys.containsKey("beacon_cardinal:colour")) { 188 163 mark = new MarkCard(this); 189 } else if (keys.containsKey("buoy_isolated_danger:colour") 190 || keys.containsKey("beacon_isolated_danger:colour")) { 164 } else if (keys.containsKey("buoy_isolated_danger:colour") || keys.containsKey("beacon_isolated_danger:colour")) { 191 165 mark = new MarkIsol(this); 192 } else if (keys.containsKey("buoy_safe_water:colour") 193 || keys.containsKey("beacon_safe_water:colour")) { 166 } else if (keys.containsKey("buoy_safe_water:colour") || keys.containsKey("beacon_safe_water:colour")) { 194 167 mark = new MarkSaw(this); 195 } else if (keys.containsKey("buoy_special_purpose:colour") 196 || keys.containsKey("beacon_special_purpose:colour")) { 168 } else if (keys.containsKey("buoy_special_purpose:colour") || keys.containsKey("beacon_special_purpose:colour")) { 197 169 mark = new MarkSpec(this); 198 170 } … … 200 172 if (mark == null) { 201 173 manager.showVisualMessage(Messages.getString("NoMark")); 202 mark = new MarkUkn(this);174 panelMain.clearSelections(); 203 175 } else { 204 176 mark.parseMark(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r24835 r24839 79 79 public void actionPerformed(java.awt.event.ActionEvent e) { 80 80 if (portButton.isSelected()) { 81 if (!(dlg.mark instanceof MarkLat) 82 || (dlg.mark.getCategory() != Cat.LAT_PORT)) 81 if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PORT)) 83 82 dlg.mark = new MarkLat(dlg); 84 83 dlg.mark.setCategory(Cat.LAT_PORT); … … 98 97 } 99 98 if (stbdButton.isSelected()) { 100 if (!(dlg.mark instanceof MarkLat) 101 || (dlg.mark.getCategory() != Cat.LAT_STBD)) 99 if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_STBD)) 102 100 dlg.mark = new MarkLat(dlg); 103 101 dlg.mark.setCategory(Cat.LAT_STBD); … … 117 115 } 118 116 if (prefPortButton.isSelected()) { 119 if (!(dlg.mark instanceof MarkLat) 120 || (dlg.mark.getCategory() != Cat.LAT_PREF_PORT)) 117 if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PREF_PORT)) 121 118 dlg.mark = new MarkLat(dlg); 122 119 dlg.mark.setCategory(Cat.LAT_PREF_PORT); … … 136 133 } 137 134 if (prefStbdButton.isSelected()) { 138 if (!(dlg.mark instanceof MarkLat) 139 || (dlg.mark.getCategory() != Cat.LAT_PREF_STBD)) 135 if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PREF_STBD)) 140 136 dlg.mark = new MarkLat(dlg); 141 137 dlg.mark.setCategory(Cat.LAT_PREF_STBD); … … 188 184 private JRadioButton getPortButton() { 189 185 if (portButton == null) { 190 portButton = new JRadioButton(new ImageIcon(getClass().getResource( 191 "/images/PortButton.png"))); 186 portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png"))); 192 187 portButton.setBounds(new Rectangle(0, 0, 52, 32)); 193 portButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 194 2)); 188 portButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 195 189 portButton.setToolTipText(Messages.getString("PortTip")); 196 190 } … … 200 194 private JRadioButton getStbdButton() { 201 195 if (stbdButton == null) { 202 stbdButton = new JRadioButton(new ImageIcon(getClass().getResource( 203 "/images/StbdButton.png"))); 196 stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png"))); 204 197 stbdButton.setBounds(new Rectangle(0, 32, 52, 32)); 205 stbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 206 2)); 198 stbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 207 199 stbdButton.setToolTipText(Messages.getString("StbdTip")); 208 200 } … … 212 204 private JRadioButton getPrefPortButton() { 213 205 if (prefPortButton == null) { 214 prefPortButton = new JRadioButton(new ImageIcon(getClass() 215 .getResource("/images/PrefPortButton.png"))); 206 prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefPortButton.png"))); 216 207 prefPortButton.setBounds(new Rectangle(0, 64, 52, 32)); 217 prefPortButton.setBorder(BorderFactory.createLineBorder( 218 Color.magenta, 2)); 208 prefPortButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 219 209 prefPortButton.setToolTipText(Messages.getString("PrefPortTip")); 220 210 } … … 224 214 private JRadioButton getPrefStbdButton() { 225 215 if (prefStbdButton == null) { 226 prefStbdButton = new JRadioButton(new ImageIcon(getClass() 227 .getResource("/images/PrefStbdButton.png"))); 216 prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefStbdButton.png"))); 228 217 prefStbdButton.setBounds(new Rectangle(0, 96, 52, 32)); 229 prefStbdButton.setBorder(BorderFactory.createLineBorder( 230 Color.magenta, 2)); 218 prefStbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 231 219 prefStbdButton.setToolTipText(Messages.getString("PrefStbdTip")); 232 220 } … … 236 224 private JRadioButton getSafeWaterButton() { 237 225 if (safeWaterButton == null) { 238 safeWaterButton = new JRadioButton(new ImageIcon(getClass() 239 .getResource("/images/SafeWaterButton.png"))); 226 safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SafeWaterButton.png"))); 240 227 safeWaterButton.setBounds(new Rectangle(0, 128, 52, 32)); 241 safeWaterButton.setBorder(BorderFactory.createLineBorder( 242 Color.magenta, 2)); 228 safeWaterButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 243 229 safeWaterButton.setToolTipText(Messages.getString("SafeWaterTip")); 244 230 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r24830 r24839 91 91 private JRadioButton getOffButton() { 92 92 if (offButton == null) { 93 offButton = new JRadioButton(new ImageIcon(getClass() 94 .getResource("/images/OffButton.png"))); 93 offButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 95 94 offButton.setBounds(new Rectangle(0, 0, 34, 16)); 96 95 offButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 97 96 offButton.setToolTipText(tr("No colour")); 98 97 } … … 102 101 private JRadioButton getWhiteButton() { 103 102 if (whiteButton == null) { 104 whiteButton = new JRadioButton(new ImageIcon(getClass() 105 .getResource("/images/WhiteButton.png"))); 103 whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png"))); 106 104 whiteButton.setBounds(new Rectangle(0, 16, 34, 16)); 107 105 whiteButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 108 106 whiteButton.setToolTipText(tr("White")); 109 107 } … … 113 111 private JRadioButton getRedButton() { 114 112 if (redButton == null) { 115 redButton = new JRadioButton(new ImageIcon(getClass().getResource( 116 "/images/RedButton.png"))); 113 redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png"))); 117 114 redButton.setBounds(new Rectangle(0, 32, 34, 16)); 118 115 redButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 119 116 redButton.setToolTipText(tr("Red")); 120 117 } … … 124 121 private JRadioButton getOrangeButton() { 125 122 if (orangeButton == null) { 126 orangeButton = new JRadioButton(new ImageIcon(getClass() 127 .getResource("/images/OrangeButton.png"))); 123 orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png"))); 128 124 orangeButton.setBounds(new Rectangle(0, 48, 34, 16)); 129 125 orangeButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 130 126 orangeButton.setToolTipText(tr("Orange")); 131 127 } … … 135 131 private JRadioButton getAmberButton() { 136 132 if (amberButton == null) { 137 amberButton = new JRadioButton(new ImageIcon(getClass() 138 .getResource("/images/AmberButton.png"))); 133 amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png"))); 139 134 amberButton.setBounds(new Rectangle(0, 64, 34, 16)); 140 135 amberButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 141 136 amberButton.setToolTipText(tr("Amber")); 142 137 } … … 146 141 private JRadioButton getYellowButton() { 147 142 if (yellowButton == null) { 148 yellowButton = new JRadioButton(new ImageIcon(getClass() 149 .getResource("/images/YellowButton.png"))); 143 yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png"))); 150 144 yellowButton.setBounds(new Rectangle(0, 80, 34, 16)); 151 145 yellowButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 152 146 yellowButton.setToolTipText(tr("Yellow")); 153 147 } … … 157 151 private JRadioButton getGreenButton() { 158 152 if (greenButton == null) { 159 greenButton = new JRadioButton(new ImageIcon(getClass() 160 .getResource("/images/GreenButton.png"))); 153 greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png"))); 161 154 greenButton.setBounds(new Rectangle(0, 96, 34, 16)); 162 155 greenButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 163 156 greenButton.setToolTipText(tr("Green")); 164 157 } … … 168 161 private JRadioButton getBlueButton() { 169 162 if (blueButton == null) { 170 blueButton = new JRadioButton(new ImageIcon(getClass().getResource( 171 "/images/BlueButton.png"))); 163 blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png"))); 172 164 blueButton.setBounds(new Rectangle(0, 112, 34, 16)); 173 165 blueButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 174 166 blueButton.setToolTipText(tr("Blue")); 175 167 } … … 179 171 private JRadioButton getVioletButton() { 180 172 if (violetButton == null) { 181 violetButton = new JRadioButton(new ImageIcon(getClass() 182 .getResource("/images/VioletButton.png"))); 173 violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png"))); 183 174 violetButton.setBounds(new Rectangle(0, 128, 34, 16)); 184 175 violetButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 185 176 violetButton.setToolTipText(tr("Violet")); 186 177 } … … 190 181 private JRadioButton getBlackButton() { 191 182 if (blackButton == null) { 192 blackButton = new JRadioButton(new ImageIcon(getClass() 193 .getResource("/images/BlackButton.png"))); 183 blackButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlackButton.png"))); 194 184 blackButton.setBounds(new Rectangle(0, 144, 34, 16)); 195 185 blackButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 196 186 blackButton.setToolTipText(tr("Black")); 197 187 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r24830 r24839 32 32 33 33 public void clearSelections() { 34 34 35 35 } 36 36 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r24830 r24839 110 110 isolButton.setBorderPainted(false); 111 111 } 112 if (dlg.mark != null) dlg.mark.paintSign(); 112 if (dlg.mark != null) 113 dlg.mark.paintSign(); 113 114 } 114 115 }; … … 133 134 public void actionPerformed(java.awt.event.ActionEvent e) { 134 135 if (pillarButton.isSelected()) { 135 pillarButton.setBorderPainted(true);136 dlg.mark.setShape(Shp.PILLAR);136 pillarButton.setBorderPainted(true); 137 dlg.mark.setShape(Shp.PILLAR); 137 138 } else { 138 139 pillarButton.setBorderPainted(false); 139 140 } 140 141 if (sparButton.isSelected()) { 141 sparButton.setBorderPainted(true);142 dlg.mark.setShape(Shp.SPAR);142 sparButton.setBorderPainted(true); 143 dlg.mark.setShape(Shp.SPAR); 143 144 } else { 144 145 sparButton.setBorderPainted(false); 145 146 } 146 147 if (floatButton.isSelected()) { 147 floatButton.setBorderPainted(true);148 dlg.mark.setShape(Shp.FLOAT);148 floatButton.setBorderPainted(true); 149 dlg.mark.setShape(Shp.FLOAT); 149 150 } else { 150 151 floatButton.setBorderPainted(false); 151 152 } 152 153 if (beaconButton.isSelected()) { 153 beaconButton.setBorderPainted(true);154 dlg.mark.setShape(Shp.BEACON);154 beaconButton.setBorderPainted(true); 155 dlg.mark.setShape(Shp.BEACON); 155 156 } else { 156 157 beaconButton.setBorderPainted(false); 157 158 } 158 159 if (towerButton.isSelected()) { 159 towerButton.setBorderPainted(true);160 dlg.mark.setShape(Shp.TOWER);160 towerButton.setBorderPainted(true); 161 dlg.mark.setShape(Shp.TOWER); 161 162 } else { 162 163 towerButton.setBorderPainted(false); … … 180 181 private JRadioButton getNothButton() { 181 182 if (northButton == null) { 182 northButton = new JRadioButton(new ImageIcon(getClass() 183 .getResource("/images/CardNButton.png"))); 183 northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png"))); 184 184 northButton.setBounds(new Rectangle(0, 0, 52, 32)); 185 185 northButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 186 186 northButton.setToolTipText(Messages.getString("NorthTip")); 187 187 } … … 191 191 private JRadioButton getSouthButton() { 192 192 if (southButton == null) { 193 southButton = new JRadioButton(new ImageIcon(getClass() 194 .getResource("/images/CardSButton.png"))); 193 southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png"))); 195 194 southButton.setBounds(new Rectangle(0, 32, 52, 32)); 196 195 southButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 197 196 southButton.setToolTipText(Messages.getString("SouthTip")); 198 197 } … … 202 201 private JRadioButton getEastButton() { 203 202 if (eastButton == null) { 204 eastButton = new JRadioButton(new ImageIcon(getClass().getResource( 205 "/images/CardEButton.png"))); 203 eastButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardEButton.png"))); 206 204 eastButton.setBounds(new Rectangle(0, 64, 52, 32)); 207 205 eastButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 208 206 eastButton.setToolTipText(Messages.getString("EastTip")); 209 207 } … … 213 211 private JRadioButton getWestButton() { 214 212 if (westButton == null) { 215 westButton = new JRadioButton(new ImageIcon(getClass().getResource( 216 "/images/CardWButton.png"))); 213 westButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardWButton.png"))); 217 214 westButton.setBounds(new Rectangle(0, 96, 52, 32)); 218 215 westButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 219 216 westButton.setToolTipText(Messages.getString("WestTip")); 220 217 } … … 224 221 private JRadioButton getIsolButton() { 225 222 if (isolButton == null) { 226 isolButton = new JRadioButton(new ImageIcon(getClass().getResource( 227 "/images/IsolButton.png"))); 223 isolButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/IsolButton.png"))); 228 224 isolButton.setBounds(new Rectangle(0, 128, 52, 32)); 229 225 isolButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 230 226 isolButton.setToolTipText(Messages.getString("IsolTip")); 231 227 } … … 235 231 private JRadioButton getPillarButton() { 236 232 if (pillarButton == null) { 237 pillarButton = new JRadioButton(new ImageIcon(getClass() 238 .getResource("/images/PillarButton.png"))); 233 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 239 234 pillarButton.setBounds(new Rectangle(55, 0, 34, 32)); 240 235 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 241 236 pillarButton.setToolTipText(Messages.getString("PillarTip")); 242 237 } … … 246 241 private JRadioButton getSparButton() { 247 242 if (sparButton == null) { 248 sparButton = new JRadioButton(new ImageIcon(getClass().getResource( 249 "/images/SparButton.png"))); 243 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 250 244 sparButton.setBounds(new Rectangle(55, 32, 34, 32)); 251 245 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 252 246 sparButton.setToolTipText(Messages.getString("SparTip")); 253 247 } … … 257 251 private JRadioButton getFloatButton() { 258 252 if (floatButton == null) { 259 floatButton = new JRadioButton(new ImageIcon(getClass() 260 .getResource("/images/FloatButton.png"))); 253 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 261 254 floatButton.setBounds(new Rectangle(55, 64, 34, 32)); 262 255 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 263 256 floatButton.setToolTipText(Messages.getString("FloatTip")); 264 257 } … … 268 261 private JRadioButton getBeaconButton() { 269 262 if (beaconButton == null) { 270 beaconButton = new JRadioButton(new ImageIcon(getClass() 271 .getResource("/images/BeaconButton.png"))); 263 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 272 264 beaconButton.setBounds(new Rectangle(55, 96, 34, 32)); 273 265 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 274 266 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 275 267 } … … 279 271 private JRadioButton getTowerButton() { 280 272 if (towerButton == null) { 281 towerButton = new JRadioButton(new ImageIcon(getClass() 282 .getResource("/images/TowerButton.png"))); 273 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 283 274 towerButton.setBounds(new Rectangle(55, 128, 34, 32)); 284 275 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 285 276 towerButton.setToolTipText(Messages.getString("TowerTip")); 286 277 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r24830 r24839 54 54 vesselButton.setBorderPainted(vesselButton.isSelected()); 55 55 floatButton.setBorderPainted(floatButton.isSelected()); 56 if (dlg.mark != null) dlg.mark.paintSign(); 56 if (dlg.mark != null) 57 dlg.mark.paintSign(); 57 58 } 58 59 }; … … 65 66 66 67 public void clearSelections() { 67 68 68 69 } 69 70 70 71 private JRadioButton getHouseButton() { 71 72 if (houseButton == null) { 72 houseButton = new JRadioButton(new ImageIcon(getClass() 73 .getResource("/images/LighthouseButton.png"))); 73 houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png"))); 74 74 houseButton.setBounds(new Rectangle(0, 0, 34, 32)); 75 75 houseButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 76 76 houseButton.setToolTipText(Messages.getString("LighthouseTip")); 77 77 } … … 81 81 private JRadioButton getMajorButton() { 82 82 if (majorButton == null) { 83 majorButton = new JRadioButton(new ImageIcon(getClass() 84 .getResource("/images/LightMajorButton.png"))); 83 majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png"))); 85 84 majorButton.setBounds(new Rectangle(0, 32, 34, 32)); 86 85 majorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 87 86 majorButton.setToolTipText(Messages.getString("MajorLightTip")); 88 87 } … … 92 91 private JRadioButton getMinorButton() { 93 92 if (minorButton == null) { 94 minorButton = new JRadioButton(new ImageIcon(getClass() 95 .getResource("/images/LightMinorButton.png"))); 93 minorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMinorButton.png"))); 96 94 minorButton.setBounds(new Rectangle(0, 64, 34, 32)); 97 95 minorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 98 96 minorButton.setToolTipText(Messages.getString("MinorLightTip")); 99 97 } … … 103 101 private JRadioButton getVesselButton() { 104 102 if (vesselButton == null) { 105 vesselButton = new JRadioButton(new ImageIcon(getClass() 106 .getResource("/images/LightVesselButton.png"))); 103 vesselButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightVesselButton.png"))); 107 104 vesselButton.setBounds(new Rectangle(0, 96, 34, 32)); 108 105 vesselButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 109 106 vesselButton.setToolTipText(Messages.getString("LightVesselTip")); 110 107 } … … 114 111 private JRadioButton getFloatButton() { 115 112 if (floatButton == null) { 116 floatButton = new JRadioButton(new ImageIcon(getClass() 117 .getResource("/images/LightFloatButton.png"))); 113 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png"))); 118 114 floatButton.setBounds(new Rectangle(0, 128, 34, 32)); 119 115 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 120 116 floatButton.setToolTipText(Messages.getString("LightFloatTip")); 121 117 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r24830 r24839 37 37 38 38 public void clearSelections() { 39 39 40 40 } 41 41 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r24835 r24839 18 18 import oseam.Messages; 19 19 import oseam.dialogs.OSeaMAction; 20 import oseam.seamarks.MarkLat; 21 import oseam.seamarks.MarkSaw; 22 import oseam.seamarks.MarkCard; 23 import oseam.seamarks.MarkIsol; 20 24 import oseam.seamarks.MarkSpec; 21 25 import oseam.seamarks.MarkLight; 26 import oseam.seamarks.SeaMark.Cat; 22 27 23 28 public class PanelMain extends JPanel { … … 120 125 alType = new ActionListener() { 121 126 public void actionPerformed(java.awt.event.ActionEvent e) { 122 if (dlg. mark== null) {127 if (dlg.node == null) { 123 128 typeButtons.clearSelection(); 124 return;125 129 } 126 130 if (chanButton.isSelected()) { 131 if (!((dlg.mark instanceof MarkLat) || (dlg.mark instanceof MarkSaw))) { 132 dlg.mark = null; 133 clearIcons(); 134 } 127 135 chanButton.setBorderPainted(true); 128 136 panelChan.setVisible(true); … … 133 141 } 134 142 if (hazButton.isSelected()) { 143 if (!((dlg.mark instanceof MarkCard) || (dlg.mark instanceof MarkIsol))) { 144 dlg.mark = null; 145 clearIcons(); 146 } 135 147 hazButton.setBorderPainted(true); 136 148 panelHaz.setVisible(true); … … 141 153 } 142 154 if (specButton.isSelected()) { 143 if (!(dlg.mark instanceof MarkSpec)) 155 if (!(dlg.mark instanceof MarkSpec)) { 144 156 dlg.mark = new MarkSpec(dlg); 157 clearIcons(); 158 } 145 159 specButton.setBorderPainted(true); 146 160 panelSpec.setVisible(true); … … 151 165 } 152 166 if (lightsButton.isSelected()) { 153 if (!(dlg.mark instanceof MarkLight)) 167 if (!(dlg.mark instanceof MarkLight)) { 154 168 dlg.mark = new MarkLight(dlg); 169 clearIcons(); 170 } 155 171 lightsButton.setBorderPainted(true); 156 172 panelLights.setVisible(true); … … 235 251 miscButtons.clearSelection(); 236 252 alMisc.actionPerformed(null); 237 shapeIcon.setIcon(null);238 lightIcon.setIcon(null);239 topIcon.setIcon(null);240 reflIcon.setIcon(null);241 radarIcon.setIcon(null);242 fogIcon.setIcon(null);243 253 panelChan.clearSelections(); 244 254 panelHaz.clearSelections(); … … 249 259 panelRadar.clearSelections(); 250 260 panelLit.clearSelections(); 261 clearIcons(); 262 } 263 264 public void clearIcons() { 265 shapeIcon.setIcon(null); 266 lightIcon.setIcon(null); 267 topIcon.setIcon(null); 268 reflIcon.setIcon(null); 269 radarIcon.setIcon(null); 270 fogIcon.setIcon(null); 251 271 } 252 272 253 273 private JRadioButton getChanButton() { 254 274 if (chanButton == null) { 255 chanButton = new JRadioButton(new ImageIcon(getClass().getResource( 256 "/images/ChanButton.png"))); 275 chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png"))); 257 276 chanButton.setBounds(new Rectangle(0, 0, 62, 40)); 258 chanButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 259 2)); 277 chanButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 260 278 chanButton.setToolTipText(Messages.getString("ChanTip")); 261 279 } … … 265 283 private JRadioButton getHazButton() { 266 284 if (hazButton == null) { 267 hazButton = new JRadioButton(new ImageIcon(getClass().getResource( 268 "/images/HazButton.png"))); 285 hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png"))); 269 286 hazButton.setBounds(new Rectangle(0, 40, 62, 40)); 270 hazButton.setBorder(BorderFactory 271 .createLineBorder(Color.magenta, 2)); 287 hazButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 272 288 hazButton.setToolTipText(Messages.getString("HazTip")); 273 289 } … … 277 293 private JRadioButton getSpecButton() { 278 294 if (specButton == null) { 279 specButton = new JRadioButton(new ImageIcon(getClass().getResource( 280 "/images/SpecButton.png"))); 295 specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png"))); 281 296 specButton.setBounds(new Rectangle(0, 80, 62, 40)); 282 specButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 283 2)); 297 specButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 284 298 specButton.setToolTipText(Messages.getString("SpecTip")); 285 299 } … … 289 303 private JRadioButton getLightsButton() { 290 304 if (lightsButton == null) { 291 lightsButton = new JRadioButton(new ImageIcon(getClass() 292 .getResource("/images/LightsButton.png"))); 305 lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png"))); 293 306 lightsButton.setBounds(new Rectangle(0, 120, 62, 40)); 294 lightsButton.setBorder(BorderFactory.createLineBorder( 295 Color.magenta, 2)); 307 lightsButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 296 308 lightsButton.setToolTipText(Messages.getString("LightsTip")); 297 309 } … … 301 313 private JRadioButton getTopButton() { 302 314 if (topButton == null) { 303 topButton = new JRadioButton(new ImageIcon(getClass().getResource( 304 "/images/TopButton.png"))); 315 topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png"))); 305 316 topButton.setBounds(new Rectangle(0, 165, 34, 32)); 306 topButton.setBorder(BorderFactory 307 .createLineBorder(Color.magenta, 2)); 317 topButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 308 318 topButton.setToolTipText(Messages.getString("TopmarksTip")); 309 319 } … … 313 323 private JRadioButton getFogButton() { 314 324 if (fogButton == null) { 315 fogButton = new JRadioButton(new ImageIcon(getClass().getResource( 316 "/images/FogButton.png"))); 325 fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png"))); 317 326 fogButton.setBounds(new Rectangle(0, 205, 34, 32)); 318 fogButton.setBorder(BorderFactory 319 .createLineBorder(Color.magenta, 2)); 327 fogButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 320 328 fogButton.setToolTipText(Messages.getString("FogSignalsTip")); 321 329 } … … 325 333 private JRadioButton getRadarButton() { 326 334 if (radarButton == null) { 327 radarButton = new JRadioButton(new ImageIcon(getClass() 328 .getResource("/images/RadarButton.png"))); 335 radarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png"))); 329 336 radarButton.setBounds(new Rectangle(0, 245, 34, 32)); 330 radarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 331 2)); 337 radarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 332 338 radarButton.setToolTipText(Messages.getString("RadarTip")); 333 339 } … … 337 343 private JRadioButton getLitButton() { 338 344 if (litButton == null) { 339 litButton = new JRadioButton(new ImageIcon(getClass().getResource( 340 "/images/LitButton.png"))); 345 litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png"))); 341 346 litButton.setBounds(new Rectangle(0, 285, 34, 32)); 342 litButton.setBorder(BorderFactory 343 .createLineBorder(Color.magenta, 2)); 347 litButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 344 348 litButton.setToolTipText(Messages.getString("LitTip")); 345 349 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r24835 r24839 139 139 private JRadioButton getRegionAButton() { 140 140 if (regionAButton == null) { 141 regionAButton = new JRadioButton(new ImageIcon(getClass() 142 .getResource("/images/RegionAButton.png"))); 141 regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 143 142 regionAButton.setBounds(new Rectangle(0, 2, 34, 30)); 144 143 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 145 144 regionAButton.setToolTipText(Messages.getString("RegionATip")); 146 145 } … … 150 149 private JRadioButton getRegionBButton() { 151 150 if (regionBButton == null) { 152 regionBButton = new JRadioButton(new ImageIcon(getClass() 153 .getResource("/images/RegionBButton.png"))); 151 regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 154 152 regionBButton.setBounds(new Rectangle(0, 32, 34, 30)); 155 153 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 156 154 regionBButton.setToolTipText(Messages.getString("RegionBTip")); 157 155 } … … 161 159 private JRadioButton getPillarButton() { 162 160 if (pillarButton == null) { 163 pillarButton = new JRadioButton(new ImageIcon(getClass() 164 .getResource("/images/PillarButton.png"))); 161 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 165 162 pillarButton.setBounds(new Rectangle(0, 64, 34, 32)); 166 163 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 167 164 pillarButton.setToolTipText(Messages.getString("PillarTip")); 168 165 } … … 172 169 private JRadioButton getSparButton() { 173 170 if (sparButton == null) { 174 sparButton = new JRadioButton(new ImageIcon(getClass().getResource( 175 "/images/SparButton.png"))); 171 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 176 172 sparButton.setBounds(new Rectangle(0, 96, 34, 32)); 177 173 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 178 174 sparButton.setToolTipText(Messages.getString("SparTip")); 179 175 } … … 183 179 private JRadioButton getCanButton() { 184 180 if (canButton == null) { 185 canButton = new JRadioButton(new ImageIcon(getClass().getResource( 186 "/images/CanButton.png"))); 181 canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 187 182 canButton.setBounds(new Rectangle(0, 128, 34, 32)); 188 183 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 189 184 canButton.setToolTipText(Messages.getString("CanTip")); 190 185 } … … 194 189 private JRadioButton getFloatButton() { 195 190 if (floatButton == null) { 196 floatButton = new JRadioButton(new ImageIcon(getClass() 197 .getResource("/images/FloatButton.png"))); 191 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 198 192 floatButton.setBounds(new Rectangle(35, 0, 34, 32)); 199 193 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 200 194 floatButton.setToolTipText(Messages.getString("FloatTip")); 201 195 } … … 205 199 private JRadioButton getBeaconButton() { 206 200 if (beaconButton == null) { 207 beaconButton = new JRadioButton(new ImageIcon(getClass() 208 .getResource("/images/BeaconButton.png"))); 201 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 209 202 beaconButton.setBounds(new Rectangle(35, 32, 34, 32)); 210 203 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 211 204 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 212 205 } … … 216 209 private JRadioButton getTowerButton() { 217 210 if (towerButton == null) { 218 towerButton = new JRadioButton(new ImageIcon(getClass() 219 .getResource("/images/TowerButton.png"))); 211 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 220 212 towerButton.setBounds(new Rectangle(35, 64, 34, 32)); 221 213 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 222 214 towerButton.setToolTipText(Messages.getString("TowerTip")); 223 215 } … … 227 219 private JRadioButton getPerchButton() { 228 220 if (perchButton == null) { 229 perchButton = new JRadioButton(new ImageIcon(getClass() 230 .getResource("/images/PerchPButton.png"))); 221 perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png"))); 231 222 perchButton.setBounds(new Rectangle(35, 96, 34, 32)); 232 223 perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 233 224 perchButton.setToolTipText(Messages.getString("PerchTip")); 234 225 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefPort.java
r24835 r24839 128 128 private JRadioButton getRegionAButton() { 129 129 if (regionAButton == null) { 130 regionAButton = new JRadioButton(new ImageIcon(getClass() 131 .getResource("/images/RegionAButton.png"))); 130 regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 132 131 regionAButton.setBounds(new Rectangle(0, 2, 34, 30)); 133 132 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 134 133 regionAButton.setToolTipText(Messages.getString("RegionATip")); 135 134 } … … 139 138 private JRadioButton getRegionBButton() { 140 139 if (regionBButton == null) { 141 regionBButton = new JRadioButton(new ImageIcon(getClass() 142 .getResource("/images/RegionBButton.png"))); 140 regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 143 141 regionBButton.setBounds(new Rectangle(0, 32, 34, 30)); 144 142 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 145 143 regionBButton.setToolTipText(Messages.getString("RegionBTip")); 146 144 } … … 150 148 private JRadioButton getPillarButton() { 151 149 if (pillarButton == null) { 152 pillarButton = new JRadioButton(new ImageIcon(getClass() 153 .getResource("/images/PillarButton.png"))); 150 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 154 151 pillarButton.setBounds(new Rectangle(0, 64, 34, 32)); 155 152 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 156 153 pillarButton.setToolTipText(Messages.getString("PillarTip")); 157 154 } … … 161 158 private JRadioButton getSparButton() { 162 159 if (sparButton == null) { 163 sparButton = new JRadioButton(new ImageIcon(getClass().getResource( 164 "/images/SparButton.png"))); 160 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 165 161 sparButton.setBounds(new Rectangle(0, 96, 34, 32)); 166 162 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 167 163 sparButton.setToolTipText(Messages.getString("SparTip")); 168 164 } … … 172 168 private JRadioButton getCanButton() { 173 169 if (canButton == null) { 174 canButton = new JRadioButton(new ImageIcon(getClass().getResource( 175 "/images/CanButton.png"))); 170 canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 176 171 canButton.setBounds(new Rectangle(0, 128, 34, 32)); 177 172 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 178 173 canButton.setToolTipText(Messages.getString("CanTip")); 179 174 } … … 183 178 private JRadioButton getFloatButton() { 184 179 if (floatButton == null) { 185 floatButton = new JRadioButton(new ImageIcon(getClass() 186 .getResource("/images/FloatButton.png"))); 180 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 187 181 floatButton.setBounds(new Rectangle(35, 0, 34, 32)); 188 182 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 189 183 floatButton.setToolTipText(Messages.getString("FloatTip")); 190 184 } … … 194 188 private JRadioButton getBeaconButton() { 195 189 if (beaconButton == null) { 196 beaconButton = new JRadioButton(new ImageIcon(getClass() 197 .getResource("/images/BeaconButton.png"))); 190 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 198 191 beaconButton.setBounds(new Rectangle(35, 32, 34, 32)); 199 192 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 200 193 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 201 194 } … … 205 198 private JRadioButton getTowerButton() { 206 199 if (towerButton == null) { 207 towerButton = new JRadioButton(new ImageIcon(getClass() 208 .getResource("/images/TowerButton.png"))); 200 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 209 201 towerButton.setBounds(new Rectangle(35, 64, 34, 32)); 210 202 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 211 203 towerButton.setToolTipText(Messages.getString("TowerTip")); 212 204 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefStbd.java
r24835 r24839 128 128 private JRadioButton getRegionAButton() { 129 129 if (regionAButton == null) { 130 regionAButton = new JRadioButton(new ImageIcon(getClass() 131 .getResource("/images/RegionAButton.png"))); 130 regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 132 131 regionAButton.setBounds(new Rectangle(0, 2, 34, 30)); 133 132 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 134 133 regionAButton.setToolTipText(Messages.getString("RegionATip")); 135 134 } … … 139 138 private JRadioButton getRegionBButton() { 140 139 if (regionBButton == null) { 141 regionBButton = new JRadioButton(new ImageIcon(getClass() 142 .getResource("/images/RegionBButton.png"))); 140 regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 143 141 regionBButton.setBounds(new Rectangle(0, 32, 34, 30)); 144 142 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 145 143 regionBButton.setToolTipText(Messages.getString("RegionBTip")); 146 144 } … … 150 148 private JRadioButton getPillarButton() { 151 149 if (pillarButton == null) { 152 pillarButton = new JRadioButton(new ImageIcon(getClass() 153 .getResource("/images/PillarButton.png"))); 150 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 154 151 pillarButton.setBounds(new Rectangle(0, 64, 34, 32)); 155 152 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 156 153 pillarButton.setToolTipText(Messages.getString("PillarTip")); 157 154 } … … 161 158 private JRadioButton getSparButton() { 162 159 if (sparButton == null) { 163 sparButton = new JRadioButton(new ImageIcon(getClass().getResource( 164 "/images/SparButton.png"))); 160 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 165 161 sparButton.setBounds(new Rectangle(0, 96, 34, 32)); 166 162 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 167 163 sparButton.setToolTipText(Messages.getString("SparTip")); 168 164 } … … 172 168 private JRadioButton getConeButton() { 173 169 if (coneButton == null) { 174 coneButton = new JRadioButton(new ImageIcon(getClass().getResource( 175 "/images/ConeButton.png"))); 170 coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 176 171 coneButton.setBounds(new Rectangle(0, 128, 34, 32)); 177 172 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 178 173 coneButton.setToolTipText(Messages.getString("ConeTip")); 179 174 } … … 183 178 private JRadioButton getFloatButton() { 184 179 if (floatButton == null) { 185 floatButton = new JRadioButton(new ImageIcon(getClass() 186 .getResource("/images/FloatButton.png"))); 180 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 187 181 floatButton.setBounds(new Rectangle(35, 0, 34, 32)); 188 182 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 189 183 floatButton.setToolTipText(Messages.getString("FloatTip")); 190 184 } … … 194 188 private JRadioButton getBeaconButton() { 195 189 if (beaconButton == null) { 196 beaconButton = new JRadioButton(new ImageIcon(getClass() 197 .getResource("/images/BeaconButton.png"))); 190 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 198 191 beaconButton.setBounds(new Rectangle(35, 32, 34, 32)); 199 192 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 200 193 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 201 194 } … … 205 198 private JRadioButton getTowerButton() { 206 199 if (towerButton == null) { 207 towerButton = new JRadioButton(new ImageIcon(getClass() 208 .getResource("/images/TowerButton.png"))); 200 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 209 201 towerButton.setBounds(new Rectangle(35, 64, 34, 32)); 210 202 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 211 203 towerButton.setToolTipText(Messages.getString("TowerTip")); 212 204 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r24830 r24839 32 32 33 33 public void clearSelections() { 34 34 35 35 } 36 36 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSafeWater.java
r24835 r24839 100 100 private JRadioButton getPillarButton() { 101 101 if (pillarButton == null) { 102 pillarButton = new JRadioButton(new ImageIcon(getClass() 103 .getResource("/images/PillarButton.png"))); 102 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 104 103 pillarButton.setBounds(new Rectangle(0, 0, 34, 32)); 105 104 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 106 105 pillarButton.setToolTipText(Messages.getString("PillarTip")); 107 106 } … … 111 110 private JRadioButton getSparButton() { 112 111 if (sparButton == null) { 113 sparButton = new JRadioButton(new ImageIcon(getClass().getResource( 114 "/images/SparButton.png"))); 112 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 115 113 sparButton.setBounds(new Rectangle(0, 32, 34, 32)); 116 114 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 117 115 sparButton.setToolTipText(Messages.getString("SparTip")); 118 116 } … … 122 120 private JRadioButton getSphereButton() { 123 121 if (sphereButton == null) { 124 sphereButton = new JRadioButton(new ImageIcon(getClass() 125 .getResource("/images/SphereButton.png"))); 122 sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png"))); 126 123 sphereButton.setBounds(new Rectangle(0, 64, 34, 32)); 127 124 sphereButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 128 125 sphereButton.setToolTipText(Messages.getString("SphereTip")); 129 126 } … … 133 130 private JRadioButton getBarrelButton() { 134 131 if (barrelButton == null) { 135 barrelButton = new JRadioButton(new ImageIcon(getClass() 136 .getResource("/images/BarrelButton.png"))); 132 barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png"))); 137 133 barrelButton.setBounds(new Rectangle(0, 96, 34, 32)); 138 134 barrelButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 139 135 barrelButton.setToolTipText(Messages.getString("BarrelTip")); 140 136 } … … 144 140 private JRadioButton getFloatButton() { 145 141 if (floatButton == null) { 146 floatButton = new JRadioButton(new ImageIcon(getClass() 147 .getResource("/images/FloatButton.png"))); 142 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 148 143 floatButton.setBounds(new Rectangle(0, 128, 34, 32)); 149 144 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 150 145 floatButton.setToolTipText(Messages.getString("FloatTip")); 151 146 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r24830 r24839 81 81 beaconButton.setBorderPainted(beaconButton.isSelected()); 82 82 towerButton.setBorderPainted(towerButton.isSelected()); 83 if (dlg.mark != null) dlg.mark.paintSign(); 83 if (dlg.mark != null) 84 dlg.mark.paintSign(); 84 85 } 85 86 }; … … 98 99 99 100 public void clearSelections() { 100 101 101 102 } 102 103 103 104 private JRadioButton getPillarButton() { 104 105 if (pillarButton == null) { 105 pillarButton = new JRadioButton(new ImageIcon(getClass() 106 .getResource("/images/PillarButton.png"))); 106 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 107 107 pillarButton.setBounds(new Rectangle(55, 0, 34, 32)); 108 108 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 109 109 pillarButton.setToolTipText(Messages.getString("PillarTip")); 110 110 } … … 114 114 private JRadioButton getSparButton() { 115 115 if (sparButton == null) { 116 sparButton = new JRadioButton(new ImageIcon(getClass().getResource( 117 "/images/SparButton.png"))); 116 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 118 117 sparButton.setBounds(new Rectangle(55, 32, 34, 32)); 119 118 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 120 119 sparButton.setToolTipText(Messages.getString("SparTip")); 121 120 } … … 125 124 private JRadioButton getCanButton() { 126 125 if (canButton == null) { 127 canButton = new JRadioButton(new ImageIcon(getClass().getResource( 128 "/images/CanButton.png"))); 126 canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png"))); 129 127 canButton.setBounds(new Rectangle(55, 64, 34, 32)); 130 128 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 131 129 canButton.setToolTipText(Messages.getString("CanTip")); 132 130 } … … 136 134 private JRadioButton getConeButton() { 137 135 if (coneButton == null) { 138 coneButton = new JRadioButton(new ImageIcon(getClass().getResource( 139 "/images/ConeButton.png"))); 136 coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 140 137 coneButton.setBounds(new Rectangle(55, 96, 34, 32)); 141 138 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 142 139 coneButton.setToolTipText(Messages.getString("ConeTip")); 143 140 } … … 147 144 private JRadioButton getSphereButton() { 148 145 if (sphereButton == null) { 149 sphereButton = new JRadioButton(new ImageIcon(getClass() 150 .getResource("/images/SphereButton.png"))); 146 sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png"))); 151 147 sphereButton.setBounds(new Rectangle(55, 128, 34, 32)); 152 148 sphereButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 153 149 sphereButton.setToolTipText(Messages.getString("SphereTip")); 154 150 } … … 158 154 private JRadioButton getBarrelButton() { 159 155 if (barrelButton == null) { 160 barrelButton = new JRadioButton(new ImageIcon(getClass() 161 .getResource("/images/BarrelButton.png"))); 156 barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png"))); 162 157 barrelButton.setBounds(new Rectangle(90, 0, 34, 32)); 163 158 barrelButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 164 159 barrelButton.setToolTipText(Messages.getString("BarrelTip")); 165 160 } … … 169 164 private JRadioButton getSuperButton() { 170 165 if (superButton == null) { 171 superButton = new JRadioButton(new ImageIcon(getClass() 172 .getResource("/images/SuperButton.png"))); 166 superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png"))); 173 167 superButton.setBounds(new Rectangle(90, 32, 34, 32)); 174 168 superButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 175 169 superButton.setToolTipText(Messages.getString("SuperTip")); 176 170 } … … 180 174 private JRadioButton getFloatButton() { 181 175 if (floatButton == null) { 182 floatButton = new JRadioButton(new ImageIcon(getClass() 183 .getResource("/images/FloatButton.png"))); 176 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 184 177 floatButton.setBounds(new Rectangle(90, 64, 34, 32)); 185 178 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 186 179 floatButton.setToolTipText(Messages.getString("FloatTip")); 187 180 } … … 191 184 private JRadioButton getBeaconButton() { 192 185 if (beaconButton == null) { 193 beaconButton = new JRadioButton(new ImageIcon(getClass() 194 .getResource("/images/BeaconButton.png"))); 186 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 195 187 beaconButton.setBounds(new Rectangle(90, 96, 34, 32)); 196 188 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 197 189 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 198 190 } … … 202 194 private JRadioButton getTowerButton() { 203 195 if (towerButton == null) { 204 towerButton = new JRadioButton(new ImageIcon(getClass() 205 .getResource("/images/TowerButton.png"))); 196 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 206 197 towerButton.setBounds(new Rectangle(90, 128, 34, 32)); 207 198 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 208 199 towerButton.setToolTipText(Messages.getString("TowerTip")); 209 200 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r24835 r24839 138 138 private JRadioButton getRegionAButton() { 139 139 if (regionAButton == null) { 140 regionAButton = new JRadioButton(new ImageIcon(getClass() 141 .getResource("/images/RegionAButton.png"))); 140 regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 142 141 regionAButton.setBounds(new Rectangle(0, 2, 34, 30)); 143 142 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 144 143 regionAButton.setToolTipText(Messages.getString("RegionATip")); 145 144 } … … 149 148 private JRadioButton getRegionBButton() { 150 149 if (regionBButton == null) { 151 regionBButton = new JRadioButton(new ImageIcon(getClass() 152 .getResource("/images/RegionBButton.png"))); 150 regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 153 151 regionBButton.setBounds(new Rectangle(0, 32, 34, 30)); 154 152 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 155 153 regionBButton.setToolTipText(Messages.getString("RegionBTip")); 156 154 } … … 160 158 private JRadioButton getPillarButton() { 161 159 if (pillarButton == null) { 162 pillarButton = new JRadioButton(new ImageIcon(getClass() 163 .getResource("/images/PillarButton.png"))); 160 pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); 164 161 pillarButton.setBounds(new Rectangle(0, 64, 34, 32)); 165 162 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 166 163 pillarButton.setToolTipText(Messages.getString("PillarTip")); 167 164 } … … 171 168 private JRadioButton getSparButton() { 172 169 if (sparButton == null) { 173 sparButton = new JRadioButton(new ImageIcon(getClass().getResource( 174 "/images/SparButton.png"))); 170 sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png"))); 175 171 sparButton.setBounds(new Rectangle(0, 96, 34, 32)); 176 172 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 177 173 sparButton.setToolTipText(Messages.getString("SparTip")); 178 174 } … … 182 178 private JRadioButton getConeButton() { 183 179 if (coneButton == null) { 184 coneButton = new JRadioButton(new ImageIcon(getClass().getResource( 185 "/images/ConeButton.png"))); 180 coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png"))); 186 181 coneButton.setBounds(new Rectangle(0, 128, 34, 32)); 187 182 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 188 183 coneButton.setToolTipText(Messages.getString("ConeTip")); 189 184 } … … 193 188 private JRadioButton getFloatButton() { 194 189 if (floatButton == null) { 195 floatButton = new JRadioButton(new ImageIcon(getClass() 196 .getResource("/images/FloatButton.png"))); 190 floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 197 191 floatButton.setBounds(new Rectangle(35, 0, 34, 32)); 198 192 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 199 193 floatButton.setToolTipText(Messages.getString("FloatTip")); 200 194 } … … 204 198 private JRadioButton getBeaconButton() { 205 199 if (beaconButton == null) { 206 beaconButton = new JRadioButton(new ImageIcon(getClass() 207 .getResource("/images/BeaconButton.png"))); 200 beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png"))); 208 201 beaconButton.setBounds(new Rectangle(35, 32, 34, 32)); 209 202 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 210 203 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 211 204 } … … 215 208 private JRadioButton getTowerButton() { 216 209 if (towerButton == null) { 217 towerButton = new JRadioButton(new ImageIcon(getClass() 218 .getResource("/images/TowerButton.png"))); 210 towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 219 211 towerButton.setBounds(new Rectangle(35, 64, 34, 32)); 220 212 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 221 213 towerButton.setToolTipText(Messages.getString("TowerTip")); 222 214 } … … 226 218 private JRadioButton getPerchButton() { 227 219 if (perchButton == null) { 228 perchButton = new JRadioButton(new ImageIcon(getClass() 229 .getResource("/images/PerchSButton.png"))); 220 perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png"))); 230 221 perchButton.setBounds(new Rectangle(35, 96, 34, 32)); 231 222 perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 232 223 perchButton.setToolTipText(Messages.getString("PerchTip")); 233 224 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r24830 r24839 132 132 private JRadioButton getNoTopButton() { 133 133 if (noTopButton == null) { 134 noTopButton = new JRadioButton(new ImageIcon(getClass() 135 .getResource("/images/NoTopButton.png"))); 134 noTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NoTopButton.png"))); 136 135 noTopButton.setBounds(new Rectangle(40, 5, 27, 27)); 137 136 noTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 138 137 noTopButton.setToolTipText(Messages.getString("NoTopTip")); 139 138 } … … 143 142 private JRadioButton getCanTopButton() { 144 143 if (canTopButton == null) { 145 canTopButton = new JRadioButton(new ImageIcon(getClass() 146 .getResource("/images/CanTopButton.png"))); 144 canTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanTopButton.png"))); 147 145 canTopButton.setBounds(new Rectangle(70, 5, 27, 27)); 148 146 canTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 149 147 canTopButton.setToolTipText(Messages.getString("CanTopTip")); 150 148 } … … 154 152 private JRadioButton getConeTopButton() { 155 153 if (coneTopButton == null) { 156 coneTopButton = new JRadioButton(new ImageIcon(getClass() 157 .getResource("/images/ConeTopButton.png"))); 154 coneTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeTopButton.png"))); 158 155 coneTopButton.setBounds(new Rectangle(100, 5, 27, 27)); 159 156 coneTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 165 162 private JRadioButton getSphereTopButton() { 166 163 if (sphereTopButton == null) { 167 sphereTopButton = new JRadioButton(new ImageIcon(getClass() 168 .getResource("/images/SphereTopButton.png"))); 164 sphereTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereTopButton.png"))); 169 165 sphereTopButton.setBounds(new Rectangle(130, 5, 27, 27)); 170 166 sphereTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 176 172 private JRadioButton getXTopButton() { 177 173 if (XTopButton == null) { 178 XTopButton = new JRadioButton(new ImageIcon(getClass() 179 .getResource("/images/XTopButton.png"))); 174 XTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/XTopButton.png"))); 180 175 XTopButton.setBounds(new Rectangle(160, 5, 27, 27)); 181 176 XTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 187 182 private JRadioButton getNorthTopButton() { 188 183 if (northTopButton == null) { 189 northTopButton = new JRadioButton(new ImageIcon(getClass() 190 .getResource("/images/NorthTopButton.png"))); 184 northTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NorthTopButton.png"))); 191 185 northTopButton.setBounds(new Rectangle(40, 35, 27, 27)); 192 186 northTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 193 187 northTopButton.setToolTipText(Messages.getString("NorthTopTip")); 194 188 } … … 198 192 private JRadioButton getSouthTopButton() { 199 193 if (southTopButton == null) { 200 southTopButton = new JRadioButton(new ImageIcon(getClass() 201 .getResource("/images/SouthTopButton.png"))); 194 southTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SouthTopButton.png"))); 202 195 southTopButton.setBounds(new Rectangle(70, 35, 27, 27)); 203 196 southTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 204 197 southTopButton.setToolTipText(Messages.getString("SouthTopTip")); 205 198 } … … 209 202 private JRadioButton getEastTopButton() { 210 203 if (eastTopButton == null) { 211 eastTopButton = new JRadioButton(new ImageIcon(getClass() 212 .getResource("/images/EastTopButton.png"))); 204 eastTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/EastTopButton.png"))); 213 205 eastTopButton.setBounds(new Rectangle(100, 35, 27, 27)); 214 206 eastTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 220 212 private JRadioButton getWestTopButton() { 221 213 if (westTopButton == null) { 222 westTopButton = new JRadioButton(new ImageIcon(getClass() 223 .getResource("/images/WestTopButton.png"))); 214 westTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WestTopButton.png"))); 224 215 westTopButton.setBounds(new Rectangle(130, 35, 27, 27)); 225 216 westTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 231 222 private JRadioButton getSpheres2TopButton() { 232 223 if (spheres2TopButton == null) { 233 spheres2TopButton = new JRadioButton(new ImageIcon(getClass() 234 .getResource("/images/Spheres2TopButton.png"))); 224 spheres2TopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/Spheres2TopButton.png"))); 235 225 spheres2TopButton.setBounds(new Rectangle(160, 35, 27, 27)); 236 226 spheres2TopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 242 232 private JRadioButton getBoardDayButton() { 243 233 if (boardDayButton == null) { 244 boardDayButton = new JRadioButton(new ImageIcon(getClass() 245 .getResource("/images/BoardDayButton.png"))); 234 boardDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BoardDayButton.png"))); 246 235 boardDayButton.setBounds(new Rectangle(40, 65, 27, 27)); 247 236 boardDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 253 242 private JRadioButton getDiamondDayButton() { 254 243 if (diamondDayButton == null) { 255 diamondDayButton = new JRadioButton(new ImageIcon(getClass() 256 .getResource("/images/DiamondDayButton.png"))); 244 diamondDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png"))); 257 245 diamondDayButton.setBounds(new Rectangle(70, 65, 27, 27)); 258 246 diamondDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 264 252 private JRadioButton getTriangleDayButton() { 265 253 if (triangleDayButton == null) { 266 triangleDayButton = new JRadioButton(new ImageIcon(getClass() 267 .getResource("/images/TriangleDayButton.png"))); 254 triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png"))); 268 255 triangleDayButton.setBounds(new Rectangle(100, 65, 27, 27)); 269 256 triangleDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 275 262 private JRadioButton getTriangleInvDayButton() { 276 263 if (triangleInvDayButton == null) { 277 triangleInvDayButton = new JRadioButton(new ImageIcon(getClass() 278 .getResource("/images/TriangleInvDayButton.png"))); 264 triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png"))); 279 265 triangleInvDayButton.setBounds(new Rectangle(130, 65, 27, 27)); 280 266 triangleInvDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 286 272 private JRadioButton getSquareDayButton() { 287 273 if (squareDayButton == null) { 288 squareDayButton = new JRadioButton(new ImageIcon(getClass() 289 .getResource("/images/SquareDayButton.png"))); 274 squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png"))); 290 275 squareDayButton.setBounds(new Rectangle(160, 65, 27, 27)); 291 276 squareDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 297 282 private JRadioButton getMooringTopButton() { 298 283 if (mooringTopButton == null) { 299 mooringTopButton = new JRadioButton(new ImageIcon(getClass() 300 .getResource("/images/MooringTopButton.png"))); 284 mooringTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MooringTopButton.png"))); 301 285 mooringTopButton.setBounds(new Rectangle(40, 95, 27, 27)); 302 286 mooringTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24830 r24839 15 15 super(dia); 16 16 } 17 17 18 18 public void parseMark() { 19 19 String str; … … 81 81 } 82 82 } else if (keys.containsKey("seamark:beacon_cardinal:shape")) { 83 str = keys.get("seamark:beacon_cardinal:shape"); 84 if (str.equals("tower")) { 85 dlg.panelMain.panelHaz.towerButton.doClick(); 86 } else { 87 dlg.panelMain.panelHaz.beaconButton.doClick(); 88 } 89 } else if (keys.containsKey("seamark:type") 90 && (keys.get("seamark:type").equals("light_float"))) { 83 str = keys.get("seamark:beacon_cardinal:shape"); 84 if (str.equals("tower")) { 85 dlg.panelMain.panelHaz.towerButton.doClick(); 86 } else { 87 dlg.panelMain.panelHaz.beaconButton.doClick(); 88 } 89 } else if (keys.containsKey("seamark:type") && (keys.get("seamark:type").equals("light_float"))) { 91 90 dlg.panelMain.panelHaz.floatButton.doClick(); 92 91 } … … 106 105 107 106 public void paintSign() { 108 /* 109 if (dlg.paintlock) return; super.paintSign(); 110 */ 111 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) { 112 String image = "/images/Cardinal"; 113 switch (getShape()) { 114 case PILLAR: 115 image += "_Pillar"; 116 break; 117 case SPAR: 118 image += "_Spar"; 119 break; 120 case BEACON: 121 image += "_Beacon"; 122 break; 123 case TOWER: 124 image += "_Tower"; 125 break; 126 case FLOAT: 127 image += "_Float"; 128 break; 129 default: 130 return; 131 } 132 133 switch (getCategory()) { 134 case CARD_NORTH: 135 image += "_North"; 136 break; 137 case CARD_EAST: 138 image += "_East"; 139 break; 140 case CARD_SOUTH: 141 image += "_South"; 142 break; 143 case CARD_WEST: 144 image += "_West"; 145 break; 146 default: 147 return; 148 } 149 150 if (!image.equals("/images/Cardinal")) { 151 image += ".png"; 152 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 153 .getResource(image))); 154 } else 155 dlg.panelMain.shapeIcon.setIcon(null); 156 } 107 String image = "/images/Cardinal"; 108 switch (getShape()) { 109 case PILLAR: 110 image += "_Pillar"; 111 break; 112 case SPAR: 113 image += "_Spar"; 114 break; 115 case BEACON: 116 image += "_Beacon"; 117 break; 118 case TOWER: 119 image += "_Tower"; 120 break; 121 case FLOAT: 122 image += "_Float"; 123 break; 124 default: 125 dlg.panelMain.shapeIcon.setIcon(null); 126 return; 127 } 128 129 switch (getCategory()) { 130 case CARD_NORTH: 131 image += "_North"; 132 break; 133 case CARD_EAST: 134 image += "_East"; 135 break; 136 case CARD_SOUTH: 137 image += "_South"; 138 break; 139 case CARD_WEST: 140 image += "_West"; 141 break; 142 default: 143 dlg.panelMain.shapeIcon.setIcon(null); 144 return; 145 } 146 147 image += ".png"; 148 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 149 super.paintSign(); 157 150 } 158 151 … … 166 159 case PILLAR: 167 160 super.saveSign("buoy_cardinal"); 168 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 169 "seamark:buoy_cardinal:shape", "pillar")); 161 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "pillar")); 170 162 break; 171 163 case SPAR: 172 164 super.saveSign("buoy_cardinal"); 173 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 174 "seamark:buoy_cardinal:shape", "spar")); 165 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "spar")); 175 166 break; 176 167 case BEACON: … … 179 170 case TOWER: 180 171 super.saveSign("beacon_cardinal"); 181 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 182 "seamark:beacon_cardinal:shape", "tower")); 172 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:shape", "tower")); 183 173 break; 184 174 case FLOAT: … … 193 183 switch (getCategory()) { 194 184 case CARD_NORTH: 195 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 196 "seamark:buoy_cardinal:category", "north")); 197 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 198 "seamark:buoy_cardinal:colour", "black;yellow")); 185 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "north")); 186 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "black;yellow")); 199 187 shape = "2 cones up"; 200 188 break; 201 189 202 190 case CARD_EAST: 203 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 204 "seamark:buoy_cardinal:category", "east")); 205 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 206 "seamark:buoy_cardinal:colour", "black;yellow;black")); 191 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "east")); 192 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "black;yellow;black")); 207 193 shape = "2 cones base together"; 208 194 break; 209 195 210 196 case CARD_SOUTH: 211 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 212 "seamark:buoy_cardinal:category", "south")); 213 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 214 "seamark:buoy_cardinal:colour", "yellow;black")); 197 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "south")); 198 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "yellow;black")); 215 199 shape = "2 cones down"; 216 200 break; 217 201 218 202 case CARD_WEST: 219 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 220 "seamark:buoy_cardinal:category", "west")); 221 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 222 "seamark:buoy_cardinal:colour", "yellow;black;yellow")); 203 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "west")); 204 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "yellow;black;yellow")); 223 205 shape = "2 cones point together"; 224 206 break; 225 207 } 226 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 227 "seamark:buoy_cardinal:colour_pattern", 228 "horizontal stripes")); 229 break; 230 208 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour_pattern", "horizontal stripes")); 209 break; 210 231 211 case BEACON: 232 212 case TOWER: 233 213 switch (getCategory()) { 234 214 case CARD_NORTH: 235 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 236 "seamark:beacon_cardinal:category", "north")); 237 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 238 "seamark:beacon_cardinal:colour", "black;yellow")); 215 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "north")); 216 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "black;yellow")); 239 217 shape = "2 cones up"; 240 218 break; 241 219 242 220 case CARD_EAST: 243 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 244 "seamark:beacon_cardinal:category", "east")); 245 Main.main.undoRedo 246 .add(new ChangePropertyCommand(dlg.node, 247 "seamark:beacon_cardinal:colour", 248 "black;yellow;black")); 221 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "east")); 222 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "black;yellow;black")); 249 223 shape = "2 cones base together"; 250 224 break; 251 225 252 226 case CARD_SOUTH: 253 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 254 "seamark:beacon_cardinal:category", "south")); 255 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 256 "seamark:beacon_cardinal:colour", "yellow;black")); 227 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "south")); 228 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "yellow;black")); 257 229 shape = "2 cones down"; 258 230 break; 259 231 260 232 case CARD_WEST: 261 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 262 "seamark:beacon_cardinal:category", "west")); 263 Main.main.undoRedo 264 .add(new ChangePropertyCommand(dlg.node, 265 "seamark:beacon_cardinal:colour", 266 "yellow;black;yellow")); 233 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "west")); 234 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "yellow;black;yellow")); 267 235 shape = "2 cones point together"; 268 236 break; 269 237 } 270 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 271 "seamark:beacon_cardinal:colour_pattern", 272 "horizontal stripes")); 273 break; 274 238 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour_pattern", "horizontal stripes")); 239 break; 240 275 241 case FLOAT: 276 242 switch (getCategory()) { 277 243 case CARD_NORTH: 278 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 279 "seamark:light_float:colour", "black;yellow")); 244 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;yellow")); 280 245 shape = "2 cones up"; 281 246 break; 282 247 283 248 case CARD_EAST: 284 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 285 "seamark:light_float:colour", "black;yellow;black")); 249 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;yellow;black")); 286 250 shape = "2 cones base together"; 287 251 break; 288 252 289 253 case CARD_SOUTH: 290 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 291 "seamark:light_float:colour", "yellow;black")); 254 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow;black")); 292 255 shape = "2 cones down"; 293 256 break; 294 257 295 258 case CARD_WEST: 296 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 297 "seamark:light_float:colour", "yellow;black;yellow")); 259 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow;black;yellow")); 298 260 shape = "2 cones point together"; 299 261 break; 300 262 } 301 Main.main.undoRedo 302 .add(new ChangePropertyCommand(dlg.node, 303 "seamark:light_float:colour_pattern", 304 "horizontal stripes")); 263 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes")); 305 264 break; 306 265 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24830 r24839 15 15 super(dia); 16 16 } 17 17 18 18 public void parseMark() { 19 19 … … 50 50 } 51 51 } else if (keys.containsKey("seamark:beacon_isolated_danger:shape")) { 52 str = keys.get("seamark:beacon_isolated_danger:shape"); 53 if (str.equals("tower")) { 54 dlg.panelMain.panelHaz.towerButton.doClick(); 55 } else { 56 dlg.panelMain.panelHaz.beaconButton.doClick(); 57 } 58 } else if (keys.containsKey("seamark:type") 59 && (keys.get("seamark:type").equals("light_float"))) { 52 str = keys.get("seamark:beacon_isolated_danger:shape"); 53 if (str.equals("tower")) { 54 dlg.panelMain.panelHaz.towerButton.doClick(); 55 } else { 56 dlg.panelMain.panelHaz.beaconButton.doClick(); 57 } 58 } else if (keys.containsKey("seamark:type") && (keys.get("seamark:type").equals("light_float"))) { 60 59 dlg.panelMain.panelHaz.floatButton.doClick(); 61 60 } … … 64 63 parseFogRadar(keys); 65 64 66 //dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());67 //dlg.tfM01Name.setText(getName());68 //dlg.cM01TopMark.setSelected(hasTopMark());65 // dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 66 // dlg.tfM01Name.setText(getName()); 67 // dlg.cM01TopMark.setSelected(hasTopMark()); 69 68 } 70 69 … … 74 73 75 74 public void paintSign() { 76 /* if (dlg.paintlock) 77 78 79 super.paintSign();80 */75 /* 76 * if (dlg.paintlock) return; 77 * 78 * super.paintSign(); 79 */ 81 80 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) { 82 81 … … 104 103 if (!image.equals("/images/Cardinal")) { 105 104 image += ".png"; 106 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 107 .getResource(image))); 105 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 108 106 } else 109 107 dlg.panelMain.shapeIcon.setIcon(null); … … 120 118 case PILLAR: 121 119 super.saveSign("buoy_isolated_danger"); 122 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 123 "seamark:buoy_isolated_danger:shape", "pillar")); 120 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "pillar")); 124 121 break; 125 122 case SPAR: 126 123 super.saveSign("buoy_isolated_danger"); 127 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 128 "seamark:buoy_isolated_danger:shape", "spar")); 124 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "spar")); 129 125 break; 130 126 case BEACON: … … 133 129 case TOWER: 134 130 super.saveSign("beacon_isolated_danger"); 135 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 136 "seamark:beacon_isolated_danger:shape", "tower")); 131 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:shape", "tower")); 137 132 break; 138 133 case FLOAT: … … 145 140 case PILLAR: 146 141 case SPAR: 147 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 148 "seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes")); 149 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 150 "seamark:buoy_isolated_danger:colour", "black;red;black")); 142 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:colour_pattern", 143 "horizontal stripes")); 144 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:colour", "black;red;black")); 151 145 break; 152 146 case BEACON: 153 147 case TOWER: 154 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 155 "seamark:beacon_isolated_danger:colour_pattern", 148 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:colour_pattern", 156 149 "horizontal stripes")); 157 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 158 "seamark:beacon_isolated_danger:colour", "black;red;black")); 150 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:colour", "black;red;black")); 159 151 break; 160 152 case FLOAT: 161 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 162 "seamark:light_float:colour_pattern", "horizontal stripes")); 163 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 164 "seamark:light_float:colour", "black;red;black")); 153 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes")); 154 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;red;black")); 165 155 break; 166 156 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24835 r24839 14 14 super(dia); 15 15 } 16 16 17 17 public void parseMark() { 18 18 … … 56 56 if (keys.containsKey("seamark:topmark:shape")) { 57 57 top = keys.get("seamark:topmark:shape"); 58 //setTopMark(true);58 // setTopMark(true); 59 59 } 60 60 if (keys.containsKey("seamark:topmark:colour")) { 61 if (col.isEmpty()) col = keys.get("seamark:topmark:colour"); 62 // setTopMark(true); 61 if (col.isEmpty()) 62 col = keys.get("seamark:topmark:colour"); 63 // setTopMark(true); 63 64 } 64 65 } 65 66 66 67 if (col.isEmpty()) { 67 68 if (keys.containsKey("seamark:light:colour")) … … 70 71 71 72 /* 72 if (cat.isEmpty()) { 73 if (col.equals("red")) { 74 setColour(RED); 75 if (top.equals("cylinder")) { 76 setBuoyIndex(PORT_HAND); 77 setRegion(IALA_A); 78 } else if (top.equals("cone, point up")) { 79 setBuoyIndex(STARBOARD_HAND); 80 setRegion(IALA_B); 81 } else { 82 if (getRegion() == IALA_A) 83 setBuoyIndex(PORT_HAND); 84 else 85 setBuoyIndex(STARBOARD_HAND); 86 } 87 } else if (col.equals("green")) { 88 setColour(GREEN); 89 if (top.equals("cone, point up")) { 90 setBuoyIndex(STARBOARD_HAND); 91 setRegion(IALA_A); 92 } else if (top.equals("cylinder")) { 93 setBuoyIndex(PORT_HAND); 94 setRegion(IALA_B); 95 } else { 96 if (getRegion() == IALA_A) 97 setBuoyIndex(STARBOARD_HAND); 98 else 99 setBuoyIndex(PORT_HAND); 100 } 101 } else if (col.equals("red;green;red")) { 102 setColour(RED_GREEN_RED); 103 if (top.equals("cylinder")) { 104 setBuoyIndex(PREF_PORT_HAND); 105 setRegion(IALA_A); 106 } else if (top.equals("cone, point up")) { 107 setBuoyIndex(PREF_STARBOARD_HAND); 108 setRegion(IALA_B); 109 } else { 110 if (getRegion() == IALA_A) 111 setBuoyIndex(PREF_PORT_HAND); 112 else 113 setBuoyIndex(PREF_STARBOARD_HAND); 114 } 115 } else if (col.equals("green;red;green")) { 116 setColour(GREEN_RED_GREEN); 117 if (top.equals("cone, point up")) { 118 setBuoyIndex(PREF_STARBOARD_HAND); 119 setRegion(IALA_A); 120 } else if (top.equals("cylinder")) { 121 setBuoyIndex(PREF_PORT_HAND); 122 setRegion(IALA_B); 123 } else { 124 if (getRegion() == IALA_A) 125 setBuoyIndex(PREF_STARBOARD_HAND); 126 else 127 setBuoyIndex(PREF_PORT_HAND); 128 } 129 } 130 } else if (cat.equals("port")) { 131 132 setBuoyIndex(PORT_HAND); 133 134 if (col.equals("red")) { 135 setRegion(IALA_A); 136 setColour(RED); 137 } else if (col.equals("green")) { 138 setRegion(IALA_B); 139 setColour(GREEN); 140 } else { 141 if (getRegion() == IALA_A) 142 setColour(RED); 143 else 144 setColour(GREEN); 145 } 146 } else if (cat.equals("starboard")) { 147 148 setBuoyIndex(STARBOARD_HAND); 149 150 if (col.equals("green")) { 151 setRegion(IALA_A); 152 setColour(GREEN); 153 } else if (col.equals("red")) { 154 setRegion(IALA_B); 155 setColour(RED); 156 } else { 157 if (getRegion() == IALA_A) 158 setColour(GREEN); 159 else 160 setColour(RED); 161 } 162 } else if (cat.equals("preferred_channel_port")) { 163 164 setBuoyIndex(PREF_PORT_HAND); 165 166 if (col.equals("red;green;red")) { 167 setRegion(IALA_A); 168 setColour(RED_GREEN_RED); 169 } else if (col.equals("green;red;green")) { 170 setRegion(IALA_B); 171 setColour(GREEN_RED_GREEN); 172 } else { 173 if (getRegion() == IALA_A) 174 setColour(RED_GREEN_RED); 175 else 176 setColour(GREEN_RED_GREEN); 177 } 178 179 } else if (cat.equals("preferred_channel_starboard")) { 180 181 setBuoyIndex(PREF_STARBOARD_HAND); 182 183 if (col.equals("green;red;green")) { 184 setRegion(IALA_A); 185 setColour(GREEN_RED_GREEN); 186 } else if (col.equals("red;green;red")) { 187 setRegion(IALA_B); 188 setColour(RED_GREEN_RED); 189 } else { 190 if (getRegion() == IALA_A) 191 setColour(GREEN_RED_GREEN); 192 else 193 setColour(RED_GREEN_RED); 194 } 195 } 196 197 if (keys.containsKey("seamark:buoy_lateral:shape")) { 198 str = keys.get("seamark:buoy_lateral:shape"); 199 200 switch (getBuoyIndex()) { 201 case PORT_HAND: 202 if (str.equals("can")) 203 setStyleIndex(CAN); 204 else if (str.equals("pillar")) 205 setStyleIndex(PILLAR); 206 else if (str.equals("spar")) 207 setStyleIndex(SPAR); 208 break; 209 210 case PREF_PORT_HAND: 211 if (str.equals("can")) 212 setStyleIndex(CAN); 213 else if (str.equals("pillar")) 214 setStyleIndex(PILLAR); 215 else if (str.equals("spar")) 216 setStyleIndex(SPAR); 217 break; 218 219 case STARBOARD_HAND: 220 if (str.equals("conical")) 221 setStyleIndex(CONE); 222 else if (str.equals("pillar")) 223 setStyleIndex(PILLAR); 224 else if (str.equals("spar")) 225 setStyleIndex(SPAR); 226 break; 227 228 case PREF_STARBOARD_HAND: 229 if (str.equals("conical")) 230 setStyleIndex(CONE); 231 else if (str.equals("pillar")) 232 setStyleIndex(PILLAR); 233 else if (str.equals("spar")) 234 setStyleIndex(SPAR); 235 break; 236 } 237 } else if (keys.containsKey("seamark:beacon_lateral:shape")) { 238 str = keys.get("seamark:beacon_lateral:shape"); 239 if (str.equals("tower")) 240 setStyleIndex(TOWER); 241 else if (str.equals("perch")) 242 setStyleIndex(PERCH); 243 else 244 setStyleIndex(BEACON); 245 } else if (keys.containsKey("seamark:type") 246 && (keys.get("seamark:type").equals("beacon_lateral"))) { 247 setStyleIndex(BEACON); 248 } else if (keys.containsKey("seamark:type") 249 && (keys.get("seamark:type").equals("light_float"))) { 250 setStyleIndex(FLOAT); 251 } 252 253 parseLights(keys); 254 parseFogRadar(keys); 255 setLightColour(); 256 257 */ } 73 * if (cat.isEmpty()) { if (col.equals("red")) { setColour(RED); if 74 * (top.equals("cylinder")) { setBuoyIndex(PORT_HAND); setRegion(IALA_A); } 75 * else if (top.equals("cone, point up")) { setBuoyIndex(STARBOARD_HAND); 76 * setRegion(IALA_B); } else { if (getRegion() == IALA_A) 77 * setBuoyIndex(PORT_HAND); else setBuoyIndex(STARBOARD_HAND); } } else if 78 * (col.equals("green")) { setColour(GREEN); if 79 * (top.equals("cone, point up")) { setBuoyIndex(STARBOARD_HAND); 80 * setRegion(IALA_A); } else if (top.equals("cylinder")) { 81 * setBuoyIndex(PORT_HAND); setRegion(IALA_B); } else { if (getRegion() == 82 * IALA_A) setBuoyIndex(STARBOARD_HAND); else setBuoyIndex(PORT_HAND); } } 83 * else if (col.equals("red;green;red")) { setColour(RED_GREEN_RED); if 84 * (top.equals("cylinder")) { setBuoyIndex(PREF_PORT_HAND); 85 * setRegion(IALA_A); } else if (top.equals("cone, point up")) { 86 * setBuoyIndex(PREF_STARBOARD_HAND); setRegion(IALA_B); } else { if 87 * (getRegion() == IALA_A) setBuoyIndex(PREF_PORT_HAND); else 88 * setBuoyIndex(PREF_STARBOARD_HAND); } } else if 89 * (col.equals("green;red;green")) { setColour(GREEN_RED_GREEN); if 90 * (top.equals("cone, point up")) { setBuoyIndex(PREF_STARBOARD_HAND); 91 * setRegion(IALA_A); } else if (top.equals("cylinder")) { 92 * setBuoyIndex(PREF_PORT_HAND); setRegion(IALA_B); } else { if (getRegion() 93 * == IALA_A) setBuoyIndex(PREF_STARBOARD_HAND); else 94 * setBuoyIndex(PREF_PORT_HAND); } } } else if (cat.equals("port")) { 95 * 96 * setBuoyIndex(PORT_HAND); 97 * 98 * if (col.equals("red")) { setRegion(IALA_A); setColour(RED); } else if 99 * (col.equals("green")) { setRegion(IALA_B); setColour(GREEN); } else { if 100 * (getRegion() == IALA_A) setColour(RED); else setColour(GREEN); } } else 101 * if (cat.equals("starboard")) { 102 * 103 * setBuoyIndex(STARBOARD_HAND); 104 * 105 * if (col.equals("green")) { setRegion(IALA_A); setColour(GREEN); } else if 106 * (col.equals("red")) { setRegion(IALA_B); setColour(RED); } else { if 107 * (getRegion() == IALA_A) setColour(GREEN); else setColour(RED); } } else 108 * if (cat.equals("preferred_channel_port")) { 109 * 110 * setBuoyIndex(PREF_PORT_HAND); 111 * 112 * if (col.equals("red;green;red")) { setRegion(IALA_A); 113 * setColour(RED_GREEN_RED); } else if (col.equals("green;red;green")) { 114 * setRegion(IALA_B); setColour(GREEN_RED_GREEN); } else { if (getRegion() 115 * == IALA_A) setColour(RED_GREEN_RED); else setColour(GREEN_RED_GREEN); } 116 * 117 * } else if (cat.equals("preferred_channel_starboard")) { 118 * 119 * setBuoyIndex(PREF_STARBOARD_HAND); 120 * 121 * if (col.equals("green;red;green")) { setRegion(IALA_A); 122 * setColour(GREEN_RED_GREEN); } else if (col.equals("red;green;red")) { 123 * setRegion(IALA_B); setColour(RED_GREEN_RED); } else { if (getRegion() == 124 * IALA_A) setColour(GREEN_RED_GREEN); else setColour(RED_GREEN_RED); } } 125 * 126 * if (keys.containsKey("seamark:buoy_lateral:shape")) { str = 127 * keys.get("seamark:buoy_lateral:shape"); 128 * 129 * switch (getBuoyIndex()) { case PORT_HAND: if (str.equals("can")) 130 * setStyleIndex(CAN); else if (str.equals("pillar")) setStyleIndex(PILLAR); 131 * else if (str.equals("spar")) setStyleIndex(SPAR); break; 132 * 133 * case PREF_PORT_HAND: if (str.equals("can")) setStyleIndex(CAN); else if 134 * (str.equals("pillar")) setStyleIndex(PILLAR); else if 135 * (str.equals("spar")) setStyleIndex(SPAR); break; 136 * 137 * case STARBOARD_HAND: if (str.equals("conical")) setStyleIndex(CONE); else 138 * if (str.equals("pillar")) setStyleIndex(PILLAR); else if 139 * (str.equals("spar")) setStyleIndex(SPAR); break; 140 * 141 * case PREF_STARBOARD_HAND: if (str.equals("conical")) setStyleIndex(CONE); 142 * else if (str.equals("pillar")) setStyleIndex(PILLAR); else if 143 * (str.equals("spar")) setStyleIndex(SPAR); break; } } else if 144 * (keys.containsKey("seamark:beacon_lateral:shape")) { str = 145 * keys.get("seamark:beacon_lateral:shape"); if (str.equals("tower")) 146 * setStyleIndex(TOWER); else if (str.equals("perch")) setStyleIndex(PERCH); 147 * else setStyleIndex(BEACON); } else if (keys.containsKey("seamark:type") 148 * && (keys.get("seamark:type").equals("beacon_lateral"))) { 149 * setStyleIndex(BEACON); } else if (keys.containsKey("seamark:type") && 150 * (keys.get("seamark:type").equals("light_float"))) { setStyleIndex(FLOAT); 151 * } 152 * 153 * parseLights(keys); parseFogRadar(keys); setLightColour(); 154 */} 258 155 259 156 public void setLightColour() { … … 272 169 273 170 public void paintSign() { 274 /* if (dlg.paintlock) 275 return; 276 super.paintSign(); 277 */ 171 /* 172 * if (dlg.paintlock) return; super.paintSign(); 173 */ 278 174 boolean region = getRegion(); 279 175 Shp style = getShape(); … … 488 384 489 385 image += ".png"; 490 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 491 .getResource(image))); 386 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 492 387 493 388 if (hasTopMark()) { … … 571 466 } 572 467 if (!image.isEmpty()) 573 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 574 .getResource(image))); 468 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image))); 575 469 } 576 470 } else … … 594 488 case CAN: 595 489 super.saveSign("buoy_lateral"); 596 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 597 "seamark:buoy_lateral:shape", "can")); 490 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can")); 598 491 break; 599 492 case PILLAR: 600 493 super.saveSign("buoy_lateral"); 601 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 602 "seamark:buoy_lateral:shape", "pillar")); 494 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar")); 603 495 break; 604 496 case SPAR: 605 497 super.saveSign("buoy_lateral"); 606 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 607 "seamark:buoy_lateral:shape", "spar")); 498 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar")); 608 499 break; 609 500 case BEACON: … … 612 503 case TOWER: 613 504 super.saveSign("beacon_lateral"); 614 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 615 "seamark:beacon_lateral:shape", "tower")); 505 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower")); 616 506 break; 617 507 case FLOAT: … … 620 510 case PERCH: 621 511 super.saveSign("beacon_lateral"); 622 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 623 "seamark:beacon_lateral:shape", "perch")); 512 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch")); 624 513 break; 625 514 default: … … 629 518 case PILLAR: 630 519 case SPAR: 631 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 632 "seamark:buoy_lateral:category", "port")); 633 if (getRegion() == IALA_A) { 634 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 635 "seamark:buoy_lateral:colour", "red")); 636 colour = "red"; 637 } else { 638 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 639 "seamark:buoy_lateral:colour", "green")); 520 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "port")); 521 if (getRegion() == IALA_A) { 522 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red")); 523 colour = "red"; 524 } else { 525 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green")); 640 526 colour = "green"; 641 527 } 642 528 break; 643 529 case PERCH: 644 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 645 "seamark:beacon_lateral:category", "port")); 530 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "port")); 646 531 break; 647 532 case BEACON: 648 533 case TOWER: 649 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 650 "seamark:beacon_lateral:category", "port")); 651 if (getRegion() == IALA_A) { 652 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 653 "seamark:beacon_lateral:colour", "red")); 654 colour = "red"; 655 } else { 656 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 657 "seamark:beacon_lateral:colour", "green")); 534 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "port")); 535 if (getRegion() == IALA_A) { 536 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red")); 537 colour = "red"; 538 } else { 539 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green")); 658 540 colour = "green"; 659 541 } … … 661 543 case FLOAT: 662 544 if (getRegion() == IALA_A) { 663 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 664 "seamark:light_float:colour", "red")); 665 colour = "red"; 666 } else { 667 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 668 "seamark:light_float:colour", "green")); 545 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red")); 546 colour = "red"; 547 } else { 548 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green")); 669 549 colour = "green"; 670 550 } … … 678 558 case CAN: 679 559 super.saveSign("buoy_lateral"); 680 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 681 "seamark:buoy_lateral:shape", "can")); 560 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can")); 682 561 break; 683 562 case PILLAR: 684 563 super.saveSign("buoy_lateral"); 685 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 686 "seamark:buoy_lateral:shape", "pillar")); 564 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar")); 687 565 break; 688 566 case SPAR: 689 567 super.saveSign("buoy_lateral"); 690 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 691 "seamark:buoy_lateral:shape", "spar")); 568 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar")); 692 569 break; 693 570 case BEACON: … … 696 573 case TOWER: 697 574 super.saveSign("beacon_lateral"); 698 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 699 "seamark:beacon_lateral:shape", "tower")); 575 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower")); 700 576 break; 701 577 case FLOAT: … … 708 584 case PILLAR: 709 585 case SPAR: 710 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 711 "seamark:buoy_lateral:category", "preferred_channel_port")); 712 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 713 "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); 714 if (getRegion() == IALA_A) { 715 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 716 "seamark:buoy_lateral:colour", "red;green;red")); 717 colour = "red"; 718 } else { 719 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 720 "seamark:buoy_lateral:colour", "green;red;green")); 586 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "preferred_channel_port")); 587 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); 588 if (getRegion() == IALA_A) { 589 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red;green;red")); 590 colour = "red"; 591 } else { 592 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green;red;green")); 721 593 colour = "green"; 722 594 } … … 724 596 case BEACON: 725 597 case TOWER: 726 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 727 "seamark:beacon_lateral:category", "preferred_channel_port")); 728 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 729 "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); 730 if (getRegion() == IALA_A) { 731 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 732 "seamark:beacon_lateral:colour", "red;green;red")); 733 colour = "red"; 734 } else { 735 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 736 "seamark:beacon_lateral:colour", "green;red;green")); 598 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "preferred_channel_port")); 599 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); 600 if (getRegion() == IALA_A) { 601 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red;green;red")); 602 colour = "red"; 603 } else { 604 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green;red;green")); 737 605 colour = "green"; 738 606 } 739 607 break; 740 608 case FLOAT: 741 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 742 "seamark:light_float:colour_pattern", "horizontal stripes")); 743 if (getRegion() == IALA_A) { 744 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 745 "seamark:light_float:colour", "red;green;red")); 746 colour = "red"; 747 } else { 748 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 749 "seamark:light_float:colour", "green;red;green")); 609 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes")); 610 if (getRegion() == IALA_A) { 611 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;green;red")); 612 colour = "red"; 613 } else { 614 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green;red;green")); 750 615 colour = "green"; 751 616 } … … 759 624 case CONE: 760 625 super.saveSign("buoy_lateral"); 761 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 762 "seamark:buoy_lateral:shape", "conical")); 626 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical")); 763 627 break; 764 628 case PILLAR: 765 629 super.saveSign("buoy_lateral"); 766 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 767 "seamark:buoy_lateral:shape", "pillar")); 630 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar")); 768 631 break; 769 632 case SPAR: 770 633 super.saveSign("buoy_lateral"); 771 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 772 "seamark:buoy_lateral:shape", "spar")); 634 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar")); 773 635 break; 774 636 case BEACON: 775 637 super.saveSign("beacon_lateral"); 776 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 777 "seamark:beacon_lateral:shape", "stake")); 638 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake")); 778 639 break; 779 640 case TOWER: 780 641 super.saveSign("beacon_lateral"); 781 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 782 "seamark:beacon_lateral:shape", "tower")); 642 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower")); 783 643 break; 784 644 case FLOAT: … … 787 647 case PERCH: 788 648 super.saveSign("beacon_lateral"); 789 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 790 "seamark:beacon_lateral:shape", "perch")); 649 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch")); 791 650 break; 792 651 default: … … 796 655 case PILLAR: 797 656 case SPAR: 798 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 799 "seamark:buoy_lateral:category", "starboard")); 800 if (getRegion() == IALA_A) { 801 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 802 "seamark:buoy_lateral:colour", "green")); 803 colour = "green"; 804 } else { 805 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 806 "seamark:buoy_lateral:colour", "red")); 657 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "starboard")); 658 if (getRegion() == IALA_A) { 659 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green")); 660 colour = "green"; 661 } else { 662 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red")); 807 663 colour = "red"; 808 664 } … … 810 666 case BEACON: 811 667 case TOWER: 812 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 813 "seamark:beacon_lateral:category", "starboard")); 814 if (getRegion() == IALA_A) { 815 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 816 "seamark:beacon_lateral:colour", "green")); 817 colour = "green"; 818 } else { 819 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 820 "seamark:beacon_lateral:colour", "red")); 668 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "starboard")); 669 if (getRegion() == IALA_A) { 670 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green")); 671 colour = "green"; 672 } else { 673 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red")); 821 674 colour = "red"; 822 675 } … … 824 677 case FLOAT: 825 678 if (getRegion() == IALA_A) { 826 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 827 "seamark:light_float:colour", "green")); 828 colour = "green"; 829 } else { 830 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 831 "seamark:light_float:colour", "red")); 679 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green")); 680 colour = "green"; 681 } else { 682 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red")); 832 683 colour = "red"; 833 684 } 834 685 break; 835 686 case PERCH: 836 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 837 "seamark:beacon_lateral:category", "starboard")); 687 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "starboard")); 838 688 break; 839 689 } … … 845 695 case CONE: 846 696 super.saveSign("buoy_lateral"); 847 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 848 "seamark:buoy_lateral:shape", "conical")); 697 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical")); 849 698 break; 850 699 case PILLAR: 851 700 super.saveSign("buoy_lateral"); 852 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 853 "seamark:buoy_lateral:shape", "pillar")); 701 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar")); 854 702 break; 855 703 case SPAR: 856 704 super.saveSign("buoy_lateral"); 857 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 858 "seamark:buoy_lateral:shape", "spar")); 705 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar")); 859 706 break; 860 707 case BEACON: 861 708 super.saveSign("beacon_lateral"); 862 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 863 "seamark:beacon_lateral:shape", "stake")); 709 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake")); 864 710 break; 865 711 case TOWER: 866 712 super.saveSign("beacon_lateral"); 867 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 868 "seamark:beacon_lateral:shape", "tower")); 713 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower")); 869 714 break; 870 715 case FLOAT: … … 877 722 case PILLAR: 878 723 case SPAR: 879 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 880 "seamark:buoy_lateral:category", "preferred_channel_starboard")); 881 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 882 "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); 883 if (getRegion() == IALA_A) { 884 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 885 "seamark:buoy_lateral:colour", "green;red;green")); 886 colour = "green"; 887 } else { 888 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 889 "seamark:buoy_lateral:colour", "red;green;red")); 724 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "preferred_channel_starboard")); 725 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); 726 if (getRegion() == IALA_A) { 727 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green;red;green")); 728 colour = "green"; 729 } else { 730 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red;green;red")); 890 731 colour = "red"; 891 732 } … … 893 734 case BEACON: 894 735 case TOWER: 895 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 896 "seamark:beacon_lateral:category", "preferred_channel_starboard")); 897 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 898 "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); 899 if (getRegion() == IALA_A) { 900 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 901 "seamark:beacon_lateral:colour", "green;red;green")); 902 colour = "green"; 903 } else { 904 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 905 "seamark:beacon_lateral:colour", "red;green;red")); 736 Main.main.undoRedo 737 .add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "preferred_channel_starboard")); 738 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); 739 if (getRegion() == IALA_A) { 740 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green;red;green")); 741 colour = "green"; 742 } else { 743 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red;green;red")); 906 744 colour = "red"; 907 745 } 908 746 break; 909 747 case FLOAT: 910 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 911 "seamark:light_float:colour_pattern", "horizontal stripes")); 912 if (getRegion() == IALA_A) { 913 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 914 "seamark:light_float:colour", "green;red;green")); 915 colour = "green"; 916 } else { 917 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 918 "seamark:light_float:colour", "red;green;red")); 748 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes")); 749 if (getRegion() == IALA_A) { 750 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green;red;green")); 751 colour = "green"; 752 } else { 753 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;green;red")); 919 754 colour = "red"; 920 755 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24830 r24839 12 12 super(dia); 13 13 } 14 14 15 15 public void parseMark() { 16 16 … … 39 39 40 40 /* 41 if (keys.containsKey("seamark:type")) { 42 String type = keys.get("seamark:type"); 43 if (type.equals("landmark")) 44 setBuoyIndex(LIGHT_HOUSE); 45 else if (type.equals("light_major")) 46 setBuoyIndex(LIGHT_MAJOR); 47 else if (type.equals("light_minor")) 48 setBuoyIndex(LIGHT_MINOR); 49 else if (type.equals("light_vessel")) 50 setBuoyIndex(LIGHT_VESSEL); 51 } 52 53 parseLights(keys); 54 parseFogRadar(keys); 55 setTopMark(false); 56 setFired(true); 57 58 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex()); 59 dlg.tfM01Name.setText(getName()); 60 dlg.cM01Fired.setEnabled(false); 61 dlg.cM01Fired.setSelected(true); 62 */ } 41 * if (keys.containsKey("seamark:type")) { String type = 42 * keys.get("seamark:type"); if (type.equals("landmark")) 43 * setBuoyIndex(LIGHT_HOUSE); else if (type.equals("light_major")) 44 * setBuoyIndex(LIGHT_MAJOR); else if (type.equals("light_minor")) 45 * setBuoyIndex(LIGHT_MINOR); else if (type.equals("light_vessel")) 46 * setBuoyIndex(LIGHT_VESSEL); } 47 * 48 * parseLights(keys); parseFogRadar(keys); setTopMark(false); 49 * setFired(true); 50 * 51 * dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex()); 52 * dlg.tfM01Name.setText(getName()); dlg.cM01Fired.setEnabled(false); 53 * dlg.cM01Fired.setSelected(true); 54 */} 63 55 64 56 public void paintSign() { 65 /* if (dlg.paintlock) 66 return; 67 super.paintSign(); 68 */ 57 /* 58 * if (dlg.paintlock) return; super.paintSign(); 59 */ 69 60 if (getCategory() != Cat.UNKNOWN) { 70 61 71 62 switch (getCategory()) { 72 63 case LIGHT_HOUSE: 73 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 74 "/images/Light_House.png"))); 64 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_House.png"))); 75 65 break; 76 66 77 67 case LIGHT_MAJOR: 78 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 79 "/images/Light_Major.png"))); 68 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Major.png"))); 80 69 break; 81 70 82 71 case LIGHT_MINOR: 83 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 84 "/images/Light_Minor.png"))); 72 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Minor.png"))); 85 73 break; 86 74 87 75 case LIGHT_VESSEL: 88 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 89 "/images/Major_Float.png"))); 76 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Major_Float.png"))); 90 77 break; 91 78 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24835 r24839 42 42 /* 43 43 * 44 * setBuoyIndex(SAFE_WATER); 45 * setColour(SeaMark.RED_WHITE); 44 * setBuoyIndex(SAFE_WATER); setColour(SeaMark.RED_WHITE); 46 45 * setLightColour("W"); 47 46 * setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 48 47 * 49 * if (keys.containsKey("seamark:buoy_safe_water:shape")) { 50 * str =keys.get("seamark:buoy_safe_water:shape");48 * if (keys.containsKey("seamark:buoy_safe_water:shape")) { str = 49 * keys.get("seamark:buoy_safe_water:shape"); 51 50 * 52 * if (str.equals("pillar")) setStyleIndex(SAFE_PILLAR); 53 * else if 54 * (str.equals("spar")) setStyleIndex(SAFE_SPAR); 55 * else if (str.equals("sphere")) setStyleIndex(SAFE_SPHERE); 56 * } else if ((keys.containsKey("seamark:type")) && 51 * if (str.equals("pillar")) setStyleIndex(SAFE_PILLAR); else if 52 * (str.equals("spar")) setStyleIndex(SAFE_SPAR); else if 53 * (str.equals("sphere")) setStyleIndex(SAFE_SPHERE); } else if 54 * ((keys.containsKey("seamark:type")) && 57 55 * (keys.get("seamark:type").equals("light_float"))) { 58 * setStyleIndex(SAFE_FLOAT); 59 * } else if ((keys.containsKey("seamark:type")) && 60 * (keys.get("seamark:type").equals("beacon_safe_water"))) { 56 * setStyleIndex(SAFE_FLOAT); } else if ((keys.containsKey("seamark:type")) 57 * && (keys.get("seamark:type").equals("beacon_safe_water"))) { 61 58 * setStyleIndex(SAFE_BEACON); } 62 59 * … … 67 64 * keys.containsKey("seamark:topmark:colour")) { setTopMark(true); } 68 65 * 69 * refreshLights(); 70 * parseLights(keys); 71 * parseFogRadar(keys); 66 * refreshLights(); parseLights(keys); parseFogRadar(keys); 72 67 * 73 68 * dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); … … 112 107 if (!image.equals("/images/Safe_Water")) { 113 108 image += ".png"; 114 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 115 .getResource(image))); 109 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 116 110 if (hasTopMark()) { 117 111 image = ""; … … 132 126 } 133 127 if (!image.isEmpty()) 134 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 135 .getResource(image))); 128 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image))); 136 129 } else 137 130 dlg.panelMain.topIcon.setIcon(null); … … 150 143 case PILLAR: 151 144 super.saveSign("buoy_safe_water"); 152 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 153 "seamark:buoy_safe_water:shape", "pillar")); 145 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "pillar")); 154 146 break; 155 147 case SPAR: 156 148 super.saveSign("buoy_safe_water"); 157 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 158 "seamark:buoy_safe_water:shape", "spar")); 149 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "spar")); 159 150 break; 160 151 case SPHERE: 161 152 super.saveSign("buoy_safe_water"); 162 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 163 "seamark:buoy_safe_water:shape", "sphere")); 153 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "sphere")); 164 154 break; 165 155 case BEACON: … … 176 166 case SPAR: 177 167 case SPHERE: 178 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 179 "seamark:buoy_safe_water:colour_pattern", 180 "vertical stripes")); 181 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 182 "seamark:buoy_safe_water:colour", "red;white")); 168 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:colour_pattern", "vertical stripes")); 169 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:colour", "red;white")); 183 170 break; 184 171 case BEACON: 185 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 186 "seamark:beacon_safe_water:colour_pattern", 187 "vertical stripes")); 188 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 189 "seamark:beacon_safe_water:colour", "red;white")); 172 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_safe_water:colour_pattern", "vertical stripes")); 173 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_safe_water:colour", "red;white")); 190 174 break; 191 175 case FLOAT: 192 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 193 "seamark:light_float:colour_pattern", "vertical stripes")); 194 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 195 "seamark:light_float:colour", "red;white")); 176 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "vertical stripes")); 177 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;white")); 196 178 break; 197 179 default: -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24830 r24839 15 15 super(dia); 16 16 } 17 17 18 18 public void parseMark() { 19 19 … … 38 38 setName(keys.get("seamark:light_float:name")); 39 39 40 /* 41 dlg.cM01TopMark.setEnabled(true); 42 43 setBuoyIndex(SPECIAL_PURPOSE); 44 setColour(SeaMark.YELLOW); 45 setLightColour("W"); 46 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 47 48 if (keys.containsKey("seamark:buoy_special_purpose:shape")) { 49 str = keys.get("seamark:buoy_special_purpose:shape"); 50 51 if (str.equals("pillar")) 52 setStyleIndex(PILLAR); 53 else if (str.equals("can")) 54 setStyleIndex(CAN); 55 else if (str.equals("conical")) 56 setStyleIndex(CONE); 57 else if (str.equals("spar")) 58 setStyleIndex(SPAR); 59 else if (str.equals("sphere")) 60 setStyleIndex(SPHERE); 61 else if (str.equals("barrel")) 62 setStyleIndex(BARREL); 63 } 64 65 if (keys.containsKey("seamark:beacon_special_purpose:shape")) { 66 str = keys.get("seamark:beacon_special_purpose:shape"); 67 if (str.equals("tower")) 68 setStyleIndex(TOWER); 69 else 70 setStyleIndex(BEACON); 71 } 72 73 if (keys.containsKey("seamark:light_float:colour")) { 74 setStyleIndex(FLOAT); 75 } 76 77 if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals( 78 "beacon_special_purpose")) 79 || keys.containsKey("seamark:beacon_special_purpose:colour") 80 || keys.containsKey("seamark:beacon_special_purpose:shape")) { 81 if (keys.containsKey("seamark:beacon_special_purpose:shape") 82 && keys.get("seamark:beacon_special_purpose:shape").equals("tower")) 83 setStyleIndex(TOWER); 84 else 85 setStyleIndex(BEACON); 86 } else if (keys.containsKey("seamark:light_float:colour") 87 && keys.get("seamark:light_float:colour").equals("yellow")) 88 setStyleIndex(FLOAT); 89 90 if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) 91 setStyleIndex(0); 92 93 keys = node.getKeys(); 94 if (keys.containsKey("seamark:topmark:shape")) { 95 str = keys.get("seamark:topmark:shape"); 96 setTopMark(true); 97 if (str.equals("x-shape")) { 98 if (keys.containsKey("seamark:topmark:colour")) { 99 if (keys.get("seamark:topmark:colour").equals("red")) 100 setTopMarkIndex(TOP_RED_X); 101 else 102 setTopMarkIndex(TOP_YELLOW_X); 103 } 104 } else if (str.equals("cone, point up")) { 105 setTopMarkIndex(TOP_YELLOW_CONE); 106 } else if (str.equals("cylinder")) { 107 setTopMarkIndex(TOP_YELLOW_CAN); 108 } 109 } 110 111 parseLights(keys); 112 parseFogRadar(keys); 113 114 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 115 dlg.tfM01Name.setText(getName()); 116 dlg.cM01TopMark.setSelected(hasTopMark()); 117 */ } 40 /* 41 * dlg.cM01TopMark.setEnabled(true); 42 * 43 * setBuoyIndex(SPECIAL_PURPOSE); setColour(SeaMark.YELLOW); 44 * setLightColour("W"); 45 * setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 46 * 47 * if (keys.containsKey("seamark:buoy_special_purpose:shape")) { str = 48 * keys.get("seamark:buoy_special_purpose:shape"); 49 * 50 * if (str.equals("pillar")) setStyleIndex(PILLAR); else if 51 * (str.equals("can")) setStyleIndex(CAN); else if (str.equals("conical")) 52 * setStyleIndex(CONE); else if (str.equals("spar")) setStyleIndex(SPAR); 53 * else if (str.equals("sphere")) setStyleIndex(SPHERE); else if 54 * (str.equals("barrel")) setStyleIndex(BARREL); } 55 * 56 * if (keys.containsKey("seamark:beacon_special_purpose:shape")) { str = 57 * keys.get("seamark:beacon_special_purpose:shape"); if 58 * (str.equals("tower")) setStyleIndex(TOWER); else setStyleIndex(BEACON); } 59 * 60 * if (keys.containsKey("seamark:light_float:colour")) { 61 * setStyleIndex(FLOAT); } 62 * 63 * if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals( 64 * "beacon_special_purpose")) || 65 * keys.containsKey("seamark:beacon_special_purpose:colour") || 66 * keys.containsKey("seamark:beacon_special_purpose:shape")) { if 67 * (keys.containsKey("seamark:beacon_special_purpose:shape") && 68 * keys.get("seamark:beacon_special_purpose:shape").equals("tower")) 69 * setStyleIndex(TOWER); else setStyleIndex(BEACON); } else if 70 * (keys.containsKey("seamark:light_float:colour") && 71 * keys.get("seamark:light_float:colour").equals("yellow")) 72 * setStyleIndex(FLOAT); 73 * 74 * if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) 75 * setStyleIndex(0); 76 * 77 * keys = node.getKeys(); if (keys.containsKey("seamark:topmark:shape")) { 78 * str = keys.get("seamark:topmark:shape"); setTopMark(true); if 79 * (str.equals("x-shape")) { if (keys.containsKey("seamark:topmark:colour")) 80 * { if (keys.get("seamark:topmark:colour").equals("red")) 81 * setTopMarkIndex(TOP_RED_X); else setTopMarkIndex(TOP_YELLOW_X); } } else 82 * if (str.equals("cone, point up")) { setTopMarkIndex(TOP_YELLOW_CONE); } 83 * else if (str.equals("cylinder")) { setTopMarkIndex(TOP_YELLOW_CAN); } } 84 * 85 * parseLights(keys); parseFogRadar(keys); 86 * 87 * dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 88 * dlg.tfM01Name.setText(getName()); 89 * dlg.cM01TopMark.setSelected(hasTopMark()); 90 */} 118 91 119 92 public void setLightColour() { … … 122 95 123 96 public void paintSign() { 124 /* if (dlg.paintlock) 125 return; 126 super.paintSign(); 127 */ 97 /* 98 * if (dlg.paintlock) return; super.paintSign(); 99 */ 128 100 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) { 129 101 … … 163 135 if (!image.equals("/images/Special_Purpose")) { 164 136 image += ".png"; 165 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 166 .getResource(image))); 167 /* if (hasTopMark()) { 168 image = ""; 169 switch (getShape()) { 170 case PILLAR: 171 case SPAR: 172 switch (getTopMarkIndex()) { 173 case TOP_YELLOW_X: 174 image = "/images/Top_X_Yellow_Buoy.png"; 175 break; 176 case TOP_RED_X: 177 image = "/images/Top_X_Red_Buoy.png"; 178 break; 179 case TOP_YELLOW_CAN: 180 image = "/images/Top_Can_Yellow_Buoy.png"; 181 break; 182 case TOP_YELLOW_CONE: 183 image = "/images/Top_Cone_Yellow_Buoy.png"; 184 break; 185 } 186 break; 187 case CAN: 188 case CONE: 189 case SPHERE: 190 case BARREL: 191 switch (getTopMarkIndex()) { 192 case TOP_YELLOW_X: 193 image = "/images/Top_X_Yellow_Buoy_Small.png"; 194 break; 195 case TOP_RED_X: 196 image = "/images/Top_X_Red_Buoy_Small.png"; 197 break; 198 case TOP_YELLOW_CAN: 199 image = "/images/Top_Can_Yellow_Buoy_Small.png"; 200 break; 201 case TOP_YELLOW_CONE: 202 image = "/images/Top_Cone_Yellow_Buoy_Small.png"; 203 break; 204 } 205 break; 206 case BEACON: 207 case TOWER: 208 switch (getTopMarkIndex()) { 209 case TOP_YELLOW_X: 210 image = "/images/Top_X_Yellow_Beacon.png"; 211 break; 212 case TOP_RED_X: 213 image = "/images/Top_X_Red_Beacon.png"; 214 break; 215 case TOP_YELLOW_CAN: 216 image = "/images/Top_Can_Yellow_Beacon.png"; 217 break; 218 case TOP_YELLOW_CONE: 219 image = "/images/Top_Cone_Yellow_Beacon.png"; 220 break; 221 } 222 break; 223 case FLOAT: 224 switch (getTopMarkIndex()) { 225 case TOP_YELLOW_X: 226 image = "/images/Top_X_Yellow_Float.png"; 227 break; 228 case TOP_RED_X: 229 image = "/images/Top_X_Red_Float.png"; 230 break; 231 case TOP_YELLOW_CAN: 232 image = "/images/Top_Can_Yellow_Float.png"; 233 break; 234 case TOP_YELLOW_CONE: 235 image = "/images/Top_Cone_Yellow_Float.png"; 236 break; 237 } 238 break; 239 } 240 if (!image.isEmpty()) 241 dlg.lM06Icon.setIcon(new ImageIcon(getClass().getResource(image))); 242 } 243 */ } else 137 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image))); 138 /* 139 * if (hasTopMark()) { image = ""; switch (getShape()) { case PILLAR: 140 * case SPAR: switch (getTopMarkIndex()) { case TOP_YELLOW_X: image = 141 * "/images/Top_X_Yellow_Buoy.png"; break; case TOP_RED_X: image = 142 * "/images/Top_X_Red_Buoy.png"; break; case TOP_YELLOW_CAN: image = 143 * "/images/Top_Can_Yellow_Buoy.png"; break; case TOP_YELLOW_CONE: image 144 * = "/images/Top_Cone_Yellow_Buoy.png"; break; } break; case CAN: case 145 * CONE: case SPHERE: case BARREL: switch (getTopMarkIndex()) { case 146 * TOP_YELLOW_X: image = "/images/Top_X_Yellow_Buoy_Small.png"; break; 147 * case TOP_RED_X: image = "/images/Top_X_Red_Buoy_Small.png"; break; 148 * case TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Buoy_Small.png"; 149 * break; case TOP_YELLOW_CONE: image = 150 * "/images/Top_Cone_Yellow_Buoy_Small.png"; break; } break; case 151 * BEACON: case TOWER: switch (getTopMarkIndex()) { case TOP_YELLOW_X: 152 * image = "/images/Top_X_Yellow_Beacon.png"; break; case TOP_RED_X: 153 * image = "/images/Top_X_Red_Beacon.png"; break; case TOP_YELLOW_CAN: 154 * image = "/images/Top_Can_Yellow_Beacon.png"; break; case 155 * TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Beacon.png"; break; 156 * } break; case FLOAT: switch (getTopMarkIndex()) { case TOP_YELLOW_X: 157 * image = "/images/Top_X_Yellow_Float.png"; break; case TOP_RED_X: 158 * image = "/images/Top_X_Red_Float.png"; break; case TOP_YELLOW_CAN: 159 * image = "/images/Top_Can_Yellow_Float.png"; break; case 160 * TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Float.png"; break; 161 * } break; } if (!image.isEmpty()) dlg.lM06Icon.setIcon(new 162 * ImageIcon(getClass().getResource(image))); } 163 */} else 244 164 dlg.panelMain.shapeIcon.setIcon(null); 245 165 } … … 254 174 case PILLAR: 255 175 super.saveSign("buoy_special_purpose"); 256 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 257 "seamark:buoy_special_purpose:shape", "pillar")); 258 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 259 "seamark:buoy_special_purpose:colour", "yellow")); 176 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "pillar")); 177 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 260 178 break; 261 179 case SPAR: 262 180 super.saveSign("buoy_special_purpose"); 263 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 264 "seamark:buoy_special_purpose:shape", "spar")); 265 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 266 "seamark:buoy_special_purpose:colour", "yellow")); 181 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "spar")); 182 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 267 183 break; 268 184 case CAN: 269 185 super.saveSign("buoy_special_purpose"); 270 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 271 "seamark:buoy_special_purpose:shape", "can")); 272 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 273 "seamark:buoy_special_purpose:colour", "yellow")); 186 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "can")); 187 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 274 188 break; 275 189 case CONE: 276 190 super.saveSign("buoy_special_purpose"); 277 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 278 "seamark:buoy_special_purpose:shape", "conical")); 279 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 280 "seamark:buoy_special_purpose:colour", "yellow")); 191 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "conical")); 192 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 281 193 break; 282 194 case SPHERE: 283 195 super.saveSign("buoy_special_purpose"); 284 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 285 "seamark:buoy_special_purpose:shape", "sphere")); 286 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 287 "seamark:buoy_special_purpose:colour", "yellow")); 196 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "sphere")); 197 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 288 198 break; 289 199 case BARREL: 290 200 super.saveSign("buoy_special_purpose"); 291 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 292 "seamark:buoy_special_purpose:shape", "barrel")); 293 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 294 "seamark:buoy_special_purpose:colour", "yellow")); 201 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "barrel")); 202 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 295 203 break; 296 204 case FLOAT: 297 205 super.saveSign("light_float"); 298 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 299 "seamark:light_float:colour", "yellow")); 206 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow")); 300 207 break; 301 208 case BEACON: 302 209 super.saveSign("beacon_special_purpose"); 303 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 304 "seamark:beacon_special_purpose:colour", "yellow")); 210 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow")); 305 211 break; 306 212 case TOWER: 307 213 super.saveSign("beacon_special_purpose"); 308 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 309 "seamark:beacon_special_purpose:shape", "tower")); 310 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 311 "seamark:beacon_special_purpose:colour", "yellow")); 214 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:shape", "tower")); 215 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow")); 312 216 break; 313 217 default: 314 218 } 315 /* switch (getTopMarkIndex()) { 316 case TOP_YELLOW_X: 317 saveTopMarkData("x-shape", "yellow"); 318 break; 319 case TOP_RED_X: 320 saveTopMarkData("x-shape", "red"); 321 break; 322 case TOP_YELLOW_CAN: 323 saveTopMarkData("cylinder", "yellow"); 324 break; 325 case TOP_YELLOW_CONE: 326 saveTopMarkData("cone, point up", "yellow"); 327 break; 328 } 329 */ saveLightData(); 219 /* 220 * switch (getTopMarkIndex()) { case TOP_YELLOW_X: 221 * saveTopMarkData("x-shape", "yellow"); break; case TOP_RED_X: 222 * saveTopMarkData("x-shape", "red"); break; case TOP_YELLOW_CAN: 223 * saveTopMarkData("cylinder", "yellow"); break; case TOP_YELLOW_CONE: 224 * saveTopMarkData("cone, point up", "yellow"); break; } 225 */saveLightData(); 330 226 saveRadarFogData(); 331 227 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24835 r24839 6 6 import java.util.regex.Pattern; 7 7 8 import javax.swing.ImageIcon; 9 8 10 import org.openstreetmap.josm.Main; 9 11 import org.openstreetmap.josm.command.ChangePropertyCommand; … … 18 20 19 21 public enum Cat { 20 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, 21 CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, 22 LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT 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_FLOAT 23 23 } 24 24 … … 28 28 29 29 public enum Col { 30 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, 31 RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE, BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK 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_BLACK 32 31 } 33 32 … … 379 378 380 379 if (matcher.find()) { 381 //setErrMsg(null);380 // setErrMsg(null); 382 381 } else { 383 //setErrMsg("Must be a number");382 // setErrMsg("Must be a number"); 384 383 lightPeriod = ""; 385 //dlg.tfM01RepeatTime.requestFocus();384 // dlg.tfM01RepeatTime.requestFocus(); 386 385 } 387 386 } … … 448 447 } 449 448 } 450 setSectorIndex(0);451 // dlg.cbM01Sector.setSelectedIndex(0);452 // dlg.cM01Fired.setSelected(isFired());453 // dlg.rbM01Fired1.setSelected(!isSectored());454 // dlg.rbM01FiredN.setSelected(isSectored());455 // dlg.cbM01Kennung.setSelectedItem(getLightChar());456 // dlg.tfM01Height.setText(getHeight());457 // dlg.tfM01Range.setText(getRange());458 // dlg.tfM01Group.setText(getLightGroup());459 // dlg.tfM01RepeatTime.setText(getLightPeriod());460 // dlg.cbM01Colour.setSelectedItem(getLightColour());461 449 } 462 450 … … 466 454 setRadar(false); 467 455 setRacon(false); 468 if (k.containsKey("seamark:fog_signal") 469 || k.containsKey("seamark:fog_signal:category") 470 || k.containsKey("seamark:fog_signal:group") 471 || k.containsKey("seamark:fog_signal:period")) { 456 if (k.containsKey("seamark:fog_signal") || k.containsKey("seamark:fog_signal:category") 457 || k.containsKey("seamark:fog_signal:group") || k.containsKey("seamark:fog_signal:period")) { 472 458 setFog(true); 473 459 if (k.containsKey("seamark:fog_signal:category")) { … … 495 481 setFogPeriod(k.get("seamark:fog_signal:period")); 496 482 } 497 // dlg.cM01Fog.setSelected(hasFog()); 498 // dlg.cbM01Fog.setSelectedIndex(getFogSound()); 499 // dlg.tfM01FogGroup.setText(getFogGroup()); 500 // dlg.tfM01FogPeriod.setText(getFogPeriod()); 501 502 if (k.containsKey("seamark:radar_transponder") 503 || k.containsKey("seamark:radar_transponder:category") 483 484 if (k.containsKey("seamark:radar_transponder") || k.containsKey("seamark:radar_transponder:category") 504 485 || k.containsKey("seamark:radar_transponder:group")) { 505 486 setRacon(true); … … 519 500 } else if (k.containsKey("seamark:radar_reflector")) 520 501 setRadar(true); 521 // dlg.cM01Radar.setSelected(hasRadar()); 522 // dlg.cM01Racon.setSelected(hasRacon()); 523 // dlg.cbM01Racon.setSelectedIndex(getRaType()); 524 // dlg.tfM01Racon.setText(getRaconGroup()); 525 } 526 527 public abstract void paintSign(); 502 } 503 504 public void paintSign() { 505 /* 506 * dlg.lM01NameMark.setText(getName()); 507 * 508 * dlg.bM01Save.setEnabled(true); 509 * 510 * dlg.cM01TopMark.setSelected(hasTopMark()); 511 * dlg.cM01Fired.setSelected(isFired()); 512 * 513 * dlg.tfM01RepeatTime.setText(getLightPeriod()); 514 * 515 * dlg.tfM01Name.setText(getName()); dlg.tfM01Name.setEnabled(true); 516 * 517 * if (hasRadar()) { dlg.lM03Icon.setIcon(new 518 * ImageIcon(getClass().getResource( "/images/Radar_Reflector_355.png"))); } 519 * 520 * else if (hasRacon()) { dlg.lM04Icon.setIcon(new 521 * ImageIcon(getClass().getResource( "/images/Radar_Station.png"))); if 522 * (getRaType() != 0) { String c = (String) 523 * dlg.cbM01Racon.getSelectedItem(); if ((getRaType() == RATYPE_RACON) && 524 * !getRaconGroup().isEmpty()) c += ("(" + getRaconGroup() + ")"); 525 * dlg.lM01RadarMark.setText(c); } dlg.cbM01Racon.setVisible(true); if 526 * (getRaType() == RATYPE_RACON) { dlg.lM01Racon.setVisible(true); 527 * dlg.tfM01Racon.setVisible(true); dlg.tfM01Racon.setEnabled(true); } else 528 * { dlg.lM01Racon.setVisible(false); dlg.tfM01Racon.setVisible(false); } } 529 * else { dlg.cbM01Racon.setVisible(false); dlg.lM01Racon.setVisible(false); 530 * dlg.tfM01Racon.setVisible(false); } 531 * 532 * if (hasFog()) { dlg.lM05Icon.setIcon(new 533 * ImageIcon(getClass().getResource( "/images/Fog_Signal.png"))); if 534 * (getFogSound() != 0) { String c = (String) 535 * dlg.cbM01Fog.getSelectedItem(); if (!getFogGroup().isEmpty()) c += ("(" + 536 * getFogGroup() + ")"); if (!getFogPeriod().isEmpty()) c += (" " + 537 * getFogPeriod() + "s"); dlg.lM01FogMark.setText(c); } 538 * dlg.cbM01Fog.setVisible(true); if (getFogSound() == 0) { 539 * dlg.lM01FogGroup.setVisible(false); dlg.tfM01FogGroup.setVisible(false); 540 * dlg.lM01FogPeriod.setVisible(false); 541 * dlg.tfM01FogPeriod.setVisible(false); } else { 542 * dlg.lM01FogGroup.setVisible(true); dlg.tfM01FogGroup.setVisible(true); 543 * dlg.lM01FogPeriod.setVisible(true); dlg.tfM01FogPeriod.setVisible(true); 544 * } } else { dlg.cbM01Fog.setVisible(false); 545 * dlg.lM01FogGroup.setVisible(false); dlg.tfM01FogGroup.setVisible(false); 546 * dlg.lM01FogPeriod.setVisible(false); 547 * dlg.tfM01FogPeriod.setVisible(false); } 548 * 549 * if (isFired()) { String lp, c; String tmp = null; int i1; 550 * 551 * String col = getLightColour(); if (col.equals("W")) { 552 * dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 553 * "/images/Light_White_120.png"))); 554 * dlg.cbM01Colour.setSelectedIndex(WHITE_LIGHT); } else if 555 * (col.equals("R")) { dlg.lM02Icon.setIcon(new 556 * ImageIcon(getClass().getResource( "/images/Light_Red_120.png"))); 557 * dlg.cbM01Colour.setSelectedIndex(RED_LIGHT); } else if (col.equals("G")) 558 * { dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 559 * "/images/Light_Green_120.png"))); 560 * dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT); } else { 561 * dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 562 * "/images/Light_Magenta_120.png"))); 563 * dlg.cbM01Colour.setSelectedIndex(UNKNOWN_COLOUR); } 564 * 565 * c = getLightChar(); dlg.cbM01Kennung.setSelectedItem(c); if 566 * (c.contains("+")) { i1 = c.indexOf("+"); tmp = c.substring(i1, 567 * c.length()); c = c.substring(0, i1); if (!getLightGroup().isEmpty()) { c 568 * = c + "(" + getLightGroup() + ")"; } if (tmp != null) c = c + tmp; 569 * dlg.cbM01Kennung.setSelectedItem(c); } else if 570 * (!getLightGroup().isEmpty()) c = c + "(" + getLightGroup() + ")"; if 571 * (dlg.cbM01Kennung.getSelectedIndex() == 0) 572 * dlg.cbM01Kennung.setSelectedItem(c); c = c + " " + getLightColour(); lp = 573 * getLightPeriod(); if (!lp.isEmpty()) c = c + " " + lp + "s"; 574 * dlg.lM01FireMark.setText(c); dlg.cM01Fired.setVisible(true); 575 * dlg.lM01Kennung.setVisible(true); dlg.cbM01Kennung.setVisible(true); if 576 * (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) { 577 * dlg.tfM01Group.setVisible(false); dlg.lM01Group.setVisible(false); } else 578 * { dlg.lM01Group.setVisible(true); dlg.tfM01Group.setVisible(true); } 579 * dlg.tfM01Group.setText(getLightGroup()); 580 * dlg.lM01RepeatTime.setVisible(true); 581 * dlg.tfM01RepeatTime.setVisible(true); if (isSectored()) { 582 * dlg.rbM01Fired1.setSelected(false); dlg.rbM01FiredN.setSelected(true); if 583 * ((getSectorIndex() != 0) && (!LightChar[0].isEmpty())) 584 * dlg.cbM01Kennung.setEnabled(false); else 585 * dlg.cbM01Kennung.setEnabled(true); 586 * dlg.cbM01Kennung.setSelectedItem(getLightChar()); if ((getSectorIndex() 587 * != 0) && (!LightGroup[0].isEmpty())) dlg.tfM01Group.setEnabled(false); 588 * else dlg.tfM01Group.setEnabled(true); 589 * dlg.tfM01Group.setText(getLightGroup()); if ((getSectorIndex() != 0) && 590 * (!LightPeriod[0].isEmpty())) dlg.tfM01RepeatTime.setEnabled(false); else 591 * dlg.tfM01RepeatTime.setEnabled(true); 592 * dlg.tfM01RepeatTime.setText(getLightPeriod()); if ((getSectorIndex() != 593 * 0) && (!Height[0].isEmpty())) dlg.tfM01Height.setEnabled(false); else 594 * dlg.tfM01Height.setEnabled(true); dlg.tfM01Height.setText(getHeight()); 595 * if ((getSectorIndex() != 0) && (!Range[0].isEmpty())) 596 * dlg.tfM01Range.setEnabled(false); else dlg.tfM01Range.setEnabled(true); 597 * dlg.tfM01Range.setText(getRange()); dlg.lM01Sector.setVisible(true); 598 * dlg.cbM01Sector.setVisible(true); } else { } } else { } } else { 599 */} 528 600 529 601 public void saveSign(String type) { 530 delSeaMarkKeys(dlg.node); 531 532 String str = dlg.panelMain.nameBox.getText(); 533 if (!str.isEmpty()) 534 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 535 "seamark:name", str)); 536 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", 537 type)); 538 } 539 540 protected void saveLightData() { 541 /* String colour; 542 if (dlg.cM01Fired.isSelected()) { 543 if (!(colour = LightColour[0]).isEmpty()) 544 if (colour.equals("R")) { 545 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 546 "seamark:light:colour", "red")); 547 } else if (colour.equals("G")) { 548 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 549 "seamark:light:colour", "green")); 550 } else if (colour.equals("W")) { 551 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 552 "seamark:light:colour", "white")); 553 } 554 555 if (!LightPeriod[0].isEmpty()) 556 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 557 "seamark:light:period", LightPeriod[0])); 558 559 if (!LightChar[0].isEmpty()) 560 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 561 "seamark:light:character", LightChar[0])); 562 563 if (!LightGroup[0].isEmpty()) 564 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 565 "seamark:light:group", LightGroup[0])); 566 567 if (!Height[0].isEmpty()) 568 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 569 "seamark:light:height", Height[0])); 570 571 if (!Range[0].isEmpty()) 572 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 573 "seamark:light:range", Range[0])); 574 575 for (int i = 1; i < 10; i++) { 576 if ((colour = LightColour[i]) != null) 577 if (colour.equals("R")) { 578 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 579 "seamark:light:" + i + ":colour", "red")); 580 if ((Bearing1[i] != null) && (Bearing2[i] != null) 581 && (Radius[i] != null)) 582 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 583 "seamark:light:" + i, "red:" + Bearing1[i] + ":" 584 + Bearing2[i] + ":" + Radius[i])); 585 } else if (colour.equals("G")) { 586 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 587 "seamark:light:" + i + ":colour", "green")); 588 if ((Bearing1[i] != null) && (Bearing2[i] != null) 589 && (Radius[i] != null)) 590 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 591 "seamark:light:" + i, "green:" + Bearing1[i] + ":" 592 + Bearing2[i] + ":" + Radius[i])); 593 } else if (colour.equals("W")) { 594 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 595 "seamark:light:" + i + ":colour", "white")); 596 if ((Bearing1[i] != null) && (Bearing2[i] != null) 597 && (Radius[i] != null)) 598 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 599 "seamark:light:" + i, "white:" + Bearing1[i] + ":" 600 + Bearing2[i] + ":" + Radius[i])); 601 } 602 603 if (LightPeriod[i] != null) 604 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 605 "seamark:light:" + i + ":period", LightPeriod[i])); 606 607 if (LightChar[i] != null) 608 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 609 "seamark:light:" + i + ":character", LightChar[i])); 610 611 if (LightGroup[i] != null) 612 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 613 "seamark:light:" + i + ":group", LightGroup[i])); 614 615 if (Height[i] != null) 616 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 617 "seamark:light:" + i + ":height", Height[i])); 618 619 if (Range[i] != null) 620 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 621 "seamark:light:" + i + ":range", Range[i])); 622 623 if (Bearing1[i] != null) 624 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 625 "seamark:light:" + i + ":sector_start", Bearing1[i])); 626 627 if (Bearing2[i] != null) 628 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 629 "seamark:light:" + i + ":sector_end", Bearing2[i])); 630 } 631 } 632 */ } 633 634 protected void saveTopMarkData(String shape, String colour) { 635 /* if (hasTopMark()) { 636 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 637 "seamark:topmark:shape", shape)); 638 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 639 "seamark:topmark:colour", colour)); 640 } 641 */ } 642 643 protected void saveRadarFogData() { 644 /* if (hasRadar()) { 645 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 646 "seamark:radar_reflector", "yes")); 647 } 648 if (hasRacon()) { 649 switch (RaType) { 650 case RATYPE_RACON: 651 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 652 "seamark:radar_transponder:category", "racon")); 653 if (!getRaconGroup().isEmpty()) 654 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 655 "seamark:radar_transponder:group", getRaconGroup())); 656 break; 657 case RATYPE_RAMARK: 658 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 659 "seamark:radar_transponder:category", "ramark")); 660 break; 661 case RATYPE_LEADING: 662 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 663 "seamark:radar_transponder:category", "leading")); 664 break; 665 default: 666 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 667 "seamark:radar_transponder", "yes")); 668 } 669 } 670 if (hasFog()) { 671 if (getFogSound() == 0) { 672 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 673 "seamark:fog_signal", "yes")); 674 } else { 675 switch (getFogSound()) { 676 case FOG_HORN: 677 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 678 "seamark:fog_signal:category", "horn")); 679 break; 680 case FOG_SIREN: 681 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 682 "seamark:fog_signal:category", "siren")); 683 break; 684 case FOG_DIA: 685 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 686 "seamark:fog_signal:category", "diaphone")); 687 break; 688 case FOG_BELL: 689 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 690 "seamark:fog_signal:category", "bell")); 691 break; 692 case FOG_WHIS: 693 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 694 "seamark:fog_signal:category", "whistle")); 695 break; 696 case FOG_GONG: 697 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 698 "seamark:fog_signal:category", "gong")); 699 break; 700 case FOG_EXPLOS: 701 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 702 "seamark:fog_signal:category", "explosive")); 703 break; 704 } 705 if (!getFogGroup().isEmpty()) 706 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 707 "seamark:fog_signal:group", getFogGroup())); 708 if (!getFogPeriod().isEmpty()) 709 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 710 "seamark:fog_signal:period", getFogPeriod())); 711 } 712 } 713 */ } 714 715 protected void delSeaMarkKeys(Node node) { 716 Iterator<String> it = node.getKeys().keySet().iterator(); 602 Iterator<String> it = dlg.node.getKeys().keySet().iterator(); 717 603 String str; 718 604 719 605 while (it.hasNext()) { 720 606 str = it.next(); 721 722 if (str.contains("seamark") == true) 723 if (str.compareTo("seamark") != 0) { 724 Main.main.undoRedo.add(new ChangePropertyCommand(node, str, 725 null)); 607 if (str.contains("seamark")) 608 if (!str.equals("seamark")) { 609 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, null)); 726 610 } 727 611 } 728 } 612 str = dlg.panelMain.nameBox.getText(); 613 if (!str.isEmpty()) 614 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 /* 620 * String colour; if (dlg.cM01Fired.isSelected()) { if (!(colour = 621 * LightColour[0]).isEmpty()) if (colour.equals("R")) { 622 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 623 * "seamark:light:colour", "red")); } else if (colour.equals("G")) { 624 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 625 * "seamark:light:colour", "green")); } else if (colour.equals("W")) { 626 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 627 * "seamark:light:colour", "white")); } 628 * 629 * if (!LightPeriod[0].isEmpty()) Main.main.undoRedo.add(new 630 * ChangePropertyCommand(Node, "seamark:light:period", LightPeriod[0])); 631 * 632 * if (!LightChar[0].isEmpty()) Main.main.undoRedo.add(new 633 * ChangePropertyCommand(Node, "seamark:light:character", LightChar[0])); 634 * 635 * if (!LightGroup[0].isEmpty()) Main.main.undoRedo.add(new 636 * ChangePropertyCommand(Node, "seamark:light:group", LightGroup[0])); 637 * 638 * if (!Height[0].isEmpty()) Main.main.undoRedo.add(new 639 * ChangePropertyCommand(Node, "seamark:light:height", Height[0])); 640 * 641 * if (!Range[0].isEmpty()) Main.main.undoRedo.add(new 642 * ChangePropertyCommand(Node, "seamark:light:range", Range[0])); 643 * 644 * for (int i = 1; i < 10; i++) { if ((colour = LightColour[i]) != null) if 645 * (colour.equals("R")) { Main.main.undoRedo.add(new 646 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "red")); if 647 * ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 648 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, "seamark:light:" + 649 * i, "red:" + Bearing1[i] + ":" + Bearing2[i] + ":" + Radius[i])); } else 650 * if (colour.equals("G")) { Main.main.undoRedo.add(new 651 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "green")); 652 * if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != 653 * null)) Main.main.undoRedo.add(new ChangePropertyCommand(Node, 654 * "seamark:light:" + i, "green:" + Bearing1[i] + ":" + Bearing2[i] + ":" + 655 * Radius[i])); } else if (colour.equals("W")) { Main.main.undoRedo.add(new 656 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "white")); 657 * if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != 658 * null)) Main.main.undoRedo.add(new ChangePropertyCommand(Node, 659 * "seamark:light:" + i, "white:" + Bearing1[i] + ":" + Bearing2[i] + ":" + 660 * Radius[i])); } 661 * 662 * if (LightPeriod[i] != null) Main.main.undoRedo.add(new 663 * ChangePropertyCommand(Node, "seamark:light:" + i + ":period", 664 * LightPeriod[i])); 665 * 666 * if (LightChar[i] != null) Main.main.undoRedo.add(new 667 * ChangePropertyCommand(Node, "seamark:light:" + i + ":character", 668 * LightChar[i])); 669 * 670 * if (LightGroup[i] != null) Main.main.undoRedo.add(new 671 * ChangePropertyCommand(Node, "seamark:light:" + i + ":group", 672 * LightGroup[i])); 673 * 674 * if (Height[i] != null) Main.main.undoRedo.add(new 675 * ChangePropertyCommand(Node, "seamark:light:" + i + ":height", 676 * Height[i])); 677 * 678 * if (Range[i] != null) Main.main.undoRedo.add(new 679 * ChangePropertyCommand(Node, "seamark:light:" + i + ":range", Range[i])); 680 * 681 * if (Bearing1[i] != null) Main.main.undoRedo.add(new 682 * ChangePropertyCommand(Node, "seamark:light:" + i + ":sector_start", 683 * Bearing1[i])); 684 * 685 * if (Bearing2[i] != null) Main.main.undoRedo.add(new 686 * ChangePropertyCommand(Node, "seamark:light:" + i + ":sector_end", 687 * Bearing2[i])); } } 688 */} 689 690 protected void saveTopMarkData(String shape, String colour) { 691 /* 692 * if (hasTopMark()) { Main.main.undoRedo.add(new 693 * ChangePropertyCommand(Node, "seamark:topmark:shape", shape)); 694 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 695 * "seamark:topmark:colour", colour)); } 696 */} 697 698 protected void saveRadarFogData() { 699 /* 700 * if (hasRadar()) { Main.main.undoRedo.add(new ChangePropertyCommand(Node, 701 * "seamark:radar_reflector", "yes")); } if (hasRacon()) { switch (RaType) { 702 * case RATYPE_RACON: Main.main.undoRedo.add(new ChangePropertyCommand(Node, 703 * "seamark:radar_transponder:category", "racon")); if 704 * (!getRaconGroup().isEmpty()) Main.main.undoRedo.add(new 705 * ChangePropertyCommand(Node, "seamark:radar_transponder:group", 706 * getRaconGroup())); break; case RATYPE_RAMARK: Main.main.undoRedo.add(new 707 * ChangePropertyCommand(Node, "seamark:radar_transponder:category", 708 * "ramark")); break; case RATYPE_LEADING: Main.main.undoRedo.add(new 709 * ChangePropertyCommand(Node, "seamark:radar_transponder:category", 710 * "leading")); break; default: Main.main.undoRedo.add(new 711 * ChangePropertyCommand(Node, "seamark:radar_transponder", "yes")); } } if 712 * (hasFog()) { if (getFogSound() == 0) { Main.main.undoRedo.add(new 713 * ChangePropertyCommand(Node, "seamark:fog_signal", "yes")); } else { 714 * switch (getFogSound()) { case FOG_HORN: Main.main.undoRedo.add(new 715 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "horn")); 716 * break; case FOG_SIREN: Main.main.undoRedo.add(new 717 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "siren")); 718 * break; case FOG_DIA: Main.main.undoRedo.add(new 719 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "diaphone")); 720 * break; case FOG_BELL: Main.main.undoRedo.add(new 721 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "bell")); 722 * break; case FOG_WHIS: Main.main.undoRedo.add(new 723 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "whistle")); 724 * break; case FOG_GONG: Main.main.undoRedo.add(new 725 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "gong")); 726 * break; case FOG_EXPLOS: Main.main.undoRedo.add(new 727 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "explosive")); 728 * break; } if (!getFogGroup().isEmpty()) Main.main.undoRedo.add(new 729 * ChangePropertyCommand(Node, "seamark:fog_signal:group", getFogGroup())); 730 * if (!getFogPeriod().isEmpty()) Main.main.undoRedo.add(new 731 * ChangePropertyCommand(Node, "seamark:fog_signal:period", 732 * getFogPeriod())); } } 733 */} 729 734 730 735 }
Note:
See TracChangeset
for help on using the changeset viewer.