Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/Browser.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/Browser.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/Browser.java	(revision 12778)
@@ -21,5 +21,5 @@
     static
     {
-	Logger.getLogger("org.lobobrowser").setLevel(Level.WARNING);
+    Logger.getLogger("org.lobobrowser").setLevel(Level.WARNING);
     }
 
@@ -29,75 +29,75 @@
 
     public Browser(String uri) {
-	super();
+    super();
 
-	UserAgentContext ucontext = new CacheableUserAgentContext();
-	rcontext = new SimpleHtmlRendererContext(this, ucontext);
-	addNotify();
+    UserAgentContext ucontext = new CacheableUserAgentContext();
+    rcontext = new SimpleHtmlRendererContext(this, ucontext);
+    addNotify();
 
-	process( uri );
+    process( uri );
     }
 
     private void process(String uri) {
-	try {
-	    URL url;
-	    try {
-		url = new URL(uri);
-	    } catch (java.net.MalformedURLException mfu) {
-		int idx = uri.indexOf(':');
-		if (idx == -1 || idx == 1) {
-		    // try file
-		    url = new URL("file:" + uri);
-		} else {
-		    throw mfu;
-		}
-	    }
-	    // Call SimpleHtmlRendererContext.navigate()
-	    // which implements incremental rendering.
-	    this.rcontext.navigate(url, null);
-	} catch (Exception err) {
-	    err.printStackTrace();
-	}
+    try {
+        URL url;
+        try {
+        url = new URL(uri);
+        } catch (java.net.MalformedURLException mfu) {
+        int idx = uri.indexOf(':');
+        if (idx == -1 || idx == 1) {
+            // try file
+            url = new URL("file:" + uri);
+        } else {
+            throw mfu;
+        }
+        }
+        // Call SimpleHtmlRendererContext.navigate()
+        // which implements incremental rendering.
+        this.rcontext.navigate(url, null);
+    } catch (Exception err) {
+        err.printStackTrace();
     }
-    
+    }
+
     @Override
     public void setSize(final Dimension newSize)
     {
-	if (!newSize.equals(oldSize)) {
-	    oldSize = newSize;
-	    super.setSize(newSize);
-	    validate();
+    if (!newSize.equals(oldSize)) {
+        oldSize = newSize;
+        super.setSize(newSize);
+        validate();
 
-	    executeAsyncScript("resizeMap(" + newSize.width + "," + newSize.height + ");");
-	}
+        executeAsyncScript("resizeMap(" + newSize.width + "," + newSize.height + ");");
+    }
     }
 
     public void executeAsyncScript(final String script)
     {
-	EventQueue.invokeLater(new Runnable() {
-	    public void run() {
-		executeScript(script);
-	    }
-	});
+    EventQueue.invokeLater(new Runnable() {
+        public void run() {
+        executeScript(script);
+        }
+    });
     }
-    
+
     public Object executeScript(String script)
     {
-	System.out.println("Executing script " + script);
-	try {
-	    Window window = Window.getWindow(rcontext);
-	    if( window.getDocumentNode() == null )
-		return null; // Document not loaded yet
+    System.out.println("Executing script " + script);
+    try {
+        Window window = Window.getWindow(rcontext);
+        if( window.getDocumentNode() == null )
+        return null; // Document not loaded yet
 
-	    return window.eval(script);
-	} catch (EcmaError ecmaError) {
-	    logger.log(Level.WARNING, "Javascript error at " + ecmaError.sourceName() + ":" + ecmaError.lineNumber() + ": " + ecmaError.getMessage());
-	} catch (Throwable err) {
-	    logger.log(Level.WARNING, "Unable to evaluate Javascript code", err);
-	}
-	
-	return null;
+        return window.eval(script);
+    } catch (EcmaError ecmaError) {
+        logger.log(Level.WARNING, "Javascript error at " + ecmaError.sourceName() + ":" + ecmaError.lineNumber() + ": " + ecmaError.getMessage());
+    } catch (Throwable err) {
+        logger.log(Level.WARNING, "Unable to evaluate Javascript code", err);
     }
-    
-    
+
+    return null;
+    }
+
+
     /**
      * Overrided to hide hardcoded scrollbars and insets
@@ -105,5 +105,5 @@
     @Override
     protected HtmlBlockPanel createHtmlBlockPanel(UserAgentContext ucontext, HtmlRendererContext rcontext) {
-	return new MyHtmlBlockPanel(java.awt.Color.WHITE, true, ucontext, rcontext, this);
+    return new MyHtmlBlockPanel(java.awt.Color.WHITE, true, ucontext, rcontext, this);
     }
 }
Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/CacheableHttpRequest.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/CacheableHttpRequest.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/CacheableHttpRequest.java	(revision 12778)
@@ -44,122 +44,122 @@
 
     public CacheableHttpRequest(UserAgentContext context, Proxy proxy) {
-	this.context = context;
-	this.proxy = proxy;
+    this.context = context;
+    this.proxy = proxy;
     }
 
     public synchronized int getReadyState() {
-	return this.readyState;
+    return this.readyState;
     }
 
     public synchronized String getResponseText() {
-	if( response == null ) return null;
-	
-	byte[] bytes = this.response.responseBytes;
-	String encoding = this.response.encoding;
-	
-	try {
-	    return bytes == null ? null : new String(bytes, encoding);
-	} catch (UnsupportedEncodingException uee) {
-	    logger.log(Level.WARNING, "getResponseText(): Charset '" + encoding + "' did not work. Retrying with ISO-8859-1.", uee);
-	    try {
-		return new String(bytes, "ISO-8859-1");
-	    } catch (UnsupportedEncodingException uee2) {
-		// Ignore this time
-		return null;
-	    }
-	}
+    if( response == null ) return null;
+
+    byte[] bytes = this.response.responseBytes;
+    String encoding = this.response.encoding;
+
+    try {
+        return bytes == null ? null : new String(bytes, encoding);
+    } catch (UnsupportedEncodingException uee) {
+        logger.log(Level.WARNING, "getResponseText(): Charset '" + encoding + "' did not work. Retrying with ISO-8859-1.", uee);
+        try {
+        return new String(bytes, "ISO-8859-1");
+        } catch (UnsupportedEncodingException uee2) {
+        // Ignore this time
+        return null;
+        }
+    }
     }
 
     public synchronized Document getResponseXML() {
-	if( response == null ) return null;
-
-	byte[] bytes = this.response.responseBytes;
-	if (bytes == null) return null;
-
-	InputStream in = new ByteArrayInputStream(bytes);
-	try {
-	    return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in);
-	} catch (Exception err) {
-	    logger.log(Level.WARNING, "Unable to parse response as XML.", err);
-	    return null;
-	}
+    if( response == null ) return null;
+
+    byte[] bytes = this.response.responseBytes;
+    if (bytes == null) return null;
+
+    InputStream in = new ByteArrayInputStream(bytes);
+    try {
+        return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in);
+    } catch (Exception err) {
+        logger.log(Level.WARNING, "Unable to parse response as XML.", err);
+        return null;
+    }
     }
 
     public synchronized byte[] getResponseBytes() {
-	if( response == null ) return null;
-	return this.response.responseBytes;
+    if( response == null ) return null;
+    return this.response.responseBytes;
     }
 
     public synchronized Image getResponseImage() {
-	if( response == null ) return null;
-
-	byte[] bytes = this.response.responseBytes;
-	if (bytes == null) return null;
-
-	return Toolkit.getDefaultToolkit().createImage(bytes);
+    if( response == null ) return null;
+
+    byte[] bytes = this.response.responseBytes;
+    if (bytes == null) return null;
+
+    return Toolkit.getDefaultToolkit().createImage(bytes);
     }
 
     public synchronized int getStatus() {
-	if( response == null ) return 0;
-	return this.response.status;
+    if( response == null ) return 0;
+    return this.response.status;
     }
 
     public synchronized String getStatusText() {
-	if( response == null ) return null;
-	return this.response.statusText;
+    if( response == null ) return null;
+    return this.response.statusText;
     }
 
     public synchronized String getAllResponseHeaders() {
-	if( response == null ) return null;
-	return this.response.responseHeaders;
+    if( response == null ) return null;
+    return this.response.responseHeaders;
     }
 
     public synchronized String getResponseHeader(String headerName) {
-	if( response == null ) return null;
-	Map headers = this.response.responseHeadersMap;
-	return headers == null ? null : (String) headers.get(headerName);
+    if( response == null ) return null;
+    Map headers = this.response.responseHeadersMap;
+    return headers == null ? null : (String) headers.get(headerName);
     }
 
     public void open(String method, String url) throws IOException {
-	this.open(method, url, true);
+    this.open(method, url, true);
     }
 
     public void open(String method, URL url) throws IOException {
-	this.open(method, url, true, null, null);
+    this.open(method, url, true, null, null);
     }
 
     public void open(String method, URL url, boolean asyncFlag) throws IOException {
-	this.open(method, url, asyncFlag, null, null);
+    this.open(method, url, asyncFlag, null, null);
     }
 
     public void open(String method, String url, boolean asyncFlag) throws IOException {
-	URL urlObj = Urls.createURL(null, url);
-	this.open(method, urlObj, asyncFlag, null);
+    URL urlObj = Urls.createURL(null, url);
+    this.open(method, urlObj, asyncFlag, null);
     }
 
     public void open(String method, URL url, boolean asyncFlag, String userName) throws IOException {
-	this.open(method, url, asyncFlag, userName, null);
+    this.open(method, url, asyncFlag, userName, null);
     }
 
     public void abort() {
-	URLConnection c;
-	synchronized (this) {
-	    c = this.connection;
-	    response = null;
-	}
-	if (c instanceof HttpURLConnection) {
-	    ((HttpURLConnection) c).disconnect();
-	} else if (c != null) {
-	    try {
-		c.getInputStream().close();
-	    } catch (IOException ioe) {
-		ioe.printStackTrace();
-	    }
-	}
+    URLConnection c;
+    synchronized (this) {
+        c = this.connection;
+        response = null;
+    }
+    if (c instanceof HttpURLConnection) {
+        ((HttpURLConnection) c).disconnect();
+    } else if (c != null) {
+        try {
+        c.getInputStream().close();
+        } catch (IOException ioe) {
+        ioe.printStackTrace();
+        }
+    }
     }
 
     /**
      * Opens the request. Call {@link #send(String)} to complete it.
-     * 
+     *
      * @param method The request method.
      * @param url The request URL.
@@ -170,29 +170,29 @@
      */
     public void open(final String method, final URL url, boolean asyncFlag, final String userName, final String password) throws IOException {
-	this.abort();
-
-	HttpResponse response = HttpResponse.lookup(url);
-	URLConnection c = null;
-	
-	if( response == null )
-	{
-	    c = proxy == null || proxy == Proxy.NO_PROXY ? url.openConnection() : url.openConnection(proxy);
-	    response = new HttpResponse();
-	}
-	    
-	synchronized (this) {
-	    this.connection = c;
-	    this.isAsync = asyncFlag;
-	    this.requestMethod = method;
-	    this.requestUserName = userName;
-	    this.requestPassword = password;
-	    this.requestURL = url;
-	    this.response = response;
-	    
-	    if( response.loaded )
-		changeState(HttpRequest.STATE_LOADING);
-	    else
-		changeState(HttpRequest.STATE_LOADING, 0, null, null);
-	}
+    this.abort();
+
+    HttpResponse response = HttpResponse.lookup(url);
+    URLConnection c = null;
+
+    if( response == null )
+    {
+        c = proxy == null || proxy == Proxy.NO_PROXY ? url.openConnection() : url.openConnection(proxy);
+        response = new HttpResponse();
+    }
+
+    synchronized (this) {
+        this.connection = c;
+        this.isAsync = asyncFlag;
+        this.requestMethod = method;
+        this.requestUserName = userName;
+        this.requestPassword = password;
+        this.requestURL = url;
+        this.response = response;
+
+        if( response.loaded )
+        changeState(HttpRequest.STATE_LOADING);
+        else
+        changeState(HttpRequest.STATE_LOADING, 0, null, null);
+    }
     }
 
@@ -201,28 +201,28 @@
      * <p>
      * In the case of asynchronous requests, a new thread is created.
-     * 
+     *
      * @param content POST content or <code>null</code> if there's no such
      *        content.
      */
     public void send(final String content) throws IOException {
-	final URL url = this.requestURL;
-	if (url == null) {
-	    throw new IOException("No URL has been provided.");
-	}
-	if (this.isAsync) {
-	    // Should use a thread pool instead
-	    new Thread("SimpleHttpRequest-" + url.getHost()) {
-		@Override
+    final URL url = this.requestURL;
+    if (url == null) {
+        throw new IOException("No URL has been provided.");
+    }
+    if (this.isAsync) {
+        // Should use a thread pool instead
+        new Thread("SimpleHttpRequest-" + url.getHost()) {
+        @Override
         public void run() {
-		    try {
-			sendSync(content);
-		    } catch (Throwable thrown) {
-			logger.log(Level.WARNING,"send(): Error in asynchronous request on " + url, thrown);
-		    }
-		}
-	    }.start();
-	} else {
-	    sendSync(content);
-	}
+            try {
+            sendSync(content);
+            } catch (Throwable thrown) {
+            logger.log(Level.WARNING,"send(): Error in asynchronous request on " + url, thrown);
+            }
+        }
+        }.start();
+    } else {
+        sendSync(content);
+    }
     }
 
@@ -232,5 +232,5 @@
      */
     protected String getPostCharset() {
-	return "UTF-8";
+    return "UTF-8";
     }
 
@@ -238,61 +238,61 @@
      * This is a synchronous implementation of {@link #send(String)} method
      * functionality. It may be overridden to change the behavior of the class.
-     * 
+     *
      * @param content POST content if any. It may be <code>null</code>.
      * @throws IOException
      */
     protected void sendSync(String content) throws IOException {
-	if( response.loaded )
-	{
-	    // Response from cache
-	    changeState(HttpRequest.STATE_LOADED);
-	    changeState(HttpRequest.STATE_INTERACTIVE);
-	    changeState(HttpRequest.STATE_COMPLETE);
-	    return;
-	}
-	
-	try {
-	    URLConnection c;
-	    synchronized (this) {
-		c = this.connection;
-	    }
-	    c.setRequestProperty("User-Agent", this.context.getUserAgent());
-	    int istatus = 0;
-	    String istatusText = "";
-	    InputStream err = null;
-	    
-	    if (c instanceof HttpURLConnection) {
-		HttpURLConnection hc = (HttpURLConnection) c;
-		String method = requestMethod.toUpperCase();
-		hc.setRequestMethod(method);
-		if ("POST".equals(method) && content != null) {
-		    hc.setDoOutput(true);
-		    byte[] contentBytes = content.getBytes(this.getPostCharset());
-		    hc.setFixedLengthStreamingMode(contentBytes.length);
-		    OutputStream out = hc.getOutputStream();
-		    try {
-			out.write(contentBytes);
-		    } finally {
-			out.flush();
-		    }
-		}
-		istatus = hc.getResponseCode();
-		istatusText = hc.getResponseMessage();
-		err = hc.getErrorStream();
-	    }
-
-	    response.setConnectionInfo(c);
-	    changeState(HttpRequest.STATE_LOADED, istatus, istatusText, null);
-	    InputStream in = err == null ? c.getInputStream() : err;
-	    int contentLength = c.getContentLength();
-	    changeState(HttpRequest.STATE_INTERACTIVE, istatus, istatusText, null);
-	    byte[] bytes = IORoutines.load(in, contentLength == -1 ? 4096 : contentLength);
-	    changeState(HttpRequest.STATE_COMPLETE, istatus, istatusText, bytes);
-	    response.store(requestURL);
-	} finally {
-	    synchronized (this) {
-		this.connection = null;
-	    }
-	}
+    if( response.loaded )
+    {
+        // Response from cache
+        changeState(HttpRequest.STATE_LOADED);
+        changeState(HttpRequest.STATE_INTERACTIVE);
+        changeState(HttpRequest.STATE_COMPLETE);
+        return;
+    }
+
+    try {
+        URLConnection c;
+        synchronized (this) {
+        c = this.connection;
+        }
+        c.setRequestProperty("User-Agent", this.context.getUserAgent());
+        int istatus = 0;
+        String istatusText = "";
+        InputStream err = null;
+
+        if (c instanceof HttpURLConnection) {
+        HttpURLConnection hc = (HttpURLConnection) c;
+        String method = requestMethod.toUpperCase();
+        hc.setRequestMethod(method);
+        if ("POST".equals(method) && content != null) {
+            hc.setDoOutput(true);
+            byte[] contentBytes = content.getBytes(this.getPostCharset());
+            hc.setFixedLengthStreamingMode(contentBytes.length);
+            OutputStream out = hc.getOutputStream();
+            try {
+            out.write(contentBytes);
+            } finally {
+            out.flush();
+            }
+        }
+        istatus = hc.getResponseCode();
+        istatusText = hc.getResponseMessage();
+        err = hc.getErrorStream();
+        }
+
+        response.setConnectionInfo(c);
+        changeState(HttpRequest.STATE_LOADED, istatus, istatusText, null);
+        InputStream in = err == null ? c.getInputStream() : err;
+        int contentLength = c.getContentLength();
+        changeState(HttpRequest.STATE_INTERACTIVE, istatus, istatusText, null);
+        byte[] bytes = IORoutines.load(in, contentLength == -1 ? 4096 : contentLength);
+        changeState(HttpRequest.STATE_COMPLETE, istatus, istatusText, bytes);
+        response.store(requestURL);
+    } finally {
+        synchronized (this) {
+        this.connection = null;
+        }
+    }
     }
 
@@ -300,11 +300,11 @@
 
     public void addReadyStateChangeListener( final ReadyStateChangeListener listener) {
-	readyEvent.addListener(new GenericEventListener() {
-	    public void processEvent(EventObject event) {
-		listener.readyStateChanged();
-	    }
-	});
-    }
-    
+    readyEvent.addListener(new GenericEventListener() {
+        public void processEvent(EventObject event) {
+        listener.readyStateChanged();
+        }
+    });
+    }
+
     protected void changeState(int readyState, int status, String statusMessage, byte[] bytes) {
         synchronized (this) {
Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/CacheableUserAgentContext.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/CacheableUserAgentContext.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/CacheableUserAgentContext.java	(revision 12778)
@@ -9,10 +9,10 @@
 public class CacheableUserAgentContext extends SimpleUserAgentContext {
 
-    /** 
+    /**
      * Returns a cache aware HttpRequest
      */
     @Override
     public HttpRequest createHttpRequest() {
-	return new CacheableHttpRequest(this, this.getProxy());
+    return new CacheableHttpRequest(this, this.getProxy());
     }
 }
Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/HttpResponse.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/HttpResponse.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/HttpResponse.java	(revision 12778)
@@ -1,4 +1,4 @@
 /**
- * 
+ *
  */
 package org.openstreetmap.josm.plugins.openLayers;
@@ -16,5 +16,5 @@
 public class HttpResponse implements Serializable {
     private static final long serialVersionUID = -8605486951415515445L;
-    
+
     /** The status of the response */
     protected int status;
@@ -27,5 +27,5 @@
     /** Whether this response has been already loaded */
     protected boolean loaded = false;
-    
+
     /** Response headers are set in this map after a response is received. */
     protected Map<String, List<String>> responseHeadersMap;
@@ -33,5 +33,5 @@
     /** Response headers are set in this string after a response is received. */
     protected String responseHeaders;
-    
+
     /**
      * Sets the information about this response: headers and encoding
@@ -43,5 +43,5 @@
         if (encoding == null)
             encoding = "ISO-8859-1";
-        
+
         responseHeaders = getAllResponseHeaders(c);
         responseHeadersMap = c.getHeaderFields();
@@ -50,5 +50,5 @@
     /**
      * Sets the state of this response
-     * 
+     *
      * @param status The response status
      * @param statusMessage The status message
@@ -56,9 +56,9 @@
      */
     public synchronized void changeState(int status, String statusMessage, byte[] bytes) {
-	this.status = status;
+    this.status = status;
         this.statusText = statusMessage;
         this.responseBytes = bytes;
     }
-        
+
     /**
      * Returns the headers of the connection as a String
@@ -68,18 +68,18 @@
     private String getAllResponseHeaders(URLConnection c) {
         int idx = 0;
-	String value;
-	StringBuffer buf = new StringBuffer();
-	while((value = c.getHeaderField(idx)) != null) {
-	    String key = c.getHeaderFieldKey(idx);
-	    if( key != null )
-	    {
-		buf.append(key);
-		buf.append("=");
-	    }
-	    buf.append(value);
-	    buf.append("\n");
-	    idx++;
-	}
-	return buf.toString();
+    String value;
+    StringBuffer buf = new StringBuffer();
+    while((value = c.getHeaderField(idx)) != null) {
+        String key = c.getHeaderFieldKey(idx);
+        if( key != null )
+        {
+        buf.append(key);
+        buf.append("=");
+        }
+        buf.append(value);
+        buf.append("\n");
+        idx++;
+    }
+    return buf.toString();
     }
 
@@ -89,15 +89,15 @@
      */
     public void store(URL requestURL) {
-	loaded = true;
-	StorageManager.getInstance().put(requestURL, this);
+    loaded = true;
+    StorageManager.getInstance().put(requestURL, this);
     }
-    
+
     /**
      * Looks up the requested URL in the cache
-     * @param requestURL The requested URL 
+     * @param requestURL The requested URL
      * @return The response, if available
      */
     public static HttpResponse lookup(URL requestURL) {
-	return StorageManager.getInstance().get(requestURL);
+    return StorageManager.getInstance().get(requestURL);
     }
 }
Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/MyHtmlBlockPanel.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/MyHtmlBlockPanel.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/MyHtmlBlockPanel.java	(revision 12778)
@@ -43,5 +43,5 @@
             this.rblock = null;
         }
-        
+
         this.invalidate();
         this.validateAll();
Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/OpenLayersLayer.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/OpenLayersLayer.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/OpenLayersLayer.java	(revision 12778)
@@ -21,7 +21,7 @@
 /**
  * Class that displays a OpenLayers layer.
- * 
+ *
  * @author Francisco R. Santos <frsantos@gmail.com>
- * 
+ *
  */
 public class OpenLayersLayer extends Layer implements PreferenceChangedListener, PropertyChangeListener {
@@ -33,14 +33,14 @@
      */
     public OpenLayersLayer() {
-	super("OpenLayers");
-	
-	this.browser = new Browser(OpenLayersPlugin.pluginDir + "yahoo.html");
-        
-	if( Main.map != null )
-	{
-	    LatLon bottomLeft = Main.map.mapView.getLatLon(0,Main.map.mapView.getHeight());
-	    LatLon topRight = Main.map.mapView.getLatLon(Main.map.mapView.getWidth(), 0);
-	    browser.executeAsyncScript("zoomMapToExtent(" + bottomLeft.lon() + "," + bottomLeft.lat() + "," + topRight.lon() + "," + topRight.lat() + ")");
-	}
+    super("OpenLayers");
+
+    this.browser = new Browser(OpenLayersPlugin.pluginDir + "yahoo.html");
+
+    if( Main.map != null )
+    {
+        LatLon bottomLeft = Main.map.mapView.getLatLon(0,Main.map.mapView.getHeight());
+        LatLon topRight = Main.map.mapView.getLatLon(Main.map.mapView.getWidth(), 0);
+        browser.executeAsyncScript("zoomMapToExtent(" + bottomLeft.lon() + "," + bottomLeft.lat() + "," + topRight.lon() + "," + topRight.lat() + ")");
+    }
     }
 
@@ -50,6 +50,6 @@
     @Override
     public void paint(Graphics g, MapView mv) {
-	setSize(Main.map.mapView.getSize());
-	browser.paint(g);
+    setSize(Main.map.mapView.getSize());
+    browser.paint(g);
     }
 
@@ -58,37 +58,37 @@
      */
     public void setSize(Dimension dim) {
-	browser.setSize(dim);
+    browser.setSize(dim);
     }
-    
+
     @Override
     public Icon getIcon() {
-	return ImageProvider.get("OpenLayers.png");
+    return ImageProvider.get("OpenLayers.png");
     }
 
     @Override
     public Object getInfoComponent() {
-	return null;
+    return null;
     }
 
     @Override
     public Component[] getMenuEntries() {
-	return new Component[] {
-		new JMenuItem(new LayerListDialog.ShowHideLayerAction(this)),
-		new JMenuItem(new LayerListDialog.DeleteLayerAction(this)),
-		new JSeparator(),
-		// color,
-		new JMenuItem(new RenameLayerAction(associatedFile, this)),
-		new JSeparator(),
-		new JMenuItem(new LayerListPopup.InfoAction(this)) };
+    return new Component[] {
+        new JMenuItem(new LayerListDialog.ShowHideLayerAction(this)),
+        new JMenuItem(new LayerListDialog.DeleteLayerAction(this)),
+        new JSeparator(),
+        // color,
+        new JMenuItem(new RenameLayerAction(associatedFile, this)),
+        new JSeparator(),
+        new JMenuItem(new LayerListPopup.InfoAction(this)) };
     }
 
     @Override
     public String getToolTipText() {
-	return null;
+    return null;
     }
 
     @Override
     public boolean isMergable(Layer other) {
-	return false;
+    return false;
     }
 
@@ -103,11 +103,11 @@
     @Override
     public void destroy() {
-	Main.pref.listener.remove(this);
+    Main.pref.listener.remove(this);
 
-	if( Main.map != null )
-	    Main.map.mapView.removePropertyChangeListener(this);
-	
-	OpenLayersPlugin.layer = null;
-	StorageManager.flush();
+    if( Main.map != null )
+        Main.map.mapView.removePropertyChangeListener(this);
+
+    OpenLayersPlugin.layer = null;
+    StorageManager.flush();
     }
 
@@ -116,13 +116,13 @@
 
     public void propertyChange(PropertyChangeEvent evt) {
-	if( !visible )
-	    return;
-	
+    if( !visible )
+        return;
+
         String prop = evt.getPropertyName();
-	if ("center".equals(prop) || "scale".equals(prop)) {
-	    zoomToMapView();
-	}
+    if ("center".equals(prop) || "scale".equals(prop)) {
+        zoomToMapView();
     }
-    
+    }
+
     public void zoomToMapView()
     {
@@ -133,5 +133,5 @@
         {
             // TODO wrong calculations
-            
+
             // Get actual extent from browser
             NativeArray array = (NativeArray)value;
@@ -140,12 +140,12 @@
             double right  = ((Double)array.get(2, null)).doubleValue();
             double top    = ((Double)array.get(3, null)).doubleValue();
-	    bottomLeft = new LatLon( bottom, left );
-	    topRight   = new LatLon( top, right);
-	    
-	    BoundingXYVisitor v = new BoundingXYVisitor();
-	    v.visit(Main.proj.latlon2eastNorth(bottomLeft));
-	    v.visit(Main.proj.latlon2eastNorth(topRight));
-	    System.out.println("Recalculating position (" + left + "," + bottom + "," + right + "," + top + ")");
-	    Main.map.mapView.recalculateCenterScale(v);
+        bottomLeft = new LatLon( bottom, left );
+        topRight   = new LatLon( top, right);
+
+        BoundingXYVisitor v = new BoundingXYVisitor();
+        v.visit(Main.proj.latlon2eastNorth(bottomLeft));
+        v.visit(Main.proj.latlon2eastNorth(topRight));
+        System.out.println("Recalculating position (" + left + "," + bottom + "," + right + "," + top + ")");
+        Main.map.mapView.recalculateCenterScale(v);
         }
     }
Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/OpenLayersPlugin.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/OpenLayersPlugin.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/OpenLayersPlugin.java	(revision 12778)
@@ -14,7 +14,7 @@
 /**
  * Main class for the OpenLayers plugin.
- * 
+ *
  * @author Francisco R. Santos <frsantos@gmail.com>
- * 
+ *
  */
 public class OpenLayersPlugin extends Plugin {
@@ -25,38 +25,38 @@
 
     public OpenLayersPlugin() {
-	pluginDir = getPluginDir();
-	try {
-	    copy("/resources/yahoo.html", "yahoo.html");
-	} catch (FileNotFoundException e) {
-	    // TODO Auto-generated catch block
-	    e.printStackTrace();
-	} catch (IOException e) {
-	    // TODO Auto-generated catch block
-	    e.printStackTrace();
-	}
-	StorageManager.initStorage( pluginDir );
-	refreshMenu();
+    pluginDir = getPluginDir();
+    try {
+        copy("/resources/yahoo.html", "yahoo.html");
+    } catch (FileNotFoundException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+    } catch (IOException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
     }
-    
+    StorageManager.initStorage( pluginDir );
+    refreshMenu();
+    }
+
     public static void refreshMenu() {
-	JMenuBar menuBar = Main.main.menu;
-	if (menu == null) {
-		menu = new JMenu(tr("OpenLayers"));
-		menuBar.add(menu, 5);
-	} else {
-		menu.removeAll();
-	}
-	
-	menu.add(new JMenuItem(new ShowOpenLayersAction("Yahoo")));
+    JMenuBar menuBar = Main.main.menu;
+    if (menu == null) {
+        menu = new JMenu(tr("OpenLayers"));
+        menuBar.add(menu, 5);
+    } else {
+        menu.removeAll();
+    }
+
+    menu.add(new JMenuItem(new ShowOpenLayersAction("Yahoo")));
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.openstreetmap.josm.plugins.Plugin#getPreferenceSetting()
      */
     @Override
     public PreferenceSetting getPreferenceSetting() {
-	return null;
+    return null;
     }
 
Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/ShowOpenLayersAction.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/ShowOpenLayersAction.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/ShowOpenLayersAction.java	(revision 12778)
@@ -10,22 +10,22 @@
 
     public ShowOpenLayersAction(String name) {
-	super(name, "OpenLayers", "Show layer" + name, 0, 0, false);
+    super(name, "OpenLayers", "Show layer" + name, 0, 0, false);
     }
 
     public void actionPerformed(ActionEvent e) {
-	final OpenLayersLayer layer = OpenLayersPlugin.layer != null ? OpenLayersPlugin.layer : new OpenLayersLayer();
-	OpenLayersPlugin.layer = layer;
-	Main.main.addLayer(layer);
-	
-	EventQueue.invokeLater(new Runnable() {
-	    public void run() {
-		layer.setSize(Main.map.mapView.getSize());
-	    }
-	});
-	    
-	// Get notifications of scale and position
-	Main.map.mapView.addPropertyChangeListener("scale", layer);
-	Main.map.mapView.addPropertyChangeListener("center", layer);
-	
+    final OpenLayersLayer layer = OpenLayersPlugin.layer != null ? OpenLayersPlugin.layer : new OpenLayersLayer();
+    OpenLayersPlugin.layer = layer;
+    Main.main.addLayer(layer);
+
+    EventQueue.invokeLater(new Runnable() {
+        public void run() {
+        layer.setSize(Main.map.mapView.getSize());
+        }
+    });
+
+    // Get notifications of scale and position
+    Main.map.mapView.addPropertyChangeListener("scale", layer);
+    Main.map.mapView.addPropertyChangeListener("center", layer);
+
     }
 };
Index: applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/StorageManager.java
===================================================================
--- applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/StorageManager.java	(revision 8748)
+++ applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/StorageManager.java	(revision 12778)
@@ -10,52 +10,52 @@
  * too big, with many jars, it should be replaced for a hand-made storage to
  * disk.
- * 
+ *
  * @author frsantos
- * 
+ *
  */
 public class StorageManager {
 
     private Cache cache;
-    
+
     private static StorageManager storage;
-    
+
     public static void initStorage(String basedir)
     {
-	if( storage != null ) storage.dispose();
-	
-	storage = new StorageManager(basedir);
+    if( storage != null ) storage.dispose();
+
+    storage = new StorageManager(basedir);
     }
-    
+
     protected StorageManager(String basedir)
     {
-	System.setProperty("net.sf.ehcache.enableShutdownHook", "true"); 
-	cache = new Cache("OpenLayers", 500, MemoryStoreEvictionPolicy.LRU, true, basedir + "cache", false, 300*24*7, 300, true, 3600*24*7, null);
-	CacheManager.getInstance().addCache(cache);
+    System.setProperty("net.sf.ehcache.enableShutdownHook", "true");
+    cache = new Cache("OpenLayers", 500, MemoryStoreEvictionPolicy.LRU, true, basedir + "cache", false, 300*24*7, 300, true, 3600*24*7, null);
+    CacheManager.getInstance().addCache(cache);
     }
-    
+
     protected void dispose()
     {
-	if( cache != null )
-	    cache.dispose();
+    if( cache != null )
+        cache.dispose();
     }
-    
+
     public static StorageManager getInstance()
     {
-	return storage;
+    return storage;
     }
-    
+
     public HttpResponse get(URL key)
     {
-	Element element = cache.get(key);
-	if( element != null )
-	    return (HttpResponse)element.getObjectValue();
-	
-	return null;
+    Element element = cache.get(key);
+    if( element != null )
+        return (HttpResponse)element.getObjectValue();
+
+    return null;
     }
-    
+
     public void put(URL key, HttpResponse value)
     {
-	Element element = new Element(key, value);
-	cache.put(element);
+    Element element = new Element(key, value);
+    cache.put(element);
     }
 
@@ -64,6 +64,6 @@
      */
     public static void flush() {
-	if( storage != null )
-	    storage.cache.flush();
+    if( storage != null )
+        storage.cache.flush();
     }
 }
