package { import flash.display.*; import flash.events.*; import flash.geom.*; import org.lamsfoundation.lams.common.dictionary.*; public class MindMap extends Branch { protected var deleteMessage:DeleteMessage; protected var switchMessage:SwitchMessage; protected var conceptHovered:Concept; public var dictionary:XMLDictionary; protected var _player:String; public function get player():String { return this._player; } protected var ids:int; public function get leftUpSpace():Number { var result:Number = 0; if(this.sonCount>0){ var i:int; for(i=0;i1){ var i:int; for(i=1;i"+concept.creator+"")); } else { if(this.conceptHovered == concept){ this.dispatchEvent(new InformationEvent(InformationEvent.NO_INFORMATION)); } } } public function chooseDeletion(concept:InternalConcept):void { if(concept.branch.sonCount==0){ this.deleteConcept(concept); } } public function conceptRemoved(concept:InternalConcept):void { if(this.deleteMessage.visible && this.deleteMessage.concept == concept){ this.deleteMessage.hide(); } } public function branchAdded(branch:InternalBranch):void { if(this.deleteMessage.visible && this.deleteMessage.concept == branch.father.base){ this.deleteMessage.hide(); } } public function getNewConceptId():int { return this.ids++; } public function allowConceptId(id:int):void { this.ids = Math.max(id+1,this.ids); } protected function deleteConcept(concept:InternalConcept):void { (InternalBranch)(concept.branch).father.removeSon(concept); concept.branch.proper(); } protected function rebalance():void { var i:int; for (i=0; i0?sonSpace:0); } else { totalWidthRight += this.son(i).span+(totalWidthRight>0?sonSpace:0); } } var dropperYLeft:Number = -leftUpSpace; var dropperYRight:Number = -rightUpSpace; for (i=0; iMath.floor((this.sonCount-1)/2)){ throw new ArgumentError("MindMap.indexAtLeftPosition: position is out of bounds"); } if(positionMath.floor((this.sonCount-2)/2)){ throw new ArgumentError("MindMap.indexAtRightPosition: position is out of bounds"); } if(position