Changeset 30670 in osm
- Timestamp:
- 2014-09-23T11:46:57+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java
r30669 r30670 101 101 if (commandText.isEmpty()) { 102 102 commandText = history.getLastItem(); 103 } 104 else { 103 } else { 105 104 history.addItem(commandText); 106 105 } … … 108 107 if (command != null) { 109 108 startCommand(command); 109 } else { 110 setMode(Mode.IDLE); 110 111 } 111 else112 setMode(Mode.IDLE);113 112 break; 114 113 case SELECTION: … … 189 188 }; 190 189 191 if ( Main.main.menu != null) {190 if (Main.main.menu != null) { 192 191 commandMenu = Main.main.menu.addMenu(marktr("Commands") , KeyEvent.VK_O, Main.main.menu.getDefaultMenuPos(), ht("/Plugin/CommandLine")); 193 192 MainMenu.add(commandMenu, new CommandLineAction(this)); … … 259 258 return commands.get(i); 260 259 } 261 } 262 else { 263 if ( commands.get(i).name.toLowerCase().startsWith( text.toLowerCase() ) && text.length() > 1 ) { 264 return commands.get(i); 265 } 260 } else if ( commands.get(i).name.toLowerCase().startsWith( text.toLowerCase() ) && text.length() > 1 ) { 261 return commands.get(i); 266 262 } 267 263 } … … 340 336 Layer olayer = Main.map.mapView.getActiveLayer(); 341 337 if (olayer != null) { 342 if (olayer instanceof ImageryLayer) { 343 } 344 else { 338 if (!(olayer instanceof ImageryLayer)) { 345 339 List<ImageryLayer> imageryLayers = Main.map.mapView.getLayersOfType(ImageryLayer.class); 346 340 if (imageryLayers.size() == 1) { … … 404 398 setMode(Mode.SELECTION); 405 399 } 406 } 407 else { 400 } else { 408 401 runTool(); 409 402 } 410 } 411 else { 403 } else { 412 404 Main.info("Invalid argument"); 413 405 endInput(); … … 424 416 if (ok) { 425 417 currentCommand.nextParameter(); 426 } 427 else { 418 } else { 428 419 currentCommand.resetLoading(); 429 420 } … … 463 454 debugstr.append(s + " "); 464 455 debugstr.append("\n"); 465 System.out.print(debugstr.toString());456 Main.info(debugstr.toString()); 466 457 467 458 final ToolProcess tp = new ToolProcess(); … … 469 460 tp.process = builder.start(); 470 461 } catch (final IOException e) { 471 e.printStackTrace();472 462 synchronized (debugstr) { 473 System.out.print(463 Main.error( 474 464 tr("Error executing the script: ") + 475 465 debugstr.toString() + e.getMessage() + "\n" + e.getStackTrace()); … … 577 567 final OsmToCmd osmToCmd = new OsmToCmd(that, currentDataSet); 578 568 String commandName = currentCommand.name; 579 //HashMap<Long, Long> inexiDMap = new HashMap<Long, Long>();580 569 final InputStream inputStream = tp.process.getInputStream(); 581 570 osmToCmd.parseStream(inputStream); … … 590 579 }); 591 580 } 592 } 593 catch (Exception e) {}581 } catch (Exception e) { 582 } 594 583 finally { 595 584 synchronized (syncObj) {
Note:
See TracChangeset
for help on using the changeset viewer.