Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java	(revision 5245)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/DownloadWMSTask.java	(revision 5319)
@@ -21,19 +21,16 @@
 	
 	public DownloadWMSTask(String name, String wmsurl) {
-		
 		super(tr("Downloading " + name));
-		
+
 		// simply check if we already have a layer created. if not, create; if yes, reuse.
-		
 		if (wmsLayer == null) {
-			
 			if (wmsurl.matches("(?i).*layers=npeoocmap.*") || wmsurl.matches("(?i).*layers=npe.*") ){
 				//then we use the OSGBLayer
 				this.wmsLayer= new OSGBLayer(name, wmsurl);
-			} else {			
+			} else {
 				this.wmsLayer = new WMSLayer(name, wmsurl); 
-				
 			} 
 		} 
+	
 	}
 	
@@ -50,10 +47,7 @@
 		layerAdded = false;
 		for (Iterator it = Main.map.mapView.getAllLayers().iterator(); it.hasNext(); ) {
-        Object  element = it.next();
-       
-        if (element.equals(wmsLayer)) layerAdded = true;
-        
+			Object  element = it.next();
+			if (element.equals(wmsLayer)) layerAdded = true;
 		}
-		 
 				
 		if ((wmsLayer != null) && (!layerAdded))
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java	(revision 5245)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSDownloadAction.java	(revision 5319)
@@ -21,5 +21,5 @@
 		// download task here every time, then different layers are displayed even
 		// for images from the same server, and we don't want that.
-		
+		System.out.println(info.url);
 		if (info.downloadTask == null)
 			info.downloadTask = new DownloadWMSTask(info.name, info.url);
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSImage.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSImage.java	(revision 5245)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSImage.java	(revision 5319)
@@ -4,10 +4,20 @@
 import java.awt.Image;
 import java.awt.Point;
+import java.awt.image.BufferedImage;
+import java.awt.image.RenderedImage;
+import java.io.Externalizable;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.ObjectInput;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
 import java.net.MalformedURLException;
 import java.net.URL;
 
 import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
 
 import org.openstreetmap.josm.Main;
@@ -17,8 +27,8 @@
 import org.openstreetmap.josm.io.ProgressInputStream;
 
-public class WMSImage
+public class WMSImage implements Serializable
 {
 	String constURL;
-	protected Image theImage;
+	protected BufferedImage theImage;
 	protected double grabbedScale;
 	protected EastNorth topLeft, bottomRight;
@@ -29,10 +39,30 @@
 		this.constURL = constURL;
 	}
+	
+	private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
+		constURL = (String) in.readObject();
+		topLeft = (EastNorth) in.readObject();
+		bottomRight = (EastNorth) in.readObject();
+		dEast = in.readDouble();
+		dNorth = in.readDouble();
+		grabbedScale = in.readDouble();
+		theImage = (BufferedImage) ImageIO.read(ImageIO.createImageInputStream(in));
+	}
+	
+	private void writeObject(ObjectOutputStream out) throws IOException {
+		System.out.println("writ" + theImage.getWidth(null));
+		out.writeObject(constURL);
+		out.writeObject(topLeft);
+		out.writeObject(bottomRight);
+		out.writeDouble(dEast);
+		out.writeDouble(dNorth);
+		out.writeDouble(grabbedScale);
+		ImageIO.write(theImage, "png", ImageIO.createImageOutputStream(out));
+	}
 
 	public void grab(NavigatableComponent nc) throws IOException
 	{
-
-		EastNorth topLeft  = nc.getEastNorth(0,0);
-		grabbedScale =  nc.getScale();  // scale is enPerPixel
+		EastNorth topLeft = nc.getEastNorth(0,0);
+		grabbedScale = nc.getScale();  // scale is enPerPixel
 
 		this.topLeft = topLeft;
@@ -101,5 +131,5 @@
 		InputStream is = new ProgressInputStream(
 			url.openConnection(), Main.pleaseWaitDlg);
-		theImage = ImageIO.read(is) ;
+		theImage = ImageIO.read(is);
 		is.close();
 		Main.map.repaint();
@@ -126,5 +156,5 @@
 	public void paint(Graphics g,NavigatableComponent nc) 
 	{
-		if(theImage!=null)
+		if (theImage != null)
 		{
 			double zoomInFactor = grabbedScale / nc.getScale();
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java	(revision 5245)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java	(revision 5319)
@@ -6,13 +6,25 @@
 import java.awt.Graphics;
 import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.ArrayList;
 
+import javax.swing.AbstractAction;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
+import javax.swing.JFileChooser;
 import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
 import javax.swing.JSeparator;
+import javax.swing.filechooser.FileFilter;
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.ExtensionFileFilter;
+import org.openstreetmap.josm.actions.SaveActionBase;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
 import org.openstreetmap.josm.data.projection.Projection;
@@ -21,4 +33,5 @@
 import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
 import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.data.coor.EastNorth;
 
@@ -29,10 +42,14 @@
 public class WMSLayer extends Layer {
 
-	protected static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(WMSPlugin.class.getResource("/images/wms.png")));
-
+	protected static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(WMSPlugin.class.getResource("/images/wms_small.png")));
 	protected final ArrayList<WMSImage> wmsImages;
-
 	protected final String url;
-
+	protected final int serializeFormatVersion = 1;
+ 
+	public WMSLayer() {
+		super("Blank Layer");
+		wmsImages = new ArrayList<WMSImage>();
+		url = "";
+	}
 	public WMSLayer(String name, String url) {
 		super(name);
@@ -100,5 +117,7 @@
 		return new Component[]{
 				new JMenuItem(new LayerListDialog.ShowHideLayerAction(this)),
-				new JMenuItem(new LayerListDialog.DeleteLayerAction(this)),
+				new JMenuItem(new LayerListDialog.DeleteLayerAction(this)),				
+				new JMenuItem(new LoadWmsAction()),
+				new JMenuItem(new SaveWmsAction()),
 				new JSeparator(),
 				new JMenuItem(new LayerListPopup.InfoAction(this))};
@@ -117,8 +136,109 @@
 	//to enable the removal of the images when the layer is removed.
 	public void destroy() {
-	
 		wmsImages.clear();
+	}
+	
+	public class SaveWmsAction extends AbstractAction {
+		public SaveWmsAction() {
+			super(tr("Save WMS layer to file"), ImageProvider.get("save"));
+		}
+		public void actionPerformed(ActionEvent ev) {
+			File f = openFileDialog(false);
+			try {
+				FileOutputStream fos = new FileOutputStream(f);
+				ObjectOutputStream oos = new ObjectOutputStream(fos);
+				oos.writeInt(serializeFormatVersion);
+				oos.writeInt(wmsImages.size());
+				for (WMSImage w : wmsImages) {
+					oos.writeObject(w);
+				}
+				oos.close();
+				fos.close();
+			} catch (Exception ex) {
+				ex.printStackTrace(System.out);
+			}
+		}
+	}
+	
+	public class LoadWmsAction extends AbstractAction {
+		public LoadWmsAction() {
+			super(tr("Load WMS layer from file"), ImageProvider.get("load"));
+		}
+		public void actionPerformed(ActionEvent ev) {
+			File f = openFileDialog(true);
+			try {
+				FileInputStream fis = new FileInputStream(f);
+				ObjectInputStream ois = new ObjectInputStream(fis);
+				int sfv = ois.readInt();
+				if (sfv != serializeFormatVersion) {
+					JOptionPane.showMessageDialog(Main.parent, 
+						tr("Unsupported WMS file version; found {0}, expected {1}", sfv, serializeFormatVersion),
+						tr("File Format Error"), 
+						JOptionPane.ERROR_MESSAGE);
+					return;
+				}
+				int numImg = ois.readInt();
+				for (int i=0; i< numImg; i++) {
+					WMSImage img = (WMSImage) ois.readObject();
+					wmsImages.add(img);
+				}
+				ois.close();
+				fis.close();
+			} catch (Exception ex) {
+				// FIXME be more specific
+				ex.printStackTrace(System.out);
+				JOptionPane.showMessageDialog(Main.parent, 
+						tr("Error loading file"),
+						tr("Error"), 
+						JOptionPane.ERROR_MESSAGE);
+					return;
+			}
+		}
+	}
+	
+	protected static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple) {
+		String curDir = Main.pref.get("lastDirectory");
+		if (curDir.equals(""))
+			curDir = ".";
+		JFileChooser fc = new JFileChooser(new File(curDir));
+		fc.setMultiSelectionEnabled(multiple);
+		for (int i = 0; i < ExtensionFileFilter.filters.length; ++i)
+			fc.addChoosableFileFilter(ExtensionFileFilter.filters[i]);
+		fc.setAcceptAllFileFilterUsed(true);
+	
+		int answer = open ? fc.showOpenDialog(Main.parent) : fc.showSaveDialog(Main.parent);
+		if (answer != JFileChooser.APPROVE_OPTION)
+			return null;
 		
+		if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir))
+			Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
+
+		if (!open) {
+			File file = fc.getSelectedFile();
+			if (file == null || (file.exists() && JOptionPane.YES_OPTION != 
+					JOptionPane.showConfirmDialog(Main.parent, tr("File exists. Overwrite?"), tr("Overwrite"), JOptionPane.YES_NO_OPTION)))
+				return null;
+		}
 		
+		return fc;
+	}
+	
+	public static File openFileDialog(boolean open) {
+		JFileChooser fc = createAndOpenFileChooser(open, false);
+		if (fc == null)
+			return null;
+
+		File file = fc.getSelectedFile();
+
+		String fn = file.getPath();
+		if (fn.indexOf('.') == -1) {
+			FileFilter ff = fc.getFileFilter();
+			if (ff instanceof ExtensionFileFilter)
+				fn = "." + ((ExtensionFileFilter)ff).defaultExtension;
+			else
+				fn += ".osm";
+			file = new File(fn);
+		}
+		return file;
 	}
 }
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 5245)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 5319)
@@ -4,7 +4,10 @@
 
 
+import java.awt.event.ActionEvent;
 import java.util.ArrayList;
 import java.util.Map;
 import java.util.TreeSet;
+
+import javax.swing.AbstractAction;
 import javax.swing.JMenu;
 import javax.swing.JMenuBar;
@@ -31,10 +34,6 @@
 	static ArrayList<WMSInfo> wmsList = new ArrayList<WMSInfo>();
 	
-
-	
 	public WMSPlugin() {
-		
 		refreshMenu();
-		
 	}
 
@@ -110,12 +109,15 @@
 		
 		wmsJMenu.addSeparator();
+		wmsJMenu.add(new JMenuItem(new AbstractAction("Blank Layer") {
+			public void actionPerformed(ActionEvent ev) {
+				Main.main.addLayer(new WMSLayer());
+			}
+		}));
+		wmsJMenu.addSeparator();
 		wmsJMenu.add(new JMenuItem(new Help_WMSmenuAction()));
-		
-		
-	
 	}
 	
 	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if(oldFrame==null && newFrame!=null) { 
+		if (oldFrame==null && newFrame!=null) { 
 			wmsJMenu.setEnabled(true);
 			Main.map.toolBarActions.addSeparator();
