Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java	(revision 2310)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java	(revision 2311)
@@ -2,9 +2,20 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Color;
 import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Image;
 
 import javax.swing.JTable;
 
+import org.openstreetmap.josm.tools.ImageProvider;
+
 public class MemberTableLinkedCellRenderer extends MemberTableCellRenderer {
+
+    final static Image arrowUp = ImageProvider.get("dialogs", "arrowup").getImage();
+    final static Image arrowDown = ImageProvider.get("dialogs", "arrowdown").getImage();
+    private WayConnectionType value = new WayConnectionType();
 
     @Override
@@ -12,10 +23,61 @@
             int row, int column) {
         reset();
-
+        this.value = (WayConnectionType) value;
         renderForeground(isSelected);
-        setText(value.toString());
+        //setText(value.toString());
         setToolTipText(((WayConnectionType)value).getToolTip());
         renderBackground(getModel(table), null, isSelected);
         return this;
     }
+
+    @Override
+    public void paintComponent(Graphics g) {
+        super.paintComponent(g);
+        if (value == null || value.invalid) {
+            return;
+        }
+
+        Image image = null;
+        switch (value.direction) {
+            case 1:
+                image = arrowDown;
+                break;
+            case -1:
+                image = arrowUp;
+                break;
+        }
+
+        int ymax=this.getSize().height - 1;
+        int xoff = this.getSize().width / 2;
+        int w = 2;
+        int p = 2 + w + 1;
+        int y1 = 0;
+        int y2 = 0;
+
+        if (image != null && (value.connectedToPrevious || value.connectedToNext)) {
+            g.drawImage(image, xoff-3, ymax / 2 - 2, null);
+        }
+
+        if (value.connectedToPrevious) {
+            g.setColor(Color.black);
+            g.fillRect(xoff - 2, 0, 5, 2);
+            y1 = 0;
+        } else {
+            g.setColor(Color.red);
+            g.drawRect(xoff-1, p - 1 - w, w, w);
+            y1 = p;
+        }
+
+        if (value.connectedToNext) {
+            g.setColor(Color.black);
+            g.fillRect(xoff - 2, ymax - 1, 5, 2);
+            y2 = ymax;
+        } else {
+            g.setColor(Color.red);
+            g.drawRect(xoff-1, ymax - p + 1, w, w);
+            y2 = ymax - p;
+        }
+        g.setColor(Color.black);
+        g.drawLine(xoff, y1, xoff, y2);
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java	(revision 2310)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java	(revision 2311)
@@ -92,5 +92,5 @@
             return members.get(rowIndex).getMember();
         case 2:
-            return linked(rowIndex);
+            return wayConnection(rowIndex);
         }
         // should not happen
@@ -682,13 +682,14 @@
     // no recursion and no forward/backward support
     // TODO: add back the number of linked elements
-    private WayConnectionType linked(int i) {
+    // Returns +1 if member i and (i+1) are ways and could be combined without changing
+    // the direction of one of them. If they are linked "head to head" or "tail to tail"
+    // -1 is returned.
+    // In all other cases the result is null.
+    private Integer linked(int i) {
         // this method is aimed at finding out whether the
         // relation member is "linked" with the next, i.e. whether
-        // (if both are ways) these ways are connected. It should
-        // really produce a much more beautiful output (with a linkage
-        // symbol somehow placed between the two member lines!),
-        // so... FIXME ;-)
-
-        WayConnectionType link = WayConnectionType.none;
+        // (if both are ways) these ways are connected.
+
+        Integer link = null;
         RelationMember m1 = members.get(i);
         RelationMember m2 = members.get((i + 1) % members.size());
@@ -708,11 +709,11 @@
             Node way2last = way2.lastNode();
             if (way1first != null && way2first != null && (way1first == way2first)) {
-                link = WayConnectionType.tail_to_tail;
+                link = -1;
             } else if (way1first != null && way2last != null && (way1first == way2last)) {
-                link = WayConnectionType.tail_to_head;
+                link = 1;
             } else if (way1last != null && way2first != null && (way1last == way2first)) {
-                link = WayConnectionType.head_to_tail;
+                link = 1;
             } else if (way1last != null && way2last != null && (way1last == way2last)) {
-                link = WayConnectionType.head_to_head;
+                link = -1;
             }
         }
@@ -720,3 +721,30 @@
         return link;
     }
+
+    private WayConnectionType wayConnection(int i) {
+        RelationMember m = members.get(i);
+        if (! m.isWay()) {
+            return new WayConnectionType();
+        }
+        Way w = m.getWay();
+        if (w == null || w.incomplete) {
+            return new WayConnectionType();
+        }
+        
+        int ip = (i - 1 + members.size()) % members.size();
+        Integer link_p = linked(ip);
+        Integer link_n = linked(i);
+        Integer dir = 1;
+        // FIXME: It is somewhat stupid to loop here, but
+        // there shouldn't be a performance problem in practice.
+        for (int k = i - 1; k >= 0; --k) {
+            Integer link = linked(k);
+            if (link != null) {
+                dir *= link;
+            } else {
+                break;
+            }
+        }
+        return new WayConnectionType(link_p != null, link_n != null, dir);
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/WayConnectionType.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/WayConnectionType.java	(revision 2310)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/WayConnectionType.java	(revision 2311)
@@ -4,27 +4,48 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-public enum WayConnectionType {
+public class WayConnectionType {
 
-    none("", tr("Not connected")),
-    head_to_head("-><-", tr("Last points of ways are connected")),
-    tail_to_tail("<-->", tr("First points of ways are connected")),
-    head_to_tail("->->", tr("First point of second way connects to last point of first way")),
-    tail_to_head("<-<-", tr("First point of first way connects to last point of second way"));
+    public final boolean connectedToPrevious;
+    public final boolean connectedToNext;
+    /** Is 1 if way has the same direction as the first way in the set of connected ways. Else it is (-1) */
+    public final int direction;
+    /** The WayConnectionType is invalid, if the corresponding primitive is not a way or the way is incomplete */
+    public final boolean invalid;
 
-    private String textSymbol;
-    private String toolTip;
-
-    WayConnectionType(String textSymbol, String toolTip) {
-        this.textSymbol = textSymbol;
-        this.toolTip = toolTip;
+    public WayConnectionType(boolean connectedToPrevious, boolean connectedToNext, int direction) {
+        this.connectedToPrevious = connectedToPrevious;
+        this.connectedToNext = connectedToNext;
+        this.direction = direction;
+        invalid = false;
     }
 
-    @Override
-    public String toString() {
-        return textSymbol;
+    public WayConnectionType() {
+        connectedToPrevious = false;
+        connectedToNext = false;
+        direction = 1;
+        invalid = true;
     }
 
+//    @Override
+//    public String toString() {
+//        return ...
+//    }
+
     public String getToolTip() {
-        return toolTip;
+        if (invalid) {
+            return "";
+        }
+        else if (connectedToPrevious && connectedToNext) {
+            return tr("way is connected");
+        }
+        else if (connectedToPrevious) {
+            return tr("way is connected to previous relation member");
+        }
+        else if (connectedToNext) {
+            return tr("way is connected to next relation member");
+        }
+        else {
+            return tr("way is not connected to previous or next relation member");
+        }
     }
 }
