Sydney

Class FlexibleSizingFunction

Object
   |
   +--Function
         |
         +--FlexibleSizingFunction

class FlexibleSizingFunction
extends Function

Defined in flexible_sizing_function.js


Constructor Summary
FlexibleSizingFunction (<float> hMargin, <float> vMargin, <float> hGutter, <float> vGutter)
            Creates a sizing function suitable for use with a GridLayout.
 
Method Summary
 Object getColumnWidth(<int> column)
           Returns the width of the given column.
 Object getDefaultColumnWidth()
          
 Object getDefaultRowHeight()
          
 Object getRowHeight(<int> row)
           Returns the height of the given row.
 boolean isColumnDefault(<int> column)
           Returns true if and only if column column has no specified width.
 boolean isRowDefault(<int> row)
           Returns true if and only if row row has no specified height.
 void setBottomMargin(<float> bMargin)
           Sets the bottom margin to bMargin pixels.
 void setColumnWidth(<int> column, <float> width, <float> weight, <boolean> usePixels)
           Sets the width of column column to width.
 void setDefaultColumnWidth(<float> width, <boolean> canGrow, <boolean> usePixels)
           Sets the default column width to width.
 void setDefaultRowHeight(<float> height, <boolean> canGrow, <boolean> usePixels)
           Sets the default row height to height.
 void setHorizontalMargin(<float> hMargin)
           Sets both the left and right margins to hMargin pixels.
 void setLeftMargin(<float> lMargin)
           Sets the left margin to lMargin pixels.
 void setRightMargin(<float> rMargin)
           Sets the right margin to rMargin pixels.
 void setRowHeight(<int> row, <float> height, <float> weight, <boolean> usePixels)
           Sets the height of row row to height.
 void setTopMargin(<float> tMargin)
           Sets the top margin to tMargin pixels.
 void setVerticalMargin(<float> vMargin)
           Sets both the top and bottom margins to vMargin pixels.
<static> boolean computeSizes(<int> cells, <int> availSize, <float> pixelsPerEm, <Array> sizeCache, <Array> edgeCache, <Hash> cellDimensions, <float> reservedSize, <float> reservedWeight, <Object> defaultSize, <float> marginOne, <float> marginTwo, <float> gutter)
           Computes either the horizontal or vertical dimensions of a grid's cells.

Constructor Detail

FlexibleSizingFunction

function FlexibleSizingFunction(<float> hMargin, <float> vMargin, <float> hGutter, <float> vGutter)
Method Detail

getColumnWidth

Object getColumnWidth(<int> column)

getDefaultColumnWidth

Object getDefaultColumnWidth()

getDefaultRowHeight

Object getDefaultRowHeight()

getRowHeight

Object getRowHeight(<int> row)

isColumnDefault

boolean isColumnDefault(<int> column)

isRowDefault

boolean isRowDefault(<int> row)

setBottomMargin

void setBottomMargin(<float> bMargin)

setColumnWidth

void setColumnWidth(<int> column, <float> width, <float> weight, <boolean> usePixels)

setDefaultColumnWidth

void setDefaultColumnWidth(<float> width, <boolean> canGrow, <boolean> usePixels)

setDefaultRowHeight

void setDefaultRowHeight(<float> height, <boolean> canGrow, <boolean> usePixels)

setHorizontalMargin

void setHorizontalMargin(<float> hMargin)
    Sets both the left and right margins to hMargin pixels.
    Parameters:
      hMargin - the new width of the horizontal margins

setLeftMargin

void setLeftMargin(<float> lMargin)
    Sets the left margin to lMargin pixels.
    Parameters:
      lMargin - the new width of the left margin

setRightMargin

void setRightMargin(<float> rMargin)
    Sets the right margin to rMargin pixels.
    Parameters:
      rMargin - the new width of the right margin

setRowHeight

void setRowHeight(<int> row, <float> height, <float> weight, <boolean> usePixels)
    Sets the height of row row to height. To set the given row back to the default settings, pass only row. height is a number of ems unless usePixels is true. If weight is zero then the given row will not grow (it will always be exactly height units tall). If weight is non-zero, then the given row will always be at least height units tall but will grow larger if there is extra space. The sum of the row weights must be between zero and one.
    Parameters:
      row - the index of row to affect
      height - the height of the row as a float
      weight - (Optional) - a number between zero and one indicating what portion of extra space should be allocated to this row. Defaults to zero.
      usePixels - (Optional) a boolean indicating whether height is a number of ems or pixels. Defaults to false.

setTopMargin

void setTopMargin(<float> tMargin)
    Sets the top margin to tMargin pixels.
    Parameters:
      tMargin - the new height of the top margin

setVerticalMargin

void setVerticalMargin(<float> vMargin)
    Sets both the top and bottom margins to vMargin pixels.
    Parameters:
      vMargin - the new height of the vertical margins

computeSizes

<static> boolean computeSizes(<int> cells, <int> availSize, <float> pixelsPerEm, <Array> sizeCache, <Array> edgeCache, <Hash> cellDimensions, <float> reservedSize, <float> reservedWeight, <Object> defaultSize, <float> marginOne, <float> marginTwo, <float> gutter)
    Computes either the horizontal or vertical dimensions of a grid's cells.
    Parameters:
      cells - the number of cells in this direction
      availSize - the number of pixels available in this dimension
      pixelsPerEm - the number of pixels per em
      sizeCache - a reference to an array in which cell sizes will be stored
      edgeCache - a reference to an array in which cell edge co-ordinates will be stored
      cellDimensions - a Hash from cell number to dimension spec for each cell with predefined dimensions
      reservedSize - the total number of pixels reserved by cells with predefined dimensions
      reservedWeight - the total fraction of ‘extra space’ reserved by cells with predefined dimensions
      defaultSize - a dimension spec to apply to cells with no predefined dimensions
      marginOne - the number of pixels to use for either the top or left margin
      marginTwo - the number of pixels to use for either the bottom or right margin
      gutter - the number of pixels of gutter to apply
    Returns:
      true if sizeCache or edgeCache changed and false otherwise

Sydney

SourceForge.net Logo