 
   getView:-> @childView
 
-  delayedDisplay:(timeout = @getOptions().delayIn)->
-    @utils.killWait @displayTimer
-    @displayTimer = @utils.wait timeout, =>
-      if @isCurrentlyRemovable()
-        @display()
-      else
-        @delayedRemove()
-
-  remove:->
-
-    return unless @visible
-
-    KD.getSingleton('windowController').removeLayer @
-    document.body.removeChild @$()[0]
-    @visible = no
-
   destroy:->
 
-    @visible = no
     @parentView.tooltip = null
     delete @parentView.tooltip
     super
 
-  delayedRemove:(timeout = @getOptions().delayOut)->
-
-    return if @getOptions().sticky
-
-    @utils.killWait @deleteTimer
-    @deleteTimer = @utils.wait timeout, =>
-      unless @isCurrentlyRemovable()
-        if @getOptions().animate
-          @unsetClass 'in'
-          KD.getSingleton('windowController').enableScroll()
-          @utils.killWait @animatedDeleteTimer
-          @animatedDeleteTimer = @utils.wait 2000, @bound "remove"
-        else
-          KD.getSingleton('windowController').enableScroll()
-          @remove()
-
   translateCompassDirections:(o)->
 
     {placement,gravity} = o


  constructor:(options,data)->

    options.bind   or= "mouseenter mouseleave"
    options.sticky  ?= no

    super options, data

    @avoidDestroy = no
    @visible      = yes
    @parentView   = @getDelegate()

    # Container for positioning in the viewport
    @setClass 'kdtooltip'
    @setClass options.viewCssClass if options.viewCssClass?

    # Wrapper for the view and/or content of the tooltip
    @wrapper    = new KDView
      cssClass  : 'wrapper'

    # Arrow Container for Tooltip design arrows
    @arrow = new KDView
      cssClass : 'arrow'

    if @getOptions().animate then @setClass 'out' else @hide()

    @addListeners()
    KDView.appendToDOMBody @
    @remove()

  _show = (tooltip)->
    return if tooltip.visible
    document.body.appendChild tooltip.$()[0]
    KD.getSingleton('windowController').addLayer tooltip
    tooltip.emit 'MouseEnteredAnchor'
    tooltip.visible = yes

  show:(event)->

    return if @visible
    o = @getOptions()

    if o.selector
      selectorEntered = no

      @parentView.on 'mousemove', (mouseEvent)=>

        if $(mouseEvent.target).is(o.selector) and selectorEntered is no
          selectorEntered = yes
          _show @
        if not $(mouseEvent.target).is(o.selector) and selectorEntered
          return if $(mouseEvent.target).is @$()
          selectorEntered = no
          @emit 'MouseLeftAnchor'
    else _show @

    super

  hide: (event)->

    @utils.defer =>
      o = @getOptions()

      if event
        return if o.selector and not $(event.target).is o.selector
      @parentView.off 'mousemove'
      # to throttle super need to call it explicitly
      # KDView::show.call @
      super
      @emit 'MouseLeftAnchor'

  update:(o = @getOptions(), view = null)->
    unless view

  display:(o = @getOptions())->

    # converts NESW-Values to topbottomleftright and retains them in @getOptions
    KDView.appendToDOMBody this
    @getSingleton("windowController").addLayer this
    o = @translateCompassDirections o if o.gravity
    o.gravity = null

    @setClass 'in' if o.animate
    @utils.defer => @setPosition o

  getCorrectPositionCoordinates:(o={},positionValues,callback=noop)->
    # values that can/will be used in all the submethods
