- Timestamp:
- 2012-08-15T15:06:01+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/remotecontrol
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
r5009 r5445 25 25 */ 26 26 static final int protocolMajorVersion = 1; 27 static final int protocolMinorVersion = 3;27 static final int protocolMinorVersion = 4; 28 28 29 29 /** 30 * Returns an array of int values with major and minor API version 31 * and major and minor HTTP protocol version. 32 * 33 * The function returns an int[4] instead of an object with fields 34 * to avoid ClassNotFound errors with old versions of remotecontrol. 35 * 36 * @return array of integer version numbers: 37 * apiMajorVersion (obsolete), apiMinorVersion (obsolete), protocolMajorVersion, protocolMajorVersion 38 */ 39 @Deprecated 40 public int[] getVersion() 41 { 42 int versions[] = {1, 0, protocolMajorVersion, protocolMajorVersion}; 43 return versions; 44 } 45 46 /** 47 * Start the remote control server 30 * Starts the remote control server 48 31 */ 49 32 public static void start() { … … 52 35 53 36 /** 54 * Add externalexternal request handler.37 * Adds external request handler. 55 38 * Can be used by plugins that want to use remote control. 56 * 57 * @param handler The additional request handler. 39 * 40 * @param command The command name. 41 * @param handlerClass The additional request handler. 58 42 */ 59 43 public void addRequestHandler(String command, Class<? extends RequestHandler> handlerClass) -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
r5444 r5445 49 49 String title = args.get("title"); 50 50 String type = args.get("type"); 51 if ((title == null) || (title. length() == 0)) {51 if ((title == null) || (title.isEmpty())) { 52 52 title = tr("Remote imagery"); 53 53 } 54 54 String cookies = args.get("cookies"); 55 ImageryLayer imgLayer = ImageryLayer.create(new ImageryInfo(title, url, type, null, cookies)); 56 Main.main.addLayer(imgLayer); 55 ImageryInfo imgInfo = new ImageryInfo(title, url, type, null, cookies); 56 String min_zoom = args.get("min_zoom"); 57 if (min_zoom != null && !min_zoom.isEmpty()) { 58 try { 59 imgInfo.setDefaultMinZoom(Integer.parseInt(min_zoom)); 60 } catch (NumberFormatException e) { 61 System.err.println(e.getMessage()); 62 } 63 } 64 String max_zoom = args.get("max_zoom"); 65 if (max_zoom != null && !max_zoom.isEmpty()) { 66 try { 67 imgInfo.setDefaultMaxZoom(Integer.parseInt(max_zoom)); 68 } catch (NumberFormatException e) { 69 System.err.println(e.getMessage()); 70 } 71 } 72 Main.main.addLayer(ImageryLayer.create(imgInfo)); 57 73 } 58 74
Note:
See TracChangeset
for help on using the changeset viewer.