flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject [2/2] git commit: [flex-sdk] [refs/heads/develop] - use _columns instead of columns to save splicing columns array
Date Wed, 29 May 2013 06:03:47 GMT
use _columns instead of columns to save splicing columns array


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/4290ab14
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/4290ab14
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/4290ab14

Branch: refs/heads/develop
Commit: 4290ab1429522df3a0b7e3e889957d063170b898
Parents: b67ea01
Author: Justin Mclean <jmclean@apache.org>
Authored: Wed May 29 16:03:22 2013 +1000
Committer: Justin Mclean <jmclean@apache.org>
Committed: Wed May 29 16:03:22 2013 +1000

----------------------------------------------------------------------
 .../src/mx/controls/AdvancedDataGridBaseEx.as      |  116 +++++++-------
 1 files changed, 58 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4290ab14/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as b/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
index 52a0116..458f307 100644
--- a/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
+++ b/frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
@@ -1962,7 +1962,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
 
         var o:EdgeMetrics = viewMetrics;
 
-        var n:int = columns.length;
+        var n:int = _columns.length;
         if (n == 0)
         {
             measuredWidth = DEFAULT_MEASURED_WIDTH;
@@ -1974,11 +1974,11 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         var columnMinWidths:Number = 0;
         for (var i:int = 0; i < n; i++)
         {
-            if (columns[i].visible)
+            if (_columns[i].visible)
             {
-                columnWidths += columns[i].preferredWidth;
+                columnWidths += _columns[i].preferredWidth;
                 if (isNaN(_minColumnWidth))
-                    columnMinWidths += columns[i].minWidth;
+                    columnMinWidths += _columns[i].minWidth;
             }
         }
 
@@ -2244,7 +2244,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         else if (shiftKey && code == Keyboard.PAGE_DOWN)
         {
             // We don't want to exceed the max scroll value or the last column's index
-            maxPosition = Math.min(maxHorizontalScrollPosition, columns.length-1);
+            maxPosition = Math.min(maxHorizontalScrollPosition, _columns.length-1);
             newHorizontalScrollPosition = Math.min(
                 horizontalScrollPosition + (visibleColumns.length - lockedColumnCount)
                 , maxPosition);
@@ -2365,11 +2365,11 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
     {
         var w:Number = 0;
 
-        var n:int = columns ? columns.length : 0;
+        var n:int = _columns ? _columns.length : 0;
         for (var i:int = 0; i < n; i++)
         {
-            if (columns[i].visible)
-                w += columns[i].width;
+            if (_columns[i].visible)
+                w += _columns[i].width;
         }
 
         return w;
@@ -2391,7 +2391,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         var item:IListItemRenderer;
         var c:AdvancedDataGridColumn;
 
-        var n:int = columns.length;
+        var n:int = _columns.length;
         var i:int;
         var j:int = 0;
 
@@ -2407,12 +2407,12 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         for (i = 0; i < n; i++)
         {
             // skip any columns that are visible
-            if (skipVisible && j < visibleColumns.length && visibleColumns[j].colNum
== columns[i].colNum)
+            if (skipVisible && j < visibleColumns.length && visibleColumns[j].colNum
== _columns[i].colNum)
             {
                 j++;
                 continue;
             }
-            c = columns[i];
+            c = _columns[i];
 
             if (!c.visible)
                 continue;
@@ -2878,10 +2878,10 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
     protected function initializeHeaderInfo(columns:Array):Array
     {
         var newArray:Array = [];
-        var n:int = columns.length;
+        var n:int = _columns.length;
         for(var i:int = 0; i < n; i++)
         {
-            var headerInfo:AdvancedDataGridHeaderInfo = new AdvancedDataGridHeaderInfo(columns[i],null,i,
0) ;
+            var headerInfo:AdvancedDataGridHeaderInfo = new AdvancedDataGridHeaderInfo(_columns[i],null,i,
0) ;
             newArray.push(headerInfo);
         }
         return newArray;
@@ -2948,7 +2948,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
      */
     mx_internal function measureHeightOfItemsUptoMaxHeight(index:int = -1, count:int = 0,
maxHeight:Number = -1):Number
     {
-        if (!columns.length)
+        if (!_columns.length)
             return rowHeight * count;
 
         var h:Number = 0;
@@ -3014,10 +3014,10 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
             {
                 data = (lockedCount > 0) ? collectionIterator.current : iterator.current;
                 ch = 0;
-                n = columns.length;
+                n = _columns.length;
                 for (j = 0; j < n; j++)
                 {
-                    c = columns[j];
+                    c = _columns[j];
 
                     if (!c.visible)
                         continue;
@@ -3085,7 +3085,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
      */
     protected function calculateHeaderHeight():Number
     {
-        if (!columns.length)
+        if (!_columns.length)
             return rowHeight;
 
         var item:IListItemRenderer;
@@ -3104,7 +3104,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         if (headerVisible)
         {
             ch = 0;
-            n = columns.length;
+            n = _columns.length;
 
             if (_headerWordWrapPresent)
             {
@@ -3114,7 +3114,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
 
             for (j = 0; j < n; j++)
             {
-                c = columns[j];
+                c = _columns[j];
 
                 if (!c.visible)
                     continue;
@@ -3264,10 +3264,10 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
             {
                 data = iterator.current;
                 ch = 0;
-                n = columns.length;
+                n = _columns.length;
                 for (j = 0; j < n; j++)
                 {
-                    c = columns[j];
+                    c = _columns[j];
 
                     if (!c.visible)
                         continue;
@@ -3441,7 +3441,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
     private function generateColumnsPendingResultHandler(data:Object, info:ListBaseSeekPending):void
     {
         // generate cols if we haven't successfully generated them
-        if (columns.length == 0)
+        if (_columns.length == 0)
             generateCols();
         seekPendingResultHandler(data, info);
     }
@@ -3489,7 +3489,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         var col:AdvancedDataGridColumn;
         var cw:Number;
 
-        if (columns.length == 0)
+        if (_columns.length == 0)
         {
             visibleColumns = [];
             return;
@@ -3504,10 +3504,10 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
 
             if (minColumnWidthInvalid)
             {
-                n = columns.length;
+                n = _columns.length;
                 for (i = 0; i < n; i++)
                 {
-                    columns[i].minWidth = minColumnWidth;
+                    _columns[i].minWidth = minColumnWidth;
                 }
                 minColumnWidthInvalid = false;
             }
@@ -3749,22 +3749,22 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         // that someone can set width in AS
         if (!visibleColumns || visibleColumns.length == 0)
         {
-            columns[col].setWidth(w);
-            columns[col].preferredWidth = w;
+            _columns[col].setWidth(w);
+            _columns[col].preferredWidth = w;
             return;
         }
 
-        if (w < columns[col].minWidth)
-            w = columns[col].minWidth;
+        if (w < _columns[col].minWidth)
+            w = _columns[col].minWidth;
 
         // hScrollBar is present
         if (_horizontalScrollPolicy == ScrollPolicy.ON ||
             _horizontalScrollPolicy == ScrollPolicy.AUTO)
         {
             // adjust the column's width
-            columns[col].setWidth(w);
-            columns[col].explicitWidth = w;
-            columns[col].preferredWidth = w;
+            _columns[col].setWidth(w);
+            _columns[col].explicitWidth = w;
+            _columns[col].preferredWidth = w;
             columnsInvalid = true;
         }
         else
@@ -5591,8 +5591,8 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
                     var lockedWidth:Number = 0;
                     if(lockedColumnCount > 0)
                     {
-                        var lastLockedInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(columns[lockedColumnCount-1]);
-                        lockedWidth = lastLockedInfo.headerItem.x + columns[lockedColumnCount
- 1].width;
+                        var lastLockedInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(_columns[lockedColumnCount-1]);
+                        lockedWidth = lastLockedInfo.headerItem.x + _columns[lockedColumnCount
- 1].width;
                     }
                     else
                         lockedWidth = 0;
@@ -6064,7 +6064,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
                                     columnNumber:int,
                                     collection:ICollectionView):void
     {
-        var column:AdvancedDataGridColumn = columns[columnNumber];
+        var column:AdvancedDataGridColumn = _columns[columnNumber];
 
         if (!column.sortable)
             return;
@@ -6135,7 +6135,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
                                     columnNumber:int,
                                     collection:ICollectionView):void
     {
-        var column:AdvancedDataGridColumn = columns[columnNumber];
+        var column:AdvancedDataGridColumn = _columns[columnNumber];
 
         if (!collection || !collection.sort || !collection.sort.fields
                 || !collection.sort.fields.length)
@@ -6170,7 +6170,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
     {
         if (collection.sort)
         {
-            var column:AdvancedDataGridColumn = columns[columnNumber];
+            var column:AdvancedDataGridColumn = _columns[columnNumber];
             
             collection.sort.fields[findSortField(columnName)]["descending"]
                 = ! collection.sort.fields[findSortField(columnName)]["descending"];
@@ -6319,7 +6319,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
 			var obj:Object = itemRenderer;
             if (isNaN(explicitRowHeight))
             {
-                if (iterator && columns.length > 0)
+                if (iterator && _columns.length > 0)
                 {
                     if (!measuringObjects)
                         measuringObjects = new Dictionary(false);
@@ -6336,10 +6336,10 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
                     var item:IListItemRenderer;
                     var c:AdvancedDataGridColumn;
                     var ch:Number = 0;
-                    var n:int = columns.length;
+                    var n:int = _columns.length;
                     for (var i:int = 0; i < n; i++)
                     {
-                        c = columns[i];
+                        c = _columns[i];
 
                         if (!c.visible)
                             continue;
@@ -6387,7 +6387,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
             if (columnIndex == -1)
                 columnIndex = visibleColumns[0].colNum;
 
-            selectedHeaderInfo = getHeaderInfo(columns[columnIndex]);
+            selectedHeaderInfo = getHeaderInfo(_columns[columnIndex]);
             headerIndex = columnIndex;
             selectColumnHeader(headerIndex);
         }
@@ -6683,7 +6683,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
             }
 
             var newAbsoluteColumnIndex:int = displayToAbsoluteColumnIndex(newDisplayColumnIndex);
-            if (newAbsoluteColumnIndex < 0 || newAbsoluteColumnIndex > columns.length-1)
+            if (newAbsoluteColumnIndex < 0 || newAbsoluteColumnIndex > _columns.length-1)
                 return -1;
 
             if (scroll)
@@ -7005,8 +7005,8 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
                                 var lockedWidth:Number = 0;
                                 if(lockedColumnCount > 0)
                                 {
-                                    var lastLockedInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(columns[lockedColumnCount-1]);
-                                    lockedWidth = lastLockedInfo.headerItem.x + columns[lockedColumnCount
- 1].width;
+                                    var lastLockedInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(_columns[lockedColumnCount-1]);
+                                    lockedWidth = lastLockedInfo.headerItem.x + _columns[lockedColumnCount
- 1].width;
                                 }
                                 else
                                     lockedWidth = 0;
@@ -7146,8 +7146,8 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
                                 var lockedWidth:Number = 0;
                                 if(lockedColumnCount > 0)
                                 {
-                                    var lastLockedInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(columns[lockedColumnCount-1]);
-                                    lockedWidth = lastLockedInfo.headerItem.x + columns[lockedColumnCount
- 1].width;
+                                    var lastLockedInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(_columns[lockedColumnCount-1]);
+                                    lockedWidth = lastLockedInfo.headerItem.x + _columns[lockedColumnCount
- 1].width;
                                 }
                                 else
                                 {
@@ -7525,7 +7525,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         if (isKeyPressed && headerIndex != -1)
         {
             isKeyPressed = false;
-            selectedHeaderInfo = getHeaderInfo(columns[headerIndex]);
+            selectedHeaderInfo = getHeaderInfo(_columns[headerIndex]);
             selectColumnHeader(headerIndex);
         }
     }
@@ -7814,7 +7814,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         else if (event.charCode == Keyboard.ENTER && event.keyCode != 229)
         {
             // multiline editors can take the enter key.
-            if (columns[_editedItemPosition.columnIndex].editorUsesEnterKey)
+            if (_columns[_editedItemPosition.columnIndex].editorUsesEnterKey)
                 return;
 
             // Enter edits the item, moves down a row
@@ -7922,7 +7922,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
             // if rendererIsEditor, don't apply the data as the data may have already changed
in some way.
             // This can happen if clicking on a checkbox rendererIsEditor as the checkbox
will try to change
             // its value as we try to stuff in an old value here.
-            if (!columns[event.columnIndex].rendererIsEditor)
+            if (!_columns[event.columnIndex].rendererIsEditor)
                 itemEditorInstance.data = editedItemRenderer.data;
 
             if (itemEditorInstance is IInvalidating)
@@ -7930,7 +7930,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
 
             if (itemEditorInstance is IIMESupport)
                 IIMESupport(itemEditorInstance).imeMode =
-                    (columns[event.columnIndex].imeMode == null) ? _imeMode : columns[event.columnIndex].imeMode;
+                    (_columns[event.columnIndex].imeMode == null) ? _imeMode : _columns[event.columnIndex].imeMode;
 
             var fm:IFocusManager = focusManager;
             // trace("setting focus to item editor");
@@ -8092,12 +8092,12 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         var sortFields:Array;
         var sort:ISort;
 
-        if (!sortableColumns || !columns[columnNumber].sortable)
+        if (!sortableColumns || !_columns[columnNumber].sortable)
             return;
 
         //In case there is no dataField we will use the unique column uid to identify if
the column is sorted
         if (columnName == null)
-            columnName = itemToUID(columns[columnNumber]);
+            columnName = itemToUID(_columns[columnNumber]);
 
         // If normal click for single column sort
         // or
@@ -8159,7 +8159,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
         // to that column header.
         if (headerIndex != -1)
         {
-            selectedHeaderInfo = getHeaderInfo(columns[event.columnIndex]);
+            selectedHeaderInfo = getHeaderInfo(_columns[event.columnIndex]);
             headerIndex = event.columnIndex;
             selectColumnHeader(headerIndex);
         }
@@ -8208,7 +8208,7 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
             {
                 unselectColumnHeader(headerIndex);
                 
-                selectedHeaderInfo = getHeaderInfo(columns[newColumnIndex]);
+                selectedHeaderInfo = getHeaderInfo(_columns[newColumnIndex]);
                 headerIndex = newColumnIndex;
                 selectColumnHeader(headerIndex);
             }
@@ -8219,24 +8219,24 @@ public class AdvancedDataGridBaseEx extends AdvancedDataGridBase implements
IIME
             if (newColumnIndex != -1)
             {
                 unselectColumnHeader(headerIndex);
-                selectedHeaderInfo = getHeaderInfo(columns[newColumnIndex]);
+                selectedHeaderInfo = getHeaderInfo(_columns[newColumnIndex]);
                 headerIndex = newColumnIndex;
                 selectColumnHeader(headerIndex);
             }
         }
         else if (keyCode == Keyboard.SPACE)
         {
-            if (sortableColumns && columns[headerIndex].sortable)
+            if (sortableColumns && _columns[headerIndex].sortable)
             {
                 isKeyPressed = true;
-                selectedHeaderInfo = getHeaderInfo(columns[headerIndex]);
+                selectedHeaderInfo = getHeaderInfo(_columns[headerIndex]);
                 selectColumnHeader(headerIndex);
     
                 var advancedDataGridEvent:AdvancedDataGridEvent =
                     new AdvancedDataGridEvent(AdvancedDataGridEvent.SORT, false, true);
     
                 advancedDataGridEvent.columnIndex     = headerIndex;
-                advancedDataGridEvent.dataField       = columns[headerIndex].dataField;
+                advancedDataGridEvent.dataField       = _columns[headerIndex].dataField;
                 advancedDataGridEvent.multiColumnSort      = event.ctrlKey;
                 advancedDataGridEvent.removeColumnFromSort = event.shiftKey;
     


Mime
View raw message