 class KDDiaScene extends JView
 
   constructor:(options = {}, data)->
-    options.cssClass = KD.utils.curry 'kddia-scene', options.cssClass
-    options.bind     = KD.utils.curry 'mousemove',   options.bind
+
+    options.cssClass = KD.utils.curry "kddia-scene", options.cssClass
+    options.bind     = KD.utils.curry "mousemove",   options.bind
+
+    options.lineCap         or= "round"
+    options.lineWidth        ?= 2
+    options.lineColor       or= "#ccc"
+    options.lineColorActive or= "orange"
+    options.lineColorHelper or= "green"
+    options.lineDashes       ?= []
+    options.curveDistance    ?= 50
 
     super
 


  drawFakeLine:(options={})->
    {sx,sy,ex,ey} = options
    @cleanup @fakeCanvas

    @fakeContext.beginPath()
    @fakeContext.moveTo sx, sy
    @fakeContext.lineTo ex, ey
    @fakeContext.lineWidth = 2
    @fakeContext.strokeStyle = 'orange'
    @fakeContext.lineCap = 'round'
    @fakeContext.stroke()

  mouseMove:(e)->

      {source, target} = connection

      if (source.dia in @activeDias) or (target.dia in @activeDias)
        @realContext.strokeStyle = @getOption 'lineColorActive'
      else
        @realContext.strokeStyle = @getOption 'lineColor'

      sJoint = source.dia.getJointPos source.joint
      tJoint = target.dia.getJointPos target.joint

      ld = @getOption 'lineDashes'
      @realContext.setLineDash ld  if ld.length > 0

      @realContext.moveTo sJoint.x, sJoint.y

      cd = @getOption 'curveDistance'
      [sx, sy, tx, ty] = [0, 0, 0, 0]
      if source.joint in ["top", "bottom"]
        sy = if source.joint is "top" then -cd else cd
      if source.joint in ["left", "right"]
        sx = if source.joint is "left" then -cd else cd
      if target.joint in ["top", "bottom"]
        ty = if target.joint is "top" then -cd else cd
      if target.joint in ["left", "right"]
        tx = if target.joint is "left" then -cd else cd

      @realContext.bezierCurveTo(sJoint.x + sx, sJoint.y + sy, \
                                 tJoint.x + tx, tJoint.y + ty, \
                                 tJoint.x, tJoint.y)

      @realContext.lineWidth = @getOption 'lineWidth'
      @realContext.stroke()

  viewAppended:->
