this.nodeclass = lz[ nc ]; new nodeclass( this , { name : "nodeinst" } ); p.setAttr( openattr, val ? "true" : "false" ); if (el != null) { selman.select( el ); } else { selman.clearSelection(); } var curr = this.highlighted; if ( !curr ){ var cls = this.nodeinst.clones; if ( !cls.length ) return; this.select( cls[ 0 ] ); return; } if ( k == 38 || k == 40 ){ //up down var dir = k - 39; var cl = this._findNextClone( curr , dir ); this.select( cl ); } else if ( k == 37 ){ //left if ( curr.open ) { this.setOpen( curr.datapath.p , false ); }else { var pnode = curr.datapath.p.parentNode; if ( pnode == datapath.p ) return; var cl = this._findInClones( pnode ); var wentin = false; while( cl == null ){ wentin = true; this._adjustMargin( - 1 ); cl = this._findInClones( pnode ); } if ( wentin ) this._adjustMargin( - 1 ); this.select( cl ); } } else if ( k == 39 ){ //right if ( !curr.open ) { this.setOpen( curr.datapath.p , true ); }else { var cl = this._findNextClone( curr , 1 ); this.select( cl ); } } else if ( k == 32 || k == 13 ){ if ( highlighted ){ highlighted.doSelected(); } } = 0 && nextnum < cls.length ){ var nextone = cls[ nextnum ]; } if ( nextone ){ var itheight = cls[ 0 ].height; var adjy = nextone.y + y; if ( adjy < itheight ){ this._adjustMargin( -1 ); } else if ( adjy > mask.height - 2*itheight ){ this._adjustMargin( 1 ); } return nextone; } var clptr = who.datapath.p; var clptrnum = null; var nodes = this.nodeinst.nodes; var clptrnum = null; for ( var i = 0; i < nodes.length; i++ ){ if ( nodes[ i ] == clptr ) { clptrnum = i; break; } } var nexthnode = nodes[ clptrnum + dir ]; this._adjustMargin( nextnum < 0 ? -1 : 1 ); return this._findInClones( nexthnode ); ]]> //moves the opttree up or down (depending on the dir) in within //its clipping region. var cls = this.nodeinst.clones; var itheight = cls[ 0 ].height; var adj = itheight * -dir; var ny = y + adj; this.setAttribute('y', Math.min( 0 , Math.max( mask.height - height, ny ) ) ); if ( on ){ movedel.register( lz.Idle, "onidle" ); } else { movedel.unregisterAll(); this.setAttribute('visible', false ); } h *.75 ){ this.dragisover = false; this.cpos = Math.ceil( ( py - czero.y ) / h ); } else { this.dragisover = true; this.cpos = Math.floor( ( py - czero.y ) / h ); } if ( this.dragisover ){ parent.select( parent.nodeinst.clones[ this.cpos ] ); } else { this.setAttribute('y', cy + this.cpos * h ); parent.select( null ); } if ( visible != !this.dragisover ){ this.setAttribute('visible', !this.dragisover ); } ]]> this.dragged = new nodeclass( this ); dragged.setAttribute('visible', false ); this.dragupdel = new lz.Delegate( this, "_updateDragged" ); this.dragindent = dragged.indent; this._ydragoff = iy; if ( !dragged ){ this._setupDrag(); } dragged.setAttributeRelative( 'x', who ); dragged.setAttribute('visible', true ); this.dragdata = who.datapath.p; var dragparent = this.dragdata.parentNode dragparent.removeChild( this.dragdata ); var dpc = this._findInClones( dragparent ); if ( dpc ) dpc.checkChildren(); dragged.datapath.setPointer( this.dragdata ); dragged.bringToFront(); this.dragupdel.register( lz.Idle, "onidle" ); _clicker.drag( true ); dragged.setAttribute('y', this.getMouse( 'y' ) - this._ydragoff ); //Debug.write( 'update', p );