Index: applications/editors/josm/plugins/piclayer/README
===================================================================
--- applications/editors/josm/plugins/piclayer/README	(revision 17314)
+++ applications/editors/josm/plugins/piclayer/README	(revision 17321)
@@ -10,5 +10,5 @@
 Step 2b) If you chose a clipboard, please wait. For some reason it takes time. To be fixed later.
 NOTE) If something failed, you should get a message box. If not - check the console for messages (Linux only?)
-Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list.
+Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list and activate it (!).
 Step 4) Start aligning the image.
 Step 4a) Move the image by choosing 'Move' from the toolbar and draggin the mouse around with left button pressed.
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/HelpAction.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/HelpAction.java	(revision 17314)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/HelpAction.java	(revision 17321)
@@ -64,5 +64,5 @@
             + "NOTE) If something failed, you should get a message box. If not - check the console for messages (Linux only?)"
             + "\n"
-            + "Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list."
+            + "Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list and activate it (!!!)."
             + "\n"
             + "Step 4) Start aligning the image."
@@ -73,4 +73,6 @@
             + "\n"
             + "Step 4c) Scale the image by choosing 'Scale' from the toolbar and draggin the mouse up/down with left button pressed."
+            + "\n"
+            + "Step 4d) You can also choose to scale in just one axis by selecting the proper button."
             + "\n"
             + "NOTE) If it does not work - make sure the right layer is selected."
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java	(revision 17314)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java	(revision 17321)
@@ -60,5 +60,6 @@
     private double m_angle = 0.0;
     // Scale of the image
-    private double m_scale = 1.0;
+    private double m_scalex = 1.0;
+    private double m_scaley = 1.0;
     // The scale that was set on the map during image creation
     private double m_initial_scale = 0;
@@ -190,6 +191,7 @@
             g.rotate( m_angle * Math.PI / 180.0 );
             // Scale
-            double scale = m_scale * m_initial_scale / Main.map.mapView.getDist100Pixel();
-            g.scale( scale, scale );
+            double scalex = m_scalex * m_initial_scale / Main.map.mapView.getDist100Pixel();
+            double scaley = m_scaley * m_initial_scale / Main.map.mapView.getDist100Pixel();
+            g.scale( scalex, scaley );
 
             // Draw picture
@@ -222,6 +224,7 @@
      * Scales the picture. Scaled in... don't know but works ok :)
      */
-    public void scalePictureBy( double scale ) {
-        m_scale += scale;
+    public void scalePictureBy( double scalex, double scaley ) {
+        m_scalex += scalex;
+        m_scaley += scaley;
     }
 
@@ -244,5 +247,6 @@
      */
     public void resetScale() {
-        m_scale = 1.0;
+        m_scalex = 1.0;
+        m_scaley = 1.0;
     }
 
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java	(revision 17314)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java	(revision 17321)
@@ -42,5 +42,7 @@
 	private IconToggleButton m_movePictureButton = null;
 	private IconToggleButton m_rotatePictureButton = null;
-	private IconToggleButton m_scalePictureButton = null;
+	private IconToggleButton m_scalexPictureButton = null;
+	private IconToggleButton m_scaleyPictureButton = null;
+	private IconToggleButton m_scalexyPictureButton = null;
 	
 	// Menu actions
@@ -81,19 +83,27 @@
         	MovePictureAction movePictureAction = new MovePictureAction(newFrame);
         	RotatePictureAction rotatePictureAction = new RotatePictureAction(newFrame);
-        	ScalePictureAction scalePictureAction = new ScalePictureAction(newFrame);
+        	ScaleXYPictureAction scaleXYPictureAction = new ScaleXYPictureAction(newFrame);
+        	ScaleXPictureAction scaleXPictureAction = new ScaleXPictureAction(newFrame);
+        	ScaleYPictureAction scaleYPictureAction = new ScaleYPictureAction(newFrame);
         	// Create plugin buttons and add them to the toolbar
         	m_movePictureButton = new IconToggleButton(movePictureAction);
-        	m_rotatePictureButton = new IconToggleButton(rotatePictureAction);
-        	m_scalePictureButton = new IconToggleButton(scalePictureAction);
+            m_rotatePictureButton = new IconToggleButton(rotatePictureAction);
+            m_scalexyPictureButton = new IconToggleButton(scaleXYPictureAction);
+            m_scalexPictureButton = new IconToggleButton(scaleXPictureAction);
+            m_scaleyPictureButton = new IconToggleButton(scaleYPictureAction);
             newFrame.addMapMode(m_movePictureButton);
             newFrame.addMapMode(m_rotatePictureButton);
-            newFrame.addMapMode(m_scalePictureButton);
-            newFrame.toolGroup.add(m_movePictureButton);
-            newFrame.toolGroup.add(m_rotatePictureButton);
-            newFrame.toolGroup.add(m_scalePictureButton);
-            // Hide them by default
+            newFrame.addMapMode(m_scalexyPictureButton);
+            newFrame.addMapMode(m_scalexPictureButton);
+            newFrame.addMapMode(m_scaleyPictureButton);
+//            newFrame.toolGroup.add(m_movePictureButton);
+//            newFrame.toolGroup.add(m_rotatePictureButton);
+//            newFrame.toolGroup.add(m_scalePictureButton);
+            // Show them by default
             m_movePictureButton.setVisible(true);
             m_rotatePictureButton.setVisible(true);
-            m_scalePictureButton.setVisible(true);
+            m_scalexyPictureButton.setVisible(true);
+            m_scalexPictureButton.setVisible(true);
+            m_scaleyPictureButton.setVisible(true);
         }
     }
@@ -103,7 +113,4 @@
 	 */
 	public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-		m_movePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );		
-		m_rotatePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );		
-		m_scalePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );
 	}
 
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScalePictureAction.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScalePictureAction.java	(revision 17314)
+++ 	(revision )
@@ -1,99 +1,0 @@
-/***************************************************************************
- *   Copyright (C) 2009 by Tomasz Stelmach                                 *
- *   http://www.stelmach-online.net/                                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-package org.openstreetmap.josm.plugins.piclayer;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.mapmode.MapMode;
-import org.openstreetmap.josm.gui.MapFrame;
-import org.openstreetmap.josm.tools.ImageProvider;
-
-// TODO: Move/Rotate/Scale action classes are similar. Do the redesign!
-
-/**
- * This class handles the input during scaling the picture.
- */
-public class ScalePictureAction extends MapMode implements MouseListener, MouseMotionListener 
-{
-	// Scaling ongoing?
-	private boolean mb_dragging = false;
-	
-	// Last mouse position
-	private int m_prevY;
-	
-	// Layer we're working on
-	private PicLayerAbstract m_currentLayer = null;
-	
-	/**
-	 * Constructor
-	 */
-	public ScalePictureAction(MapFrame frame) {
-		super("PicLayer", "scale", "Drag to scale the picture", frame, ImageProvider.getCursor("crosshair", null));
-		// TODO Auto-generated constructor stub
-	}
-
-    @Override 
-    public void enterMode() {
-        super.enterMode();
-        Main.map.mapView.addMouseListener(this);
-        Main.map.mapView.addMouseMotionListener(this);
-    }
-
-    @Override 
-    public void exitMode() {
-        super.exitMode();
-        Main.map.mapView.removeMouseListener(this);
-        Main.map.mapView.removeMouseMotionListener(this);
-    }	
-	
-    @Override 
-    public void mousePressed(MouseEvent e) {
-    	// Start scaling
-    	if ( Main.map.mapView.getActiveLayer() instanceof PicLayerAbstract ) {
-	        m_currentLayer = (PicLayerAbstract)Main.map.mapView.getActiveLayer();
-	        
-	        if ( m_currentLayer != null && e.getButton() == MouseEvent.BUTTON1 ) {
-	        	mb_dragging = true;
-	        	m_prevY = e.getY();
-	        }
-    	}
-    }   
-    
-    @Override 
-    public void mouseDragged(MouseEvent e) {
-    	// Scale the picture
-        if(mb_dragging) {
-            m_currentLayer.scalePictureBy( ( e.getY() - m_prevY ) / 500.0 );
-            m_prevY = e.getY();
-            Main.map.mapView.repaint();
-        }
-    }    
-    
-    @Override 
-    public void mouseReleased(MouseEvent e) {
-    	// Stop scaling
-    	mb_dragging = false;
-    }    
-
-}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScalePictureActionAbstract.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScalePictureActionAbstract.java	(revision 17321)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScalePictureActionAbstract.java	(revision 17321)
@@ -0,0 +1,104 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Tomasz Stelmach                                 *
+ *   http://www.stelmach-online.net/                                       *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+package org.openstreetmap.josm.plugins.piclayer;
+
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.mapmode.MapMode;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+// TODO: Move/Rotate/Scale action classes are similar. Do the redesign!
+
+/**
+ * This class handles the input during scaling the picture.
+ */
+public abstract class ScalePictureActionAbstract extends MapMode implements MouseListener, MouseMotionListener 
+{
+	// Scaling ongoing?
+	private boolean mb_dragging = false;
+	
+	// Last mouse position
+	private int m_prevY;
+	
+	// Layer we're working on
+	protected PicLayerAbstract m_currentLayer = null;
+	
+	/**
+	 * Constructor
+	 */
+	public ScalePictureActionAbstract (String name, String icon, String tooltip, MapFrame frame) {
+		super(name, icon, tooltip, frame, ImageProvider.getCursor("crosshair", null));
+		// TODO Auto-generated constructor stub
+	}
+
+    @Override 
+    public void enterMode() {
+        super.enterMode();
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);
+    }
+
+    @Override 
+    public void exitMode() {
+        super.exitMode();
+        Main.map.mapView.removeMouseListener(this);
+        Main.map.mapView.removeMouseMotionListener(this);
+    }	
+	
+    @Override 
+    public void mousePressed(MouseEvent e) {
+    	// Start scaling
+    	if ( Main.map.mapView.getActiveLayer() instanceof PicLayerAbstract ) {
+	        m_currentLayer = (PicLayerAbstract)Main.map.mapView.getActiveLayer();
+	        
+	        if ( m_currentLayer != null && e.getButton() == MouseEvent.BUTTON1 ) {
+	        	mb_dragging = true;
+	        	m_prevY = e.getY();
+	        }
+    	}
+    }   
+    
+    @Override 
+    public void mouseDragged(MouseEvent e) {
+    	// Scale the picture
+        if(mb_dragging) {
+            doTheScale( ( e.getY() - m_prevY ) / 500.0 );
+            m_prevY = e.getY();
+            Main.map.mapView.repaint();
+        }
+    }
+    
+    @Override 
+    public void mouseReleased(MouseEvent e) {
+    	// Stop scaling
+    	mb_dragging = false;
+    }
+    
+    /**
+    * Does the actual scaling in the inherited class.
+    */
+    protected abstract void doTheScale( double scale );
+
+}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleXPictureAction.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleXPictureAction.java	(revision 17321)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleXPictureAction.java	(revision 17321)
@@ -0,0 +1,46 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Tomasz Stelmach                                 *
+ *   http://www.stelmach-online.net/                                       *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+package org.openstreetmap.josm.plugins.piclayer;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.mapmode.MapMode;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+// TODO: Move/Rotate/Scale action classes are similar. Do the redesign!
+
+/**
+ * This class handles the input during scaling the picture.
+ */
+public class ScaleXPictureAction extends ScalePictureActionAbstract 
+{
+	/*
+	 * Constructor
+	 */
+	public ScaleXPictureAction(MapFrame frame) {
+		super("PicLayer", "scale_x", "Drag to scale the picture in the X Axis", frame);
+		// TODO Auto-generated constructor stub
+	}
+
+	public void doTheScale( double scale ) {
+            m_currentLayer.scalePictureBy( scale, 0.0 );
+        }
+}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleXYPictureAction.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleXYPictureAction.java	(revision 17321)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleXYPictureAction.java	(revision 17321)
@@ -0,0 +1,46 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Tomasz Stelmach                                 *
+ *   http://www.stelmach-online.net/                                       *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+package org.openstreetmap.josm.plugins.piclayer;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.mapmode.MapMode;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+// TODO: Move/Rotate/Scale action classes are similar. Do the redesign!
+
+/**
+ * This class handles the input during scaling the picture.
+ */
+public class ScaleXYPictureAction extends ScalePictureActionAbstract 
+{
+	/*
+	 * Constructor
+	 */
+	public ScaleXYPictureAction(MapFrame frame) {
+		super("PicLayer", "scale", "Drag to scale the picture in the X and Y Axis", frame);
+		// TODO Auto-generated constructor stub
+	}
+
+	public void doTheScale( double scale ) {
+            m_currentLayer.scalePictureBy( scale, scale );
+        }
+}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleYPictureAction.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleYPictureAction.java	(revision 17321)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleYPictureAction.java	(revision 17321)
@@ -0,0 +1,46 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Tomasz Stelmach                                 *
+ *   http://www.stelmach-online.net/                                       *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+package org.openstreetmap.josm.plugins.piclayer;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.mapmode.MapMode;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+// TODO: Move/Rotate/Scale action classes are similar. Do the redesign!
+
+/**
+ * This class handles the input during scaling the picture.
+ */
+public class ScaleYPictureAction extends ScalePictureActionAbstract 
+{
+	/*
+	 * Constructor
+	 */
+	public ScaleYPictureAction(MapFrame frame) {
+		super("PicLayer", "scale_y", "Drag to scale the picture in the Y Axis", frame);
+		// TODO Auto-generated constructor stub
+	}
+
+	public void doTheScale( double scale ) {
+            m_currentLayer.scalePictureBy( 0.0, scale );
+        }
+}
