Transferred from the Adobe Open Source Subversion Repository

Revision: 12127
Author:   hmuller@adobe.com
Date:     2009-11-23T23:58:00.001192Z

Log Message:
-----------
Additional min/max Inspectable metadata, mostly for the filter classes.

QE notes:
Doc notes:
Bugs: sdk-24365
Reviewer: Chet, Jason, Ryan
Tests run:
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ConvolutionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseDimensionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BlurFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DisplacementMapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DropShadowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientFilter.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1281119 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/VideoDisplay.as
+++ frameworks/projects/spark/src/spark/components/VideoDisplay.as
@@ -883,7 +883,7 @@
     //  volume
     //----------------------------------

-    [Inspectable(category="General", defaultValue="1.0")]
+    [Inspectable(category="General", defaultValue="1.0", minValue="0.0", maxValue="1.0")]
     [Bindable("volumeChanged")]

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1277824 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/SparkClasses.as
+++ frameworks/projects/spark/src/SparkClasses.as
@@ -1,3 +1,13 @@
+ ////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package
 {


Add sprites

Add sprites

--- index.as
+++ index.as
@@ -83,8 +83,9 @@
 }

 def reset() {
+  joy_reset();
+  gpu_reset();
   cpu_reset();
-  gpu_reset();
 }

 def fini() {
@@ -4319,7 +4320,7 @@

   // IF HALT; just return 4 (cycles)
   if HALT {
-    if IME or (IE & IF & 0x1F) == 0 {
+    if (IE & IF & 0x1F) == 0 {
       return 4;
     } else {
       HALT = false;
@@ -4439,8 +4440,16 @@
 let gpu_scy = 0;
 let gpu_scx = 0;

+// Window
+let gpu_wy = 0;
+let gpu_wx = 7;
+
 // Palette
 let gpu_palette: uint8 = 0;
+
+// Sprites
+let gpu_obj0_palette: uint8 = 0;
+let gpu_obj1_palette: uint8 = 0;

 def gpu_init() {
   gpu_framebuffer = malloc(160 * 144);
@@ -4462,76 +4471,210 @@
 }

 def gpu_render_scanline() {
-  // if not gpu_lcd_enable {
-  //   return;
-  // }
-
-  // if gpu_window_enable {
-  //   printf("WINDOW IS ENABLED\n");
-  // }
-
-  if not gpu_bg_enable {
+  // TODO: Combine Window & Background rendering .. code is super duplicated
+
+  // Background
+  if gpu_bg_enable {
+    // Line (to be rendered)
+    // With a high SCY value, the line wraps around
+    let line = (int64(gpu_line) + int64(gpu_scy)) & 0xFF;
+
+    // Tile Map (Offset)
+    // The tile map is 32x32 (1024 bytes) and is an index into the tile data
+    // A single tile map cell corresponds to an 8x8 cell in the framebuffer
+    //  map 0 ~ line 0..7
+    //  map 31 ~ line 8..13
+    let map: int64 = if (gpu_bg_tm_select) { 0x1C00; } else { 0x1800; };
+    map += (line >> 3) << 5;
+
+    let i: int64 = 0;
+    let x = gpu_scx % 8;
+    let offset = int64(gpu_scx) >> 3;
+    let y = line % 8;
+
+    let i = 0;
+    while i < 160 {
+      if (x == 8) {
+        // New Tile
+        x = 0;
+        offset = (offset + 1) % 32;
+      }
+
+      // Tile Map
+      let tile: int16;
+      if gpu_td_select {
+        tile = int16(*(vram + map + offset));
+      } else {
+        tile = int16(int8(*(vram + map + offset))) + 256;
+      }
+
+      // Tile Data
+      // tile = 0;
+      let td_address: int16 = tile * 16 + int16(y) * 2;
+
+      // Make a bitmask for the pixel being rendered
+      let pixel_mask = 0x80 >> (x % 8);
+
+      // Check the color bits for that pixel
+      let palette_lo = if *(vram + td_address) & pixel_mask != 0 { 1; } else { 0; };
+      let palette_hi = if *(vram + td_address + 1) & pixel_mask != 0 { 1; } else { 0; };
+
+      // Combine them into a single index from 0 to 3
+      let palette_index = uint8((palette_hi << 1) | palette_lo);
+
+      // Palette
+      let color = (gpu_palette >> (palette_index * 2)) & 0x3;
+
+      // Push pixel to framebuffer
+      *(gpu_framebuffer + (int64(gpu_line) * 160) + i) = color;
+
+      x += 1;
+      i += 1;
+    }
+  } else {
     // Background not enabled
     // FIXME: Should we do anything special here?
-
-    return;
-  }
-
-  // Line (to be rendered)
-  // With a high SCY value, the line wraps around
-  let line = (int64(gpu_line) + int64(gpu_scy)) & 0xFF;
-
-  // Tile Map (Offset)
-  // The tile map is 32x32 (1024 bytes) and is an index into the tile data
-  // A single tile map cell corresponds to an 8x8 cell in the framebuffer
-  //  map 0 ~ line 0..7
-  //  map 31 ~ line 8..13
-  let map: int64 = if (gpu_bg_tm_select) { 0x1C00; } else { 0x1800; };
-  map += (line >> 3) << 5;
-
-  let i: int64 = 0;
-  let x = gpu_scx % 8;
-  let offset = int64(gpu_scx) >> 3;
-  let y = line % 8;
-
-  let i = 0;
-  while i < 160 {
-    if (x == 8) {
-      // New Tile
-      x = 0;
-      offset = (offset + 1) % 32;
+  }
+
+  // Window
+  if gpu_window_enable {
+    // FIXME: What is supposed to happen when WX is set to < 7 ?
+    let wx = if gpu_wx < 7 { 0; } else { gpu_wx - 7; };
+    let wy = gpu_wy;
+
+    // Line (to be rendered)
+    let line = int64(gpu_line);
+    if line > int64(wy) {
+
+      // Tile Map (Offset)
+      // The tile map is 32x32 (1024 bytes) and is an index into the tile data
+      // A single tile map cell corresponds to an 8x8 cell in the framebuffer
+      //  map 0 ~ line 0..7
+      //  map 31 ~ line 8..13
+      let map: int64 = if (gpu_window_tm_select) { 0x1C00; } else { 0x1800; };
+      map += ((line - int64(wy)) >> 3) << 5;
+
+      let i: int64 = 0;
+      let x = 0;
+      let offset = 0;
+      let y = line % 8;
+
+      let i = wx;
+      while i < 160 {
+        if (x == 8) {
+          // New Tile
+          x = 0;
+          offset = (offset + 1) % 32;
+        }
+
+        // Tile Map
+        let tile: int16;
+        if gpu_td_select {
+          tile = int16(*(vram + map + offset));
+        } else {
+          tile = int16(int8(*(vram + map + offset))) + 256;
+        }
+
+        // Tile Data
+        // tile = 0;
+        let td_address: int16 = tile * 16 + int16(y) * 2;
+
+        // Make a bitmask for the pixel being rendered
+        let pixel_mask = 0x80 >> (x % 8);
+
+        // Check the color bits for that pixel
+        let palette_lo = if *(vram + td_address) & pixel_mask != 0 { 1; } else { 0; };
+        let palette_hi = if *(vram + td_address + 1) & pixel_mask != 0 { 1; } else { 0; };
+
+        // Combine them into a single index from 0 to 3
+        let palette_index = uint8((palette_hi << 1) | palette_lo);
+
+        // Palette
+        let color = (gpu_palette >> (palette_index * 2)) & 0x3;
+
+        // Push pixel to framebuffer
+        *(gpu_framebuffer + (int64(gpu_line) * 160) + i) = color;
+
+        x += 1;
+        i += 1;
+      }
     }
-
-    // Tile Map
-    let tile: int16;
-    if gpu_td_select {
-      tile = int16(*(vram + map + offset));
-    } else {
-      tile = int16(int8(*(vram + map + offset))) + 256;
+  } else {
+    // Window not enabled
+    // FIXME: Should we do anything special here?
+  }
+
+  // Sprites
+  if gpu_sprite_enable {
+    // Sprite attributes reside in the Sprite Attribute Table (
+    // OAM - Object Attribute Memory) at $FE00-FE9F.
+    // Each of the 40 entries consists of four bytes with the
+    // following meanings:
+    //  Byte0 - Y Position
+    //  Byte1 - X Position
+    //  Byte2 - Tile/Pattern Number
+    //  Byte3 - Attributes/Flags:
+    //    Bit7   OBJ-to-BG Priority (0=OBJ Above BG, 1=OBJ Behind BG color 1-3)
+    //           (Used for both BG and Window. BG color 0 is always behind OBJ)
+    //    Bit6   Y flip          (0=Normal, 1=Vertically mirrored)
+    //    Bit5   X flip          (0=Normal, 1=Horizontally mirrored)
+    //    Bit4   Palette number  **Non CGB Mode Only** (0=OBP0, 1=OBP1)
+    //    Bit3   Tile VRAM-Bank  **CGB Mode Only**     (0=Bank 0, 1=Bank 1)
+    //    Bit2-0 Palette number  **CGB Mode Only**     (OBP0-7)
+
+    let i = 0;
+    while i < 40 {
+      let offset = (i * 4);
+
+      let sprite_y = int16(*(oam + offset + 0)) - 16;
+      let sprite_x = int16(*(oam + offset + 1)) - 8;
+      let sprite_tile = int16(*(oam + offset + 2));
+      let sprite_flags = *(oam + offset + 3);
+
+      // Remember, we are rendering on a line-by-line basis
+      // Does this sprite intersect our current scanline?
+
+      if sprite_y <= int16(gpu_line) and (sprite_y + 8) > int16(gpu_line) {
+
+        let tile_y: int16 = int16(gpu_line) - sprite_y;
+        let td_address: int16 = sprite_tile * 16 + int16(tile_y) * 2;
+
+        // Iterate through the columns of the sprite pixels and
+        // blit them on the scanline
+
+        let x: int16 = 0;
+        while x < 8 {
+          if (sprite_x + x >= 0) and (sprite_x + x < 160) {
+            // Make a bitmask for the pixel being rendered
+            let pixel_mask = 0x80 >> ((sprite_x + x) % 8);
+
+            // Check the color bits for that pixel
+            let palette_lo = if *(vram + td_address) & pixel_mask != 0 { 1; } else { 0; };
+            let palette_hi = if *(vram + td_address + 1) & pixel_mask != 0 { 1; } else { 0; };
+
+            // Combine them into a single index from 0 to 3
+            let palette_index = uint8((palette_hi << 1) | palette_lo);
+
+            // Palette
+            let color = if testb(sprite_flags, 4) {
+              (gpu_obj0_palette >> (palette_index * 2)) & 0x3;
+            } else {
+              (gpu_obj1_palette >> (palette_index * 2)) & 0x3;
+            };
+
+            // Push pixel to framebuffer
+            *(gpu_framebuffer + (int64(gpu_line) * 160) + (sprite_x + x)) = color;
+          }
+
+          x += 1;
+        }
+      }
+
+      i += 1;
     }
-
-    // Tile Data
-    // tile = 0;
-    let td_address: int16 = tile * 16 + int16(y) * 2;
-
-    // Make a bitmask for the pixel being rendered
-    let pixel_mask = 0x80 >> (x % 8);
-
-    // Check the color bits for that pixel
-    let palette_lo = if *(vram + td_address) & pixel_mask != 0 { 1; } else { 0; };
-    let palette_hi = if *(vram + td_address + 1) & pixel_mask != 0 { 1; } else { 0; };
-
-    // Combine them into a single index from 0 to 3
-    let palette_index = uint8((palette_hi << 1) | palette_lo);
-
-    // Palette
-    let color = (gpu_palette >> (palette_index * 2)) & 0x3;
-
-    // Push pixel to framebuffer
-    *(gpu_framebuffer + (int64(gpu_line) * 160) + i) = color;
-
-    x += 1;
-    i += 1;
+  } else {
+    // Sprites not enabled
+    // FIXME: Should we do anything special here?
   }
 }

@@ -4646,6 +4789,12 @@
       bit(gpu_line == gpu_line_compare, 2) |
       uint8(gpu_mode)
     );
+  } else if address == 0xFF42 {
+    // SCY – Scroll Y (R/W)
+    return gpu_scy;
+  } else if address == 0xFF43 {
+    // SCX – Scroll X (R/W)
+    return gpu_scx;
   } else if address == 0xFF44 {
     // LY – LCDC Y-Coordinate (R)
     return gpu_line;
@@ -4655,6 +4804,18 @@
   } else if address == 0xFF47 {
     // BGP – Background Palette (R/W)
     return gpu_palette;
+  } else if address == 0xFF4A {
+    // WY – Window Y Position (R/W)
+    return gpu_wy;
+  } else if address == 0xFF4B {
+    // WX – Window X Position (R/W)
+    return gpu_wx;
+  } else if address == 0xFF48 {
+    // OBP0 - Object Palette 0 Data (R/W)
+    return gpu_obj0_palette;
+  } else if address == 0xFF49 {
+    // OBP1 - Object Palette 1 Data (R/W)
+    return gpu_obj1_palette;
   }

   printf("warn: unhandled read from GPU register: $%04X\n", address);
@@ -4690,6 +4851,33 @@
   } else if address == 0xFF47 {
     // BGP – Background Palette (R/W)
     gpu_palette = value;
+  } else if address == 0xFF4A {
+    // WY – Window Y Position (R/W)
+    gpu_wy = value;
+  } else if address == 0xFF4B {
+    // WX – Window X Position (R/W)
+    gpu_wx = value;
+  } else if address == 0xFF46 {
+    // DMA - DMA Transfer and Start Address (W)
+
+    // FIXME: This is supposed to take 160 × 4 + 4 cycles to complete
+    //        4 cycles to begin with 4 cycles per write/read (transfer)
+
+    let src = uint16(value) << 8;
+    if src >= 0x8000 and src < 0xE000 {
+      let i: uint16 = 0;
+      while i < 0xA0 {
+        mmu_write8(0xFE00 + i, mmu_read8(src + i));
+
+        i += 1;
+      }
+    }
+  } else if address == 0xFF48 {
+    // OBP0 - Object Palette 0 Data (R/W)
+    gpu_obj0_palette = value;
+  } else if address == 0xFF49 {
+    // OBP1 - Object Palette 1 Data (R/W)
+    gpu_obj1_palette = value;
   } else {
     printf("warn: unhandled write to GPU register: $%04X ($%02X)\n",
       address, value);
@@ -4703,8 +4891,8 @@
 let joy_sel_direction = false;

 // 1 - Pressed
-let joy_state_start = false;
-let joy_state_sel = false;
+let joy_state_start = true;
+let joy_state_sel = true;
 let joy_state_a = false;
 let joy_state_b = false;
 let joy_state_up = false;
@@ -4713,8 +4901,8 @@
 let joy_state_right = false;

 def joy_reset() {
-  joy_sel_button = false;
-  joy_sel_direction = false;
+  joy_sel_button = true;
+  joy_sel_direction = true;

   joy_state_start = false;
   joy_state_sel = false;


:memo:

:memo:

--- index.as
+++ index.as
@@ -22,4 +22,4 @@
 // [ ] Cast: Alias (pointer)

 // [ ] Implicit cast to type alias from unnamed _literal_ of underlying type
-// [ ] If Expression+// [ ] If Expression


:memo:

:memo:

--- index.as
+++ index.as
@@ -27,3 +27,5 @@

 // [ ] Error on duplicate method names
 // [ ] Error on method names conflicting with record member names
+// [ ] Error on impl not in same module
+// [ ] Error on impl not on user-defined-type


Gave Tilemap usePositions property to use x/y positions instead of columns/rows.

--- net/flashpunk/graphics/Tilemap.as
+++ net/flashpunk/graphics/Tilemap.as
@@ -11,6 +11,11 @@
 	 */
 	public class Tilemap extends Canvas
 	{
+		/**
+		 * If x/y positions should be used instead of columns/rows.
+		 */
+		public var usePositions:Boolean;
+
 		/**
 		 * Constructor.
 		 * @param	tileset			The source tileset image.
@@ -51,6 +56,11 @@
 		 */
 		public function setTile(column:uint, row:uint, index:uint = 0):void
 		{
+			if (usePositions)
+			{
+				column /= _tile.width;
+				row /= _tile.height;
+			}
 			index %= _setCount;
 			column %= _columns;
 			row %= _rows;
@@ -67,6 +77,11 @@
 		 */
 		public function clearTile(column:uint, row:uint):void
 		{
+			if (usePositions)
+			{
+				column /= _tile.width;
+				row /= _tile.height;
+			}
 			column %= _columns;
 			row %= _rows;
 			_tile.x = column * _tile.width;
@@ -82,6 +97,11 @@
 		 */
 		public function getTile(column:uint, row:uint):uint
 		{
+			if (usePositions)
+			{
+				column /= _tile.width;
+				row /= _tile.height;
+			}
 			return _map.getPixel(column % _columns, row % _rows);
 		}

@@ -95,11 +115,20 @@
 		 */
 		public function setRegion(column:uint, row:uint, width:uint = 1, height:uint = 1, index:uint = 0):void
 		{
+			if (usePositions)
+			{
+				column /= _tile.width;
+				row /= _tile.height;
+				width /= _tile.width;
+				height /= _tile.height;
+			}
 			column %= _columns;
 			row %= _rows;
 			var c:uint = column,
 				r:uint = column + width,
-				b:uint = row + height;
+				b:uint = row + height,
+				u:Boolean = usePositions;
+			usePositions = false;
 			while (row < b)
 			{
 				while (column < r)
@@ -110,6 +139,7 @@
 				column = c;
 				row ++;
 			}
+			usePositions = u;
 		}

 		/**
@@ -121,11 +151,20 @@
 		 */
 		public function clearRegion(column:uint, row:uint, width:uint = 1, height:uint = 1):void
 		{
+			if (usePositions)
+			{
+				column /= _tile.width;
+				row /= _tile.height;
+				width /= _tile.width;
+				height /= _tile.height;
+			}
 			column %= _columns;
 			row %= _rows;
 			var c:uint = column,
 				r:uint = column + width,
-				b:uint = row + height;
+				b:uint = row + height,
+				u:Boolean = usePositions;
+			usePositions = false;
 			while (row < b)
 			{
 				while (column < r)
@@ -136,6 +175,7 @@
 				column = c;
 				row ++;
 			}
+			usePositions = u;
 		}

 		/**


always show healthbars for both HQ and TOWERS

--- src/battlecode/client/viewer/render/DrawRobot.as
+++ src/battlecode/client/viewer/render/DrawRobot.as
@@ -304,7 +304,7 @@
         ///////////////////////////////////////////////////////

         private function drawEnergonBar():void {
-            if (!RenderConfiguration.showEnergon() && getType() != RobotType.HQ)
+            if (!RenderConfiguration.showEnergon() && !(getType() == RobotType.HQ || getType() == RobotType.TOWER))
                 return;

             var ratio:Number = energon / maxEnergon;


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260479 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/effects/effectClasses/RotateInstance.as
+++ frameworks/projects/framework/src/mx/effects/effectClasses/RotateInstance.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.effects.effectClasses
 {


FLEX-33665: Corrected the item edit coordinates to match it's renderer and not it's dataprovider.  It also seems the added whitespace in the file has been removed.

--- frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
@@ -59,13 +59,13 @@
 [ExcludeClass]

 /**
- *  The DataGridEditor contains all the logic and event handling needed to
- *  manage the life cycle of an item editor.
- *  A DataGridEditor is owned by a
+ *  The DataGridEditor contains all the logic and event handling needed to
+ *  manage the life cycle of an item editor.
+ *  A DataGridEditor is owned by a
  *  specified DataGrid. The owning DataGrid is responsible for calling
- *  initialize() to enable editing and uninitialize() when editing is no
+ *  initialize() to enable editing and uninitialize() when editing is no
  *  longer needed.
- *
+ *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 2.5
@@ -73,7 +73,7 @@
  */
 public class DataGridEditor
 {
-    include "../../core/Version.as";
+    include "../../core/Version.as";

     //--------------------------------------------------------------------------
     //
@@ -83,7 +83,7 @@

     /**
      *  Constructor
-     *
+     *
      *  @param dataGrid The owner of this editor.
      *
      *  @langversion 3.0
@@ -94,9 +94,9 @@
     public function DataGridEditor(dataGrid:DataGrid)
     {
         _dataGrid = dataGrid;
-
-    }
-
+
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Variables
@@ -107,7 +107,7 @@
      *  Timer used to cancel edits if a double click occurs.
      */
     private var doubleClickTimer:Timer;
-
+
     /**
      *  @private
      *  True if we have received double click event since the last click.
@@ -119,7 +119,7 @@
      *  True if we have received a FlexEvent.ENTER.
      */
     private var gotFlexEnterEvent:Boolean;
-
+
     /**
      *  @private
      */
@@ -130,22 +130,22 @@
      *  Position of the last item renderer that was clicked.
      */
     private var lastItemClickedPosition:Object;
-
+
     /**
      *  @private
      *  Used to make sure the mouse up is on the same item
      *  renderer as the mouse down.
      */
     private var lastItemDown:IVisualElement;
-
+
     /**
      *  @private
      *  the last editedItemPosition and the last
      *  position where editing was attempted if editing
-     *  was cancelled.
+     *  was cancelled.
      */
     private var lastEditedItemPosition:*;
-
+
     /**
      *  @private
      *  Determines if the hasFocusableChildren flags are restored when
@@ -161,7 +161,7 @@
      *  Used to restore the value of DataGrid's hasFocusableChildren.
      */
     private var saveDataGridHasFocusableChildren:Boolean;
-
+
     /**
      *  @private
      *  Used to restore the value of scroller's hasFocusableChildren.
@@ -185,32 +185,32 @@
      */
     public function get dataGrid():DataGrid
     {
-        return _dataGrid;
-    }
-
+        return _dataGrid;
+    }
+
     /**
      *  @private
      *  Convenience property to get the grid.
      */
     public function get grid():Grid
     {
-        return _dataGrid.grid;
+        return _dataGrid.grid;
     }

     //----------------------------------
     //  editedItemPosition
     //----------------------------------
-
+
     /**
      *  @private
      */
     private var _editedItemPosition:Object;
-
+
     /**
      *  The column and row index of the item renderer for the
      *  data provider item being edited, if any.
      *
-     *
This Object has two fields, columnIndex and
+     *
This Object has two fields, columnIndex and
      *  rowIndex,
      *  the zero-based column and row indexes of the item.
      *  For example: {columnIndex:2, rowIndex:3}

@@ -220,7 +220,7 @@
      *  open an item editor on the specified item renderer.

      *
      *  @default null
-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
@@ -234,7 +234,7 @@
         else
             return _editedItemPosition;
     }
-
+
     /**
      *  @private
      */
@@ -245,13 +245,13 @@
             setEditedItemPosition(null);
             return;
         }
-
+
         var newValue:Object = {rowIndex: value.rowIndex,
             columnIndex: value.columnIndex};
-
+
         setEditedItemPosition(newValue);
     }
-
+
     /**
      *  @private
      */
@@ -259,10 +259,10 @@
     {
         if (!grid.enabled || !dataGrid.editable)
             return;
-
+
         if (!grid.dataProvider || grid.dataProvider.length == 0)
             return;
-
+
         // just give focus back to the itemEditorInstance
         if (itemEditorInstance && coord &&
             itemEditorInstance is IFocusManagerComponent &&
@@ -272,57 +272,66 @@
             IFocusManagerComponent(itemEditorInstance).setFocus();
             return;
         }
-
+
         // dispose of any existing editor, saving away its data first
         if (itemEditorInstance)
         {
             if (!dataGrid.endItemEditorSession())
                 return;
         }
-
+
         // store the value
         _editedItemPosition = coord;
-
+
         // allow setting of undefined to dispose item editor instance
         if (!coord)
             return;
-
+
         var rowIndex:int = coord.rowIndex;
         var columnIndex:int = coord.columnIndex;
-
+
         dataGrid.ensureCellIsVisible(rowIndex, columnIndex);
-
+
         createItemEditor(rowIndex, columnIndex);
-
+
+
+        //If the item edit renderer is not setup abort the item editing.
+        if (_editedItemRenderer == null)
+        {
+            _editedItemPosition = null;
+            return;
+        }
+
+
         if (itemEditorInstance is IInvalidating)
             IInvalidating(itemEditorInstance).validateNow();
-
+
         var column:GridColumn = dataGrid.columns.getItemAt(columnIndex) as GridColumn;
         if (itemEditorInstance is IIMESupport)
             IIMESupport(itemEditorInstance).imeMode =
                 (column.imeMode == null) ? dataGrid.imeMode : column.imeMode;
-
+
         var fm:IFocusManager = grid.focusManager;
         if (itemEditorInstance is IFocusManagerComponent)
         {
             // Temporarily remove the FOCUS_OUT handler: if we give the editor the focus and
-            // it immediately vectors it to a non-editor descendant, like to the mobile soft
+            // it immediately vectors it to a non-editor descendant, like to the mobile soft
             // keyboard, we don't want to end the editor session.
-
-            itemEditorInstance.removeEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
+
+            itemEditorInstance.removeEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
             fm.setFocus(IFocusManagerComponent(itemEditorInstance));
-            itemEditorInstance.addEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
-        }
-
+            itemEditorInstance.addEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
+        }
+
         lastEditedItemPosition = _editedItemPosition;
-
+
         // Notify event that a new editor is starting.
         // Don't dispatch life cycle events for item renderers.
         var dataGridEvent:GridItemEditorEvent = null;
-
+
         if (column.rendererIsEditable == false)
             dataGridEvent = new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_START);
-
+
         if (dataGridEvent)
         {
             dataGridEvent.columnIndex = editedItemPosition.columnIndex;
@@ -338,17 +347,17 @@
      *  some timing issues with collection updates
      */
     private var inEndEdit:Boolean = false;
-
-    /**
-     *  A reference to the currently active instance of the item editor,
+
+    /**
+     *  A reference to the currently active instance of the item editor,
      *  if it exists.
      *
-     *
To access the item editor instance and the new item value when an
-     *  item is being edited, you use the itemEditorInstance
+     *
To access the item editor instance and the new item value when an
+     *  item is being edited, you use the itemEditorInstance
      *  property. The itemEditorInstance property
      *  is not valid until after the event listener for
      *  the itemEditBegin event executes. Therefore, you typically
-     *  only access the itemEditorInstance property from within
+     *  only access the itemEditorInstance property from within
      *  the event listener for the itemEditEnd event.

      *
      *
The DataGridColumn.itemEditor property defines the
@@ -356,20 +365,20 @@
      *  and, therefore, the data type of the item editor instance.

      *
      *
You do not set this property in MXML.

-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
     public var itemEditorInstance:IGridItemEditor;
-
-
+
+
     /**
      *  @private
      */
     private var _editedItemRenderer:IVisualElement;
-
+
     /**
      *  A reference to the item renderer
      *  in the DataGrid control whose item is currently being edited.
@@ -378,7 +387,7 @@
      *  and itemEditEnd events,
      *  you can access the current value of the item being edited
      *  using the editedItemRenderer.data property.

-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
@@ -388,17 +397,17 @@
     {
         return _editedItemRenderer;
     }
-
+
     //----------------------------------
     //  editorColumnIndex
     //----------------------------------
-
-    /**
-     *  The zero-based column index of the cell that is being edited. The
+
+    /**
+     *  The zero-based column index of the cell that is being edited. The
      *  value is -1 if no cell is being edited.
-     *
+     *
      *  @default -1
-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
@@ -408,20 +417,20 @@
     {
         if (editedItemPosition)
             return editedItemPosition.columnIndex;
-
+
         return -1;
     }
-
+
     //----------------------------------
     //  editorRowIndex
     //----------------------------------
-
-    /**
-     *  The zero-based row index of the cell that is being edited. The
+
+    /**
+     *  The zero-based row index of the cell that is being edited. The
      *  value is -1 if no cell is being edited.
-     *
+     *
      *  @default -1
-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
@@ -431,7 +440,7 @@
     {
         if (editedItemPosition)
             return editedItemPosition.rowIndex;
-
+
         return -1;
     }

@@ -440,50 +449,50 @@
     //  Methods
     //
     //--------------------------------------------------------------------------
-
+
     /**
      *  @private
      *  Called by the data grid after construction to initialize the editor. No
      *  item editors can be created until after this method is called.
-     */
+     */
     public function initialize():void
     {
         // add listeners to enable cell editing
         var grid:Grid = dataGrid.grid;
-
+
         dataGrid.addEventListener(KeyboardEvent.KEY_DOWN, dataGrid_keyboardDownHandler);
-
-        // Make sure we get first shot at mouse events before selection is changed. We use
+
+        // Make sure we get first shot at mouse events before selection is changed. We use
         // this is test if you are clicking on a selected row or not.
         grid.addEventListener(GridEvent.GRID_MOUSE_DOWN, grid_gridMouseDownHandler, false, 1000);
         grid.addEventListener(GridEvent.GRID_MOUSE_UP, grid_gridMouseUpHandler, false, 1000);
         grid.addEventListener(GridEvent.GRID_DOUBLE_CLICK, grid_gridDoubleClickHandler);
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  The method is called to disable item editing on the data grid.
-     */
+     */
     public function uninitialize():void
     {
-        // remove listeners to disable cell editing
-
+        // remove listeners to disable cell editing
+
         grid.removeEventListener(KeyboardEvent.KEY_DOWN, dataGrid_keyboardDownHandler);
         grid.removeEventListener(GridEvent.GRID_MOUSE_DOWN, grid_gridMouseDownHandler);
         grid.removeEventListener(GridEvent.GRID_MOUSE_UP, grid_gridMouseUpHandler);
         grid.removeEventListener(GridEvent.GRID_DOUBLE_CLICK, grid_gridDoubleClickHandler);
     }
-
-    /**
-     *  @private
-     *
-     *  This method closes an item editor currently open on an item renderer.
-     *  You typically only call this method from within the event listener
+
+    /**
+     *  @private
+     *
+     *  This method closes an item editor currently open on an item renderer.
+     *  You typically only call this method from within the event listener
      *  for the itemEditEnd event, after
-     *  you have already called the preventDefault() method to
+     *  you have already called the preventDefault() method to
      *  prevent the default event listener from executing.
-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
@@ -494,64 +503,64 @@
         // trace("destroyItemEditor");
         if (grid.root)
             grid.systemManager.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
-
+
         grid.systemManager.getSandboxRoot().
             removeEventListener(MouseEvent.MOUSE_DOWN, sandBoxRoot_mouseDownHandler, true);
         grid.systemManager.getSandboxRoot().
             removeEventListener(SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE, sandBoxRoot_mouseDownHandler);
         grid.systemManager.removeEventListener(Event.RESIZE, editorAncestorResizeHandler);
         dataGrid.removeEventListener(Event.RESIZE, editorAncestorResizeHandler);
-
+
         if (itemEditorInstance || editedItemRenderer)
         {
             if (itemEditorInstance)
                 itemEditorInstance.discard();
-
-            var o:IVisualElement = (itemEditorInstance ?
+
+            var o:IVisualElement = (itemEditorInstance ?
                                     itemEditorInstance : editedItemRenderer);
-
+
             o.removeEventListener(KeyboardEvent.KEY_DOWN, editor_keyDownHandler);
             o.removeEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
             o.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, editor_keyFocusChangeHandler);
             addRemoveFlexEventEnterListener(DisplayObject(o), false);
-
+
             if (grid.focusManager)
                 grid.focusManager.defaultButtonEnabled = true;
-
+
             // setfocus back to us so something on stage has focus
             dataGrid.setFocus();
-
+
             // defer focus can cause focusOutHandler to destroy the editor
             // and make itemEditorInstance null
             if (itemEditorInstance)
                 grid.removeElement(itemEditorInstance);
             else
                 grid.invalidateDisplayList();   // force the editorIndicator to be redrawn
-
+
             if (restoreFocusableChildren)
             {
                 restoreFocusableChildrenFlags();
             }
-
+
             itemEditorInstance = null;
             _editedItemRenderer = null;
             _editedItemPosition = null;
         }
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Creates the item editor for the item renderer at the
      *  editedItemPosition using the editor
      *  specified by the itemEditor property.
      *
-     *
This method sets the editor instance as the
+     *
This method sets the editor instance as the
      *  itemEditorInstance property.

      *
      *  @param rowIndex The row index in the data provider of the item to be edited.
      *  @param columnIndex The column index in the data provider of the item to be edited.
-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
@@ -562,29 +571,41 @@
         // check for bad values
         if (columnIndex >= grid.columns.length)
             return;
-
+
+
+        //Correction for the item editor positioning
+        var rendererColumnIndex:int = grid.getVisibleColumnIndices().indexOf(columnIndex);
+        var rendererRowIndex:int = grid.getVisibleRowIndices().indexOf(rowIndex);
+
+        //If the renderer row/column can't be found, cancel the item editor.
+        if (rendererColumnIndex == -1 || rendererRowIndex == -1)
+        {
+            return;
+        }
+
+
         var col:GridColumn = grid.columns.getItemAt(columnIndex) as GridColumn;
         var item:IGridItemRenderer = grid.getItemRendererAt(rowIndex, columnIndex);
-        var cellBounds:Rectangle = grid.getCellBounds(rowIndex,columnIndex);
+        var cellBounds:Rectangle = grid.getCellBounds(rendererRowIndex, rendererColumnIndex);
         var localCellOrigin:Point = cellBounds.topLeft;
-
+
         _editedItemRenderer = item;
-
+
        // Need to turn on focusable children flag so focus manager will
         // allow focus into the data grid's children.
         if (restoreFocusableChildren)
-            saveDataGridHasFocusableChildren = dataGrid.hasFocusableChildren;
+            saveDataGridHasFocusableChildren = dataGrid.hasFocusableChildren;
         dataGrid.hasFocusableChildren = true;
-
+
         if (dataGrid.scroller)
         {
             if (restoreFocusableChildren)
-                saveScrollerHasFocusableChildren = dataGrid.scroller.hasFocusableChildren;
+                saveScrollerHasFocusableChildren = dataGrid.scroller.hasFocusableChildren;
             dataGrid.scroller.hasFocusableChildren = true;
         }
-
+
         restoreFocusableChildren = true;
-
+
         if (!col.rendererIsEditable)
         {
             // First use the column's itemEditor.
@@ -596,7 +617,7 @@
                 itemEditor = dataGrid.itemEditor;
             if (!itemEditor)
                 itemEditor = GridColumn.defaultItemEditorFactory;
-
+
             if (itemEditor == GridColumn.defaultItemEditorFactory)
             {
                 // if it is the default factory, see if someone
@@ -607,7 +628,7 @@
                     itemEditor = col.itemEditor = new ClassFactory(c);
                 }
             }
-
+
             itemEditorInstance = itemEditor.newInstance();
             itemEditorInstance.owner = dataGrid;
             itemEditorInstance.rowIndex = rowIndex;
@@ -616,25 +637,25 @@

             if (itemEditorInstance is ISimpleStyleClient)
                 ISimpleStyleClient(itemEditorInstance).styleName = item;
-
+
             // Add the editor to the grid before setting the data so that
             // the editor's children will be created.
             grid.addElement(itemEditorInstance);
-
+
             itemEditorInstance.data = item.data;
-
-            // The editor will overlay the cell, covering the first pixel of the
-            // cell separators. This is done so that a cell editor with borders
+
+            // The editor will overlay the cell, covering the first pixel of the
+            // cell separators. This is done so that a cell editor with borders
             // will overlay the cell separators. It prevents the cell separators
             // from adding borders to the editor for the common case when the cell
             // separators are only 1 pixel wide.
             itemEditorInstance.width = cellBounds.width + 1;
             itemEditorInstance.height = cellBounds.height + 1;
             itemEditorInstance.setLayoutBoundsPosition(localCellOrigin.x, localCellOrigin.y);
-
+
             if (itemEditorInstance is IInvalidating)
                 IInvalidating(itemEditorInstance).validateNow();
-
+
             // Allow the user code to make any final adjustments and make the editor visible.
             itemEditorInstance.prepare();
             itemEditorInstance.visible = true;
@@ -643,29 +664,29 @@
         {
             setFocusInItemRenderer(item);
         }
-
+
         if (itemEditorInstance || editedItemRenderer)
         {
             var editor:IEventDispatcher = itemEditorInstance ? itemEditorInstance : editedItemRenderer;
-
+
             editor.addEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
-
+
             // listen for keyStrokes on the itemEditorInstance (which lets the grid supervise for ESC/ENTER)
             editor.addEventListener(KeyboardEvent.KEY_DOWN, editor_keyDownHandler);
             editor.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, editor_keyFocusChangeHandler, false, 1000);
             addRemoveFlexEventEnterListener(DisplayObject(editor), true);
-
-        }
-
+
+        }
+
         if (grid.focusManager)
             grid.focusManager.defaultButtonEnabled = false;

         // Invalidate the grid so the editor indicator will be shown.
         grid.invalidateDisplayList();
-
+
         if (grid.root)
             grid.systemManager.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
-
+
         // we disappear on any mouse down outside the editor
         grid.systemManager.getSandboxRoot().
             addEventListener(MouseEvent.MOUSE_DOWN, sandBoxRoot_mouseDownHandler, true, 0, true);
@@ -673,12 +694,12 @@
             addEventListener(SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE, sandBoxRoot_mouseDownHandler, false, 0, true);
         // we disappear if stage or our grid is resized
         grid.systemManager.addEventListener(Event.RESIZE, editorAncestorResizeHandler);
-        grid.addEventListener(Event.RESIZE, editorAncestorResizeHandler);
-    }
-
-    /**
-     *  @private
-     */
+        grid.addEventListener(Event.RESIZE, editorAncestorResizeHandler);
+    }
+
+    /**
+     *  @private
+     */
     private function setFocusInItemRenderer(item:IGridItemRenderer):void
     {
         // if the item renderer is editable then set focus
@@ -689,14 +710,14 @@
             var o:DisplayObject = item as DisplayObject;
             var firstComponent:DisplayObject = null;
             var found:Boolean = false;
-
+
             // find the first component to take focus inside the renderer.
             do
             {
                 fm.fauxFocus = o;
                 o = fm.getNextFocusManagerComponent(false) as DisplayObject;
-                if (o == item ||
-                    item is DisplayObjectContainer &&
+                if (o == item ||
+                    item is DisplayObjectContainer &&
                     DisplayObjectContainer(item).contains(o))
                 {
                     found = true;
@@ -708,9 +729,9 @@
                     firstComponent = o;
                 else if (firstComponent == o)
                     break;
-
+
             } while (o && dataGrid.contains(o));
-
+
             // if we are moving backward then put focus on the last
             // item in the renderer instead of the first.
             if (found && wasLastEventMovingBackward())
@@ -723,23 +744,23 @@
                     lastItem = o;
                     o = fm.getNextFocusManagerComponent(false) as DisplayObject;
                 } while (o && DisplayObjectContainer(item).contains(o));
-
+
                 o = lastItem;
             }
-
+
             fm.fauxFocus = null;
-
+
             if (found)
             {
                 fm.setFocus(IFocusManagerComponent(o));
-
+
                 // Since we may have gotton here with the F2 key show the focus
                 // indicator to make it obvious which control has focus.
                 fm.showFocus();
             }
         }
     }
-
+
     /**
      *  @private
      */
@@ -753,51 +774,51 @@
             {
                 return true;
             }
-
+
             // Last event was Shift+TAB
-            if (lastEvent.type == KeyboardEvent.KEY_DOWN &&
+            if (lastEvent.type == KeyboardEvent.KEY_DOWN &&
                 KeyboardEvent(lastEvent).keyCode == Keyboard.TAB &&
                 KeyboardEvent(lastEvent).shiftKey)
             {
                 return true;
             }
         }
-
+
         return false;
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Start editing a cell for a specified row and column index.
-     *
+     *
      *  Dispatches a GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING
-     *   event.
-     *
+     *   event.
+     *
      *  @param rowIndex The zero-based row index of the cell to edit.
-     *
+     *
      *  @param columnIndex The zero-based column index of the cell to edit.
      */
     public function startItemEditorSession(rowIndex:int, columnIndex:int):Boolean
     {
-
+
         // validate row and column index
         if (!isValidCellPosition(rowIndex, columnIndex))
             return false;
-
+
         dataGrid.addEventListener(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING,
                                   dataGrid_gridItemEditorSessionStartingHandler,
                                   false, EventPriority.DEFAULT_HANDLER);
-
+
         var column:GridColumn = grid.columns.getItemAt(columnIndex) as GridColumn;
-
+
         if (!column || !column.visible)
             return false;
-
+
         // The START_GRID_ITEM_EDITOR_SESSION event is cancelable
         var dataGridEvent:GridItemEditorEvent = new GridItemEditorEvent(
-                                                        GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING,
-                                                        false, true);
+                                                        GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING,
+                                                        false, true);
         dataGridEvent.rowIndex = Math.min(rowIndex, grid.dataProvider.length - 1);
         dataGridEvent.columnIndex = Math.min(columnIndex, grid.columns.length - 1);
         dataGridEvent.column = column;
@@ -809,43 +830,43 @@
             dataGrid_gridItemEditorSessionStartingHandler(dataGridEvent);   // start editor session without the option to cancel
             editorStarted = true;
         }
-        else
-        {
-            editorStarted = dataGrid.dispatchEvent(dataGridEvent);
-        }
-
-        if (editorStarted)
+        else
+        {
+            editorStarted = dataGrid.dispatchEvent(dataGridEvent);
+        }
+
+        if (editorStarted)
         {
             lastEditedItemPosition = { columnIndex: columnIndex, rowIndex: rowIndex };
-
+
             dataGrid.grid.caretRowIndex = rowIndex;
             dataGrid.grid.caretColumnIndex = columnIndex;
         }
-
+
         restoreFocusableChildren = true;
         dataGrid.removeEventListener(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING,
                                      dataGrid_gridItemEditorSessionStartingHandler);
-
+
         return editorStarted;
     }
-
+
     /**
      *  Closes the currently active editor and optionally saves the editor's value
      *  by calling the item editor's save() method.  If the cancel parameter is true,
      *  then the editor's cancel() method is called instead.
-     *
-     *  @param cancel if true then the data in the editor is discarded,
+     *
+     *  @param cancel if true then the data in the editor is discarded,
      *  otherwise it's saved.
-     *
+     *
      *  @return true if the data in the editor was saved, false otherwise.
-     *
+     *
      *  @see spark.components.IGridItemEditor
-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 2.0
      *  @productversion Flex 4.5
-     */
+     */
     public function endItemEditorSession(cancel:Boolean = false):Boolean
     {
         if (cancel)
@@ -858,10 +879,10 @@
             return endEdit();
         }
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Close the item editor without saving the data.
      */
     mx_internal function cancelEdit():Boolean
@@ -885,14 +906,14 @@
             destroyItemEditor();
         }

-        return true;
-
-    }
-
-
-    /**
-     *  @private
-     *
+        return true;
+
+    }
+
+
+    /**
+     *  @private
+     *
      *  Notify event that the editor session is cancelled.
      *  This event cannot be cancelled.
      */
@@ -900,19 +921,19 @@
     {
         var dataGridEvent:GridItemEditorEvent =
             new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_CANCEL);
-
+
         dataGridEvent.columnIndex = editedItemPosition.columnIndex;
         dataGridEvent.column = itemEditorInstance.column;
         dataGridEvent.rowIndex = editedItemPosition.rowIndex;
         dataGrid.dispatchEvent(dataGridEvent);
     }
-
-    /**
-     *  @private
-     *
-     *  When the user finished editing an item, this method is called to close
+
+    /**
+     *  @private
+     *
+     *  When the user finished editing an item, this method is called to close
      *  the editor and save the data.
-     *
+     *
      */
     private function endEdit():Boolean
     {
@@ -924,13 +945,13 @@
             inEndEdit = false;
             return true;
         }
-
+
         // this happens if the renderer is removed asynchronously ususally with FDS
         if (!itemEditorInstance)
             return false;
-
+
         inEndEdit = true;
-
+
         var itemPosition:Object = editedItemPosition;
         if (!saveItemEditorSession())
         {
@@ -938,14 +959,14 @@
             // If it can then dispatch a cancel event.
             if (itemEditorInstance.cancel())
                 dispatchCancelEvent();
-
+
             inEndEdit = false;
             return false;
         }
-
+
         var dataGridEvent:GridItemEditorEvent =
             new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_SAVE);
-
+
         // GRID_ITEM_EDITOR_SESSION_SAVE events are NOT cancelable
         dataGridEvent.columnIndex = itemPosition.columnIndex;
         dataGridEvent.column = dataGrid.columns.getItemAt(itemPosition.columnIndex) as GridColumn;
@@ -953,69 +974,69 @@
         dataGrid.dispatchEvent(dataGridEvent);

         inEndEdit = false;
-
+
         return true;
     }
-
-    /**
-     *  @private
-     *  Save the editor session. The developer can still cancel out so the
+
+    /**
+     *  @private
+     *  Save the editor session. The developer can still cancel out so the
      *  data may not be saved.
-     *
+     *
      *  @return true if the data is saved, false otherwise.
      */
     private function saveItemEditorSession():Boolean
     {
         var dataSaved:Boolean = false;
-
+
         if (itemEditorInstance)
         {
             dataSaved = itemEditorInstance.save();
-
+
             if (dataSaved)
                 destroyItemEditor();
         }
-
+
         return dataSaved;
     }
-
-    /**
-     *  @private
-     *  Start an editor session in the next editable cell.
+
+    /**
+     *  @private
+     *  Start an editor session in the next editable cell.
      *
      *  @param rowIndex zero-based row index to start search from, inclusive.
-     *  @param columnIndex zero-based column index to start search from, not inclusive.
+     *  @param columnIndex zero-based column index to start search from, not inclusive.
      *  @param backward - if true move backward column by column and then row by row.
      *  If false, then move forward column by column, row by row.
-     *
+     *
      *  @return true if an editor was opened, false otherwise.
-     *
+     *
      */
     private function openEditorInNextEditableCell(rowIndex:int, columnIndex:int, backward:Boolean):Boolean
     {
         var nextCell:Point = new Point(rowIndex, columnIndex);
         var openedEditor:Boolean = false;
-
+
         do
         {
             nextCell = getNextEditableCell(nextCell.x, nextCell.y, backward);
-
+
             if (nextCell)
-                openedEditor = dataGrid.startItemEditorSession(nextCell.x, nextCell.y);
+                openedEditor = dataGrid.startItemEditorSession(nextCell.x, nextCell.y);
         } while (nextCell && !openedEditor);
-
+
         return openedEditor;
     }
-
-    /**
-     *  @private
-     *  Find the next editable cell.
-     *
+
+    /**
+     *  @private
+     *  Find the next editable cell.
+     *
      *  @param rowIndex zero-based row index to start search from, inclusive.
-     *  @param columnIndex zero-based column index to start search from, not inclusive.
+     *  @param columnIndex zero-based column index to start search from, not inclusive.
      *  @param backward - if true move backward column by column and then row by row.
      *  If false, then move forward column by column, row by row.
-     *
+     *
      *  @return If an editable cell was found then return a Point with the x property
      *  containing the rowIndex and the y property containing the column index. If no
      *  editable cell was found then null is returned.
@@ -1032,7 +1053,7 @@
             var nextColumn:int = columnIndex + increment;
             if (nextColumn >= 0 && nextColumn < dataGrid.columns.length)
             {
-                columnIndex += increment;
+                columnIndex += increment;
             }
             else
             {
@@ -1045,29 +1066,29 @@
                     return null;
             }
         } while (!canEditColumn(columnIndex));
-
+
         return new Point(rowIndex, columnIndex);
     }
-
-
-    /**
-     *  @private
-     *
+
+
+    /**
+     *  @private
+     *
      *  @param columnIndex
-     *
+     *
      *  @return true if the column can be edited, false otherwise.
-     */
+     */
     private function canEditColumn(columnIndex:int):Boolean
     {
-        var column:GridColumn = grid.columns.getItemAt(columnIndex) as GridColumn;
-        return (dataGrid.editable &&
+        var column:GridColumn = grid.columns.getItemAt(columnIndex) as GridColumn;
+        return (dataGrid.editable &&
                 column.editable &&
                 column.visible);
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Test if the cell was selected at the last selection snapshot.
      */
     private function wasCellPreviouslySelected(rowIndex:int, columnIndex:int):Boolean
@@ -1076,7 +1097,7 @@
             return dataGrid.selectionContainsIndex(rowIndex);
         else if (dataGrid.isCellSelectionMode())
             return dataGrid.selectionContainsCell(rowIndex, columnIndex);
-
+
         return false;
     }

@@ -1084,25 +1105,25 @@
      *  @private
      *
      *  Determine if a cell position is valid.
-     *
-     *  @return true if valid, false otherwise.
+     *
+     *  @return true if valid, false otherwise.
      */
     private function isValidCellPosition(rowIndex:int, cellIndex:int):Boolean
     {
         if (rowIndex >= 0 && rowIndex < dataGrid.dataProvider.length &&
             cellIndex >= 0 && cellIndex < dataGrid.columns.length)
-        {
+        {
             return true;
         }
-
+
         return false;
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Add a FlexEvent.ENTER listener to all child IVisualElements.
-     *
+     *
      *  @param element add listener to element and its children.
      *  @param addListener if true add a listener, otherwise remove a listener.
      */
@@ -1112,7 +1133,7 @@
             element.addEventListener(FlexEvent.ENTER, editor_enterHandler);
         else
             element.removeEventListener(FlexEvent.ENTER, editor_enterHandler);
-
+
         if (element is DisplayObjectContainer)
         {
             var container:DisplayObjectContainer = DisplayObjectContainer(element);
@@ -1120,7 +1141,7 @@
             for (var i:int = 0; i < n; i++)
             {
                 var child:DisplayObject = container.getChildAt(i);
-
+
                 if (child is DisplayObjectContainer)
                 {
                     addRemoveFlexEventEnterListener(child, addListener);
@@ -1134,17 +1155,17 @@
                 }
             }
         }
-
-    }
-
+
+    }
+
     /**
      *  @private
      *  Check if a mouse click occured within the editor.
-     *
+     *
      *  @param event A MouseEvent or a SandboxMouseEvent
-     *
+     *
      *  @return true if the target is within the editor, false otherwise.
-     */
+     */
     private function editorOwnsClick(event:Event):Boolean
     {
         if (event is MouseEvent)
@@ -1156,98 +1177,98 @@

         return false;
     }
-
+
     /**
      *  @private
      *  Check if a child is contained within the editor using the owns() method.
      *  The editor can be either editedItemRenderer or itemEditorInstance.
-     *
+     *
      *  @param child child to test.
      *  @return true if the child is owned by the editor.
-     */
+     */
     private function editorOwns(child:IUIComponent):Boolean
     {
         return (itemEditorInstance &&
-                (itemEditorInstance == child ||
+                (itemEditorInstance == child ||
                     IUIComponent(itemEditorInstance).owns(DisplayObject(child))) ||
             (editedItemRenderer &&
-                (editedItemRenderer == child ||
+                (editedItemRenderer == child ||
                      IUIComponent(editedItemRenderer).owns(DisplayObject(child)))));
     }
-
+
     /**
      *  @private
      *  The IUIComponent related to a given object. If the object is not a IUIComponent
-     *  then work up the display list until we find a IUIComponent.
+     *  then work up the display list until we find a IUIComponent.
      *  @param  displayObject The object to get a IUIComponet from.
-     *  @return returns the displayObject if it is a display object or its
-     *  closest parent that is a display object.
-     */
+     *  @return returns the displayObject if it is a display object or its
+     *  closest parent that is a display object.
+     */
     private function getIUIComponent(displayObject:DisplayObject):IUIComponent
     {
         if (displayObject is IUIComponent)
             return IUIComponent(displayObject);
-
+
         var current:DisplayObject = displayObject.parent;
         while (current)
         {
             if (current is IUIComponent)
                 return IUIComponent(current);
-
+
             current = current.parent;
         }
-
+
         return null;
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Restore the focusable children flags.
-     */
+     */
     private function restoreFocusableChildrenFlags():void
     {
         dataGrid.hasFocusableChildren = saveDataGridHasFocusableChildren;
-
+
         if (dataGrid.scroller)
             dataGrid.scroller.hasFocusableChildren = saveScrollerHasFocusableChildren;

     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Get the effective mouse event that activates an editor.
      *  If the column has a setting, then use it. Otherwise use the setting on
      *  the data grid.
-     */
+     */
     private function getEditorActivationMouseEvent(columnIndex:int):String
     {
         var editorActivationMouseEvent:String = null;
-
+
         if (columnIndex >= 0 && columnIndex < dataGrid.columns.length)
         {
-            var column:GridColumn = grid.columns.getItemAt(columnIndex) as GridColumn;
-            editorActivationMouseEvent = column.editorActivationMouseEvent;
-        }
-
+            var column:GridColumn = grid.columns.getItemAt(columnIndex) as GridColumn;
+            editorActivationMouseEvent = column.editorActivationMouseEvent;
+        }
+
         if (!editorActivationMouseEvent)
             editorActivationMouseEvent = dataGrid.editorActivationMouseEvent;
-
+
         return editorActivationMouseEvent;
     }
-
+
     //--------------------------------------------------------------------------
     //
     //  Event handlers
     //
     //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Default handler for the startItemEditorSession event.
-     *
+     *
      */
     private function dataGrid_gridItemEditorSessionStartingHandler(event:GridItemEditorEvent):void
     {
@@ -1259,55 +1280,55 @@
         else if (!itemEditorInstance)
         {
             _editedItemPosition = null;
-
+
             // return focus to the grid w/o selecting an item
             dataGrid.setFocus();
         }
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Handle the F2 key to start editing a cell.
      */
     private function dataGrid_keyboardDownHandler(event:KeyboardEvent):void
     {
         if (!dataGrid.editable || dataGrid.selectionMode == GridSelectionMode.NONE)
             return;
-
+
         if (event.isDefaultPrevented())
             return;
-
+
         lastEvent = event;
-
+
         if (event.keyCode == dataGrid.editKey)
         {
             // ignore F2 if we are already editing a cell or the column is not
             // editable
             if (itemEditorInstance)
                 return;
-
-            // Edit the last column edited. If no last column then try to
+
+            // Edit the last column edited. If no last column then try to
             // edit the first column.
             var nextCell:Point = null;
             if (dataGrid.isRowSelectionMode())
             {
                 var lastColumn:int = lastEditedItemPosition ? lastEditedItemPosition.columnIndex : 0;
-                openEditorInNextEditableCell(dataGrid.grid.caretRowIndex,
+                openEditorInNextEditableCell(dataGrid.grid.caretRowIndex,
                                                         lastColumn - 1,
                                                         false);
                 return;
             }
             else if (canEditColumn(grid.caretColumnIndex))
             {
-                dataGrid.startItemEditorSession(grid.caretRowIndex, grid.caretColumnIndex);
-            }
-        }
-    }
-
-    /**
-     *  @private
-     *
+                dataGrid.startItemEditorSession(grid.caretRowIndex, grid.caretColumnIndex);
+            }
+        }
+    }
+
+    /**
+     *  @private
+     *
      */
     private function grid_gridMouseDownHandler(event:GridEvent):void
     {
@@ -1321,24 +1342,24 @@

         if (!isValidCellPosition(event.rowIndex, event.columnIndex))
             return;
-
+
         lastEvent = event;
-
+
         const rowIndex:int = event.rowIndex;
         const columnIndex:int = event.columnIndex;
-
+
         //trace("grid_gridMouseDownHandler: (rowIndex, columnIndex) = (" + rowIndex + "," + columnIndex + ")");
-
+
         // item editor handling
         var r:IGridItemRenderer = event.itemRenderer;
-
+
         lastItemDown = null;
-
+
         // if selection is being modified with shift or ctrl keys then
         // don't start up an editor session.
         if (event.shiftKey || event.ctrlKey)
             return;
-
+
         // if an editor is already up, close it without starting a new editor.
         if (itemEditorInstance)
         {
@@ -1350,68 +1371,68 @@
             }
             return;
         }
-
+
         var editorActivationMouseEvent:String = getEditorActivationMouseEvent(columnIndex);
-        if (editorActivationMouseEvent != GridItemEditorActivationMouseEvent.SINGLE_CLICK &&
+        if (editorActivationMouseEvent != GridItemEditorActivationMouseEvent.SINGLE_CLICK &&
             editorActivationMouseEvent != GridItemEditorActivationMouseEvent.SINGLE_CLICK_ON_SELECTED_CELL)
         {
             return;     // not allowed to start editor on a single click
         }
-
-        // Don't open and editor if the click was not on a previously selected
-        // cell, unless that cell is an item renderer. We don't want to stop
+
+        // Don't open and editor if the click was not on a previously selected
+        // cell, unless that cell is an item renderer. We don't want to stop
         // the item renderer from getting focus so start an edit session.
         const column:GridColumn = dataGrid.columns.getItemAt(columnIndex) as GridColumn;
-        if (r &&
-            (column.rendererIsEditable ||
-             (wasCellPreviouslySelected(rowIndex, columnIndex) &&
+        if (r &&
+            (column.rendererIsEditable ||
+             (wasCellPreviouslySelected(rowIndex, columnIndex) &&
                  editorActivationMouseEvent == GridItemEditorActivationMouseEvent.SINGLE_CLICK_ON_SELECTED_CELL) ||
              editorActivationMouseEvent == GridItemEditorActivationMouseEvent.SINGLE_CLICK))
         {
-            //trace("cell was previously selected: (" + rowIndex + "," + columnIndex + ")");
+            //trace("cell was previously selected: (" + rowIndex + "," + columnIndex + ")");
             lastItemDown = r;
         }
-
-    }
-
-    /**
-     *  @private
-     *
+
+    }
+
+    /**
+     *  @private
+     *
      *  If clicked on a the same cell as mouse down then start editing the cell.
      */
     private function grid_gridMouseUpHandler(event:GridEvent):void
     {
         //trace("grid_gridMouseUpHandler");
-
+
         if (!dataGrid.editable)
             return;

         if (!isValidCellPosition(event.rowIndex, event.columnIndex))
             return;
-
+
         lastEvent = event;
-
+
         const eventRowIndex:int = event.rowIndex;
         const eventColumnIndex:int = event.columnIndex;
-
+
         // Only start an edit if the row is the only selected row.
         // Only start editing when one row is selected.
         if (dataGrid.selectionLength != 1)
             return;
-
+
         const rowIndex:int = eventRowIndex;
         var columnIndex:int = eventColumnIndex;
-
+
         var editorActivationMouseEvent:String = getEditorActivationMouseEvent(columnIndex);
-        if (editorActivationMouseEvent != GridItemEditorActivationMouseEvent.SINGLE_CLICK &&
+        if (editorActivationMouseEvent != GridItemEditorActivationMouseEvent.SINGLE_CLICK &&
             editorActivationMouseEvent != GridItemEditorActivationMouseEvent.SINGLE_CLICK_ON_SELECTED_CELL)
         {
             return;     // not allowed to start editor on a single click
         }
-
+
         var r:IVisualElement = event.itemRenderer;
-        //trace("grid_gridMouseUpHandler: itemRenderer = " + event.itemRenderer);
-        if (r && r != editedItemRenderer &&
+        //trace("grid_gridMouseUpHandler: itemRenderer = " + event.itemRenderer);
+        if (r && r != editedItemRenderer &&
             lastItemDown && lastItemDown == r)
         {
             if (columnIndex >= 0)
@@ -1424,81 +1445,81 @@
                         if (rowIndex == lastItemClickedPosition.rowIndex &&
                             columnIndex == lastItemClickedPosition.columnIndex)
                         {
-                            // Clicked on the same item again and we
+                            // Clicked on the same item again and we
                             // already have a timer. Wait on the existing timer.
                             lastItemDown == null;
                             return;
                         }
-                        else
+                        else
                         {
                             // Clicked on a different item. Stop the timer and start a new one
                             doubleClickTimer.stop();
                             doubleClickTimer = null;
                         }
                     }
-
+
                     lastItemClickedPosition = { columnIndex: columnIndex, rowIndex: rowIndex};
-
+
                     // If double click is not enabled or we want a double click to open an
                     // editor, then open the editor directly now. Otherwise start a timer
                     // and wait to see if a double click comes in that will cancel the edit.
-                    if (dataGrid.editOnDoubleClick ||
+                    if (dataGrid.editOnDoubleClick ||
                         InteractiveObject(lastItemDown).doubleClickEnabled == false)
                     {
                         // we don't need to wait on the time since editing double click is ok.
                         dataGrid.startItemEditorSession(rowIndex, columnIndex);
                     }
-                    else
+                    else
                     {
                         doubleClickTimer = new Timer(dataGrid.doubleClickTime, 1);
                         doubleClickTimer.addEventListener(TimerEvent.TIMER, doubleClickTimerHandler);
-                        doubleClickTimer.start();
+                        doubleClickTimer.start();
                     }
                 }
             }
         }
-
-        lastItemDown = null;
-    }
-
-    /**
-     *  @private
-     *
+
+        lastItemDown = null;
+    }
+
+    /**
+     *  @private
+     *
      *  If clicked on a the same cell as mouse down then start editing the cell.
      */
     private function grid_gridDoubleClickHandler(event:GridEvent):void
     {
         //trace("grid_gridDoubleClickHandler: got double click");
-
+
         if (!dataGrid.editable)
             return;
-
+
         if (!isValidCellPosition(event.rowIndex, event.columnIndex))
             return;
-
+
         lastEvent = event;
-
+
         gotDoubleClickEvent = true;
-
+
         // If double-click editing is enabled then start up and editor session.
         var editorActivationMouseEvent:String = getEditorActivationMouseEvent(event.columnIndex);
         if (editorActivationMouseEvent == GridItemEditorActivationMouseEvent.DOUBLE_CLICK)
             dataGrid.startItemEditorSession(event.rowIndex, event.columnIndex);
-
-    }
-
-    /**
-     *  @private
-     *
+
+    }
+
+    /**
+     *  @private
+     *
      *  Timer for double click events.
      */
     private function doubleClickTimerHandler(event:TimerEvent):void
     {
         //trace("doubleClickTimerHandler");
-
+
         doubleClickTimer.removeEventListener(TimerEvent.TIMER, doubleClickTimerHandler);
         doubleClickTimer = null;
-
+
         if (!gotDoubleClickEvent)
         {
             dataGrid.startItemEditorSession(lastItemClickedPosition.rowIndex, lastItemClickedPosition.columnIndex);
@@ -1506,8 +1527,8 @@

         gotDoubleClickEvent = false;
     }
-
-
+
+
     /**
      *  @private
      */
@@ -1517,7 +1538,7 @@
         // focus back to the dataGrid.
         if (itemEditorInstance || editedItemRenderer)
         {
-            // If we can't save the data, say, because the data was invalid,
+            // If we can't save the data, say, because the data was invalid,
             // then cancel the save.
             if (!dataGrid.endItemEditorSession())
             {
@@ -1526,7 +1547,7 @@
             dataGrid.setFocus();
         }
     }
-
+
     /**
      *  @private
      *  Closes the itemEditorInstance if the focus is outside of the data grid.
@@ -1534,31 +1555,31 @@
     private function editor_focusOutHandler(event:FocusEvent):void
     {
         //trace("editor_focusOutHandler " + event.relatedObject);
-
-        // If the focus goes to a component that is owned by the editor,
+
+        // If the focus goes to a component that is owned by the editor,
         // then don't end the editor session.
         if (event.relatedObject)
         {
             var component:IUIComponent = getIUIComponent(event.relatedObject);
             if (component && editorOwns(component))
-                return;
-        }
-
+                return;
+        }
+
         // ignore textfields losing focus on mousedowns
         if (!event.relatedObject)
             return;
-
+
         if (itemEditorInstance || editedItemRenderer)
         {
-            // If we can't save the data, say, because the data was invalid,
+            // If we can't save the data, say, because the data was invalid,
             // then cancel the save.
             if (!dataGrid.endItemEditorSession())
             {
                 dataGrid.endItemEditorSession(true);
             }
-        }
-    }
-
+        }
+    }
+
     /**
      *  @private
      *  Special case for TextArea control. See editor_keyDownHandler.
@@ -1571,10 +1592,10 @@
         if (event is FlexEvent)
             gotFlexEnterEvent = true;
     }
-
-    /**
-     *  @private
-     *
+
+    /**
+     *  @private
+     *
      *  Handle keys on the editor to stop the editing session.
      */
     private function editor_keyDownHandler(event:KeyboardEvent):void
@@ -1582,9 +1603,9 @@
         //trace("keyboard event = " + event);
         if (event.isDefaultPrevented())
         {
-            // Special case the ENTER key since TextArea cancels the ENTER when it
+            // Special case the ENTER key since TextArea cancels the ENTER when it
             // doesn't use it but instead it dispatches an FlexEvent.ENTER.
-            // The problem is the ENTER event does not have the control and
+            // The problem is the ENTER event does not have the control and
             // shift key flags we need.
             if (!(event.charCode == Keyboard.ENTER && gotFlexEnterEvent))
             {
@@ -1592,9 +1613,9 @@
                 return;
             }
         }
-
+
         gotFlexEnterEvent = false;
-
+
         // ESC just kills the editor, no new data
         if (event.keyCode == Keyboard.ESCAPE)
         {
@@ -1608,13 +1629,13 @@
         {
             if (!_editedItemPosition)
                 return;
-
-            // If the ctrl or ctrl and shift keys are down then set a flag to
-            // avoid changing the focusable children flag becaue
+
+            // If the ctrl or ctrl and shift keys are down then set a flag to
+            // avoid changing the focusable children flag becaue
             // need to be redone when starting up the editor again.
             if (event.ctrlKey || (event.ctrlKey && event.shiftKey))
                 restoreFocusableChildren = false;
-
+
             // Enter closes the editor.
             // The 229 keyCode is for IME compatability. When entering an IME expression,
             // the enter key is down, but the keyCode is 229 instead of the enter key code.
@@ -1623,17 +1644,17 @@
             {
                 if (grid.focusManager)
                     grid.focusManager.defaultButtonEnabled = false;
-
+
                 if (event.ctrlKey || (event.ctrlKey && event.shiftKey))
                 {
                     var lastRow:int = lastEditedItemPosition ? lastEditedItemPosition.rowIndex : 0;
                     var lastColumn:int = lastEditedItemPosition ? lastEditedItemPosition.columnIndex : 0;
-
+
                     if (event.shiftKey)
                         lastRow -= 1;
                     else
                         lastRow += 1;
-
+
                     // If we have a valid next row, then start another editor.
                     if (lastRow >= 0 && lastRow < dataGrid.dataProvider.length)
                     {
@@ -1644,17 +1665,17 @@
                             restoreFocusableChildren = true;
                             restoreFocusableChildrenFlags();
                         }
-                    }
+                    }
                 }
             }
         }
-
-        // Prevent the DataGrid from processing any keystrokes that were
-        // received by the editor. We don't cancel the keystokes here
+
+        // Prevent the DataGrid from processing any keystrokes that were
+        // received by the editor. We don't cancel the keystokes here
         // because on AIR that cancels text input into the text field.
         event.stopPropagation();
     }
-
+
     /**
      *  @private
      *  handle focus changes generated from keyboard keys.
@@ -1666,24 +1687,24 @@
         // next cell.
         //trace("editor_editor_keyFocusChangeHandler");
         lastEvent = event;
-
+
         if (itemEditorInstance || editedItemRenderer)
         {
             if (event.isDefaultPrevented())
                 return;
-
+
             var nextObject:IFocusManagerComponent = grid.focusManager.getNextFocusManagerComponent(event.shiftKey);
             if (nextObject == itemEditorInstance ||
                 (itemEditorInstance && !DisplayObjectContainer(itemEditorInstance).contains(DisplayObject(nextObject))) ||
-                (!itemEditorInstance &&
+                (!itemEditorInstance &&
                     (nextObject == editedItemRenderer ||
                     (editedItemRenderer && !DisplayObjectContainer(editedItemRenderer).contains(DisplayObject(nextObject))))))
             {
                 event.preventDefault();
-
+
                 restoreFocusableChildren = false;
                 dataGrid.endItemEditorSession();
-
+
                 if (!openEditorInNextEditableCell(lastEditedItemPosition.rowIndex,
                                                   lastEditedItemPosition.columnIndex,
                                                   event.shiftKey))
@@ -1691,7 +1712,7 @@
                     // We didn't start an editor so restore the data grid's
                     // focusable chidlren flags.
                     restoreFocusableChildren = true;
-                    restoreFocusableChildrenFlags();
+                    restoreFocusableChildrenFlags();
                 }
             }
         }
@@ -1702,14 +1723,14 @@
      */
     private function editorAncestorResizeHandler(event:Event):void
     {
-        // If we can't save the data, say, because the data was invalid,
+        // If we can't save the data, say, because the data was invalid,
         // then cancel the save.
         if (!dataGrid.endItemEditorSession())
         {
             dataGrid.endItemEditorSession(true);
         }
     }
-
+
     /**
      *  @private
      */
@@ -1719,27 +1740,27 @@
         {
             return;
         }
-
+
         // If clicked on the scroll bars then keep the editor up
-        if (dataGrid.scroller &&
+        if (dataGrid.scroller &&
             dataGrid.scroller.contains(DisplayObject(event.target)) &&
             !grid.contains(DisplayObject(event.target)))
         {
             return;
         }
-
-        // If we can't save the data, say, because the data was invalid,
+
+        // If we can't save the data, say, because the data was invalid,
         // then cancel the save.
         if (!dataGrid.endItemEditorSession())
         {
             dataGrid.endItemEditorSession(true);
         }
-
-        // If the item editor was destroyed then set focus back to the grid
-        // so grid logic will deal if focus doesn't end up somewhere else.
+
+        // If the item editor was destroyed then set focus back to the grid
+        // so grid logic will deal if focus doesn't end up somewhere else.
         if (!itemEditorInstance)
             dataGrid.setFocus();
     }
-
+
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18608
Author:   dloverin@adobe.com
Date:     2010-11-16T12:47:31.739520Z

Log Message:
-----------
Grid item editor bug fixes.

http://bugs.adobe.com/jira/browse/SDK-28556
Stop an infinite loop in DataGridEditor. Added some code in getNextEditableCell() to stop when the row is negative. Also modified the logic to restore the data grid’s focusable items flags.

https://bugs.adobe.com/jira/browse/SDK-28476
Don’t edit a column that is not visible.

https://bugs.adobe.com/jira/browse/SDK-28349
When clicking outside of a cell editor, cancel the editor if the data cannot be saved (most likely because it is invalid).

https://bugs.adobe.com/jira/browse/SDK-28327
Call event.stopPropagation() on mouseMove events over the item editor to keep the datagrid from showing hover effects.

A few other small changes:

DataGridEditor:
     Call the DataGrid’s startItemEditorSession() instead of the local startItemEditorSession().

DefaultItemEditor:
     Tweaked the work around for TextArea growing past its max size. Changed the magic number from three pixels to two pixels.

QE notes: None.
Doc notes: None.
Bugs: SDK-28566, SDK-28476, SDK-28349, SDK-28327
Reviewer: Hans
Tests run: checkintests
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DefaultGridItemEditor.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1281542 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
@@ -315,8 +315,9 @@
     {
         // Clean up
         clearErrorStringFromContainer(this);
-        removeEventListener(MouseEvent.MOUSE_UP, mouseUpDownHandler);
-        removeEventListener(MouseEvent.MOUSE_DOWN, mouseUpDownHandler);
+        removeEventListener(MouseEvent.MOUSE_UP, mouseUpDownMoveHandler);
+        removeEventListener(MouseEvent.MOUSE_DOWN, mouseUpDownMoveHandler);
+        removeEventListener(MouseEvent.MOUSE_MOVE, mouseUpDownMoveHandler);
     }

     /**
@@ -325,8 +326,11 @@
     public function prepare():void
     {
         // Stop the item renderer from seeing mouse clicks on the editor.
-        addEventListener(MouseEvent.MOUSE_UP, mouseUpDownHandler);
-        addEventListener(MouseEvent.MOUSE_DOWN, mouseUpDownHandler);
+        addEventListener(MouseEvent.MOUSE_UP, mouseUpDownMoveHandler);
+        addEventListener(MouseEvent.MOUSE_DOWN, mouseUpDownMoveHandler);
+
+        // Stop hover highlighting on rows underneath the editor.
+        addEventListener(MouseEvent.MOUSE_MOVE, mouseUpDownMoveHandler);
     }

     /**
@@ -515,9 +519,12 @@
      *   @private
      *   Stop the item renderer from getting the click.
      */
-    private function mouseUpDownHandler(event:MouseEvent):void
-    {
-        event.preventDefault();
+    private function mouseUpDownMoveHandler(event:MouseEvent):void
+    {
+        if (event.cancelable)
+            event.preventDefault();
+        else
+            event.stopPropagation();
     }
 }
 }


comments for todo

comments for todo

--- capabilities/ktu/utils/align/capabilities/VizAlignCapabilities.as
+++ capabilities/ktu/utils/align/capabilities/VizAlignCapabilities.as
@@ -35,6 +35,11 @@
 	 * 	TO DO:
 	 *
 	 * 		put code generator in
+	 * 			how do I display the grouping? it will get kinda long... maybe?
+	 * 			examples:
+	 * 				VizAlign.align ([green, red], [new VizAlignment(AlignMethods.left, stage)], true, true, true);
+	 * 				VizAlign.align ([ [green, red], [yellow, purple, cyan] ], [new VizAlignment(AlignMethods.scaleToFit, stage), new VizAlignment(AlignMethods.center, stage)], true, true, true);
+	 * 				??? VizAlign.align ([ [green, red], [yellow, purple, cyan] ], [{type: AlignMethods.scaleToFit, tcs:stage}, {type:AlignMethods.center, tcs:stage}], true, true, true);
 	 *
 	 *		++ Groups, Shapes
 	 *


even better fix for FLEX-34454

even better fix for FLEX-34454

--- frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as
+++ frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as
@@ -1047,7 +1047,6 @@
             // don't remove blur unless this is the first modal window to put up the blur
             if (blurOwners[sm] != null && blurOwners[sm] == o.owner)
             {
-                blurOwners[sm] = null;
                 // Blur effect on the application
                 const blurAmount:Number = popUpStyleClient.getStyle("modalTransparencyBlur");

@@ -1279,6 +1278,8 @@
     				awm.numModalWindows--;
                 }

+                if (blurOwners[sm] == o.owner)
+                    blurOwners[sm] = null;
                 popupInfo.splice(i, 1);
                 break;
             }
@@ -1337,7 +1338,6 @@
 			if (obj.parent)	// Mustella can already take you off stage
 				obj.parent.removeChild(obj);
 		}
-
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1262198 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/resources/IResourceModule.as
+++ frameworks/projects/framework/src/mx/resources/IResourceModule.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.resources
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 22686
Author:   smgilson@adobe.com
Date:     2011-09-22T16:55:28.367453Z

Log Message:
-----------
Add ASDoc examples for View and ViewNavigator.as

QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run: checkintests
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewNavigatorExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewNavigatorExampleHomeView.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewNavigatorExampleSearch.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/asdoc/en_US/spark/components/examples/ViewExampleHomeView.mxml</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1264193 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mobilecomponents/src/spark/components/View.as
+++ frameworks/projects/mobilecomponents/src/spark/components/View.as
@@ -175,6 +175,9 @@
  *  </pre>
  *
  *  @see ViewNavigator
+ *
+ *  @includeExample examples/ViewExample.mxml -noswf
+ *  @includeExample examples/ViewExampleHomeView.mxml -noswf
  *
  *  @langversion 3.0
  *  @playerversion AIR 2.5


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1267549 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/containers/ApplicationControlBar.as
+++ frameworks/projects/mx/src/mx/containers/ApplicationControlBar.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2004-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.containers
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1283946 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/effects/animation/Keyframe.as
+++ frameworks/projects/spark/src/spark/effects/animation/Keyframe.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

 package spark.effects.animation
 {


fix fragment reloading issue with live playlist introduced by recent changes

--- src/org/mangui/HLS/streaming/FragmentLoader.as
+++ src/org/mangui/HLS/streaming/FragmentLoader.as
@@ -514,10 +514,11 @@
             if (_pts_loading_in_progress == false) {
                 if (last_seqnum == _levels[_level].end_seqnum) {
                     // if last segment was last fragment of VOD playlist, notify last fragment loaded event, and return
-                    if (_hls.type == HLSTypes.VOD)
+                    if (_hls.type == HLSTypes.VOD) {
                         _hls.dispatchEvent(new HLSEvent(HLSEvent.LAST_VOD_FRAGMENT_LOADED));
-                    // stop loading timer as well, as no other fragments can be loaded
-                    _timer.stop();
+                        // stop loading timer as well, as no other fragments can be loaded
+                        _timer.stop();
+                    }
                     return 1;
                 } else {
                     // if previous segment is not the last one, increment it to get new seqnum


fix regression introduced by #342

fix regression introduced by #342

--- src/org/mangui/hls/loader/FragmentLoader.as
+++ src/org/mangui/hls/loader/FragmentLoader.as
@@ -147,6 +147,7 @@
                     break;
                 // nothing to load until level is retrieved
                 case LOADING_WAITING_LEVEL_UPDATE:
+                    break;
                 // loading already in progress
                 case LOADING_IN_PROGRESS:
                     // monitor fragment load progress after half of expected fragment duration,to stabilize bitrate
@@ -162,7 +163,9 @@
                         var fragLoadedDelay : Number =(expected-loaded)/loadRate;
                         var fragLevel0LoadedDelay : Number = fragDuration*_levels[0].bitrate/(8*loadRate); //bps/Bps
                         var bufferLen : Number = _hls.stream.bufferLength;
-
+                        // CONFIG::LOGGING {
+                        //     Log.info("bufferLen/fragDuration/fragLoadedDelay/fragLevel0LoadedDelay:" + bufferLen.toFixed(1) + "/" + fragDuration.toFixed(1) + "/" + fragLoadedDelay.toFixed(1) + "/" + fragLevel0LoadedDelay.toFixed(1));
+                        // }
                         /* if we have less than 2 frag duration in buffer and if frag loaded delay is greater than buffer len
                           ... and also bigger than duration needed to load fragment at next level ...*/
                         if(bufferLen < 2*fragDuration && fragLoadedDelay > bufferLen && fragLoadedDelay > fragLevel0LoadedDelay) {


Removed trace statement

Removed trace statement

--- test/laml/layout/FlowLayoutTest.as
+++ test/laml/layout/FlowLayoutTest.as
@@ -169,7 +169,6 @@
 			child = box.getChildAt(2);
 			assertRectangle(child, 5, 165, 200, 105);

-			trace("-------------");
 			// Change the size of a child
 			child.width = 300;
 			child.height = 200;
@@ -206,7 +205,6 @@
 			assertRectangle(child, 5, 165, 200, 25);
 		}

-
 		public function testNestedChildrenCallCount():void {
 			var xml:XML = <VBox id="root" xmlns="laml.display" x="200" y="10" padding="5" backgroundColor="#FFCC00">
 				<ComponentMock id="child1" width="100%" height="80" backgroundColor="#FF0000" />