- Timestamp:
- 08/11/10 12:55:02 (22 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
ssme/trunk/flex/Common/src/com/kh/ssme/components/GridCanvas.as
r4037 r4040 39 39 * Number of columns 40 40 */ 41 private var columns_:Array; 41 private var columns_:Array; 42 42 public function get columns():Array{ 43 43 return columns_; … … 49 49 } 50 50 } 51 public var columnsPosition:Array; 52 51 53 52 54 /** … … 63 65 } 64 66 } 67 public var rowsPosition:Array; 65 68 66 69 … … 183 186 184 187 // inner border 185 var inBorderThickness:int; 188 var inBorderThickness:int, xTempPos:int, yTempPos:int; 189 columnsPosition = []; 190 rowsPosition = []; 186 191 for (var i:int = 0; i<inBorderThicknesses.length; i++){ 187 if (inBorderThicknesses[i] > 0)188 {192 // for each border level 193 if (inBorderThicknesses[i] > 0){ 189 194 inBorderThickness = inBorderThicknesses[i]; 190 195 graphics.lineStyle(inBorderThickness,inBorderColors[i],inBorderAlphas[i], … … 193 198 CapsStyle.NONE); 194 199 200 var tempColumnsPos:Array = [], tempRowsPos:Array = []; 195 201 if(columns_.length>=i){ 196 202 var xstep:Number = (unscaledWidth - (2*outBorderThickness+leftHorizontalMargin+rightHorizontalMargin) - (columns_[i] - 1)*inBorderThickness) / columns_[i]; 203 // left border position 197 204 var x:Number = outBorderThickness+leftHorizontalMargin; 198 for ( var col:int = 1; col < columns_[i]; col++ ) 199 { 205 xTempPos = x - inBorderThickness*0.5; 206 tempColumnsPos.push( xTempPos ); 207 // draw column lines 208 for ( var col:int = 1; col < columns_[i]; col++ ){ 200 209 x += (xstep + inBorderThickness); 201 graphics.moveTo(x - inBorderThickness*0.5, outBorderThickness + verticalMargin);// + inBorderThickness*0.5); 202 graphics.lineTo(x - inBorderThickness*0.5, unscaledHeight - outBorderThickness - verticalMargin);// - inBorderThickness*0.5); 210 xTempPos = x - inBorderThickness*0.5; 211 graphics.moveTo(xTempPos, outBorderThickness + verticalMargin); 212 graphics.lineTo(xTempPos, unscaledHeight - outBorderThickness - verticalMargin); 213 tempColumnsPos.push( xTempPos ); 203 214 } 215 // right border position 216 x += (xstep + inBorderThickness); 217 xTempPos = x - inBorderThickness*0.5; 218 tempColumnsPos.push( xTempPos ); 204 219 } 205 220 if(rows_.length>=i){ 206 221 var ystep:Number = (unscaledHeight - (2*outBorderThickness+2*verticalMargin) - (rows_[i] - 1)*inBorderThickness) / rows_[i]; 222 // top border position 207 223 var y:Number = outBorderThickness+verticalMargin; 208 for (var row:int = 1; row < rows_[i]; row++ ) 209 { 224 yTempPos = y - inBorderThickness*0.5; 225 tempRowsPos.push( yTempPos ); 226 // draw rows lines 227 for (var row:int = 1; row < rows_[i]; row++ ){ 210 228 y += (ystep + inBorderThickness); 211 graphics.moveTo(outBorderThickness + leftHorizontalMargin,// + inBorderThickness*0.5,212 y - inBorderThickness*0.5);213 graphics.lineTo(unscaledWidth - outBorderThickness - rightHorizontalMargin, // - inBorderThickness*0.5,214 y - inBorderThickness*0.5);229 yTempPos = y - inBorderThickness*0.5; 230 graphics.moveTo(outBorderThickness + leftHorizontalMargin, yTempPos); 231 graphics.lineTo(unscaledWidth - outBorderThickness - rightHorizontalMargin, yTempPos); 232 tempRowsPos.push( yTempPos ); 215 233 } 234 // bottom border position 235 y += (ystep + inBorderThickness); 236 yTempPos = y - inBorderThickness*0.5; 237 tempRowsPos.push( yTempPos ); 216 238 } 217 239 columnsPosition.push( tempColumnsPos ); 240 rowsPosition.push( tempRowsPos ); 218 241 } 219 242 } 220 243 221 222 223 244 } 224 245
