 
     # if the decision point has (2) children, draw them and remember their prosition
     if decisionPoint.children.length > 0
-      c1 = @drawTreeWithWidths(decisionPoint.children[0], left,  m, top + (chainCount + 1) * @nodeDistance)
-      c2 = @drawTreeWithWidths(decisionPoint.children[1], m, right, top + (chainCount + 1) * @nodeDistance)
+      # Calculate the top of the children
+      if mode == MODE_NORMAL or chainCount < 3
+        topC = top + (chainCount + 1) * @nodeDistance
+      else if mode == MODE_NOCHAIN
+        topC = top + 3 * @nodeDistance
+
+      c1 = @drawTreeWithWidths(decisionPoint.children[0], left,  m, topC, mode)
+      c2 = @drawTreeWithWidths(decisionPoint.children[1], m, right, topC, mode)
       # set the root's x coordinate to be in between the decisionPoint's childs
       xr = (c1[0] + c2[0]) / 2
       # draw edges from last node in 'chain' (or root, if chain empty)
       # and the decisionPoint's children
-      @drawEdge(xr, top + chainCount * @nodeDistance, c1[0], c1[1])
-      @drawEdge(xr, top + chainCount * @nodeDistance, c2[0], c2[1])
+      @drawEdge(xr, topC - @nodeDistance, c1[0], c1[1])
+      @drawEdge(xr, topC - @nodeDistance, c2[0], c2[1])
     else
       # if decisionPoint is leaf, there's not much to do
       xr = m
     
-    # Draw the chain and the root, connect them.
-    node = tree
-    for i in [0..chainCount]
-      @drawNode(xr, top + i * @nodeDistance, node.id)
-      node = node.children[0]
-      if i != 0
-        @drawEdge(xr, top + (i - 1) * @nodeDistance, xr, top + i * @nodeDistance)
+    if mode == MODE_NORMAL or chainCount < 3
+      # Draw the chain and the root, connect them.
+      node = tree
+      for i in [0..chainCount]
+        @drawNode(xr, top + i * @nodeDistance, node.id)
+        node = node.children[0]
+        if i != 0
+          @drawEdge(xr, top + (i - 1) * @nodeDistance, xr, top + i * @nodeDistance)
+    else if mode == MODE_NOCHAIN
+      # Draw root, chain indicator and decision point
+      @drawNode(xr, top, tree.id)
+      @drawEdge(xr, top, xr, top + 0.5 * @nodeDistance)
+      @drawChainIndicator(xr, top + 0.5 * @nodeDistance, top + 1.5 * @nodeDistance)
+      @drawEdge(xr, top + 1.5 * @nodeDistance, xr, top + 2 * @nodeDistance)
+      @drawNode(xr, top + 2 * @nodeDistance, decisionPoint.id)
 
     return [xr, top]
 

    # by recordWidths(), the second by drawTreeWithWidths().

    @recordWidths(tree)
    @drawTreeWithWidths(tree, 0, @width, @nodeDistance)

  drawTreeWithWidths : (tree, left, right, top) -> 
    # get the decision point
    decisionPoint = @getNextDecisionPoint(tree)
    # calculate m (middle that divides the left and right tree, if any)

NODE_RADIUS = 2
MAX_NODE_DISTANCE = 100
CLICK_TRESHOLD = 4

MODE_NORMAL = 0     # draw every node and the complete tree
MODE_NOCHAIN = 1    # draw only decision points

class AbsractTreeViewer
  constructor : (width, height) ->
