Changeset 24835 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-12-22T11:05:28+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r24830 r24835 79 79 public void actionPerformed(java.awt.event.ActionEvent e) { 80 80 if (portButton.isSelected()) { 81 if (!(dlg.mark instanceof MarkLat)) 82 dlg.mark = new MarkLat(dlg); 83 dlg.mark.setCategory(Cat.PORT_HAND); 81 if (!(dlg.mark instanceof MarkLat) 82 || (dlg.mark.getCategory() != Cat.LAT_PORT)) 83 dlg.mark = new MarkLat(dlg); 84 dlg.mark.setCategory(Cat.LAT_PORT); 84 85 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 85 86 dlg.mark.setColour(Col.RED); … … 94 95 portButton.setBorderPainted(false); 95 96 panelPort.setVisible(false); 97 panelPort.clearSelections(); 96 98 } 97 99 if (stbdButton.isSelected()) { 98 if (!(dlg.mark instanceof MarkLat)) 99 dlg.mark = new MarkLat(dlg); 100 dlg.mark.setCategory(Cat.STARBOARD_HAND); 100 if (!(dlg.mark instanceof MarkLat) 101 || (dlg.mark.getCategory() != Cat.LAT_STBD)) 102 dlg.mark = new MarkLat(dlg); 103 dlg.mark.setCategory(Cat.LAT_STBD); 101 104 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 102 105 dlg.mark.setColour(Col.GREEN); … … 111 114 stbdButton.setBorderPainted(false); 112 115 panelStbd.setVisible(false); 116 panelStbd.clearSelections(); 113 117 } 114 118 if (prefPortButton.isSelected()) { 115 if (!(dlg.mark instanceof MarkLat)) 116 dlg.mark = new MarkLat(dlg); 117 dlg.mark.setCategory(Cat.PREF_PORT_HAND); 119 if (!(dlg.mark instanceof MarkLat) 120 || (dlg.mark.getCategory() != Cat.LAT_PREF_PORT)) 121 dlg.mark = new MarkLat(dlg); 122 dlg.mark.setCategory(Cat.LAT_PREF_PORT); 118 123 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 119 124 dlg.mark.setColour(Col.RED_GREEN_RED); … … 128 133 prefPortButton.setBorderPainted(false); 129 134 panelPrefPort.setVisible(false); 135 panelPrefPort.clearSelections(); 130 136 } 131 137 if (prefStbdButton.isSelected()) { 132 if (!(dlg.mark instanceof MarkLat)) 133 dlg.mark = new MarkLat(dlg); 134 dlg.mark.setCategory(Cat.PREF_STARBOARD_HAND); 138 if (!(dlg.mark instanceof MarkLat) 139 || (dlg.mark.getCategory() != Cat.LAT_PREF_STBD)) 140 dlg.mark = new MarkLat(dlg); 141 dlg.mark.setCategory(Cat.LAT_PREF_STBD); 135 142 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 136 143 dlg.mark.setColour(Col.GREEN_RED_GREEN); … … 145 152 prefStbdButton.setBorderPainted(false); 146 153 panelPrefStbd.setVisible(false); 154 panelPrefStbd.clearSelections(); 147 155 } 148 156 if (safeWaterButton.isSelected()) { … … 155 163 safeWaterButton.setBorderPainted(false); 156 164 panelSafeWater.setVisible(false); 157 } 158 if (dlg.mark != null) dlg.mark.paintSign(); 165 panelSafeWater.clearSelections(); 166 } 167 if (dlg.mark != null) 168 dlg.mark.paintSign(); 159 169 } 160 170 }; … … 181 191 "/images/PortButton.png"))); 182 192 portButton.setBounds(new Rectangle(0, 0, 52, 32)); 183 portButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 193 portButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 194 2)); 184 195 portButton.setToolTipText(Messages.getString("PortTip")); 185 196 } … … 192 203 "/images/StbdButton.png"))); 193 204 stbdButton.setBounds(new Rectangle(0, 32, 52, 32)); 194 stbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 205 stbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 206 2)); 195 207 stbdButton.setToolTipText(Messages.getString("StbdTip")); 196 208 } … … 203 215 .getResource("/images/PrefPortButton.png"))); 204 216 prefPortButton.setBounds(new Rectangle(0, 64, 52, 32)); 205 prefPortButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 217 prefPortButton.setBorder(BorderFactory.createLineBorder( 218 Color.magenta, 2)); 206 219 prefPortButton.setToolTipText(Messages.getString("PrefPortTip")); 207 220 } … … 214 227 .getResource("/images/PrefStbdButton.png"))); 215 228 prefStbdButton.setBounds(new Rectangle(0, 96, 52, 32)); 216 prefStbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 229 prefStbdButton.setBorder(BorderFactory.createLineBorder( 230 Color.magenta, 2)); 217 231 prefStbdButton.setToolTipText(Messages.getString("PrefStbdTip")); 218 232 } … … 225 239 .getResource("/images/SafeWaterButton.png"))); 226 240 safeWaterButton.setBounds(new Rectangle(0, 128, 52, 32)); 227 safeWaterButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 241 safeWaterButton.setBorder(BorderFactory.createLineBorder( 242 Color.magenta, 2)); 228 243 safeWaterButton.setToolTipText(Messages.getString("SafeWaterTip")); 229 244 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r24830 r24835 130 130 chanButton.setBorderPainted(false); 131 131 panelChan.setVisible(false); 132 panelChan.clearSelections(); 132 133 } 133 134 if (hazButton.isSelected()) { … … 137 138 hazButton.setBorderPainted(false); 138 139 panelHaz.setVisible(false); 140 panelHaz.clearSelections(); 139 141 } 140 142 if (specButton.isSelected()) { … … 146 148 specButton.setBorderPainted(false); 147 149 panelSpec.setVisible(false); 150 panelSpec.clearSelections(); 148 151 } 149 152 if (lightsButton.isSelected()) { … … 155 158 lightsButton.setBorderPainted(false); 156 159 panelLights.setVisible(false); 160 panelLights.clearSelections(); 157 161 } 158 162 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r24830 r24835 19 19 import oseam.Messages; 20 20 import oseam.dialogs.OSeaMAction; 21 import oseam.seamarks.SeaMark; 22 import oseam.seamarks.SeaMark.Shp; 21 23 22 24 import java.awt.Cursor; … … 37 39 public JRadioButton towerButton = null; 38 40 public JRadioButton perchButton = null; 41 private ActionListener alShape = null; 39 42 40 43 public PanelPort(OSeaMAction dia) { … … 72 75 shapeButtons.add(towerButton); 73 76 shapeButtons.add(perchButton); 74 ActionListeneralShape = new ActionListener() {77 alShape = new ActionListener() { 75 78 public void actionPerformed(java.awt.event.ActionEvent e) { 76 pillarButton.setBorderPainted(pillarButton.isSelected()); 77 sparButton.setBorderPainted(sparButton.isSelected()); 78 canButton.setBorderPainted(canButton.isSelected()); 79 floatButton.setBorderPainted(floatButton.isSelected()); 80 beaconButton.setBorderPainted(beaconButton.isSelected()); 81 towerButton.setBorderPainted(towerButton.isSelected()); 82 perchButton.setBorderPainted(perchButton.isSelected()); 83 dlg.mark.paintSign(); 79 if (pillarButton.isSelected()) { 80 dlg.mark.setShape(Shp.PILLAR); 81 pillarButton.setBorderPainted(true); 82 } else { 83 pillarButton.setBorderPainted(false); 84 } 85 if (sparButton.isSelected()) { 86 dlg.mark.setShape(Shp.SPAR); 87 sparButton.setBorderPainted(true); 88 } else { 89 sparButton.setBorderPainted(false); 90 } 91 if (canButton.isSelected()) { 92 dlg.mark.setShape(Shp.CAN); 93 canButton.setBorderPainted(true); 94 } else { 95 canButton.setBorderPainted(false); 96 } 97 if (floatButton.isSelected()) { 98 dlg.mark.setShape(Shp.FLOAT); 99 floatButton.setBorderPainted(true); 100 } else { 101 floatButton.setBorderPainted(false); 102 } 103 if (beaconButton.isSelected()) { 104 dlg.mark.setShape(Shp.BEACON); 105 beaconButton.setBorderPainted(true); 106 } else { 107 beaconButton.setBorderPainted(false); 108 } 109 if (towerButton.isSelected()) { 110 dlg.mark.setShape(Shp.TOWER); 111 towerButton.setBorderPainted(true); 112 } else { 113 towerButton.setBorderPainted(false); 114 } 115 if (perchButton.isSelected()) { 116 dlg.mark.setShape(Shp.PERCH); 117 perchButton.setBorderPainted(true); 118 } else { 119 perchButton.setBorderPainted(false); 120 } 121 if (dlg.mark != null) 122 dlg.mark.paintSign(); 84 123 } 85 124 }; … … 94 133 95 134 public void clearSelections() { 96 135 shapeButtons.clearSelection(); 136 alShape.actionPerformed(null); 97 137 } 98 138 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefPort.java
r24830 r24835 19 19 import oseam.Messages; 20 20 import oseam.dialogs.OSeaMAction; 21 import oseam.seamarks.SeaMark.Shp; 21 22 22 23 import java.awt.Cursor; … … 36 37 public JRadioButton beaconButton = null; 37 38 public JRadioButton towerButton = null; 39 private ActionListener alShape = null; 38 40 39 41 public PanelPrefPort(OSeaMAction dia) { … … 69 71 shapeButtons.add(beaconButton); 70 72 shapeButtons.add(towerButton); 71 ActionListeneralShape = new ActionListener() {73 alShape = new ActionListener() { 72 74 public void actionPerformed(java.awt.event.ActionEvent e) { 73 pillarButton.setBorderPainted(pillarButton.isSelected()); 74 sparButton.setBorderPainted(sparButton.isSelected()); 75 canButton.setBorderPainted(canButton.isSelected()); 76 floatButton.setBorderPainted(floatButton.isSelected()); 77 beaconButton.setBorderPainted(beaconButton.isSelected()); 78 towerButton.setBorderPainted(towerButton.isSelected()); 79 dlg.mark.paintSign(); 75 if (pillarButton.isSelected()) { 76 dlg.mark.setShape(Shp.PILLAR); 77 pillarButton.setBorderPainted(true); 78 } else { 79 pillarButton.setBorderPainted(false); 80 } 81 if (sparButton.isSelected()) { 82 dlg.mark.setShape(Shp.SPAR); 83 sparButton.setBorderPainted(true); 84 } else { 85 sparButton.setBorderPainted(false); 86 } 87 if (canButton.isSelected()) { 88 dlg.mark.setShape(Shp.CAN); 89 canButton.setBorderPainted(true); 90 } else { 91 canButton.setBorderPainted(false); 92 } 93 if (floatButton.isSelected()) { 94 dlg.mark.setShape(Shp.FLOAT); 95 floatButton.setBorderPainted(true); 96 } else { 97 floatButton.setBorderPainted(false); 98 } 99 if (beaconButton.isSelected()) { 100 dlg.mark.setShape(Shp.BEACON); 101 beaconButton.setBorderPainted(true); 102 } else { 103 beaconButton.setBorderPainted(false); 104 } 105 if (towerButton.isSelected()) { 106 dlg.mark.setShape(Shp.TOWER); 107 towerButton.setBorderPainted(true); 108 } else { 109 towerButton.setBorderPainted(false); 110 } 111 if (dlg.mark != null) 112 dlg.mark.paintSign(); 80 113 } 81 114 }; … … 89 122 90 123 public void clearSelections() { 91 124 shapeButtons.clearSelection(); 125 alShape.actionPerformed(null); 92 126 } 93 127 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefStbd.java
r24830 r24835 19 19 import oseam.Messages; 20 20 import oseam.dialogs.OSeaMAction; 21 import oseam.seamarks.SeaMark.Shp; 21 22 22 23 import java.awt.Cursor; … … 36 37 public JRadioButton beaconButton = null; 37 38 public JRadioButton towerButton = null; 39 private ActionListener alShape = null; 38 40 39 41 public PanelPrefStbd(OSeaMAction dia) { … … 69 71 shapeButtons.add(beaconButton); 70 72 shapeButtons.add(towerButton); 71 ActionListeneralShape = new ActionListener() {73 alShape = new ActionListener() { 72 74 public void actionPerformed(java.awt.event.ActionEvent e) { 73 pillarButton.setBorderPainted(pillarButton.isSelected()); 74 sparButton.setBorderPainted(sparButton.isSelected()); 75 coneButton.setBorderPainted(coneButton.isSelected()); 76 floatButton.setBorderPainted(floatButton.isSelected()); 77 beaconButton.setBorderPainted(beaconButton.isSelected()); 78 towerButton.setBorderPainted(towerButton.isSelected()); 79 dlg.mark.paintSign(); 75 if (pillarButton.isSelected()) { 76 dlg.mark.setShape(Shp.PILLAR); 77 pillarButton.setBorderPainted(true); 78 } else { 79 pillarButton.setBorderPainted(false); 80 } 81 if (sparButton.isSelected()) { 82 dlg.mark.setShape(Shp.SPAR); 83 sparButton.setBorderPainted(true); 84 } else { 85 sparButton.setBorderPainted(false); 86 } 87 if (coneButton.isSelected()) { 88 dlg.mark.setShape(Shp.CONE); 89 coneButton.setBorderPainted(true); 90 } else { 91 coneButton.setBorderPainted(false); 92 } 93 if (floatButton.isSelected()) { 94 dlg.mark.setShape(Shp.FLOAT); 95 floatButton.setBorderPainted(true); 96 } else { 97 floatButton.setBorderPainted(false); 98 } 99 if (beaconButton.isSelected()) { 100 dlg.mark.setShape(Shp.BEACON); 101 beaconButton.setBorderPainted(true); 102 } else { 103 beaconButton.setBorderPainted(false); 104 } 105 if (towerButton.isSelected()) { 106 dlg.mark.setShape(Shp.TOWER); 107 towerButton.setBorderPainted(true); 108 } else { 109 towerButton.setBorderPainted(false); 110 } 111 if (dlg.mark != null) 112 dlg.mark.paintSign(); 80 113 } 81 114 }; … … 89 122 90 123 public void clearSelections() { 91 124 shapeButtons.clearSelection(); 125 alShape.actionPerformed(null); 92 126 } 93 127 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSafeWater.java
r24830 r24835 19 19 import oseam.Messages; 20 20 import oseam.dialogs.OSeaMAction; 21 import oseam.seamarks.SeaMark.Shp; 21 22 22 23 import java.awt.Cursor; … … 32 33 private JRadioButton barrelButton = null; 33 34 private JRadioButton floatButton = null; 35 private ActionListener alShape = null; 34 36 35 37 public PanelSafeWater(OSeaMAction dia) { … … 48 50 shapeButtons.add(barrelButton); 49 51 shapeButtons.add(floatButton); 50 ActionListeneralShape = new ActionListener() {52 alShape = new ActionListener() { 51 53 public void actionPerformed(java.awt.event.ActionEvent e) { 52 pillarButton.setBorderPainted(pillarButton.isSelected()); 53 sparButton.setBorderPainted(sparButton.isSelected()); 54 sphereButton.setBorderPainted(sphereButton.isSelected()); 55 barrelButton.setBorderPainted(barrelButton.isSelected()); 56 floatButton.setBorderPainted(floatButton.isSelected()); 54 if (pillarButton.isSelected()) { 55 dlg.mark.setShape(Shp.PILLAR); 56 pillarButton.setBorderPainted(true); 57 } else { 58 pillarButton.setBorderPainted(false); 59 } 60 if (sparButton.isSelected()) { 61 dlg.mark.setShape(Shp.SPAR); 62 sparButton.setBorderPainted(true); 63 } else { 64 sparButton.setBorderPainted(false); 65 } 66 if (sphereButton.isSelected()) { 67 dlg.mark.setShape(Shp.SPHERE); 68 sphereButton.setBorderPainted(true); 69 } else { 70 sphereButton.setBorderPainted(false); 71 } 72 if (barrelButton.isSelected()) { 73 dlg.mark.setShape(Shp.BARREL); 74 barrelButton.setBorderPainted(true); 75 } else { 76 barrelButton.setBorderPainted(false); 77 } 78 if (floatButton.isSelected()) { 79 dlg.mark.setShape(Shp.FLOAT); 80 floatButton.setBorderPainted(true); 81 } else { 82 floatButton.setBorderPainted(false); 83 } 84 if (dlg.mark != null) 85 dlg.mark.paintSign(); 57 86 } 58 87 }; … … 65 94 66 95 public void clearSelections() { 67 96 shapeButtons.clearSelection(); 97 alShape.actionPerformed(null); 68 98 } 69 99 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r24830 r24835 19 19 import oseam.Messages; 20 20 import oseam.dialogs.OSeaMAction; 21 import oseam.seamarks.SeaMark.Shp; 21 22 22 23 import java.awt.Cursor; … … 37 38 public JRadioButton towerButton = null; 38 39 public JRadioButton perchButton = null; 40 private ActionListener alShape = null; 39 41 40 42 public PanelStbd(OSeaMAction dia) { … … 72 74 shapeButtons.add(towerButton); 73 75 shapeButtons.add(perchButton); 74 ActionListeneralShape = new ActionListener() {76 alShape = new ActionListener() { 75 77 public void actionPerformed(java.awt.event.ActionEvent e) { 76 pillarButton.setBorderPainted(pillarButton.isSelected()); 77 sparButton.setBorderPainted(sparButton.isSelected()); 78 coneButton.setBorderPainted(coneButton.isSelected()); 79 floatButton.setBorderPainted(floatButton.isSelected()); 80 beaconButton.setBorderPainted(beaconButton.isSelected()); 81 towerButton.setBorderPainted(towerButton.isSelected()); 82 perchButton.setBorderPainted(perchButton.isSelected()); 83 dlg.mark.paintSign(); 78 if (pillarButton.isSelected()) { 79 dlg.mark.setShape(Shp.PILLAR); 80 pillarButton.setBorderPainted(true); 81 } else { 82 pillarButton.setBorderPainted(false); 83 } 84 if (sparButton.isSelected()) { 85 dlg.mark.setShape(Shp.SPAR); 86 sparButton.setBorderPainted(true); 87 } else { 88 sparButton.setBorderPainted(false); 89 } 90 if (coneButton.isSelected()) { 91 dlg.mark.setShape(Shp.CONE); 92 coneButton.setBorderPainted(true); 93 } else { 94 coneButton.setBorderPainted(false); 95 } 96 if (floatButton.isSelected()) { 97 dlg.mark.setShape(Shp.FLOAT); 98 floatButton.setBorderPainted(true); 99 } else { 100 floatButton.setBorderPainted(false); 101 } 102 if (beaconButton.isSelected()) { 103 dlg.mark.setShape(Shp.BEACON); 104 beaconButton.setBorderPainted(true); 105 } else { 106 beaconButton.setBorderPainted(false); 107 } 108 if (towerButton.isSelected()) { 109 dlg.mark.setShape(Shp.TOWER); 110 towerButton.setBorderPainted(true); 111 } else { 112 towerButton.setBorderPainted(false); 113 } 114 if (perchButton.isSelected()) { 115 dlg.mark.setShape(Shp.PERCH); 116 perchButton.setBorderPainted(true); 117 } else { 118 perchButton.setBorderPainted(false); 119 } 120 if (dlg.mark != null) 121 dlg.mark.paintSign(); 84 122 } 85 123 }; … … 94 132 95 133 public void clearSelections() { 96 134 shapeButtons.clearSelection(); 135 alShape.actionPerformed(null); 97 136 } 98 137 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24830 r24835 259 259 public void setLightColour() { 260 260 if (getRegion() == IALA_A) { 261 if (getCategory() == Cat. PORT_HAND || getCategory() == Cat.PREF_PORT_HAND)261 if (getCategory() == Cat.LAT_PORT || getCategory() == Cat.LAT_PREF_PORT) 262 262 super.setLightColour("R"); 263 263 else 264 264 super.setLightColour("G"); 265 265 } else { 266 if (getCategory() == Cat. PORT_HAND || getCategory() == Cat.PREF_PORT_HAND)266 if (getCategory() == Cat.LAT_PORT || getCategory() == Cat.LAT_PREF_PORT) 267 267 super.setLightColour("G"); 268 268 else … … 276 276 super.paintSign(); 277 277 */ 278 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) {279 278 boolean region = getRegion(); 280 Shp style = getShape(); 281 282 String image = "/images/Lateral"; 283 284 switch (getCategory()) { 285 case PORT_HAND: 286 if (region == IALA_A) 287 switch (style) { 288 case CAN: 289 image += "_Can_Red"; 290 break; 291 case PILLAR: 292 image += "_Pillar_Red"; 293 break; 294 case SPAR: 295 image += "_Spar_Red"; 296 break; 297 case BEACON: 298 image += "_Beacon_Red"; 299 break; 300 case TOWER: 301 image += "_Tower_Red"; 302 break; 303 case FLOAT: 304 image += "_Float_Red"; 305 break; 306 case PERCH: 307 image += "_Perch_Port"; 308 break; 309 default: 310 } 311 else 312 switch (style) { 313 case CAN: 314 image += "_Can_Green"; 315 break; 316 case PILLAR: 317 image += "_Pillar_Green"; 318 break; 319 case SPAR: 320 image += "_Spar_Green"; 321 break; 322 case BEACON: 323 image += "_Beacon_Green"; 324 break; 325 case TOWER: 326 image += "_Tower_Green"; 327 break; 328 case FLOAT: 329 image += "_Float_Green"; 330 break; 331 case PERCH: 332 image += "_Perch_Port"; 333 break; 334 default: 335 } 336 break; 337 338 case STARBOARD_HAND: 339 if (region == IALA_A) 340 switch (style) { 341 case CONE: 342 image += "_Cone_Green"; 343 break; 344 case PILLAR: 345 image += "_Pillar_Green"; 346 break; 347 case SPAR: 348 image += "_Spar_Green"; 349 break; 350 case BEACON: 351 image += "_Beacon_Green"; 352 break; 353 case TOWER: 354 image += "_Tower_Green"; 355 break; 356 case FLOAT: 357 image += "_Float_Green"; 358 break; 359 case PERCH: 360 image += "_Perch_Starboard"; 361 break; 362 default: 363 } 364 else 365 switch (style) { 366 case CONE: 367 image += "_Cone_Red"; 368 break; 369 case PILLAR: 370 image += "_Pillar_Red"; 371 break; 372 case SPAR: 373 image += "_Spar_Red"; 374 break; 375 case BEACON: 376 image += "_Beacon_Red"; 377 break; 378 case TOWER: 379 image += "_Tower_Red"; 380 break; 381 case FLOAT: 382 image += "_Float_Red"; 383 break; 384 case PERCH: 385 image += "_Perch_Starboard"; 386 break; 387 default: 388 } 389 break; 390 391 case PREF_PORT_HAND: 392 if (region == IALA_A) 393 switch (style) { 394 case CAN: 395 image += "_Can_Red_Green_Red"; 396 break; 397 case PILLAR: 398 image += "_Pillar_Red_Green_Red"; 399 break; 400 case SPAR: 401 image += "_Spar_Red_Green_Red"; 402 break; 403 case BEACON: 404 image += "_Beacon_Red_Green_Red"; 405 break; 406 case TOWER: 407 image += "_Tower_Red_Green_Red"; 408 break; 409 case FLOAT: 410 image += "_Float_Red_Green_Red"; 411 break; 412 default: 413 } 414 else 415 switch (style) { 416 case CAN: 417 image += "_Can_Green_Red_Green"; 418 break; 419 case PILLAR: 420 image += "_Pillar_Green_Red_Green"; 421 break; 422 case SPAR: 423 image += "_Spar_Green_Red_Green"; 424 break; 425 case BEACON: 426 image += "_Beacon_Green_Red_Green"; 427 break; 428 case TOWER: 429 image += "_Tower_Green_Red_Green"; 430 break; 431 case FLOAT: 432 image += "_Float_Green_Red_Green"; 433 break; 434 default: 435 } 436 break; 437 438 case PREF_STARBOARD_HAND: 439 if (region == IALA_A) 440 switch (style) { 441 case CONE: 442 image += "_Cone_Green_Red_Green"; 443 break; 444 case PILLAR: 445 image += "_Pillar_Green_Red_Green"; 446 break; 447 case SPAR: 448 image += "_Spar_Green_Red_Green"; 449 break; 450 case BEACON: 451 image += "_Beacon_Green_Red_Green"; 452 break; 453 case TOWER: 454 image += "_Tower_Green_Red_Green"; 455 break; 456 case FLOAT: 457 image += "_Float_Green_Red_Green"; 458 break; 459 default: 460 } 461 else 462 switch (style) { 463 case CONE: 464 image += "_Cone_Red_Green_Red"; 465 break; 466 case PILLAR: 467 image += "_Pillar_Red_Green_Red"; 468 break; 469 case SPAR: 470 image += "_Spar_Red_Green_Red"; 471 break; 472 case BEACON: 473 image += "_Beacon_Red_Green_Red"; 474 break; 475 case TOWER: 476 image += "_Tower_Red_Green_Red"; 477 break; 478 case FLOAT: 479 image += "_Float_Red_Green_Red"; 480 break; 481 default: 482 } 483 break; 484 485 default: 486 } 487 488 if (!image.equals("/images/Lateral")) { 489 490 image += ".png"; 491 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 492 .getResource(image))); 493 494 if (hasTopMark()) { 495 image = ""; 496 switch (getCategory()) { 497 case PORT_HAND: 498 case PREF_PORT_HAND: 499 if (region == IALA_A) 500 switch (style) { 501 case CAN: 502 image = "/images/Top_Can_Red_Buoy_Small.png"; 503 break; 504 case PILLAR: 505 case SPAR: 506 image = "/images/Top_Can_Red_Buoy.png"; 507 break; 508 case BEACON: 509 case TOWER: 510 image = "/images/Top_Can_Red_Beacon.png"; 511 break; 512 case FLOAT: 513 image = "/images/Top_Can_Red_Float.png"; 514 break; 515 } 516 else 517 switch (style) { 518 case CAN: 519 image = "/images/Top_Can_Green_Buoy_Small.png"; 520 break; 521 case PILLAR: 522 case SPAR: 523 image = "/images/Top_Can_Green_Buoy.png"; 524 break; 525 case BEACON: 526 case TOWER: 527 image = "/images/Top_Can_Green_Beacon.png"; 528 break; 529 case FLOAT: 530 image = "/images/Top_Can_Green_Float.png"; 531 break; 532 } 533 break; 534 535 case STARBOARD_HAND: 536 case PREF_STARBOARD_HAND: 537 if (region == IALA_A) 538 switch (style) { 539 case CONE: 540 image = "/images/Top_Cone_Green_Buoy_Small.png"; 541 break; 542 case PILLAR: 543 case SPAR: 544 image = "/images/Top_Cone_Green_Buoy.png"; 545 break; 546 case BEACON: 547 case TOWER: 548 image = "/images/Top_Cone_Green_Beacon.png"; 549 break; 550 case FLOAT: 551 image = "/images/Top_Cone_Green_Float.png"; 552 break; 553 } 554 else 555 switch (style) { 556 case CONE: 557 image = "/images/Top_Cone_Red_Buoy_Small.png"; 558 break; 559 case PILLAR: 560 case SPAR: 561 image = "/images/Top_Cone_Red_Buoy.png"; 562 break; 563 case BEACON: 564 case TOWER: 565 image = "/images/Top_Cone_Red_Beacon.png"; 566 break; 567 case FLOAT: 568 image = "/images/Top_Cone_Red_Float.png"; 569 break; 570 } 571 break; 572 } 573 if (!image.isEmpty()) 574 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 575 .getResource(image))); 576 } 577 } else 578 dlg.panelMain.shapeIcon.setIcon(null); 279 Shp style = getShape(); 280 281 String image = "/images/Lateral"; 282 283 switch (getCategory()) { 284 case LAT_PORT: 285 if (region == IALA_A) 286 switch (style) { 287 case CAN: 288 image += "_Can_Red"; 289 break; 290 case PILLAR: 291 image += "_Pillar_Red"; 292 break; 293 case SPAR: 294 image += "_Spar_Red"; 295 break; 296 case BEACON: 297 image += "_Beacon_Red"; 298 break; 299 case TOWER: 300 image += "_Tower_Red"; 301 break; 302 case FLOAT: 303 image += "_Float_Red"; 304 break; 305 case PERCH: 306 image += "_Perch_Port"; 307 break; 308 default: 309 } 310 else 311 switch (style) { 312 case CAN: 313 image += "_Can_Green"; 314 break; 315 case PILLAR: 316 image += "_Pillar_Green"; 317 break; 318 case SPAR: 319 image += "_Spar_Green"; 320 break; 321 case BEACON: 322 image += "_Beacon_Green"; 323 break; 324 case TOWER: 325 image += "_Tower_Green"; 326 break; 327 case FLOAT: 328 image += "_Float_Green"; 329 break; 330 case PERCH: 331 image += "_Perch_Port"; 332 break; 333 default: 334 } 335 break; 336 337 case LAT_STBD: 338 if (region == IALA_A) 339 switch (style) { 340 case CONE: 341 image += "_Cone_Green"; 342 break; 343 case PILLAR: 344 image += "_Pillar_Green"; 345 break; 346 case SPAR: 347 image += "_Spar_Green"; 348 break; 349 case BEACON: 350 image += "_Beacon_Green"; 351 break; 352 case TOWER: 353 image += "_Tower_Green"; 354 break; 355 case FLOAT: 356 image += "_Float_Green"; 357 break; 358 case PERCH: 359 image += "_Perch_Starboard"; 360 break; 361 default: 362 } 363 else 364 switch (style) { 365 case CONE: 366 image += "_Cone_Red"; 367 break; 368 case PILLAR: 369 image += "_Pillar_Red"; 370 break; 371 case SPAR: 372 image += "_Spar_Red"; 373 break; 374 case BEACON: 375 image += "_Beacon_Red"; 376 break; 377 case TOWER: 378 image += "_Tower_Red"; 379 break; 380 case FLOAT: 381 image += "_Float_Red"; 382 break; 383 case PERCH: 384 image += "_Perch_Starboard"; 385 break; 386 default: 387 } 388 break; 389 390 case LAT_PREF_PORT: 391 if (region == IALA_A) 392 switch (style) { 393 case CAN: 394 image += "_Can_Red_Green_Red"; 395 break; 396 case PILLAR: 397 image += "_Pillar_Red_Green_Red"; 398 break; 399 case SPAR: 400 image += "_Spar_Red_Green_Red"; 401 break; 402 case BEACON: 403 image += "_Beacon_Red_Green_Red"; 404 break; 405 case TOWER: 406 image += "_Tower_Red_Green_Red"; 407 break; 408 case FLOAT: 409 image += "_Float_Red_Green_Red"; 410 break; 411 default: 412 } 413 else 414 switch (style) { 415 case CAN: 416 image += "_Can_Green_Red_Green"; 417 break; 418 case PILLAR: 419 image += "_Pillar_Green_Red_Green"; 420 break; 421 case SPAR: 422 image += "_Spar_Green_Red_Green"; 423 break; 424 case BEACON: 425 image += "_Beacon_Green_Red_Green"; 426 break; 427 case TOWER: 428 image += "_Tower_Green_Red_Green"; 429 break; 430 case FLOAT: 431 image += "_Float_Green_Red_Green"; 432 break; 433 default: 434 } 435 break; 436 437 case LAT_PREF_STBD: 438 if (region == IALA_A) 439 switch (style) { 440 case CONE: 441 image += "_Cone_Green_Red_Green"; 442 break; 443 case PILLAR: 444 image += "_Pillar_Green_Red_Green"; 445 break; 446 case SPAR: 447 image += "_Spar_Green_Red_Green"; 448 break; 449 case BEACON: 450 image += "_Beacon_Green_Red_Green"; 451 break; 452 case TOWER: 453 image += "_Tower_Green_Red_Green"; 454 break; 455 case FLOAT: 456 image += "_Float_Green_Red_Green"; 457 break; 458 default: 459 } 460 else 461 switch (style) { 462 case CONE: 463 image += "_Cone_Red_Green_Red"; 464 break; 465 case PILLAR: 466 image += "_Pillar_Red_Green_Red"; 467 break; 468 case SPAR: 469 image += "_Spar_Red_Green_Red"; 470 break; 471 case BEACON: 472 image += "_Beacon_Red_Green_Red"; 473 break; 474 case TOWER: 475 image += "_Tower_Red_Green_Red"; 476 break; 477 case FLOAT: 478 image += "_Float_Red_Green_Red"; 479 break; 480 default: 481 } 482 break; 483 484 default: 579 485 } 486 487 if (!image.equals("/images/Lateral")) { 488 489 image += ".png"; 490 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 491 .getResource(image))); 492 493 if (hasTopMark()) { 494 image = ""; 495 switch (getCategory()) { 496 case LAT_PORT: 497 case LAT_PREF_PORT: 498 if (region == IALA_A) 499 switch (style) { 500 case CAN: 501 image = "/images/Top_Can_Red_Buoy_Small.png"; 502 break; 503 case PILLAR: 504 case SPAR: 505 image = "/images/Top_Can_Red_Buoy.png"; 506 break; 507 case BEACON: 508 case TOWER: 509 image = "/images/Top_Can_Red_Beacon.png"; 510 break; 511 case FLOAT: 512 image = "/images/Top_Can_Red_Float.png"; 513 break; 514 } 515 else 516 switch (style) { 517 case CAN: 518 image = "/images/Top_Can_Green_Buoy_Small.png"; 519 break; 520 case PILLAR: 521 case SPAR: 522 image = "/images/Top_Can_Green_Buoy.png"; 523 break; 524 case BEACON: 525 case TOWER: 526 image = "/images/Top_Can_Green_Beacon.png"; 527 break; 528 case FLOAT: 529 image = "/images/Top_Can_Green_Float.png"; 530 break; 531 } 532 break; 533 534 case LAT_STBD: 535 case LAT_PREF_STBD: 536 if (region == IALA_A) 537 switch (style) { 538 case CONE: 539 image = "/images/Top_Cone_Green_Buoy_Small.png"; 540 break; 541 case PILLAR: 542 case SPAR: 543 image = "/images/Top_Cone_Green_Buoy.png"; 544 break; 545 case BEACON: 546 case TOWER: 547 image = "/images/Top_Cone_Green_Beacon.png"; 548 break; 549 case FLOAT: 550 image = "/images/Top_Cone_Green_Float.png"; 551 break; 552 } 553 else 554 switch (style) { 555 case CONE: 556 image = "/images/Top_Cone_Red_Buoy_Small.png"; 557 break; 558 case PILLAR: 559 case SPAR: 560 image = "/images/Top_Cone_Red_Buoy.png"; 561 break; 562 case BEACON: 563 case TOWER: 564 image = "/images/Top_Cone_Red_Beacon.png"; 565 break; 566 case FLOAT: 567 image = "/images/Top_Cone_Red_Float.png"; 568 break; 569 } 570 break; 571 } 572 if (!image.isEmpty()) 573 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 574 .getResource(image))); 575 } 576 } else 577 dlg.panelMain.shapeIcon.setIcon(null); 580 578 } 581 579 … … 592 590 switch (cat) { 593 591 594 case PORT_HAND:592 case LAT_PORT: 595 593 switch (getShape()) { 596 594 case CAN: … … 676 674 break; 677 675 678 case PREF_PORT_HAND:676 case LAT_PREF_PORT: 679 677 switch (getShape()) { 680 678 case CAN: … … 757 755 break; 758 756 759 case STARBOARD_HAND:757 case LAT_STBD: 760 758 switch (getShape()) { 761 759 case CONE: … … 843 841 break; 844 842 845 case PREF_STARBOARD_HAND:843 case LAT_PREF_STBD: 846 844 switch (getShape()) { 847 845 case CONE: -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24830 r24835 89 89 * if (dlg.paintlock) return; super.paintSign(); 90 90 */ 91 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) { 92 93 String image = "/images/Safe_Water"; 94 95 switch (getShape()) { 96 case PILLAR: 97 image += "_Pillar"; 98 break; 99 case SPAR: 100 image += "_Spar"; 101 break; 102 case SPHERE: 103 image += "_Sphere"; 104 break; 105 case BEACON: 106 image += "_Beacon"; 107 break; 108 case FLOAT: 109 image += "_Float"; 110 break; 111 default: 112 } 113 114 if (!image.equals("/images/Safe_Water")) { 115 image += ".png"; 116 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 117 .getResource(image))); 118 if (hasTopMark()) { 119 image = ""; 120 switch (getShape()) { 121 case PILLAR: 122 case SPAR: 123 image = "/images/Top_Sphere_Red_Buoy.png"; 124 break; 125 case SPHERE: 126 image = "/images/Top_Sphere_Red_Buoy_Small.png"; 127 break; 128 case BEACON: 129 image = "/images/Top_Sphere_Red_Beacon.png"; 130 break; 131 case FLOAT: 132 image = "/images/Top_Sphere_Red_Float.png"; 133 break; 134 } 135 if (!image.isEmpty()) 136 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 137 .getResource(image))); 138 } else 139 dlg.panelMain.topIcon.setIcon(null); 140 } else { 141 dlg.panelMain.shapeIcon.setIcon(null); 91 String image = "/images/Safe_Water"; 92 93 switch (getShape()) { 94 case PILLAR: 95 image += "_Pillar"; 96 break; 97 case SPAR: 98 image += "_Spar"; 99 break; 100 case SPHERE: 101 image += "_Sphere"; 102 break; 103 case BEACON: 104 image += "_Beacon"; 105 break; 106 case FLOAT: 107 image += "_Float"; 108 break; 109 default: 110 } 111 112 if (!image.equals("/images/Safe_Water")) { 113 image += ".png"; 114 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 115 .getResource(image))); 116 if (hasTopMark()) { 117 image = ""; 118 switch (getShape()) { 119 case PILLAR: 120 case SPAR: 121 image = "/images/Top_Sphere_Red_Buoy.png"; 122 break; 123 case SPHERE: 124 image = "/images/Top_Sphere_Red_Buoy_Small.png"; 125 break; 126 case BEACON: 127 image = "/images/Top_Sphere_Red_Beacon.png"; 128 break; 129 case FLOAT: 130 image = "/images/Top_Sphere_Red_Float.png"; 131 break; 132 } 133 if (!image.isEmpty()) 134 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass() 135 .getResource(image))); 136 } else 142 137 dlg.panelMain.topIcon.setIcon(null); 143 } 138 } else { 139 dlg.panelMain.shapeIcon.setIcon(null); 140 dlg.panelMain.topIcon.setIcon(null); 144 141 } 145 142 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24830 r24835 18 18 19 19 public enum Cat { 20 UNKNOWN, PORT_HAND, STARBOARD_HAND, PREF_PORT_HAND, PREF_STARBOARD_HAND,20 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, 21 21 CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, 22 22 LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT
Note:
See TracChangeset
for help on using the changeset viewer.