var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
    constructor: function ( treeNotifyHandler ) {
        this.parent = null;
        this.children = [];
        this.data = {};
        this.tnh = treeNotifyHandler;
        this.rc = new kity.Group();
        this.rc.minderNode = this;
    },

    getParent: function () {
        return this.parent;
    },

    getDepth: function () {
        var depth = 0,
            p = this.parent;
        while ( p ) {
            p = p.parent;
            depth++;
        }
        return depth;
    },

    getRoot: function () {
        var root = this;
        while ( root.parent ) {
            root = root.parent;
        }
        return root;
    },

    preTraverse: function ( fn ) {
        var children = this.getChildren();
        fn( this );
        for ( var i = 0; i < children.length; i++ ) {
            children[ i ].preTraverse( fn );
        }
    },

    postTraverse: function ( fn ) {
        var children = this.getChildren();
        for ( var i = 0; i < children.length; i++ ) {
            children[ i ].postTraverse( fn );
        }
        fn( this );
    },

    traverse: function ( fn ) {
        return this.postTraverse( fn );
    },

    getChildren: function () {
        return this.children;
    },

    getIndex: function () {
        return this.parent ? this.parent.children.indexOf( this ) : -1;
    },

    insertChild: function ( node, index ) {
        if ( index === undefined ) {
            index = this.children.length;
        }
        if ( node.parent ) {
            node.parent.removeChild( node );
        }
        node.parent = this;
        this.children.splice( index, 0, node );
        this.handelInsert( node );
    },

    handelInsert: function ( node ) {
        var root = this.getRoot();
        if ( root.tnh ) {
            root.tnh.handelNodeInsert.call( root.tnh, node );
        }
    },

    appendChild: function ( node ) {
        return this.insertChild( node );
    },

    prependChild: function ( node ) {
        return this.insertChild( node, 0 );
    },

    removeChild: function ( elem ) {
        var index = elem,
            removed;
        if ( elem instanceof MinderNode ) {
            index = this.children.indexOf( elem );
        }
        if ( index >= 0 ) {
            removed = this.children.splice( index, 1 )[ 0 ];
            removed.parent = null;
            this.handelRemove( removed );
        }
    },

    handelRemove: function ( node ) {
        var root = this.getRoot();
        if ( root.tnh ) {
            root.tnh.handelNodeRemove.call( root.tnh, node );
        }
    },

    getChild: function ( index ) {
        return this.children[ index ];
    },

    getData: function ( name ) {
        if ( name === undefined ) {
            return this.data;
        }
        return this.data[ name ];
    },

    setData: function ( name, value ) {
        if ( arguments.length == 1 && typeof ( arguments[ 0 ] ) == 'object' ) {
            Utils.extend( this.data, arguments[ 0 ] );
        }
        this.data[ name ] = value;
    },
    clearData: function () {
        this.data = {};
    },
    getRenderContainer: function () {
        return this.rc;
    }
} );
@@ -3238,16 +3238,820 @@
 his.rc;%0A
+    %7D,%0A    getCommonAncestor:function(node)%7B%0A        if(this === node)%7B%0A            return this.parent%0A        %7D%0A        if(this.contains(node))%7B%0A            return this%0A        %7D%0A        if(node.contains(this))%7B%0A            return node%0A        %7D%0A        var parent = node.parent;%0A        while(!parent.contains(node))%7B%0A            parent = parent.parentNode;%0A        %7D%0A        return parent;%0A    %7D,%0A    contains:function(node)%7B%0A        if(this === node)%7B%0A            return true;%0A        %7D%0A        if(this === node.parent)%7B%0A            return true;%0A        %7D%0A        var isContain = false;%0A        utils.each(this.getChildren(),function(i,n)%7B%0A            isContain = n.contains(node);%0A            if(isContain === true)%7B%0A                return false%0A            %7D%0A        %7D);%0A        return isContain;%0A%0A
     %7D%0A%7D 

添加getCommonAncestor/contains