Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/gui/PTAssistantLayer.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/gui/PTAssistantLayer.java	(revision 32429)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/gui/PTAssistantLayer.java	(revision 32430)
@@ -2,4 +2,7 @@
 
 import java.awt.Graphics2D;
+import java.awt.KeyboardFocusManager;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -20,4 +23,5 @@
 import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
 import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
+import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.LayerPositionStrategy;
@@ -25,36 +29,37 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 
-public class PTAssistantLayer extends Layer implements SelectionChangedListener {
-	
+public class PTAssistantLayer extends Layer implements SelectionChangedListener, PropertyChangeListener {
+
 	private List<OsmPrimitive> primitives = new ArrayList<>();
 
-	
 	public PTAssistantLayer() {
 		super("pt_assistant layer");
+
+		 KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener(this);
+
 	}
-	
+
 	public void addPrimitive(OsmPrimitive primitive) {
 		this.primitives.add(primitive);
 	}
-	
+
 	public void clear() {
 		this.primitives.clear();
 	}
 
-	
-    @Override
-    public void paint(final Graphics2D g, final MapView mv, Bounds bounds) {
+	@Override
+	public void paint(final Graphics2D g, final MapView mv, Bounds bounds) {
 
-        PTAssistantPaintVisitor paintVisitor = new PTAssistantPaintVisitor(g, mv);
-        for (OsmPrimitive primitive: primitives) {
-            paintVisitor.visit(primitive);
+		PTAssistantPaintVisitor paintVisitor = new PTAssistantPaintVisitor(g, mv);
+		for (OsmPrimitive primitive : primitives) {
+			paintVisitor.visit(primitive);
 
-        }
-        
-    }
+		}
+
+	}
 
 	@Override
 	public Icon getIcon() {
-        return ImageProvider.get("layer", "osmdata_small");
+		return ImageProvider.get("layer", "osmdata_small");
 	}
 
@@ -66,11 +71,7 @@
 	@Override
 	public Action[] getMenuEntries() {
-        return new Action[] {
-                LayerListDialog.getInstance().createShowHideLayerAction(),
-                LayerListDialog.getInstance().createDeleteLayerAction(),
-                SeparatorLayerAction.INSTANCE,
-                new RenameLayerAction(null, this),
-                SeparatorLayerAction.INSTANCE,
-                new LayerListPopup.InfoAction(this) };
+		return new Action[] { LayerListDialog.getInstance().createShowHideLayerAction(),
+				LayerListDialog.getInstance().createDeleteLayerAction(), SeparatorLayerAction.INSTANCE,
+				new RenameLayerAction(null, this), SeparatorLayerAction.INSTANCE, new LayerListPopup.InfoAction(this) };
 	}
 
@@ -88,5 +89,5 @@
 	public void mergeFrom(Layer arg0) {
 		// do nothing
-		
+
 	}
 
@@ -94,20 +95,18 @@
 	public void visitBoundingBox(BoundingXYVisitor arg0) {
 		// do nothing
-		
+
 	}
 
-	
-    @Override
-    public LayerPositionStrategy getDefaultLayerPosition() {
-        return LayerPositionStrategy.IN_FRONT;
-    }
+	@Override
+	public LayerPositionStrategy getDefaultLayerPosition() {
+		return LayerPositionStrategy.IN_FRONT;
+	}
 
 	@Override
 	public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-		
-		
+
 		ArrayList<Relation> routes = new ArrayList<>();
-		
-		for (OsmPrimitive primitive: newSelection) {
+
+		for (OsmPrimitive primitive : newSelection) {
 			if (primitive.getType().equals(OsmPrimitiveType.RELATION)) {
 				Relation relation = (Relation) primitive;
@@ -115,7 +114,8 @@
 					routes.add(relation);
 				}
+
 			}
 		}
-		
+
 		if (!routes.isEmpty()) {
 			this.primitives.clear();
@@ -125,9 +125,40 @@
 			}
 		}
-		
 
-		
 	}
-    
-    
+	
+	
+	/**
+	 * Listens to a focus change
+	 */
+	@Override
+	public void propertyChange(PropertyChangeEvent evt) {
+
+		if ("focusedWindow".equals(evt.getPropertyName())) {
+
+			if (evt.getNewValue() == null) {
+				return;
+			}
+
+			if (evt.getNewValue().getClass().equals(GenericRelationEditor.class)) {
+				
+				GenericRelationEditor editor = (GenericRelationEditor) evt.getNewValue(); 
+				Relation relation = editor.getRelation();
+				
+				if (RouteUtils.isTwoDirectionRoute(relation)) {
+					this.primitives.clear();
+					this.primitives.add(relation);
+					if (!Main.getLayerManager().containsLayer(this)) {
+						Main.getLayerManager().addLayer(this);
+					}
+//					Main.map.repaint();
+				}
+
+			}
+
+//			System.out.println("focusedWindow: ");
+//			System.out.println("GET NEW VALUE: " + evt.getNewValue().getClass());
+//			System.out.println("");
+		}
+	}
 }
Index: applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java
===================================================================
--- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java	(revision 32429)
+++ applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java	(revision 32430)
@@ -47,5 +47,5 @@
 		layer = new PTAssistantLayer();
 		DataSet.addSelectionListener(layer);
-
+		
 	}
 
