 	use namespace weave_internal;
 
 	
-	/**	VisApplication
-   	 *  @author abaumann
- 	 * 	A class that extends Application to provide a workspace to add tools, handle setting of settings from files, etc.
- 	 **/
+	/**	
+ 	 * A class that extends Application to provide a workspace to add tools, handle setting of settings from files, etc.
+	 * 
+	 * @author abaumann
+ 	 */
 	public class VisApplication extends Application implements ILinkableObject
 	{
 		MXClasses; // Referencing this allows all Flex classes to be dynamically created at runtime.
-
 
 		{ /** BEGIN STATIC CODE BLOCK **/ 
 			Weave.initialize(); // referencing this here causes all WeaveAPI implementations to be registered.
 		} /** END STATIC CODE BLOCK **/ 
 		
-		
-		// Optional menu bar (top of the screen) and task bar (bottom of the screen).  These would be used for an advanced analyst
-		// view to add new tools, manage windows, do advanced tasks, etc.
+		/**
+		 * Global VisApplication instance
+		 */
+		private static var _thisInstance:VisApplication = null;
+		/**
+		 * Gets the global VisApplication instance.
+		 */
+		public static function get instance():VisApplication
+		{
+			return _thisInstance;
+		}
+
+		/**
+		 * Optional menu bar (top of the screen) and task bar (bottom of the screen).  These would be used for an advanced analyst
+		 * view to add new tools, manage windows, do advanced tasks, etc.
+		 */
 		private var _weaveMenu:WeaveMenuBar = null;
 		
-		
-		// The XML file that defines the default layout of the page if no parameter is passed that specifies another file to use
+		/**
+		 * The XML file that defines the default layout of the page if no parameter is passed that specifies another file to use
+		 */
 		private var _configFileXML:XML = null;
 		
-		// The array of data tables that are used in this application, one or more data tables are needed to visualize some data
-		private var _dataTableNames:Array = [];
-		
-		// This will be used to incorporate branding into any weave view.  Linkable to the Open Indicators Consortium website.
+		/**
+		 * This will be used to incorporate branding into any weave view.  Linkable to the Open Indicators Consortium website.
+		 */
 		private var _oicLogoPane:OICLogoPane = new OICLogoPane();
-
-		//this sprite will be used to draw curved lines to show connections between two UIComponents
-		//private var _connectionsLayer:Sprite = new Sprite();
-		
-		/**
-		 * static methods
-		 */
-		
-		// global VisApplication instance
-		private static var _thisInstance:VisApplication = null;
-		public static function get instance():VisApplication
-		{
-			return _thisInstance;
-		}
-
+
+		/**
+		 * Constructor.
+		 */
 		public function VisApplication()
 		{
 			super();

   			}
   			
		}
		
		
		/** END CONTEXT MENU CODE **/

		
		public function drawConnection(fromUI:UIComponent,toUI:UIComponent=null,clear:Boolean=true):void
		{
			var fromPoint:Point = fromUI.localToGlobal(new Point(0,0));
			var toPoint:Point = new Point();
			
			if (toUI)
				toPoint = toUI.localToGlobal(new Point(0,0));
			else{
				var toPointX:Number = 0;
				var toPointY:Number = 0;
				
				if (fromPoint.y <= mouseY)
					toPointY = mouseY-12;
				else 
					toPointY = mouseY+12;
				
				if (fromPoint.x <= mouseX)
					toPointX= mouseX-12;
				else 
					toPointX= mouseX+12;
						
				toPoint = new Point(toPointX,toPointY);
			}
				
			
			// start curve anchor at halfway point between origin and destination
			var curveAnchor:Point = new Point(
				(fromPoint.x + fromPoint.x)/2,
				(toPoint.y + toPoint.y)/2);
			
//			VisApplication.instance.rawChildren.addChild(_connectionsLayer);
//			
//			if (clear)
//				_connectionsLayer.graphics.clear();
//			
//			_connectionsLayer.graphics.lineStyle(4,0x8AA37B,1);
//			
//			//DrawUtils.drawCurvedLine(_connectionsLayer.graphics,fromPoint.x,fromPoint.y,toPoint.x,toPoint.y,2);
//			_connectionsLayer.graphics.moveTo(fromPoint.x,fromPoint.y);
//			_connectionsLayer.graphics.curveTo(curveAnchor.x,curveAnchor.y,toPoint.x,toPoint.y);

		}
		
//		public function drawConnections(fromUI:UIComponent,toUIs:Array):void
//		{
//			_connectionsLayer.graphics.clear();
//			
//			for each(var ui:UIComponent in toUIs)
//			{
//				drawConnection(fromUI,ui,false);
//			}
//			
//		}
		
//		public function removeConnections():void
//		{
//			_connectionsLayer.graphics.clear();			
//		}
		
		
		private function testColumn(column:IAttributeColumn):void
		{
			var key:IQualifiedKey;
			var keys:Array = column ? column.keys : [];
			trace(getQualifiedClassName(column), column);
			trace("keys: "+keys);
			for each (key in keys)
			{
				var debug:String = "key = "+key.keyType+'#'+key.localName+":";
				for each (var type:Class in [null, Number, String, Boolean])
				{
					var value:* = column.getValueFromKey(key, type);
					var typeStr:String = type ? String(type) : '('+getQualifiedClassName(value)+')';
					debug += "\n\t"+typeStr+":\t"+value;
				}
				trace(debug);
			}
		}
		
		private function trace(...args):void
		{

			return newToolMenuItem;
		}

		/**
		 * Handle a file fault when trying to download the config file -- for now, this just pops up a window showing that the file could not be downloaded.
		 */
		private function handleConfigFileFault(event:FaultEvent, token:Object = null):void
		{
			//if connection name exists then user might be creating a new config file.
