コード例 #1
0
ファイル: CellMapBase.php プロジェクト: donquixote/cellbrush
 /**
  * @param CellMatrix $matrix
  * @param \Donquixote\Cellbrush\Axis\Axis $rows
  * @param \Donquixote\Cellbrush\Axis\Axis $columns
  */
 public function modifyMatrix(CellMatrix $matrix, Axis $rows, Axis $columns)
 {
     // Fill the basic cells.
     foreach ($this->getCells() as $rowName => $rowCells) {
         $rowRange = $rows->subtreeRange($rowName);
         foreach ($rowCells as $colName => $cell) {
             $colRange = $columns->subtreeRange($colName);
             $brush = new RangedBrush($rowRange, $colRange);
             $matrix->addCell($brush, $cell);
         }
     }
 }
コード例 #2
0
 /**
  * @return CellMatrix
  *
  * @see BuildContainer::$CellMatrix
  */
 protected function get_CellMatrix()
 {
     $matrix = new CellMatrix($this->nRows, $this->MatrixEmptyRow);
     foreach ($this->NamedCells as $rowName => $rowCells) {
         $rowRange = $this->rows->subtreeRange($rowName);
         foreach ($rowCells as $colName => $cell) {
             $colRange = $this->columns->subtreeRange($colName);
             $brush = new RangedBrush($rowRange, $colRange);
             $matrix->addCell($brush, $cell);
         }
     }
     foreach ($this->OpenEndCells as $rowName => $rowCells) {
         $rowRange = $this->rows->subtreeRange($rowName);
         foreach ($rowCells as $colName => $cTrue) {
             $colRange = $this->columns->subtreeRange($colName);
             $brush = new RangedBrush($rowRange, $colRange);
             $matrix->brushCellGrowRight($brush);
         }
     }
     return $matrix;
 }