//This class is the canvas on which everything will be drawn
package components
{
	import Controller.ArgumentController;
	import Controller.LayoutController;
	import Controller.LoadController;
	import Controller.logic.ConditionalSyllogism;
	import Controller.logic.DisjunctiveSyllogism;
	import Controller.logic.ModusPonens;
	import Controller.logic.ModusTollens;
	import Controller.logic.NotAllSyllogism;
	import Controller.logic.ParentArg;

	import Events.AGORAEvent;

	import Model.AGORAModel;
	import Model.ArgumentTypeModel;
	import Model.InferenceModel;
	import Model.StatementModel;

	import ValueObjects.AGORAParameters;

	import classes.Language;

	import flash.display.DisplayObject;
	import flash.display.Graphics;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.geom.Point;
	import flash.text.TextField;
	import flash.utils.Dictionary;
	import flash.utils.Timer;
	import flash.utils.getDefinitionByName;
	import flash.utils.getQualifiedClassName;

	import mx.binding.utils.BindingUtils;
	import mx.binding.utils.ChangeWatcher;
	import mx.collections.ArrayCollection;
	import mx.containers.Canvas;
	import mx.controls.Alert;
	import mx.controls.Label;
	import mx.controls.Menu;
	import mx.core.DragSource;
	import mx.core.UIComponent;
	import mx.events.DragEvent;
	import mx.events.FlexEvent;
	import mx.events.ScrollEvent;
	import mx.managers.DragManager;
	import mx.states.State;

	public class AgoraMap extends Canvas
	{
		public static const BY_ARGUMENT:String = "ByArgument";
		public static const BY_CLAIM:String = "ByClaim";

		public var beganBy:String;
		public var drawUtility:UIComponent = null;
		public var ID:int;
		public var helpText:HelpText;
		public var firstClaimHelpText:FirstClaimHelpText;
		private static var _tempID:int;
		public var timer:Timer;
		private var _removePreviousElements:Boolean;

		public var panelsHash:Dictionary;
		public var menuPanelsHash:Dictionary;

		public function AgoraMap()
		{
			addEventListener(DragEvent.DRAG_ENTER,acceptDrop);
			addEventListener(DragEvent.DRAG_DROP,handleDrop );
			initializeMapStructures();
			timer = new Timer(10000);
			timer.addEventListener(TimerEvent.TIMER, onMapTimer);
			beganBy = BY_CLAIM;
			removePreviousElements = false;
		}

		//--------------------- getters and setters -------------------//
		public function get removePreviousElements():Boolean{
			return _removePreviousElements;
		}
		public function set removePreviousElements(value:Boolean):void{
			_removePreviousElements = value;
			invalidateProperties();
			invalidateDisplayList();
		}

		protected function onMapTimer(event:TimerEvent):void{
			LoadController.getInstance().fetchMapData();
		}

		public function getGlobalCoordinates(point:Point):Point
		{
			return localToGlobal(point);
		}

		public function initializeMapStructures():void{
			panelsHash = new Dictionary;
			menuPanelsHash = new Dictionary;
			removePreviousElements = true;
		}

		override protected function createChildren():void
		{
			super.createChildren();
			drawUtility = new UIComponent();
			this.addChild(drawUtility);
			drawUtility.depth = 0;
			helpText = new HelpText;
			addChild(helpText);
			helpText.visible = false;
			firstClaimHelpText = new FirstClaimHelpText;
			addChild(firstClaimHelpText);
			firstClaimHelpText.visible = false;

		}
		public function acceptDrop(d:DragEvent):void
		{
			DragManager.acceptDragDrop(Canvas(d.currentTarget));
		}

		public function handleDrop(dragEvent:DragEvent):void
		{
			var currentStage:Canvas = Canvas(dragEvent.currentTarget);
			var gridPanel:GridPanel = dragEvent.dragInitiator as GridPanel;
			var dragSource:DragSource = dragEvent.dragSource;
			var tmpx:int = int(dragSource.dataForFormat("x"));
			var tmpy:int = int(dragSource.dataForFormat("y"));
			tmpx = currentStage.mouseX - tmpx;
			tmpy = currentStage.mouseY - tmpy;
			var toxgrid:int = Math.floor(tmpy/AGORAParameters.getInstance().gridWidth);
			var toygrid:int = Math.floor(tmpx/AGORAParameters.getInstance().gridWidth);
			var diffx:int = toxgrid - int(dragSource.dataForFormat("gx"));
			var diffy:int = toygrid - int(dragSource.dataForFormat("gy"));
			setChildIndex(gridPanel, numChildren - 1);
			LayoutController.getInstance().movePanel(gridPanel,diffx, diffy);

		}

		override protected function commitProperties():void{
			super.commitProperties();
			if(removePreviousElements){
				removeAllChildren();
				removeAllElements();
				_removePreviousElements = false;
			}

			try{
				removeChild(drawUtility);
			}catch(e:Error){
			}

			addChildAt(drawUtility, 0);
			try{
				removeChild(helpText);
			}catch(e:Error){
			}
			addChild(helpText);
			try{
				removeChild(firstClaimHelpText);
			}catch(e:Error){
			}
			addChild(firstClaimHelpText);

			var newPanels:ArrayCollection = AGORAModel.getInstance().agoraMapModel.newPanels;
			for(var i:int=0; i< newPanels.length; i++){
				if(StatementModel(newPanels[i]).statementFunction == StatementModel.INFERENCE){
					var inference:ArgumentPanel = new ArgumentPanel;
					inference.model = newPanels[i];
					panelsHash[inference.model.ID] = inference;
					addChild(inference);
					//add the next infobox
					var addArgumentsInfo:InfoBox = new InfoBox;
					addArgumentsInfo.visible = false;
					addArgumentsInfo.text = Language.lookup('ArgComplete');
					addArgumentsInfo.boxWidth = 500;
					addChild(addArgumentsInfo);
				}

				else if(newPanels[i] is StatementModel){
					var argumentPanel:ArgumentPanel;
					var model:StatementModel = newPanels[i];
					if(model.statementType != StatementModel.OBJECTION){
						argumentPanel = new ArgumentPanel;
						argumentPanel.model = model;
						panelsHash[model.ID] = argumentPanel;
						argumentPanel.addEventListener(AGORAEvent.STATEMENT_STATE_TO_EDIT, ArgumentController.getInstance().removeOption);
						if(model.argumentTypeModel){
							if(!model.argumentTypeModel.reasonsCompleted)
							{
								if(model.argumentTypeModel.reasonModels.length == 1){
									argumentPanel.branchControl = new Option;
									argumentPanel.branchControl.x = argumentPanel.x + AGORAParameters.getInstance().gridWidth * 10;
									argumentPanel.branchControl.y = argumentPanel.y;
									argumentPanel.branchControl.argumentTypeModel = model.argumentTypeModel;
									addChild(argumentPanel.branchControl);
								}
							}
						}
						addChild(argumentPanel);
						argumentPanel.changeTypeInfo = new InfoBox;
						argumentPanel.changeTypeInfo.visible = false;
						argumentPanel.changeTypeInfo.text = Language.lookup('PartUnivReq');
						argumentPanel.changeTypeInfo.boxWidth = argumentPanel.getExplicitOrMeasuredWidth();
						addChild(argumentPanel.changeTypeInfo);
					}
					else{
						argumentPanel = new ArgumentPanel;
						argumentPanel.model = model;
						panelsHash[model.ID] = argumentPanel;
						addChild(argumentPanel);
					}
				}
			}

			var newMenuPanels:ArrayCollection = AGORAModel.getInstance().agoraMapModel.newConnections;
			for each(var argumentTypeModel:ArgumentTypeModel in newMenuPanels){
				var menuPanel:MenuPanel = new MenuPanel;
				menuPanel.model = argumentTypeModel;
				menuPanel.schemeSelector = new ArgSelector;
				menuPanel.schemeSelector.visible = false;
				menuPanel.schemeSelector.argumentTypeModel = argumentTypeModel;
				menuPanelsHash[menuPanel.model.ID] =  menuPanel;
				addChild(menuPanel);
				addChild(menuPanel.schemeSelector);
			}
			LoadController.getInstance().mapUpdateCleanUp();
		}

		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth,unscaledHeight);
			connectRelatedPanels();
		}

		protected function connectRelatedPanels():void
		{
			var panelList:Dictionary = panelsHash;
			drawUtility.graphics.clear();
			drawUtility.graphics.lineStyle(2,0,1);
			var gridWidth:int = AGORAParameters.getInstance().gridWidth;
			var layoutController:LayoutController = LayoutController.getInstance();
			var statementModel:StatementModel;
			var argumentTypeModel:ArgumentTypeModel;
			//code for the connecting arrows

			for each(var model:StatementModel in AGORAModel.getInstance().agoraMapModel.panelListHash){
				if(model.supportingArguments.length > 0 || model.objections.length > 0){
					//First Vertical Line Starting Point
					var argumentPanel:ArgumentPanel = panelsHash[model.ID];

					var fvlspx:int = ((argumentPanel.x + argumentPanel.width)/gridWidth + 2) * gridWidth;
					var fvlspy:int = argumentPanel.y + 72;
					if(model.supportingArguments.length > 0){
						//draw arrow
						drawUtility.graphics.lineStyle(10, 0x29ABE2, 10);
						drawUtility.graphics.moveTo(argumentPanel.x + argumentPanel.width + 20, argumentPanel.y + 87);
						drawUtility.graphics.lineTo(argumentPanel.x + argumentPanel.width, argumentPanel.y + 72);
						drawUtility.graphics.lineTo(argumentPanel.x + argumentPanel.width + 20, argumentPanel.y + 57);
						//First Vertical Line Finishing Point
						var lastMenuPanel:MenuPanel = menuPanelsHash[layoutController.getBottomArgument(model).ID];
						var fvlfpy:int = (lastMenuPanel.y + 72);
						//draw a line
						drawUtility.graphics.moveTo(fvlspx, fvlspy);
						drawUtility.graphics.lineTo(fvlspx, fvlfpy);

						//Line from claim to vertical line starting point
						var firstMenuPanel:MenuPanel = menuPanelsHash[model.supportingArguments[0].ID];
						drawUtility.graphics.moveTo(argumentPanel.x + argumentPanel.width, argumentPanel.y + 72);
						drawUtility.graphics.lineTo(fvlspx, argumentPanel.y + 72);
						//for each argument
						for each(argumentTypeModel in model.supportingArguments){
							//get the point one grid before the first reason horizontally.
							var rspx:int = (argumentTypeModel.reasonModels[0].ygrid - 1) * gridWidth;
							var rspy:int = argumentTypeModel.xgrid * gridWidth + 72;
							//get the point in front of the last reason
							var rfpy:int = layoutController.getBottomReason(argumentTypeModel).xgrid * gridWidth + 72;

							//draw a line
							drawUtility.graphics.moveTo(rspx, rspy);
							drawUtility.graphics.lineTo(rspx, rfpy);

							var menuPanel:MenuPanel = menuPanelsHash[argumentTypeModel.ID];
							//Line from menu Panel to the starting point of reason vertical line
							drawUtility.graphics.moveTo(menuPanel.x + menuPanel.width -30, menuPanel.y + 72);
							drawUtility.graphics.lineTo(rspx, menuPanel.y + 72);

							//Line from first vertical line to menu Panel
							drawUtility.graphics.moveTo(fvlspx, menuPanel.y + 72);
							drawUtility.graphics.lineTo(menuPanel.x+10, menuPanel.y + 72);

							//Line from menuPanel to Inference
							var inferencePanel:ArgumentPanel = panelsHash[argumentTypeModel.inferenceModel.ID];
							if(inferencePanel.visible){
								drawUtility.graphics.moveTo(menuPanel.x + menuPanel.width/2, menuPanel.y+menuPanel.height+10);
								drawUtility.graphics.lineTo(menuPanel.x + menuPanel.width/2, inferencePanel.y);
							}
							for each(statementModel in argumentTypeModel.reasonModels){
								//hline
								var poReason:int = statementModel.xgrid * gridWidth + 72;
								drawUtility.graphics.moveTo(rspx, poReason);
								drawUtility.graphics.lineTo(statementModel.ygrid * gridWidth, poReason);
							}
						}
					}
					if(model.objections.length > 0){
						drawUtility.graphics.lineStyle(10, 0xF99653, 10);
						argumentPanel = panelsHash[model.ID];
						var lastObjection:StatementModel = layoutController.getBottomObjection(model);
						if(lastObjection != null){

							var bottomObjection:ArgumentPanel = panelsHash[lastObjection.ID];
							fvlspx = argumentPanel.x + argumentPanel.getExplicitOrMeasuredWidth() - 30;
							fvlspy = argumentPanel.y-15 + argumentPanel.getExplicitOrMeasuredHeight();
							fvlfpy = bottomObjection.y + 72;
							//draw a line from the first objection to the last objection
							//and an arrow
							drawUtility.graphics.moveTo(fvlspx, fvlfpy);
							drawUtility.graphics.lineTo(fvlspx, fvlspy);
							drawUtility.graphics.lineTo(fvlspx-15, fvlspy +15);
							drawUtility.graphics.moveTo(fvlspx, fvlspy);
							drawUtility.graphics.lineTo(fvlspx+15, fvlspy+15);
							for each(var obj:StatementModel in model.objections){
								//horizontal line from the vertical line to the objection
								if(panelsHash.hasOwnProperty(obj.ID)){
									var objectionPanel:ArgumentPanel = panelsHash[obj.ID];
									drawUtility.graphics.moveTo(fvlspx, objectionPanel.y +72);
									drawUtility.graphics.lineTo(objectionPanel.x, objectionPanel.y + 72);
								}
							}
						}
					}
				}
			}
		}
	}
}

//This class is the canvas on which everything will be drawn
package components
{
	import Controller.ArgumentController;
	import Controller.LayoutController;
	import Controller.LoadController;
	import Controller.logic.ConditionalSyllogism;
	import Controller.logic.DisjunctiveSyllogism;
	import Controller.logic.ModusPonens;
	import Controller.logic.ModusTollens;
	import Controller.logic.NotAllSyllogism;
	import Controller.logic.ParentArg;

	import Events.AGORAEvent;

	import Model.AGORAModel;
	import Model.ArgumentTypeModel;
	import Model.InferenceModel;
	import Model.StatementModel;

	import ValueObjects.AGORAParameters;

	import classes.Language;

	import flash.display.DisplayObject;
	import flash.display.Graphics;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.geom.Point;
	import flash.text.TextField;
	import flash.utils.Dictionary;
	import flash.utils.Timer;
	import flash.utils.getDefinitionByName;
	import flash.utils.getQualifiedClassName;

	import mx.binding.utils.BindingUtils;
	import mx.binding.utils.ChangeWatcher;
	import mx.collections.ArrayCollection;
	import mx.containers.Canvas;
	import mx.controls.Alert;
	import mx.controls.Label;
	import mx.controls.Menu;
	import mx.core.DragSource;
	import mx.core.UIComponent;
	import mx.events.DragEvent;
	import mx.events.FlexEvent;
	import mx.events.ScrollEvent;
	import mx.managers.DragManager;
	import mx.states.State;

	public class AgoraMap extends Canvas
	{
		public static const BY_ARGUMENT:String = "ByArgument";
		public static const BY_CLAIM:String = "ByClaim";

		public var beganBy:String;
		public var drawUtility:UIComponent = null;
		public var ID:int;
		public var helpText:HelpText;
		public var firstClaimHelpText:FirstClaimHelpText;
		private static var _tempID:int;
		public var timer:Timer;
		private var _removePreviousElements:Boolean;

		public var panelsHash:Dictionary;
		public var menuPanelsHash:Dictionary;

		public function AgoraMap()
		{
			addEventListener(DragEvent.DRAG_ENTER,acceptDrop);
			addEventListener(DragEvent.DRAG_DROP,handleDrop );
			initializeMapStructures();
			timer = new Timer(10000);
			timer.addEventListener(TimerEvent.TIMER, onMapTimer);
			beganBy = BY_CLAIM;
			removePreviousElements = false;
		}

		//--------------------- getters and setters -------------------//
		public function get removePreviousElements():Boolean{
			return _removePreviousElements;
		}
		public function set removePreviousElements(value:Boolean):void{
			_removePreviousElements = value;
			invalidateProperties();
			invalidateDisplayList();
		}

		protected function onMapTimer(event:TimerEvent):void{
			LoadController.getInstance().fetchMapData();
		}

		public function getGlobalCoordinates(point:Point):Point
		{
			return localToGlobal(point);
		}

		public function initializeMapStructures():void{
			panelsHash = new Dictionary;
			menuPanelsHash = new Dictionary;
			removePreviousElements = true;
		}

		override protected function createChildren():void
		{
			super.createChildren();
			drawUtility = new UIComponent();
			this.addChild(drawUtility);
			drawUtility.depth = 0;
			helpText = new HelpText;
			addChild(helpText);
			helpText.visible = false;
			firstClaimHelpText = new FirstClaimHelpText;
			addChild(firstClaimHelpText);
			firstClaimHelpText.visible = false;

		}
		public function acceptDrop(d:DragEvent):void
		{
			DragManager.acceptDragDrop(Canvas(d.currentTarget));
		}

		public function handleDrop(dragEvent:DragEvent):void
		{
			var currentStage:Canvas = Canvas(dragEvent.currentTarget);
			var gridPanel:GridPanel = dragEvent.dragInitiator as GridPanel;
			var dragSource:DragSource = dragEvent.dragSource;
			var tmpx:int = int(dragSource.dataForFormat("x"));
			var tmpy:int = int(dragSource.dataForFormat("y"));
			tmpx = currentStage.mouseX - tmpx;
			tmpy = currentStage.mouseY - tmpy;
			var toxgrid:int = Math.floor(tmpy/AGORAParameters.getInstance().gridWidth);
			var toygrid:int = Math.floor(tmpx/AGORAParameters.getInstance().gridWidth);
			var diffx:int = toxgrid - int(dragSource.dataForFormat("gx"));
			var diffy:int = toygrid - int(dragSource.dataForFormat("gy"));
			setChildIndex(gridPanel, numChildren - 1);
			LayoutController.getInstance().movePanel(gridPanel,diffx, diffy);

		}

		override protected function commitProperties():void{
			super.commitProperties();
			if(removePreviousElements){
				removeAllChildren();
				removeAllElements();
				_removePreviousElements = false;
			}

			try{
				removeChild(drawUtility);
			}catch(e:Error){
			}

			addChildAt(drawUtility, 0);
			try{
				removeChild(helpText);
			}catch(e:Error){
			}
			addChild(helpText);
			try{
				removeChild(firstClaimHelpText);
			}catch(e:Error){
			}
			addChild(firstClaimHelpText);
			for each(var info:UIComponent in getChildren())
			{
				if(info is InfoBox)
				{
				var info1:InfoBox = info as InfoBox;
				if(info1.helptext == Language.lookup('ArgComplete'))
					removeChild(info);
				}
			}
			var newPanels:ArrayCollection = AGORAModel.getInstance().agoraMapModel.newPanels;
			for(var i:int=0; i< newPanels.length; i++){
				if(StatementModel(newPanels[i]).statementFunction == StatementModel.INFERENCE){
					var inference:ArgumentPanel = new ArgumentPanel;
					inference.model = newPanels[i];
					panelsHash[inference.model.ID] = inference;
					addChild(inference);
					//add the next infobox
					var addArgumentsInfo:InfoBox = new InfoBox;
					addArgumentsInfo.visible = false;
					addArgumentsInfo.text = Language.lookup('ArgComplete');
					addArgumentsInfo.boxWidth = 500;
					addChild(addArgumentsInfo);
				}

				else if(newPanels[i] is StatementModel){
					var argumentPanel:ArgumentPanel;
					var model:StatementModel = newPanels[i];
					if(model.statementType != StatementModel.OBJECTION){
						argumentPanel = new ArgumentPanel;
						argumentPanel.model = model;
						panelsHash[model.ID] = argumentPanel;
						argumentPanel.addEventListener(AGORAEvent.STATEMENT_STATE_TO_EDIT, ArgumentController.getInstance().removeOption);
						if(model.argumentTypeModel){
							if(!model.argumentTypeModel.reasonsCompleted)
							{
								if(model.argumentTypeModel.reasonModels.length == 1){
									argumentPanel.branchControl = new Option;
									argumentPanel.branchControl.x = argumentPanel.x + AGORAParameters.getInstance().gridWidth * 10;
									argumentPanel.branchControl.y = argumentPanel.y;
									argumentPanel.branchControl.argumentTypeModel = model.argumentTypeModel;
									addChild(argumentPanel.branchControl);
								}
							}
						}
						addChild(argumentPanel);
						argumentPanel.changeTypeInfo = new InfoBox;
						argumentPanel.changeTypeInfo.visible = false;
						argumentPanel.changeTypeInfo.text = Language.lookup('PartUnivReq');
						argumentPanel.changeTypeInfo.boxWidth = argumentPanel.getExplicitOrMeasuredWidth();
						addChild(argumentPanel.changeTypeInfo);
					}
					else{
						argumentPanel = new ArgumentPanel;
						argumentPanel.model = model;
						panelsHash[model.ID] = argumentPanel;
						addChild(argumentPanel);
					}
				}
			}

			var newMenuPanels:ArrayCollection = AGORAModel.getInstance().agoraMapModel.newConnections;
			for each(var argumentTypeModel:ArgumentTypeModel in newMenuPanels){
				var menuPanel:MenuPanel = new MenuPanel;
				menuPanel.model = argumentTypeModel;
				menuPanel.schemeSelector = new ArgSelector;
				menuPanel.schemeSelector.visible = false;
				menuPanel.schemeSelector.argumentTypeModel = argumentTypeModel;
				menuPanelsHash[menuPanel.model.ID] =  menuPanel;
				addChild(menuPanel);
				addChild(menuPanel.schemeSelector);
			}
			LoadController.getInstance().mapUpdateCleanUp();
		}

		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth,unscaledHeight);
			connectRelatedPanels();
		}

		protected function connectRelatedPanels():void
		{
			var panelList:Dictionary = panelsHash;
			drawUtility.graphics.clear();
			drawUtility.graphics.lineStyle(2,0,1);
			var gridWidth:int = AGORAParameters.getInstance().gridWidth;
			var layoutController:LayoutController = LayoutController.getInstance();
			var statementModel:StatementModel;
			var argumentTypeModel:ArgumentTypeModel;
			//code for the connecting arrows

			for each(var model:StatementModel in AGORAModel.getInstance().agoraMapModel.panelListHash){
				if(model.supportingArguments.length > 0 || model.objections.length > 0){
					//First Vertical Line Starting Point
					var argumentPanel:ArgumentPanel = panelsHash[model.ID];

					var fvlspx:int = ((argumentPanel.x + argumentPanel.width)/gridWidth + 2) * gridWidth;
					var fvlspy:int = argumentPanel.y + 72;
					if(model.supportingArguments.length > 0){
						//draw arrow
						drawUtility.graphics.lineStyle(10, 0x29ABE2, 10);
						drawUtility.graphics.moveTo(argumentPanel.x + argumentPanel.width + 20, argumentPanel.y + 87);
						drawUtility.graphics.lineTo(argumentPanel.x + argumentPanel.width, argumentPanel.y + 72);
						drawUtility.graphics.lineTo(argumentPanel.x + argumentPanel.width + 20, argumentPanel.y + 57);
						//First Vertical Line Finishing Point
						var lastMenuPanel:MenuPanel = menuPanelsHash[layoutController.getBottomArgument(model).ID];
						var fvlfpy:int = (lastMenuPanel.y + 72);
						//draw a line
						drawUtility.graphics.moveTo(fvlspx, fvlspy);
						drawUtility.graphics.lineTo(fvlspx, fvlfpy);

						//Line from claim to vertical line starting point
						var firstMenuPanel:MenuPanel = menuPanelsHash[model.supportingArguments[0].ID];
						drawUtility.graphics.moveTo(argumentPanel.x + argumentPanel.width, argumentPanel.y + 72);
						drawUtility.graphics.lineTo(fvlspx, argumentPanel.y + 72);
						//for each argument
						for each(argumentTypeModel in model.supportingArguments){
							//get the point one grid before the first reason horizontally.
							var rspx:int = (argumentTypeModel.reasonModels[0].ygrid - 1) * gridWidth;
							var rspy:int = argumentTypeModel.xgrid * gridWidth + 72;
							//get the point in front of the last reason
							var rfpy:int = layoutController.getBottomReason(argumentTypeModel).xgrid * gridWidth + 72;

							//draw a line
							drawUtility.graphics.moveTo(rspx, rspy);
							drawUtility.graphics.lineTo(rspx, rfpy);

							var menuPanel:MenuPanel = menuPanelsHash[argumentTypeModel.ID];
							//Line from menu Panel to the starting point of reason vertical line
							drawUtility.graphics.moveTo(menuPanel.x + menuPanel.width -30, menuPanel.y + 72);
							drawUtility.graphics.lineTo(rspx, menuPanel.y + 72);

							//Line from first vertical line to menu Panel
							drawUtility.graphics.moveTo(fvlspx, menuPanel.y + 72);
							drawUtility.graphics.lineTo(menuPanel.x+10, menuPanel.y + 72);

							//Line from menuPanel to Inference
							var inferencePanel:ArgumentPanel = panelsHash[argumentTypeModel.inferenceModel.ID];
							if(inferencePanel.visible){
								drawUtility.graphics.moveTo(menuPanel.x + menuPanel.width/2, menuPanel.y+menuPanel.height+10);
								drawUtility.graphics.lineTo(menuPanel.x + menuPanel.width/2, inferencePanel.y);
							}
							for each(statementModel in argumentTypeModel.reasonModels){
								//hline
								var poReason:int = statementModel.xgrid * gridWidth + 72;
								drawUtility.graphics.moveTo(rspx, poReason);
								drawUtility.graphics.lineTo(statementModel.ygrid * gridWidth, poReason);
							}
						}
					}
					if(model.objections.length > 0){
						drawUtility.graphics.lineStyle(10, 0xF99653, 10);
						argumentPanel = panelsHash[model.ID];
						var lastObjection:StatementModel = layoutController.getBottomObjection(model);
						if(lastObjection != null){

							var bottomObjection:ArgumentPanel = panelsHash[lastObjection.ID];
							fvlspx = argumentPanel.x + argumentPanel.getExplicitOrMeasuredWidth() - 30;
							fvlspy = argumentPanel.y-15 + argumentPanel.getExplicitOrMeasuredHeight();
							fvlfpy = bottomObjection.y + 72;
							//draw a line from the first objection to the last objection
							//and an arrow
							drawUtility.graphics.moveTo(fvlspx, fvlfpy);
							drawUtility.graphics.lineTo(fvlspx, fvlspy);
							drawUtility.graphics.lineTo(fvlspx-15, fvlspy +15);
							drawUtility.graphics.moveTo(fvlspx, fvlspy);
							drawUtility.graphics.lineTo(fvlspx+15, fvlspy+15);
							for each(var obj:StatementModel in model.objections){
								//horizontal line from the vertical line to the objection
								if(panelsHash.hasOwnProperty(obj.ID)){
									var objectionPanel:ArgumentPanel = panelsHash[obj.ID];
									drawUtility.graphics.moveTo(fvlspx, objectionPanel.y +72);
									drawUtility.graphics.lineTo(objectionPanel.x, objectionPanel.y + 72);
								}
							}
						}
					}
				}
			}
		}
	}
}

make support box disappear

make support box disappear


package aerys.minko.render
{
	import aerys.minko.render.resource.texture.ITextureResource;
	import aerys.minko.render.shader.binding.IBinder;

	import flash.utils.Dictionary;
	import aerys.minko.type.binding.IDataBindingsConsumer;

	internal final class DrawCallBindingsConsumer implements IDataBindingsConsumer
	{
		private var _enabled		: Boolean;

		private var _bindings		: Object;

		private var _cpuConstants	: Dictionary;
		private var _vsConstants	: Vector.<Number>;
		private var _fsConstants	: Vector.<Number>;
		private var _fsTextures		: Vector.<ITextureResource>;

		private var _changes		: Object;

		public function get enabled() : Boolean
		{
			return _enabled;
		}
		public function set enabled(value : Boolean) : void
		{
			_enabled = value;

			if (value)
				for (var bindingName : String in _changes)
				{
					setProperty(bindingName, _changes[bindingName]);
					delete _changes[bindingName];
				}
		}

		public function DrawCallBindingsConsumer(bindings		: Object,
												 cpuConstants	: Dictionary,
												 vsConstants	: Vector.<Number>,
												 fsConstants	: Vector.<Number>,
												 fsTextures		: Vector.<ITextureResource>)
		{
			_bindings = bindings;
			_cpuConstants = cpuConstants;
			_vsConstants = vsConstants;
			_fsConstants = fsConstants;
			_fsTextures = fsTextures;

			initialize();
		}

		private function initialize() : void
		{
			_enabled = true;
			_changes = {};
		}

		public function setProperty(propertyName : String, value : Object) : void
		{
			if (!value)
				return;

			if (!_enabled)
			{
				_changes[propertyName] = value;

				return ;
			}

			var binding : IBinder = _bindings[propertyName] as IBinder;

			if (binding != null)
				binding.set(_cpuConstants, _vsConstants, _fsConstants, _fsTextures, value);
		}
	}
}

package aerys.minko.render
{
	import aerys.minko.render.resource.texture.ITextureResource;
	import aerys.minko.render.shader.binding.IBinder;

	import flash.utils.Dictionary;
	import aerys.minko.type.binding.IDataBindingsConsumer;

	internal final class DrawCallBindingsConsumer implements IDataBindingsConsumer
	{
		private var _enabled		: Boolean;

		private var _bindings		: Object;

		private var _cpuConstants	: Dictionary;
		private var _vsConstants	: Vector.<Number>;
		private var _fsConstants	: Vector.<Number>;
		private var _fsTextures		: Vector.<ITextureResource>;

		private var _changes		: Object;

		public function get enabled() : Boolean
		{
			return _enabled;
		}
		public function set enabled(value : Boolean) : void
		{
			_enabled = value;

			if (value)
				for (var bindingName : String in _changes)
				{
					setProperty(bindingName, _changes[bindingName]);
					delete _changes[bindingName];
				}
		}

		public function DrawCallBindingsConsumer(bindings		: Object,
												 cpuConstants	: Dictionary,
												 vsConstants	: Vector.<Number>,
												 fsConstants	: Vector.<Number>,
												 fsTextures		: Vector.<ITextureResource>)
		{
			_bindings = bindings;
			_cpuConstants = cpuConstants;
			_vsConstants = vsConstants;
			_fsConstants = fsConstants;
			_fsTextures = fsTextures;

			initialize();
		}

		private function initialize() : void
		{
			_enabled = true;
			_changes = {};
		}

		public function setProperty(propertyName : String, value : Object) : void
		{
			if (value === null)
				return;

			if (!_enabled)
			{
				_changes[propertyName] = value;

				return ;
			}

			var binding : IBinder = _bindings[propertyName] as IBinder;

			if (binding != null)
				binding.set(_cpuConstants, _vsConstants, _fsConstants, _fsTextures, value);
		}
	}
}

fix changing the property to 0

fix changing the property to 0


////////////////////////////////////////////////////////////////////////////////
//
//  Licensed to the Apache Software Foundation (ASF) under one or more
//  contributor license agreements.  See the NOTICE file distributed with
//  this work for additional information regarding copyright ownership.
//  The ASF licenses this file to You under the Apache License, Version 2.0
//  (the "License"); you may not use this file except in compliance with
//  the License.  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package spark.skins.mobile
{
import flash.display.Graphics;
import flash.display.InteractiveObject;
import flash.display.Sprite;

import mx.core.DPIClassification;

import spark.components.Group;
import spark.components.SpinnerListContainer;
import spark.layouts.HorizontalLayout;
import spark.skins.mobile.supportClasses.MobileSkin;
import spark.skins.mobile120.assets.SpinnerListContainerBackground;
import spark.skins.mobile120.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile120.assets.SpinnerListContainerShadow;
import spark.skins.mobile160.assets.SpinnerListContainerBackground;
import spark.skins.mobile160.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile160.assets.SpinnerListContainerShadow;
import spark.skins.mobile240.assets.SpinnerListContainerBackground;
import spark.skins.mobile240.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile240.assets.SpinnerListContainerShadow;
import spark.skins.mobile320.assets.SpinnerListContainerBackground;
import spark.skins.mobile320.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile320.assets.SpinnerListContainerShadow;
import spark.skins.mobile480.assets.SpinnerListContainerBackground;
import spark.skins.mobile480.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile480.assets.SpinnerListContainerShadow;
import spark.skins.mobile640.assets.SpinnerListContainerBackground;
import spark.skins.mobile640.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile640.assets.SpinnerListContainerShadow;
/**
 *  ActionScript-based skin for the SpinnerListContainer in mobile applications.
 *
 *  @see spark.components.SpinnerListContainer
 *
 *  @langversion 3.0
 *  @playerversion AIR 3
 *  @productversion Flex 4.6
 */
public class SpinnerListContainerSkin extends MobileSkin
{
    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------
    /**
     *  Constructor.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     *
     */
    public function SpinnerListContainerSkin()
    {
        super();

        switch (applicationDPI)
        {
			case DPIClassification.DPI_640:
			{
				// Note provisional may need changes
				borderClass = spark.skins.mobile640.assets.SpinnerListContainerBackground;
				selectionIndicatorClass = spark.skins.mobile640.assets.SpinnerListContainerSelectionIndicator;
				shadowClass = spark.skins.mobile40.assets.SpinnerListContainerShadow;

				cornerRadius = 20;
				borderThickness = 3;
				selectionIndicatorHeight = 182;
				break;
			}
			case DPIClassification.DPI_480:
			{
				// Note provisional may need changes
				borderClass = spark.skins.mobile480.assets.SpinnerListContainerBackground;
				selectionIndicatorClass = spark.skins.mobile480.assets.SpinnerListContainerSelectionIndicator;
				shadowClass = spark.skins.mobile480.assets.SpinnerListContainerShadow;

				cornerRadius = 16;
				borderThickness = 2;
				selectionIndicatorHeight = 144;
				break;
			}
            case DPIClassification.DPI_320:
            {
                borderClass = spark.skins.mobile320.assets.SpinnerListContainerBackground;
                selectionIndicatorClass = spark.skins.mobile320.assets.SpinnerListContainerSelectionIndicator;
                shadowClass = spark.skins.mobile320.assets.SpinnerListContainerShadow;

                cornerRadius = 10;
                borderThickness = 2;
                selectionIndicatorHeight = 96;
                break;
            }
			case DPIClassification.DPI_240:
			{
				borderClass = spark.skins.mobile240.assets.SpinnerListContainerBackground;
				selectionIndicatorClass = spark.skins.mobile240.assets.SpinnerListContainerSelectionIndicator;
				shadowClass = spark.skins.mobile240.assets.SpinnerListContainerShadow;

				cornerRadius = 8;
				borderThickness = 1;
				selectionIndicatorHeight = 72;
				break;
			}
			case DPIClassification.DPI_120:
			{
				borderClass = spark.skins.mobile120.assets.SpinnerListContainerBackground;
				selectionIndicatorClass = spark.skins.mobile120.assets.SpinnerListContainerSelectionIndicator;
				shadowClass = spark.skins.mobile10.assets.SpinnerListContainerShadow;

				cornerRadius = 4;
				borderThickness = 1;
				selectionIndicatorHeight = 37;
				break;
			}
            default: // default DPI_160
            {
                borderClass = spark.skins.mobile160.assets.SpinnerListContainerBackground;
                selectionIndicatorClass = spark.skins.mobile160.assets.SpinnerListContainerSelectionIndicator;
                shadowClass = spark.skins.mobile160.assets.SpinnerListContainerShadow;

                cornerRadius = 5;
                borderThickness = 1;
                selectionIndicatorHeight = 48;

                break;
            }
        }

        minWidth = 30;
    }

    //--------------------------------------------------------------------------
    //
    //  Variables
    //
    //--------------------------------------------------------------------------

    /**
     *  Pixel thickness of the border.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var borderThickness:Number;

    /**
     *  Radius of the border corners.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var cornerRadius:Number;

    /**
     *  Height of the selection indicator.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var selectionIndicatorHeight:Number;

    /**
     *  Class for the border part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var borderClass:Class;

    /**
     *  Class for the selection indicator skin part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var selectionIndicatorClass:Class;

    /**
     *  Class for the shadow skin part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var shadowClass:Class;

    /**
     *  Border skin part which includes the background.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var border:InteractiveObject;

    /**
     *  Selection indicator skin part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var selectionIndicator:InteractiveObject;

    /**
     *  Shadow skin part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var shadow:InteractiveObject;

    /**
     *  Mask for the content group.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var contentGroupMask:Sprite;

    //--------------------------------------------------------------------------
    //
    //  Skin parts
    //
    //--------------------------------------------------------------------------

    /**
     *  An optional skin part that defines the Group where the content
     *  children are pushed into and laid out.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    public var contentGroup:Group;

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------
    /**
     *  @copy spark.skins.spark.ApplicationSkin#hostComponent
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    public var hostComponent:SpinnerListContainer;

    //--------------------------------------------------------------------------
    //
    //  Overridden Methods
    //
    //--------------------------------------------------------------------------
    /**
     *  @private
     */
    override protected function createChildren():void
    {
        super.createChildren();

        if (!border)
        {
            // Border and background
            border = new borderClass();
            border.mouseEnabled = false;
            addChild(border);
        }

        if (!contentGroup)
        {
            // Contains the child elements
            contentGroup = new Group();
            var hLayout:HorizontalLayout = new HorizontalLayout();
            hLayout.gap = 0;
            hLayout.verticalAlign = "middle";
            contentGroup.layout = hLayout;
            contentGroup.id = "contentGroup";
            addChild(contentGroup);
        }

        if (!shadow)
        {
            // Shadowing sits on top of the content
            shadow = new shadowClass();
            shadow.mouseEnabled = false;
            addChild(shadow);
        }

        if (!selectionIndicator)
        {
            // Selection indicator is on top
            selectionIndicator = new selectionIndicatorClass();
            selectionIndicator.mouseEnabled = false;
            addChild(selectionIndicator);
        }

        if (!contentGroupMask)
        {
            // Create a mask for the content
            contentGroupMask = new Sprite();
            addChild(contentGroupMask);
        }
    }

    /**
     *  @private
     */
    override protected function measure():void
    {
        super.measure();

        var contentW:Number = contentGroup.getPreferredBoundsWidth();
        var contentH:Number = contentGroup.getPreferredBoundsHeight();

        measuredWidth = measuredMinWidth = contentW + borderThickness * 2;
        measuredHeight = contentH + borderThickness * 2;

        measuredMinHeight = selectionIndicatorHeight + borderThickness * 4;
        minHeight = measuredMinHeight;
    }

    /**
     *  @private
     */
    override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
    {
        super.layoutContents(unscaledWidth, unscaledHeight);

        unscaledHeight = Math.max(unscaledHeight, selectionIndicatorHeight + borderThickness * 4);

        setElementSize(contentGroup, unscaledWidth - borderThickness * 2, unscaledHeight - borderThickness * 2);
        setElementPosition(contentGroup, borderThickness, borderThickness);

        // Inset by the borderThickness horizontally because the selectionIndicator starts at 0
        setElementSize(border, unscaledWidth - borderThickness * 2, unscaledHeight);
        setElementPosition(border, borderThickness, 0);

        setElementSize(shadow, unscaledWidth - borderThickness * 4, unscaledHeight - borderThickness * 2);
        setElementPosition(shadow, borderThickness * 2, borderThickness);

        setElementSize(selectionIndicator, unscaledWidth, selectionIndicatorHeight);
        setElementPosition(selectionIndicator, 0, Math.floor((unscaledHeight - selectionIndicatorHeight) / 2));

        // The SpinnerLists contain a left and right border. We don't want to show the leftmost
        // SpinnerLists's left border nor the rightmost one's right border.
        // We inset the mask on the left and right sides to accomplish this.
        var g:Graphics = contentGroupMask.graphics;
        g.clear();
        g.beginFill(0x00FF00);
        g.drawRoundRect(borderThickness * 2, borderThickness,
                        unscaledWidth - borderThickness * 4,
                        unscaledHeight - borderThickness * 2,
                        cornerRadius, cornerRadius);
        g.endFill();

        contentGroup.mask = contentGroupMask;
    }
}
}

////////////////////////////////////////////////////////////////////////////////
//
//  Licensed to the Apache Software Foundation (ASF) under one or more
//  contributor license agreements.  See the NOTICE file distributed with
//  this work for additional information regarding copyright ownership.
//  The ASF licenses this file to You under the Apache License, Version 2.0
//  (the "License"); you may not use this file except in compliance with
//  the License.  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package spark.skins.mobile
{
import flash.display.Graphics;
import flash.display.InteractiveObject;
import flash.display.Sprite;

import mx.core.DPIClassification;

import spark.components.Group;
import spark.components.SpinnerListContainer;
import spark.layouts.HorizontalLayout;
import spark.skins.mobile.supportClasses.MobileSkin;
import spark.skins.mobile120.assets.SpinnerListContainerBackground;
import spark.skins.mobile120.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile120.assets.SpinnerListContainerShadow;
import spark.skins.mobile160.assets.SpinnerListContainerBackground;
import spark.skins.mobile160.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile160.assets.SpinnerListContainerShadow;
import spark.skins.mobile240.assets.SpinnerListContainerBackground;
import spark.skins.mobile240.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile240.assets.SpinnerListContainerShadow;
import spark.skins.mobile320.assets.SpinnerListContainerBackground;
import spark.skins.mobile320.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile320.assets.SpinnerListContainerShadow;
import spark.skins.mobile480.assets.SpinnerListContainerBackground;
import spark.skins.mobile480.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile480.assets.SpinnerListContainerShadow;
import spark.skins.mobile640.assets.SpinnerListContainerBackground;
import spark.skins.mobile640.assets.SpinnerListContainerSelectionIndicator;
import spark.skins.mobile640.assets.SpinnerListContainerShadow;
/**
 *  ActionScript-based skin for the SpinnerListContainer in mobile applications.
 *
 *  @see spark.components.SpinnerListContainer
 *
 *  @langversion 3.0
 *  @playerversion AIR 3
 *  @productversion Flex 4.6
 */
public class SpinnerListContainerSkin extends MobileSkin
{
    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------
    /**
     *  Constructor.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     *
     */
    public function SpinnerListContainerSkin()
    {
        super();

        switch (applicationDPI)
        {
			case DPIClassification.DPI_640:
			{
				// Note provisional may need changes
				borderClass = spark.skins.mobile640.assets.SpinnerListContainerBackground;
				selectionIndicatorClass = spark.skins.mobile640.assets.SpinnerListContainerSelectionIndicator;
				shadowClass = spark.skins.mobile640.assets.SpinnerListContainerShadow;

				cornerRadius = 20;
				borderThickness = 3;
				selectionIndicatorHeight = 182;
				break;
			}
			case DPIClassification.DPI_480:
			{
				// Note provisional may need changes
				borderClass = spark.skins.mobile480.assets.SpinnerListContainerBackground;
				selectionIndicatorClass = spark.skins.mobile480.assets.SpinnerListContainerSelectionIndicator;
				shadowClass = spark.skins.mobile480.assets.SpinnerListContainerShadow;

				cornerRadius = 16;
				borderThickness = 2;
				selectionIndicatorHeight = 144;
				break;
			}
            case DPIClassification.DPI_320:
            {
                borderClass = spark.skins.mobile320.assets.SpinnerListContainerBackground;
                selectionIndicatorClass = spark.skins.mobile320.assets.SpinnerListContainerSelectionIndicator;
                shadowClass = spark.skins.mobile320.assets.SpinnerListContainerShadow;

                cornerRadius = 10;
                borderThickness = 2;
                selectionIndicatorHeight = 96;
                break;
            }
			case DPIClassification.DPI_240:
			{
				borderClass = spark.skins.mobile240.assets.SpinnerListContainerBackground;
				selectionIndicatorClass = spark.skins.mobile240.assets.SpinnerListContainerSelectionIndicator;
				shadowClass = spark.skins.mobile240.assets.SpinnerListContainerShadow;

				cornerRadius = 8;
				borderThickness = 1;
				selectionIndicatorHeight = 72;
				break;
			}
			case DPIClassification.DPI_120:
			{
				borderClass = spark.skins.mobile120.assets.SpinnerListContainerBackground;
				selectionIndicatorClass = spark.skins.mobile120.assets.SpinnerListContainerSelectionIndicator;
				shadowClass = spark.skins.mobile120.assets.SpinnerListContainerShadow;

				cornerRadius = 4;
				borderThickness = 1;
				selectionIndicatorHeight = 37;
				break;
			}
            default: // default DPI_160
            {
                borderClass = spark.skins.mobile160.assets.SpinnerListContainerBackground;
                selectionIndicatorClass = spark.skins.mobile160.assets.SpinnerListContainerSelectionIndicator;
                shadowClass = spark.skins.mobile160.assets.SpinnerListContainerShadow;

                cornerRadius = 5;
                borderThickness = 1;
                selectionIndicatorHeight = 48;

                break;
            }
        }

        minWidth = 30;
    }

    //--------------------------------------------------------------------------
    //
    //  Variables
    //
    //--------------------------------------------------------------------------

    /**
     *  Pixel thickness of the border.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var borderThickness:Number;

    /**
     *  Radius of the border corners.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var cornerRadius:Number;

    /**
     *  Height of the selection indicator.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var selectionIndicatorHeight:Number;

    /**
     *  Class for the border part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var borderClass:Class;

    /**
     *  Class for the selection indicator skin part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var selectionIndicatorClass:Class;

    /**
     *  Class for the shadow skin part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var shadowClass:Class;

    /**
     *  Border skin part which includes the background.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var border:InteractiveObject;

    /**
     *  Selection indicator skin part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var selectionIndicator:InteractiveObject;

    /**
     *  Shadow skin part.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var shadow:InteractiveObject;

    /**
     *  Mask for the content group.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    protected var contentGroupMask:Sprite;

    //--------------------------------------------------------------------------
    //
    //  Skin parts
    //
    //--------------------------------------------------------------------------

    /**
     *  An optional skin part that defines the Group where the content
     *  children are pushed into and laid out.
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    public var contentGroup:Group;

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------
    /**
     *  @copy spark.skins.spark.ApplicationSkin#hostComponent
     *
     *  @langversion 3.0
     *  @playerversion AIR 3
     *  @productversion Flex 4.6
     */
    public var hostComponent:SpinnerListContainer;

    //--------------------------------------------------------------------------
    //
    //  Overridden Methods
    //
    //--------------------------------------------------------------------------
    /**
     *  @private
     */
    override protected function createChildren():void
    {
        super.createChildren();

        if (!border)
        {
            // Border and background
            border = new borderClass();
            border.mouseEnabled = false;
            addChild(border);
        }

        if (!contentGroup)
        {
            // Contains the child elements
            contentGroup = new Group();
            var hLayout:HorizontalLayout = new HorizontalLayout();
            hLayout.gap = 0;
            hLayout.verticalAlign = "middle";
            contentGroup.layout = hLayout;
            contentGroup.id = "contentGroup";
            addChild(contentGroup);
        }

        if (!shadow)
        {
            // Shadowing sits on top of the content
            shadow = new shadowClass();
            shadow.mouseEnabled = false;
            addChild(shadow);
        }

        if (!selectionIndicator)
        {
            // Selection indicator is on top
            selectionIndicator = new selectionIndicatorClass();
            selectionIndicator.mouseEnabled = false;
            addChild(selectionIndicator);
        }

        if (!contentGroupMask)
        {
            // Create a mask for the content
            contentGroupMask = new Sprite();
            addChild(contentGroupMask);
        }
    }

    /**
     *  @private
     */
    override protected function measure():void
    {
        super.measure();

        var contentW:Number = contentGroup.getPreferredBoundsWidth();
        var contentH:Number = contentGroup.getPreferredBoundsHeight();

        measuredWidth = measuredMinWidth = contentW + borderThickness * 2;
        measuredHeight = contentH + borderThickness * 2;

        measuredMinHeight = selectionIndicatorHeight + borderThickness * 4;
        minHeight = measuredMinHeight;
    }

    /**
     *  @private
     */
    override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
    {
        super.layoutContents(unscaledWidth, unscaledHeight);

        unscaledHeight = Math.max(unscaledHeight, selectionIndicatorHeight + borderThickness * 4);

        setElementSize(contentGroup, unscaledWidth - borderThickness * 2, unscaledHeight - borderThickness * 2);
        setElementPosition(contentGroup, borderThickness, borderThickness);

        // Inset by the borderThickness horizontally because the selectionIndicator starts at 0
        setElementSize(border, unscaledWidth - borderThickness * 2, unscaledHeight);
        setElementPosition(border, borderThickness, 0);

        setElementSize(shadow, unscaledWidth - borderThickness * 4, unscaledHeight - borderThickness * 2);
        setElementPosition(shadow, borderThickness * 2, borderThickness);

        setElementSize(selectionIndicator, unscaledWidth, selectionIndicatorHeight);
        setElementPosition(selectionIndicator, 0, Math.floor((unscaledHeight - selectionIndicatorHeight) / 2));

        // The SpinnerLists contain a left and right border. We don't want to show the leftmost
        // SpinnerLists's left border nor the rightmost one's right border.
        // We inset the mask on the left and right sides to accomplish this.
        var g:Graphics = contentGroupMask.graphics;
        g.clear();
        g.beginFill(0x00FF00);
        g.drawRoundRect(borderThickness * 2, borderThickness,
                        unscaledWidth - borderThickness * 4,
                        unscaledHeight - borderThickness * 2,
                        cornerRadius, cornerRadius);
        g.endFill();

        contentGroup.mask = contentGroupMask;
    }
}
}

fix 160/480 path names

fix 160/480 path names


                                                     -*- shell-script -*-
URBI_INIT

# The full path to the *.uob dir:
# ../../../../../sdk-remote/src/tests/uobjects/access-and-change/uaccess.uob
uob=$(absolute $1.uob)
require_dir "$uob"

# The ending part, for our builddir: access-and-change/uaccess.dir.
builddir=$(echo "$uob" |
           sed -e 's,.*/src/tests/uobjects/,uobjects/,;s/\.uob$//').dir

# For error messages.
me=$(basename "$uob" .uob)

# The directory we work in.
rm -rf $builddir
mkdir -p $builddir
cd $builddir

# The remote component: an executable.
umake_remote=$(xfind_prog "umake-remote")
xrun "umake-remote" $umake_remote --output=$me$EXEEXT $uob
test -x "$me$EXEEXT" ||
  fatal "$me is not executable"
xrun "$me --version" "./$me$EXEEXT" --version

# The shared component: a dlopen module.
umake_shared=$(xfind_prog "umake-shared")
xrun "umake-shared" $umake_shared --output=$me $uob
test -f "$me.la" ||
  fatal "$me.la does not exist"

# Find urbi-launch.
urbi_launch=$(xfind_prog urbi-launch$EXEEXT)

# If urbi-launch cannot work because there is no kernel libuobject,
# skip the test.  Do pass something that will fail to be loaded,
# otherwise if it works, a server is launched, and will run endlessly.
run "urbi-launch --start" $urbi_launch --start /dev/null ||
  case $? in
    (72) error 77 "urbi-launch cannot find libuobject";;
  esac
xrun "urbi-launch $me --version" "$urbi_launch" --start $me.la -- --version

                                                     -*- shell-script -*-
URBI_INIT

# The full path to the *.uob dir:
# ../../../../../sdk-remote/src/tests/uobjects/access-and-change/uaccess.uob
uob=$(absolute $1.uob)
require_dir "$uob"

# The ending part, for our builddir: access-and-change/uaccess.dir.
builddir=$(echo "$uob" |
           sed -e 's,.*/src/tests/uobjects/,uobjects/,;s/\.uob$//').dir

# For error messages.
me=$(basename "$uob" .uob)

# The directory we work in.
rm -rf $builddir
mkdir -p $builddir
cd $builddir

# The remote component: an executable.
umake_remote=$(xfind_prog "umake-remote")
xrun "umake-remote" $umake_remote --output=$me$EXEEXT $uob
test -x "$me$EXEEXT" ||
  fatal "$me is not executable"
xrun "$me --version" "./$me$EXEEXT" --version

# The shared component: a dlopen module.
umake_shared=$(xfind_prog "umake-shared")
xrun "umake-shared" $umake_shared --output=$me $uob
test -f "$me.la" ||
  fatal "$me.la does not exist"

# Find urbi-launch.
urbi_launch=$(xfind_prog urbi-launch$EXEEXT)

# If urbi-launch cannot work because there is no kernel libuobject,
# skip the test.  Do pass something that will fail to be loaded,
# otherwise if it works, a server is launched, and will run endlessly.
run "urbi-launch --start" $urbi_launch --start /dev/null ||
  case $? in
    (72) error SKIP "urbi-launch cannot find libuobject";;
  esac
xrun "urbi-launch $me --version" "$urbi_launch" --start $me.la -- --version

Fix SKIP exit code.

Fix SKIP exit code.

	* src/tests/bin/uobject-check.as: Use the symbolic value.


package aerys.minko.render.geometry.stream
{
	import aerys.minko.ns.minko_stream;
	import aerys.minko.render.resource.IndexBuffer3DResource;
	import aerys.minko.type.Signal;

	import flash.utils.ByteArray;

	public final class IndexStream
	{
		use namespace minko_stream;

		minko_stream var _data			: Vector.<uint>		= null;
		minko_stream var _localDispose	: Boolean			= false;

		private var _usage		: uint					= 0;
		private var _resource	: IndexBuffer3DResource	= null;
		private var _length		: uint					= 0;

		private var _changed	: Signal				= new Signal('IndexStream.changed');

		public function get usage() : uint
		{
			return _usage;
		}

		public function get resource() : IndexBuffer3DResource
		{
			return _resource;
		}

		public function get length() : uint
		{
			return _length;
		}

		public function set length(value : uint) : void
		{
			_data.length = value;
			invalidate();
		}

		public function get changed() : Signal
		{
			return _changed;
		}

		public function IndexStream(usage	: uint,
									data 	: Vector.<uint> = null,
									length	: uint			= 0)
		{
			super();

			initialize(data, length, usage);
		}

		minko_stream function invalidate() : void
		{
			_length = _data.length;
			_changed.execute(this);
		}

		private function initialize(indices : Vector.<uint>,
									length 	: uint,
									usage	: uint) : void
		{
			_usage = usage;
			_resource = new IndexBuffer3DResource(this);

			if (indices)
			{
				var numIndices : int = indices && length == 0
					? indices.length
					: Math.min(indices.length, length);

				_data = new Vector.<uint>(numIndices);
				for (var i : int = 0; i < numIndices; ++i)
					_data[i] = indices[i];
			}
			else
			{
				_data = dummyData(length);
			}

			invalidate();
		}

		public function get(index : int) : uint
		{
			checkReadUsage(this);

			return _data[index];
		}

		public function set(index : int, value : uint) : void
		{
			checkWriteUsage(this);

			_data[index] = value;
		}

		public function deleteTriangleByIndex(index : int) : Vector.<uint>
		{
			checkWriteUsage(this);

			var deletedIndices : Vector.<uint> = _data.splice(index, 3);

			invalidate();

			return deletedIndices;
		}

		public function getIndices(indices : Vector.<uint> = null) : Vector.<uint>
		{
			checkReadUsage(this);

			var numIndices : int = length;

			indices ||= new Vector.<uint>();
			for (var i : int = 0; i < numIndices; ++i)
				indices[i] = _data[i];

			return indices;
		}

		public function setIndices(indices : Vector.<uint>) : void
		{
			checkWriteUsage(this);

			var length : int = indices.length;

			for (var i : int = 0; i < length; ++i)
				_data[i] = indices[i];

			_data.length = length;

			invalidate();
		}

		public function clone(usage : uint = 0) : IndexStream
		{
			return new IndexStream(usage || _usage, _data, length);
		}

		public function toString() : String
		{
			return _data.toString();
		}

		public function concat(indexStream : IndexStream,
							   firstIndex	: uint	= 0,
							   count		: uint	= 0,
							   offset		: uint 	= 0) : IndexStream
		{
			checkReadUsage(indexStream);
			checkWriteUsage(this);

			var numIndices 	: int 			= _data.length;
			var toConcat 	: Vector.<uint> = indexStream._data;

			count ||= toConcat.length;
			for (var i : int = 0; i < count; ++i, ++numIndices)
				_data[numIndices] = toConcat[int(firstIndex + i)] + offset;

			invalidate();

			return this;
		}

		public function push(indices 	: Vector.<uint>,
							 firstIndex	: uint	= 0,
							 count		: uint	= 0,
							 offset		: uint 	= 0) : void
		{
			checkWriteUsage(this);

			var numIndices : int = _data.length;

			count ||= indices.length;

			for (var i : int = 0; i < count; ++i)
				_data[int(numIndices++)] = indices[int(firstIndex + i)] + offset;

			invalidate();
		}

		public function disposeLocalData(waitForUpload : Boolean = true) : void
		{
			if (waitForUpload && _length != resource.numIndices)
				_localDispose = true;
			else
			{
				_data = null;
				_usage = StreamUsage.STATIC;
			}
		}

		public function dispose() : void
		{
			_resource.dispose();
		}

		private static function checkReadUsage(stream : IndexStream) : void
		{
			if (!(stream._usage & StreamUsage.READ))
				throw new Error(
					'Unable to read from vertex stream: stream usage '
					+ 'is not set to StreamUsage.READ.'
				);
		}

		private static function checkWriteUsage(stream : IndexStream) : void
		{
			if (!(stream._usage & StreamUsage.WRITE))
				throw new Error(
					'Unable to write in vertex stream: stream usage '
					+ 'is not set to StreamUsage.WRITE.'
				);
		}

		public static function dummyData(size : uint, offset : uint = 0) : Vector.<uint>
		{
			var indices : Vector.<uint> = new Vector.<uint>(size);

			for (var i : int = 0; i < size; ++i)
				indices[i] = i + offset;

			return indices;
		}

		public static function fromByteArray(usage		: uint,
											 data 		: ByteArray,
											 numIndices	: int) : IndexStream
		{
			var indices : Vector.<uint> = new Vector.<uint>(numIndices, true);
			var stream : IndexStream = new IndexStream(usage);

			for (var i : int = 0; i < numIndices; ++i)
				indices[i] = data.readInt();

			stream._data = indices;
			stream.invalidate();

			return stream;
		}
	}
}

package aerys.minko.render.geometry.stream
{
	import aerys.minko.ns.minko_stream;
	import aerys.minko.render.resource.IndexBuffer3DResource;
	import aerys.minko.type.Signal;

	import flash.utils.ByteArray;

	public final class IndexStream
	{
		use namespace minko_stream;

		minko_stream var _data			: Vector.<uint>		= null;
		minko_stream var _localDispose	: Boolean			= false;

		private var _usage		: uint					= 0;
		private var _resource	: IndexBuffer3DResource	= null;
		private var _length		: uint					= 0;

		private var _hasChanged	: Boolean				= false;
		private var _locked		: Boolean				= false;

		private var _changed	: Signal				= new Signal('IndexStream.changed');

		public function get usage() : uint
		{
			return _usage;
		}

		public function get resource() : IndexBuffer3DResource
		{
			return _resource;
		}

		public function get length() : uint
		{
			return _length;
		}

		public function set length(value : uint) : void
		{
			_data.length = value;
			invalidate();
		}

		public function get changed() : Signal
		{
			return _changed;
		}

		public function IndexStream(usage	: uint,
									data 	: Vector.<uint> = null,
									length	: uint			= 0)
		{
			super();

			initialize(data, length, usage);
		}

		minko_stream function invalidate() : void
		{
			_length = _data.length;

			if (_locked)
				_hasChanged = true;
			else
				_changed.execute(this);
		}

		private function initialize(indices : Vector.<uint>,
									length 	: uint,
									usage	: uint) : void
		{
			_usage = usage;
			_resource = new IndexBuffer3DResource(this);

			if (indices)
			{
				var numIndices : int = indices && length == 0
					? indices.length
					: Math.min(indices.length, length);

				_data = new Vector.<uint>(numIndices);
				for (var i : int = 0; i < numIndices; ++i)
					_data[i] = indices[i];
			}
			else
			{
				_data = dummyData(length);
			}

			invalidate();
		}

		public function get(index : int) : uint
		{
			checkReadUsage(this);

			return _data[index];
		}

		public function set(index : int, value : uint) : void
		{
			checkWriteUsage(this);

			_data[index] = value;
		}

		public function deleteTriangleByIndex(index : int) : Vector.<uint>
		{
			checkWriteUsage(this);

			var deletedIndices : Vector.<uint> = _data.splice(index, 3);

			invalidate();

			return deletedIndices;
		}

		public function getIndices(indices : Vector.<uint> = null) : Vector.<uint>
		{
			checkReadUsage(this);

			var numIndices : int = length;

			indices ||= new Vector.<uint>();
			for (var i : int = 0; i < numIndices; ++i)
				indices[i] = _data[i];

			return indices;
		}

		public function setIndices(indices : Vector.<uint>) : void
		{
			checkWriteUsage(this);

			var length : int = indices.length;

			for (var i : int = 0; i < length; ++i)
				_data[i] = indices[i];

			_data.length = length;

			invalidate();
		}

		public function clone(usage : uint = 0) : IndexStream
		{
			return new IndexStream(usage || _usage, _data, length);
		}

		public function toString() : String
		{
			return _data.toString();
		}

		public function concat(indexStream : IndexStream,
							   firstIndex	: uint	= 0,
							   count		: uint	= 0,
							   offset		: uint 	= 0) : IndexStream
		{
			checkReadUsage(indexStream);
			checkWriteUsage(this);

			var numIndices 	: int 			= _data.length;
			var toConcat 	: Vector.<uint> = indexStream._data;

			count ||= toConcat.length;
			for (var i : int = 0; i < count; ++i, ++numIndices)
				_data[numIndices] = toConcat[int(firstIndex + i)] + offset;

			invalidate();

			return this;
		}

		public function push(indices 	: Vector.<uint>,
							 firstIndex	: uint	= 0,
							 count		: uint	= 0,
							 offset		: uint 	= 0) : void
		{
			checkWriteUsage(this);

			var numIndices : int = _data.length;

			count ||= indices.length;

			for (var i : int = 0; i < count; ++i)
				_data[int(numIndices++)] = indices[int(firstIndex + i)] + offset;

			invalidate();
		}

		public function disposeLocalData(waitForUpload : Boolean = true) : void
		{
			if (waitForUpload && _length != resource.numIndices)
				_localDispose = true;
			else
			{
				_data = null;
				_usage = StreamUsage.STATIC;
			}
		}

		public function dispose() : void
		{
			_resource.dispose();
		}

		public function lock() : Vector.<uint>
		{
			checkReadUsage(this);
			checkWriteUsage(this);

			_hasChanged = false;
			_locked = true;

			return _data;
		}

		public function unlock(hasChanged : Boolean = true) : void
		{
			if (_hasChanged && hasChanged)
				_changed.execute(this);

			_hasChanged = false;
		}

		private static function checkReadUsage(stream : IndexStream) : void
		{
			if (!(stream._usage & StreamUsage.READ))
				throw new Error(
					'Unable to read from vertex stream: stream usage is not set to StreamUsage.READ.'
				);
		}

		private static function checkWriteUsage(stream : IndexStream) : void
		{
			if (!(stream._usage & StreamUsage.WRITE))
				throw new Error(
					'Unable to write in vertex stream: stream usage is not set to StreamUsage.WRITE.'
				);
		}

		public static function dummyData(size 	: uint,
										 offset : uint = 0) : Vector.<uint>
		{
			var indices : Vector.<uint> = new Vector.<uint>(size);

			for (var i : int = 0; i < size; ++i)
				indices[i] = i + offset;

			return indices;
		}

		public static function fromByteArray(usage		: uint,
											 data 		: ByteArray,
											 numIndices	: int) : IndexStream
		{
			var indices : Vector.<uint> = new Vector.<uint>(numIndices, true);
			var stream : IndexStream = new IndexStream(usage);

			for (var i : int = 0; i < numIndices; ++i)
				indices[i] = data.readInt();

			stream._data = indices;
			stream.invalidate();

			return stream;
		}
	}
}

fix IndexStram.invalidate() to set _hasChanged = true when locked


package aerys.minko.type.loader.parser
{
	import aerys.minko.render.Effect;
	import aerys.minko.scene.node.Mesh;
	import aerys.minko.type.animation.SkinningMethod;
	import aerys.minko.type.loader.ILoader;
	import aerys.minko.type.loader.SceneLoader;
	import aerys.minko.type.loader.TextureLoader;

	import flash.net.URLRequest;

	/**
	 * ParserOptions objects provide properties and function references
	 * to customize how a LoaderGroup object will load and interpret
	 * content.
	 *
	 * @author Jean-Marc Le Roux
	 *
	 */
	public final class ParserOptions
	{
		private var _loadDependencies			: Boolean	= false;
		private var _dependencyLoaderClosure	: Function	= defaultDependencyLoaderClosure;
        private var _loadSkin                   : Boolean   = false;
		private var _skinningMethod				: uint		= SkinningMethod.SHADER_DUAL_QUATERNION;
		private var _mipmapTextures				: Boolean	= true;
		private var _meshEffect					: Effect	= null;
		private var _vertexStreamUsage			: uint		= 0;
		private var _indexStreamUsage			: uint		= 0;
		private var _parser						: Class		= null;

		public function get skinningMethod() : uint
		{
			return _skinningMethod;
		}

		public function set skinningMethod(value : uint) : void
		{
			_skinningMethod = value;
		}

		public function get parser() : Class
		{
			return _parser;
		}

		public function set parser(value : Class) : void
		{
			_parser = value;
		}

		public function get indexStreamUsage() : uint
		{
			return _indexStreamUsage;
		}

		public function set indexStreamUsage(value : uint) : void
		{
			_indexStreamUsage = value;
		}

		public function get vertexStreamUsage() : uint
		{
			return _vertexStreamUsage;
		}

		public function set vertexStreamUsage(value : uint) : void
		{
			_vertexStreamUsage = value;
		}

		public function get effect() : Effect
		{
			return _meshEffect;
		}

		public function set effect(value : Effect) : void
		{
			_meshEffect = value;
		}

		public function get mipmapTextures() : Boolean
		{
			return _mipmapTextures;
		}

		public function set mipmapTextures(value : Boolean) : void
		{
			_mipmapTextures = value;
		}

		public function get dependencyLoaderClosure() : Function
		{
			return _dependencyLoaderClosure;
		}

		public function set dependencyLoaderClosure(value : Function) : void
		{
			_dependencyLoaderClosure = value;
		}

		public function get loadDependencies() : Boolean
		{
			return _loadDependencies;
		}

		public function set loadDependencies(value : Boolean) : void
		{
			_loadDependencies = value;
		}

        public function get loadSkin() : Boolean
        {
            return _loadSkin;
        }

        public function set loadSkin(value : Boolean) : void
        {
            _loadSkin = value;
        }

		public function clone() : ParserOptions
		{
			return new ParserOptions(
				_loadDependencies,
				_dependencyLoaderClosure,
                _loadSkin,
				_skinningMethod,
				_mipmapTextures,
				_meshEffect,
				_vertexStreamUsage,
				_indexStreamUsage,
				_parser
			);
		}

		public function ParserOptions(loadDependencies			: Boolean 	= false,
									  dependencyLoaderClosure	: Function 	= null,
                                      loadSkin                  : Boolean 	= true,
									  skinningMethod			: uint		= 2,
									  mipmapTextures			: Boolean 	= true,
									  meshEffect				: Effect 	= null,
									  vertexStreamUsage			: uint 		= 0,
									  indexStreamUsage			: uint 		= 0,
									  parser					: Class 	= null)
		{
			_loadDependencies			= loadDependencies;
			_dependencyLoaderClosure	= dependencyLoaderClosure || _dependencyLoaderClosure;
            _loadSkin                   = loadSkin;
			_skinningMethod				= skinningMethod;
			_mipmapTextures				= mipmapTextures;
			_meshEffect					= meshEffect || Mesh.DEFAULT_MATERIAL.effect;
			_vertexStreamUsage			= vertexStreamUsage;
			_indexStreamUsage			= indexStreamUsage;
			_parser						= parser;
		}

		private function defaultDependencyLoaderClosure(dependencyPath	: String,
														isTexture		: Boolean,
														options			: ParserOptions) : ILoader
		{
			var loader : ILoader;

			if (isTexture)
			{
				loader = new TextureLoader(true);
				loader.load(new URLRequest(dependencyPath));
			}
			else
			{
				loader = new SceneLoader(options);
				loader.load(new URLRequest(dependencyPath));
			}

			return loader;
		}

    }
}

package aerys.minko.type.loader.parser
{
	import aerys.minko.render.Effect;
	import aerys.minko.scene.node.Mesh;
	import aerys.minko.type.animation.SkinningMethod;
	import aerys.minko.type.loader.ILoader;
	import aerys.minko.type.loader.SceneLoader;
	import aerys.minko.type.loader.TextureLoader;

	import flash.net.URLRequest;

	/**
	 * ParserOptions objects provide properties and function references
	 * to customize how a LoaderGroup object will load and interpret
	 * content.
	 *
	 * @author Jean-Marc Le Roux
	 *
	 */
	public final class ParserOptions
	{
		private var _loadDependencies			: Boolean	= false;
		private var _dependencyLoaderFunction	: Function	= defaultDependencyLoaderFunction;
        private var _loadSkin                   : Boolean   = false;
		private var _skinningMethod				: uint		= SkinningMethod.SHADER_DUAL_QUATERNION;
		private var _mipmapTextures				: Boolean	= true;
		private var _meshEffect					: Effect	= null;
		private var _vertexStreamUsage			: uint		= 0;
		private var _indexStreamUsage			: uint		= 0;
		private var _parser						: Class		= null;

		public function get skinningMethod() : uint
		{
			return _skinningMethod;
		}

		public function set skinningMethod(value : uint) : void
		{
			_skinningMethod = value;
		}

		public function get parser() : Class
		{
			return _parser;
		}

		public function set parser(value : Class) : void
		{
			_parser = value;
		}

		public function get indexStreamUsage() : uint
		{
			return _indexStreamUsage;
		}

		public function set indexStreamUsage(value : uint) : void
		{
			_indexStreamUsage = value;
		}

		public function get vertexStreamUsage() : uint
		{
			return _vertexStreamUsage;
		}

		public function set vertexStreamUsage(value : uint) : void
		{
			_vertexStreamUsage = value;
		}

		public function get effect() : Effect
		{
			return _meshEffect;
		}

		public function set effect(value : Effect) : void
		{
			_meshEffect = value;
		}

		public function get mipmapTextures() : Boolean
		{
			return _mipmapTextures;
		}

		public function set mipmapTextures(value : Boolean) : void
		{
			_mipmapTextures = value;
		}

		public function get dependencyLoaderFunction() : Function
		{
			return _dependencyLoaderFunction;
		}

		public function set dependencyLoaderFunction(value : Function) : void
		{
			_dependencyLoaderFunction = value;
		}

		public function get loadDependencies() : Boolean
		{
			return _loadDependencies;
		}

		public function set loadDependencies(value : Boolean) : void
		{
			_loadDependencies = value;
		}

        public function get loadSkin() : Boolean
        {
            return _loadSkin;
        }

        public function set loadSkin(value : Boolean) : void
        {
            _loadSkin = value;
        }

		public function clone() : ParserOptions
		{
			return new ParserOptions(
				_loadDependencies,
				_dependencyLoaderFunction,
                _loadSkin,
				_skinningMethod,
				_mipmapTextures,
				_meshEffect,
				_vertexStreamUsage,
				_indexStreamUsage,
				_parser
			);
		}

		public function ParserOptions(loadDependencies			: Boolean 	= false,
									  dependencyLoaderClosure	: Function 	= null,
                                      loadSkin                  : Boolean 	= true,
									  skinningMethod			: uint		= 2,
									  mipmapTextures			: Boolean 	= true,
									  meshEffect				: Effect 	= null,
									  vertexStreamUsage			: uint 		= 0,
									  indexStreamUsage			: uint 		= 0,
									  parser					: Class 	= null)
		{
			_loadDependencies			= loadDependencies;
			_dependencyLoaderFunction	= dependencyLoaderClosure || _dependencyLoaderFunction;
            _loadSkin                   = loadSkin;
			_skinningMethod				= skinningMethod;
			_mipmapTextures				= mipmapTextures;
			_meshEffect					= meshEffect || Mesh.DEFAULT_MATERIAL.effect;
			_vertexStreamUsage			= vertexStreamUsage;
			_indexStreamUsage			= indexStreamUsage;
			_parser						= parser;
		}

		private function defaultDependencyLoaderFunction(dependencyPath	: String,
														 isTexture		: Boolean,
														 options		: ParserOptions) : ILoader
		{
			var loader : ILoader;

			if (isTexture)
			{
				loader = new TextureLoader(true);
				loader.load(new URLRequest(dependencyPath));
			}
			else
			{
				loader = new SceneLoader(options);
				loader.load(new URLRequest(dependencyPath));
			}

			return loader;
		}

    }
}

rename ParserOptions.dependencyLoaderClosure into dependencyLoaderFunction


package aerys.minko.render.effect.vertex
{
	import aerys.minko.render.RenderTarget;
	import aerys.minko.render.effect.basic.BasicProperties;
	import aerys.minko.render.effect.basic.BasicShader;
	import aerys.minko.render.shader.SFloat;
	import aerys.minko.type.stream.format.VertexComponent;

	public class VertexUVShader extends BasicShader
	{

		public function VertexUVShader(target 	: RenderTarget 	= null,
									   priority	: Number		= 0)
		{
			super(target, priority);
		}

		override protected function getPixelColor() : SFloat
		{
			var uv 				: SFloat = getVertexAttribute(VertexComponent.UV);

			if (meshBindings.propertyExists(BasicProperties.DIFFUSE_UV_SCALE))
				uv.scaleBy(meshBindings.getParameter(BasicProperties.DIFFUSE_UV_SCALE, 2));

			if (meshBindings.propertyExists(BasicProperties.DIFFUSE_UV_OFFSET))
				uv.incrementBy(meshBindings.getParameter(BasicProperties.DIFFUSE_UV_OFFSET, 2));

			var interpolatedUv 	: SFloat = fractional(interpolate(uv));

			return float4(interpolatedUv.x, interpolatedUv.y, 0, 1);
		}

	}
}

package aerys.minko.render.effect.vertex
{
	import aerys.minko.render.RenderTarget;
	import aerys.minko.render.effect.basic.BasicProperties;
	import aerys.minko.render.effect.basic.BasicShader;
	import aerys.minko.render.shader.SFloat;
	import aerys.minko.type.stream.format.VertexComponent;

	public class VertexUVShader extends BasicShader
	{
		public function VertexUVShader(target 	: RenderTarget 	= null,
									   priority	: Number		= 0)
		{
			super(target, priority);
		}

		override protected function getPixelColor() : SFloat
		{
			var uv 	: SFloat = getVertexAttribute(VertexComponent.UV);

			if (meshBindings.propertyExists(BasicProperties.DIFFUSE_UV_SCALE))
				uv.scaleBy(meshBindings.getParameter(BasicProperties.DIFFUSE_UV_SCALE, 2));

			if (meshBindings.propertyExists(BasicProperties.DIFFUSE_UV_OFFSET))
				uv.incrementBy(meshBindings.getParameter(BasicProperties.DIFFUSE_UV_OFFSET, 2));

			uv = interpolate(uv);

			var fractional : SFloat = fractional(uv);
			var fractionalIsZero : SFloat = equal(fractional, float2(0, 0));
			var interpolatedUv 	: SFloat = add(
				multiply(not(fractionalIsZero), fractional),
				multiply(fractionalIsZero, saturate(uv))
			);

			return float4(interpolatedUv.x, interpolatedUv.y, 0, 1);
		}

	}
}

Optimize uv shader for limit values

Optimize uv shader for limit values