Changeset 23138 in osm for applications/editors/josm/plugins
- Timestamp:
- 2010-09-13T15:24:15+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r23121 r23138 665 665 public void actionPerformed(java.awt.event.ActionEvent e) { 666 666 buoy.setSectored(rbM01FiredN.isSelected()); 667 if (rbM01Fired1.isSelected()) buoy.setSectorIndex(0); 667 cbM01Sector.setSelectedIndex(0); 668 buoy.setSectorIndex(0); 668 669 buoy.paintSign(); 669 670 } … … 1141 1142 public void actionPerformed(ActionEvent e) { 1142 1143 int i1, i2; 1143 String g = "",c = ""; //$NON-NLS-1$ //$NON-NLS-2$1144 String c = ""; //$NON-NLS-1$ //$NON-NLS-2$ 1144 1145 String it = (String) cbM01Kennung.getSelectedItem(); 1145 1146 1146 1147 if (it == null) 1147 1148 return; 1148 if (it.compareTo( "Not set") == 0) //$NON-NLS-1$1149 if (it.compareTo(Messages.getString("SmpDialogAction.212")) == 0) //$NON-NLS-1$ 1149 1150 return; 1150 1151 if (buoy == null) 1151 1152 return; 1152 1153 1153 i1 = it.indexOf("("); //$NON-NLS-1$1154 i2 = it.indexOf(")", i1); //$NON-NLS-1$1155 tfM01Group.setText(""); //$NON-NLS-1$1156 tfM01Group.setEnabled(false);1157 if (i1 >= 0) {1158 c = it.substring(0, i1);1159 if (i1 >= 0) {1160 g = it.substring(i1 + 1, i2);1161 if (g.isEmpty()) //$NON-NLS-1$1162 tfM01Group.setEnabled(true);1163 }1164 }1165 1154 if (it.contains("+")) { //$NON-NLS-1$ 1166 1155 i1 = it.indexOf("+"); //$NON-NLS-1$ … … 1174 1163 c = it; 1175 1164 buoy.setLightChar(c); 1176 buoy.setLightGroup(g);1177 1165 buoy.paintSign(); 1178 1166 } … … 1293 1281 tfM01Bearing.addFocusListener(new FocusAdapter() { 1294 1282 public void focusLost(FocusEvent e) { 1283 buoy.setBearing1(tfM01Bearing.getText().trim()); 1295 1284 } 1296 1285 }); … … 1305 1294 tfM02Bearing.addFocusListener(new FocusAdapter() { 1306 1295 public void focusLost(FocusEvent e) { 1296 buoy.setBearing2(tfM02Bearing.getText().trim()); 1307 1297 } 1308 1298 }); … … 1317 1307 tfM01Radius.addFocusListener(new FocusAdapter() { 1318 1308 public void focusLost(FocusEvent e) { 1309 buoy.setRadius(tfM01Radius.getText().trim()); 1319 1310 } 1320 1311 }); -
applications/editors/josm/plugins/toms/src/toms/plug/PluginApp.java
r23121 r23138 17 17 String pluginDirName = Main.pref.getPluginsDirectory().getAbsolutePath(); 18 18 19 List<Pluggable> plugins = PluginLoader.loadPlugins(new File(pluginDirName + "/tplug"));19 //!! List<Pluggable> plugins = PluginLoader.loadPlugins(new File(pluginDirName + "/tplug")); 20 20 21 if(plugins == null) return;21 //!! if(plugins == null) return; 22 22 23 PluginManager manager = new PluginManagerImpl();23 //!! PluginManager manager = new PluginManagerImpl(); 24 24 25 for(Pluggable p : plugins) p.setPluginManager(manager);26 for(Pluggable p : plugins) p.start();25 //!! for(Pluggable p : plugins) p.setPluginManager(manager); 26 //!! for(Pluggable p : plugins) p.start(); 27 27 28 28 // wait … … 33 33 } 34 34 35 for(Pluggable p: plugins) p.stop();35 //!! for(Pluggable p: plugins) p.stop(); 36 36 } 37 37 -
applications/editors/josm/plugins/toms/src/toms/plug/util/PluginLoader.java
r23119 r23138 19 19 public class PluginLoader { 20 20 21 public static List<Pluggable> loadPlugins(File plugDir) throws IOException {22 File[] plugJars = plugDir.listFiles(new JARFileFilter());23 ClassLoader cl = new URLClassLoader(PluginLoader.fileArrayToURLArray(plugJars));21 //!! public static List<Pluggable> loadPlugins(File plugDir) throws IOException { 22 //!! File[] plugJars = plugDir.listFiles(new JARFileFilter()); 23 //!! ClassLoader cl = new URLClassLoader(PluginLoader.fileArrayToURLArray(plugJars)); 24 24 25 if(cl == null) return null;25 //!! if(cl == null) return null; 26 26 27 List<Class<Pluggable>> plugClasses = PluginLoader.extractClassesFromJARs(plugJars, cl);27 //!! List<Class<Pluggable>> plugClasses = PluginLoader.extractClassesFromJARs(plugJars, cl); 28 28 29 return PluginLoader.createPluggableObjects(plugClasses);30 }29 //!! return PluginLoader.createPluggableObjects(plugClasses); 30 //!! } 31 31 32 32 private static List<Pluggable> createPluggableObjects(List<Class<Pluggable>> pluggables) { -
applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java
r23074 r23138 34 34 public final static int BLACK_RED_BLACK = 10; 35 35 public final static int YELLOW = 11; 36 public final static int RED_LIGHT = 1;37 public final static int GREEN_LIGHT = 2;38 public final static int WHITE_LIGHT = 3;36 public final static int WHITE_LIGHT = 1; 37 public final static int RED_LIGHT = 2; 38 public final static int GREEN_LIGHT = 3; 39 39 40 40 /** -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23109 r23138 172 172 173 173 public String getLightChar() { 174 if (LightChar[getSectorIndex()] == null) 175 return (LightChar[0]); 174 176 return LightChar[getSectorIndex()]; 175 177 } 176 178 177 179 public void setLightChar(String lightChar) { 180 if (getSectorIndex() == 0) 181 LightChar = new String[10]; 178 182 LightChar[getSectorIndex()] = lightChar; 179 183 } … … 182 186 183 187 public String getLightColour() { 188 if (LightColour[getSectorIndex()] == null) 189 return (LightColour[0]); 184 190 return LightColour[getSectorIndex()]; 185 191 } 186 192 187 193 public void setLightColour(String lightColour) { 194 if (getSectorIndex() == 0) 195 LightColour = new String[10]; 188 196 LightColour[getSectorIndex()] = lightColour; 189 197 } … … 192 200 193 201 public String getLightGroup() { 202 if (LightGroup[getSectorIndex()] == null) 203 return (LightGroup[0]); 194 204 return LightGroup[getSectorIndex()]; 195 205 } 196 206 197 207 public void setLightGroup(String lightGroup) { 208 if (getSectorIndex() == 0) 209 LightGroup = new String[10]; 198 210 LightGroup[getSectorIndex()] = lightGroup; 199 211 } … … 210 222 211 223 public String getHeight() { 224 if (Height[getSectorIndex()] == null) 225 return (Height[0]); 212 226 return Height[getSectorIndex()]; 213 227 } 214 228 215 229 public void setHeight(String height) { 230 if (getSectorIndex() == 0) 231 Height = new String[10]; 216 232 Height[getSectorIndex()] = height; 217 233 } … … 220 236 221 237 public String getRange() { 238 if (Range[getSectorIndex()] == null) 239 return (Range[0]); 222 240 return Range[getSectorIndex()]; 223 241 } 224 242 225 243 public void setRange(String range) { 244 if (getSectorIndex() == 0) 245 Range = new String[10]; 226 246 Range[getSectorIndex()] = range; 227 247 } 228 248 249 private String[] Bearing1 = new String[10]; 250 251 public String getBearing1() { 252 if (Bearing1[getSectorIndex()] == null) 253 return (Bearing1[0]); 254 return Bearing1[getSectorIndex()]; 255 } 256 257 public void setBearing1(String bearing) { 258 if (getSectorIndex() == 0) 259 Bearing1 = new String[10]; 260 Bearing1[getSectorIndex()] = bearing; 261 } 262 263 private String[] Bearing2 = new String[10]; 264 265 public String getBearing2() { 266 if (Bearing2[getSectorIndex()] == null) 267 return (Bearing2[0]); 268 return Bearing2[getSectorIndex()]; 269 } 270 271 public void setBearing2(String bearing) { 272 if (getSectorIndex() == 0) 273 Bearing2 = new String[10]; 274 Bearing2[getSectorIndex()] = bearing; 275 } 276 277 private String[] Radius = new String[10]; 278 279 public String getRadius() { 280 if (Radius[getSectorIndex()] == null) 281 return (Radius[0]); 282 return Radius[getSectorIndex()]; 283 } 284 285 public void setRadius(String radius) { 286 if (getSectorIndex() == 0) 287 Radius = new String[10]; 288 Radius[getSectorIndex()] = radius; 289 } 290 229 291 private String[] LightPeriod = new String[10]; 230 292 231 293 public String getLightPeriod() { 294 if (LightPeriod[getSectorIndex()] == null) 295 return (LightPeriod[0]); 232 296 return LightPeriod[getSectorIndex()]; 233 297 } … … 249 313 } 250 314 } 315 if (getSectorIndex() == 0) 316 LightPeriod = new String[10]; 251 317 LightPeriod[getSectorIndex()] = lightPeriod; 252 318 } … … 319 385 if (dlg.paintlock) 320 386 return; 387 else 388 dlg.paintlock = true; 389 321 390 dlg.lM01Icon.setIcon(null); 322 391 dlg.lM02Icon.setIcon(null); … … 390 459 391 460 String col = getLightColour(); 392 if (col.equals("W")) 461 if (col.equals("W")) { 393 462 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 394 463 "/images/Light_White_120.png"))); 395 else if (col.equals("R")) 464 dlg.cbM01Colour.setSelectedIndex(WHITE_LIGHT); 465 } else if (col.equals("R")) { 396 466 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 397 467 "/images/Light_Red_120.png"))); 398 else if (col.equals("G")) 468 dlg.cbM01Colour.setSelectedIndex(RED_LIGHT); 469 } else if (col.equals("G")) { 399 470 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 400 471 "/images/Light_Green_120.png"))); 401 else 472 dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT); 473 } else { 402 474 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource( 403 475 "/images/Light_Magenta_120.png"))); 404 405 dlg.cbM01Kennung.setEnabled(true);476 dlg.cbM01Colour.setSelectedIndex(UNKNOWN_COLOUR); 477 } 406 478 407 479 c = getLightChar(); 408 if (dlg.cbM01Kennung.getSelectedIndex() == 0) {409 dlg.tfM01Group.setEnabled(false);410 dlg.tfM01RepeatTime.setEnabled(false);411 } else {412 dlg.tfM01Group.setEnabled(true);413 dlg.tfM01RepeatTime.setEnabled(true);414 }415 480 416 481 if (c.contains("+")) { … … 432 497 433 498 dlg.cM01Fired.setVisible(true); 434 dlg.cM01Fired.setEnabled(false);435 dlg.cM01Fired.setSelected(true);436 499 dlg.lM01Kennung.setVisible(true); 437 500 dlg.cbM01Kennung.setVisible(true); … … 441 504 dlg.tfM01RepeatTime.setVisible(true); 442 505 if (isSectored()) { 506 if ((getSectorIndex() != 0) && (!LightChar[0].isEmpty())) 507 dlg.cbM01Kennung.setEnabled(false); 508 else 509 dlg.cbM01Kennung.setEnabled(true); 510 dlg.cbM01Kennung.setSelectedItem(getLightChar()); 511 if ((getSectorIndex() != 0) && (!LightGroup[0].isEmpty())) 512 dlg.tfM01Group.setEnabled(false); 513 else 514 dlg.tfM01Group.setEnabled(true); 515 dlg.tfM01Group.setText(getLightGroup()); 516 if ((getSectorIndex() != 0) && (!LightPeriod[0].isEmpty())) 517 dlg.tfM01RepeatTime.setEnabled(false); 518 else 519 dlg.tfM01RepeatTime.setEnabled(true); 520 dlg.tfM01RepeatTime.setText(getLightPeriod()); 521 if ((getSectorIndex() != 0) && (!Height[0].isEmpty())) 522 dlg.tfM01Height.setEnabled(false); 523 else 524 dlg.tfM01Height.setEnabled(true); 525 dlg.tfM01Height.setText(getHeight()); 526 if ((getSectorIndex() != 0) && (!Range[0].isEmpty())) 527 dlg.tfM01Range.setEnabled(false); 528 else 529 dlg.tfM01Range.setEnabled(true); 530 dlg.tfM01Range.setText(getRange()); 443 531 dlg.lM01Sector.setVisible(true); 444 532 dlg.cbM01Sector.setVisible(true); 445 dlg.lM01Bearing.setVisible(true); 446 dlg.tfM01Bearing.setVisible(true); 447 dlg.tfM02Bearing.setVisible(true); 448 dlg.tfM01Radius.setVisible(true); 533 if (getSectorIndex() == 0) { 534 dlg.lM01Colour.setVisible(false); 535 dlg.cbM01Colour.setVisible(false); 536 dlg.lM01Bearing.setVisible(false); 537 dlg.tfM01Bearing.setVisible(false); 538 dlg.tfM02Bearing.setVisible(false); 539 dlg.tfM01Radius.setVisible(false); 540 } else { 541 dlg.lM01Colour.setVisible(true); 542 dlg.cbM01Colour.setVisible(true); 543 dlg.lM01Bearing.setVisible(true); 544 dlg.tfM01Bearing.setVisible(true); 545 dlg.tfM01Bearing.setText(getBearing1()); 546 dlg.tfM02Bearing.setVisible(true); 547 dlg.tfM02Bearing.setText(getBearing2()); 548 dlg.tfM01Radius.setVisible(true); 549 dlg.tfM01Radius.setText(getRadius()); 550 } 449 551 } else { 552 dlg.cbM01Kennung.setEnabled(true); 553 dlg.tfM01Group.setEnabled(true); 554 dlg.tfM01RepeatTime.setEnabled(true); 555 dlg.tfM01Height.setEnabled(true); 556 dlg.tfM01Range.setEnabled(true); 557 dlg.lM01Colour.setVisible(true); 558 dlg.cbM01Colour.setVisible(true); 450 559 dlg.lM01Sector.setVisible(false); 451 560 dlg.cbM01Sector.setVisible(false); … … 495 604 dlg.tfM01Radius.setVisible(false); 496 605 } 606 dlg.paintlock = false; 497 607 } 498 608 … … 696 806 setFired(false); 697 807 dlg.rbM01Fired1.setVisible(false); 808 dlg.rbM01Fired1.setSelected(true); 698 809 dlg.rbM01FiredN.setVisible(false); 810 dlg.rbM01FiredN.setSelected(false); 699 811 setSectored(false); 700 setSectorIndex(0);701 812 dlg.cbM01Kennung.removeAllItems(); 702 813 dlg.cbM01Kennung.setVisible(false); … … 716 827 dlg.cbM01Sector.setVisible(false); 717 828 dlg.lM01Sector.setVisible(false); 829 setSectorIndex(0); 718 830 dlg.tfM01Group.setText(""); 719 831 dlg.tfM01Group.setVisible(false); … … 727 839 dlg.tfM01Bearing.setVisible(false); 728 840 dlg.lM01Bearing.setVisible(false); 841 setBearing1(""); 729 842 dlg.tfM02Bearing.setText(""); 730 843 dlg.tfM02Bearing.setVisible(false); 844 setBearing2(""); 731 845 dlg.tfM01Radius.setText(""); 732 846 dlg.tfM01Radius.setVisible(false); 847 setRadius(""); 733 848 734 849 dlg.bM01Save.setEnabled(false); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r23109 r23138 36 36 setTopMark(false); 37 37 setFired(true); 38 dlg.cM01Fired.setEnabled(false); 39 dlg.cM01Fired.setSelected(true); 38 40 } 39 41 … … 60 62 dlg.lM01Range.setVisible(true); 61 63 dlg.tfM01Range.setVisible(true); 62 dlg.lM01Colour.setVisible(true);63 dlg.cbM01Colour.setVisible(true);64 64 65 65 switch (getBuoyIndex()) {
Note:
See TracChangeset
for help on using the changeset viewer.