         parent.insertChildAfter(firstChild, children.shift())
       axis.destroy()
       parent
-
 
   # Utility
   getPanes: ->

    @movePane thisPane, newPane

    container.setRoot(root) if root isnt paneInfo.root
    @reparent(axis) for axis in @getAllAxis(root)

    container.destroyEmptyPanes()
    newPane.activateItemAtIndex index
    newPane.activate()


    @Pane      ?= thisPane.constructor
    @PaneAxis  ?= root.constructor

    parent.removeChild(thisPane, true)
    if root.getOrientation() isnt orientation
      @debug "Different orientation"
      root = new @PaneAxis({container, orientation, children: [@copyRoot(root)]})

    newPane = new @Pane()
    switch direction
