Changeset 23287 in osm
- Timestamp:
- 2010-09-20T23:31:35+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r23269 r23287 960 960 cbM01TopMark.addActionListener(new ActionListener() { 961 961 public void actionPerformed(ActionEvent e) { 962 int top = cbM01TopMark.getSelectedIndex();962 buoy.setTopMarkIndex(cbM01TopMark.getSelectedIndex()); 963 963 buoy.paintSign(); 964 964 } -
applications/editors/josm/plugins/toms/src/toms/msg/messages.properties
r23078 r23287 82 82 SmpDialogAction.212=Not set 83 83 SmpDialogAction.213=*Select shape* 84 SmpDialogAction.214=Can 85 SmpDialogAction.215=Cone 86 -
applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java
r23269 r23287 110 110 111 111 /** 112 * Topmark Shapes - correspond to TopMarkIndex 113 */ 114 115 public final static int UNKNOWN_TOPMARK = 0; 116 public final static int TOP_YELLOW_X = 1; 117 public final static int TOP_RED_X = 2; 118 public final static int TOP_YELLOW_CAN = 3; 119 public final static int TOP_YELLOW_CONE = 4; 120 121 /** 112 122 * Radar Beacons - correspond to Ratyp Index 113 123 */ -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23269 r23287 353 353 */ 354 354 dlg.cM01TopMark.setSelected(topMark); 355 } 356 357 private int TopMarkIndex = 0; 358 359 public int getTopMarkIndex() { 360 return TopMarkIndex; 361 } 362 363 public void setTopMarkIndex(int index) { 364 TopMarkIndex = index; 355 365 } 356 366 … … 895 905 896 906 protected void saveTopMarkData(String shape, String colour) { 897 if ( dlg.cM01TopMark.isSelected()) {907 if (hasTopMark()) { 898 908 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 899 909 "seamark:topmark:shape", shape)); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r23269 r23287 47 47 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.210")); //$NON-NLS-1$ 48 48 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.211")); //$NON-NLS-1$ 49 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.214")); //$NON-NLS-1$ 50 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.215")); //$NON-NLS-1$ 49 51 50 52 dlg.cM01TopMark.setEnabled(true); … … 116 118 if (keys.containsKey("seamark:topmark:shape")) { //$NON-NLS-1$ 117 119 str = keys.get("seamark:topmark:shape"); //$NON-NLS-1$ 118 120 setTopMark(true); 119 121 if (str.equals("x-shape")) { //$NON-NLS-1$ 120 setTopMark(true); 122 if (keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$ 123 if (keys.get("seamark:topmark:colour").equals("red")) 124 setTopMarkIndex(TOP_RED_X); 125 else 126 setTopMarkIndex(TOP_YELLOW_X); 127 } 128 } else if (str.equals("cone, point up")) { //$NON-NLS-1$ 129 setTopMarkIndex(TOP_YELLOW_CONE); 130 } else if (str.equals("cylinder")) { //$NON-NLS-1$ 131 setTopMarkIndex(TOP_YELLOW_CAN); 121 132 } 122 133 } … … 243 254 case SPEC_PILLAR: 244 255 case SPEC_SPAR: 245 image = "/images/Top_X_Yellow_Buoy.png"; //$NON-NLS-1$ 256 switch (getTopMarkIndex()) { 257 case TOP_YELLOW_X: 258 image = "/images/Top_X_Yellow_Buoy.png"; //$NON-NLS-1$ 259 break; 260 case TOP_RED_X: 261 image = "/images/Top_X_Red_Buoy.png"; //$NON-NLS-1$ 262 break; 263 case TOP_YELLOW_CAN: 264 image = "/images/Top_Can_Yellow_Buoy.png"; //$NON-NLS-1$ 265 break; 266 case TOP_YELLOW_CONE: 267 image = "/images/Top_Cone_Yellow_Buoy.png"; //$NON-NLS-1$ 268 break; 269 } 246 270 break; 247 271 case SPEC_CAN: … … 249 273 case SPEC_SPHERE: 250 274 case SPEC_BARREL: 251 image = "/images/Top_X_Yellow_Buoy_Small.png"; //$NON-NLS-1$ 275 switch (getTopMarkIndex()) { 276 case TOP_YELLOW_X: 277 image = "/images/Top_X_Yellow_Buoy_Small.png"; //$NON-NLS-1$ 278 break; 279 case TOP_RED_X: 280 image = "/images/Top_X_Red_Buoy_Small.png"; //$NON-NLS-1$ 281 break; 282 case TOP_YELLOW_CAN: 283 image = "/images/Top_Can_Yellow_Buoy_Small.png"; //$NON-NLS-1$ 284 break; 285 case TOP_YELLOW_CONE: 286 image = "/images/Top_Cone_Yellow_Buoy_Small.png"; //$NON-NLS-1$ 287 break; 288 } 252 289 break; 253 290 case SPEC_BEACON: 254 291 case SPEC_TOWER: 255 image = "/images/Top_X_Yellow_Beacon.png"; //$NON-NLS-1$ 292 switch (getTopMarkIndex()) { 293 case TOP_YELLOW_X: 294 image = "/images/Top_X_Yellow_Beacon.png"; //$NON-NLS-1$ 295 break; 296 case TOP_RED_X: 297 image = "/images/Top_X_Red_Beacon.png"; //$NON-NLS-1$ 298 break; 299 case TOP_YELLOW_CAN: 300 image = "/images/Top_Can_Yellow_Beacon.png"; //$NON-NLS-1$ 301 break; 302 case TOP_YELLOW_CONE: 303 image = "/images/Top_Cone_Yellow_Beacon.png"; //$NON-NLS-1$ 304 break; 305 } 256 306 break; 257 307 case SPEC_FLOAT: 258 image = "/images/Top_X_Yellow_Float.png"; //$NON-NLS-1$ 308 switch (getTopMarkIndex()) { 309 case TOP_YELLOW_X: 310 image = "/images/Top_X_Yellow_Float.png"; //$NON-NLS-1$ 311 break; 312 case TOP_RED_X: 313 image = "/images/Top_X_Red_Float.png"; //$NON-NLS-1$ 314 break; 315 case TOP_YELLOW_CAN: 316 image = "/images/Top_Can_Yellow_Float.png"; //$NON-NLS-1$ 317 break; 318 case TOP_YELLOW_CONE: 319 image = "/images/Top_Cone_Yellow_Float.png"; //$NON-NLS-1$ 320 break; 321 } 259 322 break; 260 323 } … … 322 385 default: 323 386 } 324 saveTopMarkData("x-shape", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$ 387 switch (getTopMarkIndex()) { 388 case TOP_YELLOW_X: 389 saveTopMarkData("x-shape", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$ 390 break; 391 case TOP_RED_X: 392 saveTopMarkData("x-shape", "red"); //$NON-NLS-1$ //$NON-NLS-2$ 393 break; 394 case TOP_YELLOW_CAN: 395 saveTopMarkData("cylinder", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$ 396 break; 397 case TOP_YELLOW_CONE: 398 saveTopMarkData("cone, point up", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$ 399 break; 400 } 325 401 saveLightData(); //$NON-NLS-1$ 326 402 saveRadarFogData();
Note:
See TracChangeset
for help on using the changeset viewer.