Changeset 23268 in osm for applications
- Timestamp:
- 2010-09-19T14:59:53+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r23261 r23268 472 472 } 473 473 474 buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.91")); //$NON-NLS-1$ 475 buoy.setNode(node); 476 return; 477 } 474 buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.91")); //$NON-NLS-1$ 475 buoy.setNode(node); 476 buoy.paintSign(); 477 return; 478 } 478 479 479 480 private JDialog getDM01SeaMap() { … … 794 795 int type = cbM01TypeOfMark.getSelectedIndex(); 795 796 796 if (buoy == null) { 797 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 798 return; 799 } 797 if (buoy == null) { 798 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 799 buoy.paintSign(); 800 return; 801 } 800 802 801 803 Node n = buoy.getNode(); … … 806 808 switch (type) { 807 809 808 809 810 811 buoy.setBuoyIndex(type);812 810 case SeaMark.UNKNOWN_TYPE: 811 if (!(buoy instanceof BuoyUkn)) 812 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 813 buoy.setBuoyIndex(0); 814 break; 813 815 814 816 case SeaMark.LATERAL: … … 877 879 int cat = cbM01CatOfMark.getSelectedIndex(); 878 880 879 if (buoy == null) { 880 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 881 return; 882 } 881 if (buoy == null) { 882 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 883 buoy.paintSign(); 884 return; 885 } 883 886 884 887 Node n = buoy.getNode(); … … 886 889 return; 887 890 888 if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.LATERAL) { 889 if (!(buoy instanceof BuoyLat)) 890 buoy = new BuoyLat(dia, n); 891 buoy.setBuoyIndex(cat); 892 } 893 if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.CARDINAL) { 894 if (!(buoy instanceof BuoyCard)) 895 buoy = new BuoyCard(dia, n); 896 buoy.setBuoyIndex(cat); 897 } 898 if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.LIGHT) { 899 if (!(buoy instanceof BuoyNota)) 900 buoy = new BuoyNota(dia, n); 901 buoy.setBuoyIndex(cat); 902 } 903 891 buoy.setBuoyIndex(cat); 904 892 buoy.refreshStyles(); 905 893 buoy.refreshLights(); … … 912 900 } 913 901 914 private JComboBox getCbM01StyleOfMark() { 915 if (cbM01StyleOfMark == null) { 916 cbM01StyleOfMark = new JComboBox(); 917 cbM01StyleOfMark.setBounds(new Rectangle(45, 85, 165, 25)); 918 cbM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 919 cbM01StyleOfMark.addActionListener(new ActionListener() { 920 public void actionPerformed(ActionEvent e) { 921 int style = cbM01StyleOfMark.getSelectedIndex(); 922 if (buoy != null && style != buoy.getStyleIndex()) { 923 buoy.setStyleIndex(style); 924 buoy.paintSign(); 925 } 926 } 927 }); 928 } 929 return cbM01StyleOfMark; 930 } 902 private JComboBox getCbM01StyleOfMark() { 903 if (cbM01StyleOfMark == null) { 904 cbM01StyleOfMark = new JComboBox(); 905 cbM01StyleOfMark.setBounds(new Rectangle(45, 85, 165, 25)); 906 cbM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 907 cbM01StyleOfMark.addActionListener(new ActionListener() { 908 public void actionPerformed(ActionEvent e) { 909 int style = cbM01StyleOfMark.getSelectedIndex(); 910 if (buoy != null && style != buoy.getStyleIndex()) { 911 buoy.setStyleIndex(style); 912 buoy.refreshLights(); 913 buoy.setLightColour(); 914 buoy.paintSign(); 915 } 916 } 917 }); 918 } 919 return cbM01StyleOfMark; 920 } 931 921 932 922 private JTextField getTfM01Name() { -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23261 r23268 155 155 } 156 156 157 public void setSectored(boolean sectored) { 158 Sectored = sectored; 159 } 157 public void setSectored(boolean sectored) { 158 Sectored = sectored; 159 if (sectored) { 160 LightColour[0] = ""; 161 } else { 162 setSectorIndex(0); 163 setLightChar(""); 164 setLightColour(""); 165 setLightGroup(""); 166 setHeight(""); 167 setRange(""); 168 setBearing1(""); 169 setBearing2(""); 170 setRadius(""); 171 } 172 } 160 173 161 174 private int SectorIndex = 0; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r23261 r23268 142 142 } 143 143 144 public void refreshLights() { 145 int type = getBuoyIndex(); 146 144 public void refreshLights() { 147 145 dlg.cbM01Kennung.removeAllItems(); 148 146 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 149 147 dlg.cbM01Kennung.setSelectedIndex(0); 150 148 151 switch (type) { 152 case SeaMark.CARD_NORTH: 153 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ 154 dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$ 155 break; 156 157 case SeaMark.CARD_EAST: 158 dlg.cbM01Kennung.addItem("Q(3)"); //$NON-NLS-1$ 159 dlg.cbM01Kennung.addItem("VQ(3)"); //$NON-NLS-1$ 160 break; 161 162 case SeaMark.CARD_SOUTH: 163 dlg.cbM01Kennung.addItem("Q(6)+LFl"); //$NON-NLS-1$ 164 dlg.cbM01Kennung.addItem("VQ(6)+LFl"); //$NON-NLS-1$ 165 break; 166 167 case SeaMark.CARD_WEST: 168 dlg.cbM01Kennung.addItem("Q(9)"); //$NON-NLS-1$ 169 dlg.cbM01Kennung.addItem("VQ(9)"); //$NON-NLS-1$ 170 break; 171 172 default: 173 } 174 149 switch (getBuoyIndex()) { 150 case CARD_NORTH: 151 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ 152 dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$ 153 break; 154 case CARD_EAST: 155 dlg.cbM01Kennung.addItem("Q(3)"); //$NON-NLS-1$ 156 dlg.cbM01Kennung.addItem("VQ(3)"); //$NON-NLS-1$ 157 break; 158 case CARD_SOUTH: 159 dlg.cbM01Kennung.addItem("Q(6)+LFl"); //$NON-NLS-1$ 160 dlg.cbM01Kennung.addItem("VQ(6)+LFl"); //$NON-NLS-1$ 161 break; 162 case CARD_WEST: 163 dlg.cbM01Kennung.addItem("Q(9)"); //$NON-NLS-1$ 164 dlg.cbM01Kennung.addItem("VQ(9)"); //$NON-NLS-1$ 165 break; 166 } 175 167 } 176 168 … … 179 171 } 180 172 181 public void paintSign() { 182 if (dlg.paintlock) 183 return; 184 super.paintSign(); 173 public void setLightColour() { 174 super.setLightColour("W"); //$NON-NLS-1$ 175 } 176 177 public void paintSign() { 178 if (dlg.paintlock) 179 return; 180 super.paintSign(); 185 181 186 182 dlg.sM01StatusBar.setText(getErrMsg()); 187 183 188 if (isValid()) { 189 dlg.tfM01Name.setEnabled(true); 190 dlg.tfM01Name.setText(getName()); 191 dlg.cM01TopMark.setSelected(true); 192 dlg.cM01TopMark.setVisible(true); 193 dlg.cM01TopMark.setEnabled(false); 194 dlg.cM01Radar.setVisible(true); 195 dlg.cM01Racon.setVisible(true); 196 dlg.cM01Fog.setVisible(true); 197 dlg.cM01Fired.setEnabled(true); 198 dlg.cM01Fired.setVisible(true); 199 dlg.cbM01Colour.setVisible(false); 200 dlg.lM01Colour.setVisible(false); 201 dlg.rbM01Fired1.setVisible(false); 202 dlg.rbM01FiredN.setVisible(false); 203 dlg.lM01Height.setVisible(false); 204 dlg.tfM01Height.setVisible(false); 205 dlg.lM01Range.setVisible(false); 206 dlg.tfM01Range.setVisible(false); 207 208 if (isFired()) { 209 switch (getStyleIndex()) { 210 case LAT_BEACON: 211 case LAT_TOWER: 212 dlg.rbM01Fired1.setVisible(true); 213 dlg.rbM01FiredN.setVisible(true); 214 dlg.lM01Height.setVisible(true); 215 dlg.tfM01Height.setVisible(true); 216 dlg.lM01Range.setVisible(true); 217 dlg.tfM01Range.setVisible(true); 218 break; 219 case LAT_FLOAT: 220 dlg.lM01Height.setVisible(true); 221 dlg.tfM01Height.setVisible(true); 222 dlg.lM01Range.setVisible(true); 223 dlg.tfM01Range.setVisible(true); 224 break; 225 default: 226 } 227 } 228 String image = "/images/Cardinal"; //$NON-NLS-1$ 229 230 switch (getStyleIndex()) { 231 case SeaMark.CARD_PILLAR: 232 image += "_Pillar"; //$NON-NLS-1$ 233 break; 234 184 if (isValid()) { 185 dlg.tfM01Name.setEnabled(true); 186 dlg.tfM01Name.setText(getName()); 187 dlg.cM01TopMark.setSelected(true); 188 dlg.cM01TopMark.setVisible(true); 189 dlg.cM01TopMark.setEnabled(false); 190 dlg.cM01Radar.setVisible(true); 191 dlg.cM01Racon.setVisible(true); 192 dlg.cM01Fog.setVisible(true); 193 dlg.cM01Fired.setEnabled(true); 194 dlg.cM01Fired.setVisible(true); 195 if (!isSectored()) { 196 dlg.cbM01Colour.setVisible(false); 197 dlg.lM01Colour.setVisible(false); 198 } 199 dlg.rbM01Fired1.setVisible(false); 200 dlg.rbM01FiredN.setVisible(false); 201 dlg.lM01Height.setVisible(false); 202 dlg.tfM01Height.setVisible(false); 203 dlg.lM01Range.setVisible(false); 204 dlg.tfM01Range.setVisible(false); 205 206 if (isFired()) { 207 switch (getStyleIndex()) { 208 case CARD_BEACON: 209 case CARD_TOWER: 210 case CARD_FLOAT: 211 dlg.lM01Height.setVisible(true); 212 dlg.tfM01Height.setVisible(true); 213 dlg.lM01Range.setVisible(true); 214 dlg.tfM01Range.setVisible(true); 215 break; 216 default: 217 } 218 } 219 220 String image = "/images/Cardinal"; //$NON-NLS-1$ 221 switch (getStyleIndex()) { 222 case SeaMark.CARD_PILLAR: 223 image += "_Pillar"; //$NON-NLS-1$ 224 break; 235 225 case SeaMark.CARD_SPAR: 236 226 image += "_Spar"; //$NON-NLS-1$ 237 227 break; 238 239 228 case SeaMark.CARD_BEACON: 240 229 image += "_Beacon"; //$NON-NLS-1$ 241 230 break; 242 243 231 case SeaMark.CARD_TOWER: 244 232 image += "_Tower"; //$NON-NLS-1$ 245 233 break; 246 247 234 case SeaMark.CARD_FLOAT: 248 235 image += "_Float"; //$NON-NLS-1$ 249 236 break; 250 251 237 default: 252 238 return; … … 277 263 dlg.lM01Icon.setIcon(null); 278 264 } 279 }280 281 public void setLightColour() {282 super.setLightColour("W"); //$NON-NLS-1$283 265 } 284 266 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r23261 r23268 109 109 } 110 110 111 public void paintSign() { 112 if (dlg.paintlock) 113 return; 111 public void setLightColour() { 112 super.setLightColour("W"); //$NON-NLS-1$ 113 } 114 115 public void paintSign() { 116 if (dlg.paintlock) 117 return; 114 118 115 119 super.paintSign(); … … 117 121 dlg.sM01StatusBar.setText(getErrMsg()); 118 122 119 if (isValid()) { 120 dlg.tfM01Name.setEnabled(true); 121 dlg.tfM01Name.setText(getName()); 122 dlg.cM01TopMark.setVisible(true); 123 dlg.cM01Radar.setVisible(true); 124 dlg.cM01Racon.setVisible(true); 125 dlg.cM01Fog.setVisible(true); 126 dlg.cM01Fired.setVisible(true); 127 dlg.cbM01Colour.setVisible(false); 128 dlg.lM01Colour.setVisible(false); 129 dlg.rbM01Fired1.setVisible(false); 130 dlg.rbM01FiredN.setVisible(false); 131 dlg.lM01Height.setVisible(false); 132 dlg.tfM01Height.setVisible(false); 133 dlg.lM01Range.setVisible(false); 134 dlg.tfM01Range.setVisible(false); 135 136 if (isFired()) { 137 switch (getStyleIndex()) { 138 case SPEC_FLOAT: 139 dlg.lM01Height.setVisible(true); 140 dlg.tfM01Height.setVisible(true); 141 dlg.lM01Range.setVisible(true); 142 dlg.tfM01Range.setVisible(true); 143 break; 144 case SPEC_BEACON: 145 case SPEC_TOWER: 146 dlg.rbM01Fired1.setVisible(true); 147 dlg.rbM01FiredN.setVisible(true); 148 dlg.lM01Height.setVisible(true); 149 dlg.tfM01Height.setVisible(true); 150 dlg.lM01Range.setVisible(true); 151 dlg.tfM01Range.setVisible(true); 152 break; 153 default: 154 } 155 } 123 if (isValid()) { 124 dlg.tfM01Name.setEnabled(true); 125 dlg.tfM01Name.setText(getName()); 126 dlg.cM01TopMark.setVisible(true); 127 dlg.cM01Radar.setVisible(true); 128 dlg.cM01Racon.setVisible(true); 129 dlg.cM01Fog.setVisible(true); 130 dlg.cM01Fired.setVisible(true); 131 if (!isSectored()) { 132 dlg.cbM01Colour.setVisible(false); 133 dlg.lM01Colour.setVisible(false); 134 } 135 dlg.rbM01Fired1.setVisible(false); 136 dlg.rbM01FiredN.setVisible(false); 137 dlg.lM01Height.setVisible(false); 138 dlg.tfM01Height.setVisible(false); 139 dlg.lM01Range.setVisible(false); 140 dlg.tfM01Range.setVisible(false); 141 142 if (isFired()) { 143 switch (getStyleIndex()) { 144 case ISOL_BEACON: 145 case ISOL_TOWER: 146 dlg.lM01Height.setVisible(true); 147 dlg.tfM01Height.setVisible(true); 148 dlg.lM01Range.setVisible(true); 149 dlg.tfM01Range.setVisible(true); 150 break; 151 default: 152 } 153 } 156 154 157 155 String image = "/images/Cardinal"; //$NON-NLS-1$ … … 251 249 saveLightData(); //$NON-NLS-1$ 252 250 saveRadarFogData(); 253 254 } 255 256 public void setLightColour() { 257 super.setLightColour("W"); //$NON-NLS-1$ 258 } 259 251 } 260 252 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r23261 r23268 299 299 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$ 300 300 break; 301 302 301 case STARBOARD_HAND: 303 302 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$ … … 309 308 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$ 310 309 break; 311 312 310 case PREF_PORT_HAND: 313 311 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$ … … 318 316 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$ 319 317 break; 320 321 318 case PREF_STARBOARD_HAND: 322 319 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$ … … 327 324 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$ 328 325 break; 329 330 default: 331 } 326 } 332 327 333 328 if (style >= dlg.cbM01StyleOfMark.getItemCount()) … … 339 334 } 340 335 341 public boolean isValid() { 342 return (getBuoyIndex() > 0) && (getStyleIndex() > 0); 343 } 344 345 public void paintSign() { 346 if (dlg.paintlock) 347 return; 348 super.paintSign(); 336 public void refreshLights() { 337 super.refreshLights(); 338 } 339 340 public boolean isValid() { 341 return (getBuoyIndex() > 0) && (getStyleIndex() > 0); 342 } 343 344 public void setLightColour() { 345 if (getRegion() == IALA_A) { 346 if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND) 347 super.setLightColour("R"); //$NON-NLS-1$ 348 else 349 super.setLightColour("G"); //$NON-NLS-1$ 350 } else { 351 if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND) 352 super.setLightColour("G"); //$NON-NLS-1$ 353 else 354 super.setLightColour("R"); //$NON-NLS-1$ 355 } 356 } 357 358 public void paintSign() { 359 if (dlg.paintlock) 360 return; 361 super.paintSign(); 349 362 350 363 dlg.sM01StatusBar.setText(getErrMsg()); … … 354 367 dlg.tfM01Name.setText(getName()); 355 368 356 int cat = getBuoyIndex(); 357 boolean region = getRegion(); 358 int style = getStyleIndex(); 359 360 if (style == LAT_PERCH) { 361 dlg.cM01TopMark.setVisible(false); 362 dlg.cM01TopMark.setSelected(false); 363 dlg.cM01Radar.setVisible(false); 364 dlg.cM01Racon.setVisible(false); 365 dlg.cM01Fog.setVisible(false); 366 dlg.cM01Fired.setVisible(false); 367 dlg.cM01Fired.setSelected(false); 368 } else { 369 dlg.cM01TopMark.setEnabled(true); 370 dlg.cM01TopMark.setVisible(true); 371 dlg.cM01Radar.setVisible(true); 372 dlg.cM01Racon.setVisible(true); 373 dlg.cM01Fog.setVisible(true); 374 dlg.cM01Fired.setVisible(true); 375 dlg.cM01Fired.setEnabled(true); 376 dlg.cM01TopMark.setEnabled(true); 377 } 378 dlg.cbM01Colour.setVisible(false); 379 dlg.lM01Colour.setVisible(false); 380 dlg.rbM01Fired1.setVisible(false); 381 dlg.rbM01FiredN.setVisible(false); 382 dlg.lM01Height.setVisible(false); 383 dlg.tfM01Height.setVisible(false); 384 dlg.lM01Range.setVisible(false); 385 dlg.tfM01Range.setVisible(false); 386 387 if (isFired()) { 388 switch (style) { 389 case LAT_BEACON: 390 case LAT_TOWER: 391 dlg.rbM01Fired1.setVisible(true); 392 dlg.rbM01FiredN.setVisible(true); 393 dlg.lM01Height.setVisible(true); 394 dlg.tfM01Height.setVisible(true); 395 dlg.lM01Range.setVisible(true); 396 dlg.tfM01Range.setVisible(true); 397 break; 398 case LAT_FLOAT: 399 dlg.lM01Height.setVisible(true); 400 dlg.tfM01Height.setVisible(true); 401 dlg.lM01Range.setVisible(true); 402 dlg.tfM01Range.setVisible(true); 403 break; 404 default: 405 } 406 } 369 boolean region = getRegion(); 370 int style = getStyleIndex(); 371 372 if (style == LAT_PERCH) { 373 dlg.cM01TopMark.setVisible(false); 374 dlg.cM01TopMark.setSelected(false); 375 dlg.cM01Radar.setVisible(false); 376 dlg.cM01Racon.setVisible(false); 377 dlg.cM01Fog.setVisible(false); 378 dlg.cM01Fired.setVisible(false); 379 dlg.cM01Fired.setSelected(false); 380 } else { 381 dlg.cM01TopMark.setEnabled(true); 382 dlg.cM01TopMark.setVisible(true); 383 dlg.cM01Radar.setVisible(true); 384 dlg.cM01Racon.setVisible(true); 385 dlg.cM01Fog.setVisible(true); 386 dlg.cM01Fired.setVisible(true); 387 dlg.cM01Fired.setEnabled(true); 388 dlg.cM01TopMark.setEnabled(true); 389 } 390 if (!isSectored()) { 391 dlg.cbM01Colour.setVisible(false); 392 dlg.lM01Colour.setVisible(false); 393 } 394 dlg.rbM01Fired1.setVisible(false); 395 dlg.rbM01FiredN.setVisible(false); 396 dlg.lM01Height.setVisible(false); 397 dlg.tfM01Height.setVisible(false); 398 dlg.lM01Range.setVisible(false); 399 dlg.tfM01Range.setVisible(false); 400 401 if (isFired()) { 402 switch (style) { 403 case LAT_BEACON: 404 case LAT_TOWER: 405 case LAT_FLOAT: 406 dlg.lM01Height.setVisible(true); 407 dlg.tfM01Height.setVisible(true); 408 dlg.lM01Range.setVisible(true); 409 dlg.tfM01Range.setVisible(true); 410 break; 411 default: 412 } 413 } 407 414 408 415 String image = "/images/Lateral"; //$NON-NLS-1$ … … 1059 1066 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 1060 1067 } 1061 1062 public void setLightColour() {1063 if (getRegion() == IALA_A) {1064 if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)1065 super.setLightColour("R"); //$NON-NLS-1$1066 else1067 super.setLightColour("G"); //$NON-NLS-1$1068 } else {1069 if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)1070 super.setLightColour("G"); //$NON-NLS-1$1071 else1072 super.setLightColour("R"); //$NON-NLS-1$1073 }1074 }1075 1076 1068 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r23261 r23268 105 105 } 106 106 107 public void paintSign() { 108 if (dlg.paintlock) 109 return; 110 super.paintSign(); 107 public void setLightColour() { 108 super.setLightColour("W"); //$NON-NLS-1$ 109 } 110 111 public void paintSign() { 112 if (dlg.paintlock) 113 return; 114 super.paintSign(); 111 115 112 116 dlg.sM01StatusBar.setText(getErrMsg()); 113 117 114 if (isValid()) { 115 dlg.tfM01Name.setEnabled(true); 116 dlg.tfM01Name.setText(getName()); 117 dlg.cM01TopMark.setEnabled(true); 118 dlg.cM01TopMark.setVisible(true); 119 dlg.cM01Radar.setVisible(true); 120 dlg.cM01Racon.setVisible(true); 121 dlg.cM01Fog.setVisible(true); 122 dlg.cM01Fired.setVisible(true); 123 dlg.cM01Fired.setEnabled(true); 124 dlg.cbM01Colour.setVisible(false); 125 dlg.lM01Colour.setVisible(false); 126 dlg.rbM01Fired1.setVisible(false); 127 dlg.rbM01FiredN.setVisible(false); 128 dlg.lM01Height.setVisible(false); 129 dlg.tfM01Height.setVisible(false); 130 dlg.lM01Range.setVisible(false); 131 dlg.tfM01Range.setVisible(false); 132 133 if (isFired()) { 134 switch (getStyleIndex()) { 135 case SPEC_FLOAT: 136 dlg.lM01Height.setVisible(true); 137 dlg.tfM01Height.setVisible(true); 138 dlg.lM01Range.setVisible(true); 139 dlg.tfM01Range.setVisible(true); 140 break; 141 case SPEC_BEACON: 142 case SPEC_TOWER: 143 dlg.rbM01Fired1.setVisible(true); 144 dlg.rbM01FiredN.setVisible(true); 145 dlg.lM01Height.setVisible(true); 146 dlg.tfM01Height.setVisible(true); 147 dlg.lM01Range.setVisible(true); 148 dlg.tfM01Range.setVisible(true); 149 break; 150 default: 151 } 152 } 118 if (isValid()) { 119 dlg.tfM01Name.setEnabled(true); 120 dlg.tfM01Name.setText(getName()); 121 dlg.cM01TopMark.setEnabled(true); 122 dlg.cM01TopMark.setVisible(true); 123 dlg.cM01Radar.setVisible(true); 124 dlg.cM01Racon.setVisible(true); 125 dlg.cM01Fog.setVisible(true); 126 dlg.cM01Fired.setVisible(true); 127 dlg.cM01Fired.setEnabled(true); 128 if (!isSectored()) { 129 dlg.cbM01Colour.setVisible(false); 130 dlg.lM01Colour.setVisible(false); 131 } 132 dlg.rbM01Fired1.setVisible(false); 133 dlg.rbM01FiredN.setVisible(false); 134 dlg.lM01Height.setVisible(false); 135 dlg.tfM01Height.setVisible(false); 136 dlg.lM01Range.setVisible(false); 137 dlg.tfM01Range.setVisible(false); 138 139 if (isFired()) { 140 switch (getStyleIndex()) { 141 case SPEC_FLOAT: 142 case SPEC_BEACON: 143 case SPEC_TOWER: 144 dlg.lM01Height.setVisible(true); 145 dlg.tfM01Height.setVisible(true); 146 dlg.lM01Range.setVisible(true); 147 dlg.tfM01Range.setVisible(true); 148 break; 149 default: 150 } 151 } 153 152 154 153 String image = "/images/Safe_Water"; //$NON-NLS-1$ … … 260 259 saveRadarFogData(); 261 260 } 262 263 public void setLightColour() {264 super.setLightColour("W"); //$NON-NLS-1$265 }266 267 261 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r23261 r23268 131 131 } 132 132 133 public void setStyleIndex(int styleIndex) { 134 super.setStyleIndex(styleIndex); 135 if (styleIndex == SPEC_BARREL) { 136 dlg.cM01Fired.setSelected(false); 137 dlg.cM01Fired.setEnabled(false); 138 dlg.cM01TopMark.setEnabled(true); 139 } else { 140 dlg.cM01Fired.setEnabled(true); 141 dlg.cM01TopMark.setEnabled(true); 142 } 143 } 133 public void refreshLights() { 134 super.refreshLights(); 135 136 switch (getStyleIndex()) { 137 case SPEC_BARREL: 138 dlg.cM01Fired.setSelected(false); 139 dlg.cM01Fired.setEnabled(false); 140 dlg.cM01TopMark.setEnabled(true); 141 break; 142 default: 143 dlg.cM01Fired.setEnabled(true); 144 dlg.cM01TopMark.setEnabled(true); 145 } 146 } 144 147 145 148 public boolean isValid() { … … 147 150 } 148 151 149 public void paintSign() { 150 if (dlg.paintlock) 151 return; 152 super.paintSign(); 152 public void setLightColour() { 153 super.setLightColour("W"); //$NON-NLS-1$ 154 } 155 156 public void paintSign() { 157 if (dlg.paintlock) 158 return; 159 super.paintSign(); 153 160 154 161 dlg.sM01StatusBar.setText(getErrMsg()); 155 162 156 if (isValid()) { 157 dlg.tfM01Name.setEnabled(true); 158 dlg.tfM01Name.setText(getName()); 159 dlg.cM01Radar.setVisible(true); 160 dlg.cM01Racon.setVisible(true); 161 dlg.cM01TopMark.setEnabled(true); 162 dlg.cM01TopMark.setVisible(true); 163 if (hasTopMark()) { 164 dlg.cbM01TopMark.setEnabled(true); 165 dlg.cbM01TopMark.setVisible(true); 166 } else { 167 dlg.cbM01TopMark.setVisible(false); 168 } 169 dlg.cM01Fog.setVisible(true); 170 dlg.cM01Fired.setVisible(true); 171 dlg.cM01Fired.setEnabled(true); 172 dlg.cbM01Colour.setVisible(false); 173 dlg.lM01Colour.setVisible(false); 174 dlg.rbM01Fired1.setVisible(false); 175 dlg.rbM01FiredN.setVisible(false); 176 dlg.lM01Height.setVisible(false); 177 dlg.tfM01Height.setVisible(false); 178 dlg.lM01Range.setVisible(false); 179 dlg.tfM01Range.setVisible(false); 180 181 if (isFired()) { 182 switch (getStyleIndex()) { 183 case SPEC_FLOAT: 184 dlg.lM01Height.setVisible(true); 185 dlg.tfM01Height.setVisible(true); 186 dlg.lM01Range.setVisible(true); 187 dlg.tfM01Range.setVisible(true); 188 break; 189 case SPEC_BEACON: 190 case SPEC_TOWER: 191 dlg.rbM01Fired1.setVisible(true); 192 dlg.rbM01FiredN.setVisible(true); 193 dlg.lM01Height.setVisible(true); 194 dlg.tfM01Height.setVisible(true); 195 dlg.lM01Range.setVisible(true); 196 dlg.tfM01Range.setVisible(true); 197 break; 198 default: 199 } 200 } 163 if (isValid()) { 164 dlg.tfM01Name.setEnabled(true); 165 dlg.tfM01Name.setText(getName()); 166 dlg.cM01Radar.setVisible(true); 167 dlg.cM01Racon.setVisible(true); 168 dlg.cM01TopMark.setEnabled(true); 169 dlg.cM01TopMark.setVisible(true); 170 if (hasTopMark()) { 171 dlg.cbM01TopMark.setEnabled(true); 172 dlg.cbM01TopMark.setVisible(true); 173 } else { 174 dlg.cbM01TopMark.setVisible(false); 175 } 176 dlg.cM01Fog.setVisible(true); 177 dlg.cM01Fired.setVisible(true); 178 dlg.cM01Fired.setEnabled(true); 179 if (!isSectored()) { 180 dlg.cbM01Colour.setVisible(false); 181 dlg.lM01Colour.setVisible(false); 182 } 183 dlg.rbM01Fired1.setVisible(false); 184 dlg.rbM01FiredN.setVisible(false); 185 dlg.lM01Height.setVisible(false); 186 dlg.tfM01Height.setVisible(false); 187 dlg.lM01Range.setVisible(false); 188 dlg.tfM01Range.setVisible(false); 189 190 if (isFired()) { 191 switch (getStyleIndex()) { 192 case SPEC_FLOAT: 193 case SPEC_BEACON: 194 case SPEC_TOWER: 195 dlg.lM01Height.setVisible(true); 196 dlg.tfM01Height.setVisible(true); 197 dlg.lM01Range.setVisible(true); 198 dlg.tfM01Range.setVisible(true); 199 break; 200 default: 201 } 202 } 201 203 202 204 String image = "/images/Special_Purpose"; //$NON-NLS-1$ … … 324 326 saveRadarFogData(); 325 327 } 326 327 public void setLightColour() {328 super.setLightColour("W"); //$NON-NLS-1$329 }330 331 328 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyUkn.java
r23261 r23268 11 11 12 12 public class BuoyUkn extends Buoy { 13 public BuoyUkn(SmpDialogAction dia, String Msg) { 14 super(dia); 15 resetMask(); 16 dlg.cbM01TypeOfMark.setSelectedIndex(0); 17 dlg.cbM01CatOfMark.removeAllItems(); 18 dlg.cbM01CatOfMark.setEnabled(false); 19 dlg.tfM01Name.setText(getName()); 20 setErrMsg(Msg); 21 } 13 public BuoyUkn(SmpDialogAction dia, String Msg) { 14 super(dia); 15 resetMask(); 16 dlg.cbM01TypeOfMark.setSelectedIndex(0); 17 setErrMsg(Msg); 18 } 22 19 23 20 public void paintSign() {
Note:
See TracChangeset
for help on using the changeset viewer.