Index: /applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/Harbour.java
===================================================================
--- /applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/Harbour.java	(revision 24558)
+++ /applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/Harbour.java	(revision 24559)
@@ -8,4 +8,7 @@
 import javax.swing.ImageIcon;
 import javax.swing.JComponent;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MapView;
 
 import smed.plug.ifc.SmedPluggable;
@@ -21,5 +24,4 @@
 	@Override
 	public boolean start() {
-		// TODO Auto-generated method stub
 		return false;
 	}
@@ -33,12 +35,14 @@
 	@Override
 	public boolean hasFocus() {
-		// TODO Auto-generated method stub
-		return false;
+		Main.map.mapView.addPropertyChangeListener(harbour);
+		MapView.addLayerChangeListener(harbour);
+		return true;
 	}
 
 	@Override
 	public boolean lostFocus() {
-		// TODO Auto-generated method stub
-		return false;
+		Main.map.mapView.removePropertyChangeListener(harbour);
+		MapView.removeLayerChangeListener(harbour);
+		return true;
 	}
 
Index: /applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/dialogs/HarbourAction.java
===================================================================
--- /applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/dialogs/HarbourAction.java	(revision 24558)
+++ /applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/dialogs/HarbourAction.java	(revision 24559)
@@ -10,11 +10,22 @@
 import javax.swing.JLabel;
 import java.awt.Font;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
 import javax.swing.JComboBox;
 import javax.swing.ImageIcon;
 import javax.swing.JToggleButton;
 
-public class HarbourAction {
-
-	private JPanel harbourPanel = null;  //  @jve:decl-index=0:visual-constraint="68,31"
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener;
+import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+
+public class HarbourAction implements PropertyChangeListener, LayerChangeListener, EditLayerChangeListener, ComponentListener {
+
+	private JPanel harbourPanel = null;
 	private JButton comButton = null;
 	private JButton restButton = null;
@@ -47,8 +58,11 @@
 	private JButton queryjButton = null;
 	private JToggleButton chartButton = null;
+	private JPanel curPanel = null;
+	
 	public HarbourAction() {
 		panelGeneral= new PanelGeneral();
 		panelGeneral.setBounds(new Rectangle(2, 56, 330, 270));
 		panelGeneral.setVisible(true);
+		curPanel = panelGeneral;
 		
 		panelLimits = new PanelLimits();
@@ -77,21 +91,21 @@
 		if (harbourPanel == null) {
 			regLabel = new JLabel();
-			regLabel.setBounds(new Rectangle(90, 32, 45, 20));
+			regLabel.setBounds(new Rectangle(93, 32, 54, 20));
 			regLabel.setText("Region:");
 			noLabel1 = new JLabel();
-			noLabel1.setBounds(new Rectangle(200, 32, 26, 20));
+			noLabel1.setBounds(new Rectangle(205, 32, 26, 20));
 			noLabel1.setText("Nr.:");
 			countryLabel = new JLabel();
-			countryLabel.setBounds(new Rectangle(2, 32, 32, 20));
+			countryLabel.setBounds(new Rectangle(2, 32, 40, 20));
 			countryLabel.setText("Land:");
 			typeLabel = new JLabel();
-			typeLabel.setBounds(new Rectangle(289, 32, 30, 20));
+			typeLabel.setBounds(new Rectangle(289, 32, 39, 20));
 			typeLabel.setText("Type:");
 			queryLabel = new JLabel();
-			queryLabel.setBounds(new Rectangle(201, 334, 72, 15));
+			queryLabel.setBounds(new Rectangle(201, 334, 78, 15));
 			queryLabel.setFont(new Font("Dialog", Font.PLAIN, 12));
 			queryLabel.setText("Suche nach:");
 			setLabel = new JLabel();
-			setLabel.setBounds(new Rectangle(2, 330, 60, 21));
+			setLabel.setBounds(new Rectangle(2, 330, 67, 21));
 			setLabel.setFont(new Font("Dialog", Font.PLAIN, 12));
 			setLabel.setText("Datensatz:");
@@ -157,4 +171,5 @@
 					panelGeneral.setVisible(true);
 					chartButton.setEnabled(false);
+					curPanel = panelGeneral;
 				}
 			});
@@ -182,4 +197,5 @@
 					panelLimits.setVisible(true);
 					chartButton.setEnabled(false);
+					curPanel = panelLimits;
 				}
 			});
@@ -207,4 +223,5 @@
 					panelServices.setVisible(true);
 					chartButton.setEnabled(false);
+					curPanel = panelServices;
 				}
 			});
@@ -232,4 +249,5 @@
 					panelEnv.setVisible(true);
 					chartButton.setEnabled(true);
+					curPanel = panelEnv;
 				}
 			});
@@ -257,4 +275,5 @@
 					panelRelations.setVisible(true);
 					chartButton.setEnabled(true);
+					curPanel = panelRelations;
 				}
 			});
@@ -284,5 +303,5 @@
 		if (fastbackButton == null) {
 			fastbackButton = new JButton();
-			fastbackButton.setBounds(new Rectangle(62, 330, 20, 20));
+			fastbackButton.setBounds(new Rectangle(72, 330, 20, 20));
 		}
 		return fastbackButton;
@@ -297,5 +316,5 @@
 		if (backButton == null) {
 			backButton = new JButton();
-			backButton.setBounds(new Rectangle(81, 330, 20, 20));
+			backButton.setBounds(new Rectangle(90, 330, 20, 20));
 		}
 		return backButton;
@@ -310,5 +329,5 @@
 		if (setTextField == null) {
 			setTextField = new JTextField();
-			setTextField.setBounds(new Rectangle(101, 329, 60, 23));
+			setTextField.setBounds(new Rectangle(110, 329, 51, 23));
 			setTextField.setText("");
 		}
@@ -350,5 +369,5 @@
 		if (typComboBox == null) {
 			typComboBox = new JComboBox();
-			typComboBox.setBounds(new Rectangle(323, 28, 72, 25));
+			typComboBox.setBounds(new Rectangle(328, 28, 69, 25));
 		}
 		return typComboBox;
@@ -363,5 +382,5 @@
 		if (countryComboBox == null) {
 			countryComboBox = new JComboBox();
-			countryComboBox.setBounds(new Rectangle(36, 29, 50, 25));
+			countryComboBox.setBounds(new Rectangle(42, 29, 50, 25));
 		}
 		return countryComboBox;
@@ -376,5 +395,5 @@
 		if (noTextField == null) {
 			noTextField = new JTextField();
-			noTextField.setBounds(new Rectangle(225, 29, 60, 25));
+			noTextField.setBounds(new Rectangle(230, 29, 60, 25));
 			noTextField.setText("");
 		}
@@ -390,5 +409,5 @@
 		if (regTextField == null) {
 			regTextField = new JTextField();
-			regTextField.setBounds(new Rectangle(135, 29, 60, 25));
+			regTextField.setBounds(new Rectangle(145, 29, 60, 25));
 		}
 		return regTextField;
@@ -409,5 +428,5 @@
 			queryComboBox.addItem("Type");
 			queryComboBox.addItem("Query");
-			queryComboBox.setBounds(new Rectangle(272, 331, 86, 20));
+			queryComboBox.setBounds(new Rectangle(279, 331, 86, 20));
 		}
 		return queryComboBox;
@@ -422,5 +441,5 @@
 		if (queryjButton == null) {
 			queryjButton = new JButton();
-			queryjButton.setBounds(new Rectangle(364, 330, 28, 20));
+			queryjButton.setBounds(new Rectangle(364, 331, 28, 20));
 		}
 		return queryjButton;
@@ -435,5 +454,5 @@
 		if (chartButton == null) {
 			chartButton = new JToggleButton();
-			chartButton.setBounds(new Rectangle(365, 5, 28, 18));
+			chartButton.setBounds(new Rectangle(367, 5, 28, 18));
 			chartButton.setEnabled(false);
 		}
@@ -441,3 +460,48 @@
 	}
 
+	@Override
+	public void propertyChange(PropertyChangeEvent evt) {
+		if(curPanel == panelEnv) System.out.println("Start HarbourAction.propertyChange");
+	}
+
+	@Override
+	public void componentHidden(ComponentEvent arg0) {
+		if(curPanel == panelEnv) System.out.println("Start HarbourAction.componentHidden");
+	}
+
+	@Override
+	public void componentMoved(ComponentEvent arg0) {
+		if(curPanel == panelEnv) System.out.println("Start HarbourAction.componentMoved");
+	}
+
+	@Override
+	public void componentResized(ComponentEvent arg0) {
+		if(curPanel == panelEnv) System.out.println("Start HarbourAction.componentResized");
+	}
+
+	@Override
+	public void componentShown(ComponentEvent arg0) {
+		if(curPanel == panelEnv) System.out.println("Start HarbourAction.componentShown");
+	}
+
+	@Override
+	public void activeLayerChange(Layer arg0, Layer arg1) {
+		if(curPanel == panelEnv) System.out.println("Start HarbourAction.activeLayerChange");
+	}
+
+	@Override
+	public void layerAdded(Layer arg0) {
+		if(curPanel == panelEnv) System.out.println("Start HarbourAction.layerAdded");
+	}
+
+	@Override
+	public void layerRemoved(Layer arg0) {
+		if(curPanel == panelServices) System.out.println("Start HarbourAction.layerRemoved");
+	}
+
+	@Override
+	public void editLayerChanged(OsmDataLayer arg0, OsmDataLayer arg1) {
+		System.out.println("Start HarbourAction.editLayerChanged");
+	}
+
 }
Index: /applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/OSeaM.java
===================================================================
--- /applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/OSeaM.java	(revision 24558)
+++ /applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/OSeaM.java	(revision 24559)
@@ -33,5 +33,4 @@
 	@Override
 	public boolean hasFocus() {
-		// TODO Auto-generated method stub
 		return false;
 	}
Index: /applications/editors/josm/plugins/smed/src/smed/Smed.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/Smed.java	(revision 24558)
+++ /applications/editors/josm/plugins/smed/src/smed/Smed.java	(revision 24559)
@@ -155,4 +155,11 @@
             smedTab.closeDialog();
         }
+        
+        if(Main.map != null) {
+        	// von SmedTabbedPane nach hier verlagert, damit sicher ist Main.map != null
+        	SmedPluggable p = SmedTabbedPane.getCurPlugin();
+        	
+        	if(p != null) p.hasFocus();        	
+        }
     }
 
Index: /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java	(revision 24558)
+++ /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java	(revision 24559)
@@ -34,4 +34,5 @@
 	private SmedPluginManager manager = null;
 	private int activeIndex = -1;
+	static private SmedPluggable curPlugin = null;
 	
     public SmedTabbedPane() {
@@ -64,5 +65,5 @@
             			tabbedPane.setMnemonicAt(i, KeyEvent.VK_1 + i);
             			if(i == 0) { 
-            				p.hasFocus();
+            				curPlugin = p;
             				activeIndex = 0;
             			}
@@ -94,5 +95,8 @@
 						activeIndex = pane.getSelectedIndex();
 						for(SmedPluggable p : plugins) {
-							if(p.getIndex() == activeIndex) p.hasFocus();
+							if(p.getIndex() == activeIndex) { 
+								p.hasFocus();
+								curPlugin = p;
+							}
 						}
 					}
@@ -108,3 +112,4 @@
     public static List<SmedPluggable> getPlugins() { return plugins; }
     public static JTabbedPane getTabbedPane() { return tabbedPane; }
+    public static SmedPluggable getCurPlugin() { return curPlugin; }
 }
