ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Style_Fill Class Reference
+ Inheritance diagram for PHPExcel_Style_Fill:
+ Collaboration diagram for PHPExcel_Style_Fill:

Public Member Functions

 __construct ($isSupervisor=false)
 Create a new PHPExcel_Style_Fill.
 bindParent ($parent)
 Bind parent.
 getIsSupervisor ()
 Is this a supervisor or a real style component?
 getSharedComponent ()
 Get the shared style component for the currently active cell in currently active sheet.
 getActiveSheet ()
 Get the currently active sheet.
 getXSelectedCells ()
 Get the currently active cell coordinate in currently active sheet.
 getXActiveCell ()
 Get the currently active cell coordinate in currently active sheet.
 getStyleArray ($array)
 Build style array from subcomponents.
 applyFromArray ($pStyles=null)
 Apply styles from array.
 getFillType ()
 Get Fill Type.
 setFillType ($pValue=PHPExcel_Style_Fill::FILL_NONE)
 Set Fill Type.
 getRotation ()
 Get Rotation.
 setRotation ($pValue=0)
 Set Rotation.
 getStartColor ()
 Get Start Color.
 setStartColor (PHPExcel_Style_Color $pValue=null)
 Set Start Color.
 getEndColor ()
 Get End Color.
 setEndColor (PHPExcel_Style_Color $pValue=null)
 Set End Color.
 getHashCode ()
 Get hash code.
 getHashIndex ()
 Get hash index.
 setHashIndex ($value)
 Set hash index.
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.

Data Fields

const FILL_NONE = 'none'
const FILL_SOLID = 'solid'
const FILL_GRADIENT_LINEAR = 'linear'
const FILL_GRADIENT_PATH = 'path'
const FILL_PATTERN_DARKDOWN = 'darkDown'
const FILL_PATTERN_DARKGRAY = 'darkGray'
const FILL_PATTERN_DARKGRID = 'darkGrid'
const FILL_PATTERN_DARKHORIZONTAL = 'darkHorizontal'
const FILL_PATTERN_DARKTRELLIS = 'darkTrellis'
const FILL_PATTERN_DARKUP = 'darkUp'
const FILL_PATTERN_DARKVERTICAL = 'darkVertical'
const FILL_PATTERN_GRAY0625 = 'gray0625'
const FILL_PATTERN_GRAY125 = 'gray125'
const FILL_PATTERN_LIGHTDOWN = 'lightDown'
const FILL_PATTERN_LIGHTGRAY = 'lightGray'
const FILL_PATTERN_LIGHTGRID = 'lightGrid'
const FILL_PATTERN_LIGHTHORIZONTAL = 'lightHorizontal'
const FILL_PATTERN_LIGHTTRELLIS = 'lightTrellis'
const FILL_PATTERN_LIGHTUP = 'lightUp'
const FILL_PATTERN_LIGHTVERTICAL = 'lightVertical'
const FILL_PATTERN_MEDIUMGRAY = 'mediumGray'

Private Attributes

 $_fillType
 $_rotation
 $_startColor
 $_endColor
 $_parentPropertyName
 $_isSupervisor
 $_parent
 $_hashIndex

Detailed Description

Definition at line 51 of file Fill.php.

Constructor & Destructor Documentation

PHPExcel_Style_Fill::__construct (   $isSupervisor = false)

Create a new PHPExcel_Style_Fill.

Definition at line 128 of file Fill.php.

References PHPExcel_Style_Color\COLOR_BLACK, PHPExcel_Style_Color\COLOR_WHITE, and FILL_NONE.

{
// Supervisor?
$this->_isSupervisor = $isSupervisor;
// Initialise values
$this->_fillType = PHPExcel_Style_Fill::FILL_NONE;
$this->_rotation = 0;
$this->_startColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_WHITE, $isSupervisor);
$this->_endColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor);
// bind parent if we are a supervisor
if ($isSupervisor) {
$this->_startColor->bindParent($this, '_startColor');
$this->_endColor->bindParent($this, '_endColor');
}
}

Member Function Documentation

PHPExcel_Style_Fill::__clone ( )

Implement PHP __clone to create a deep clone, not just a shallow copy.

Definition at line 437 of file Fill.php.

References $key.

{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
PHPExcel_Style_Fill::applyFromArray (   $pStyles = null)

Apply styles from array.

$objPHPExcel->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray( array( 'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR, 'rotation' => 0, 'startcolor' => array( 'rgb' => '000000' ), 'endcolor' => array( 'argb' => 'FFFFFFFF' ) ) );

Parameters
array$pStylesArray containing style information
Exceptions
Exception
Returns
PHPExcel_Style_Fill

Definition at line 244 of file Fill.php.

References getActiveSheet(), getEndColor(), getStartColor(), getStyleArray(), getXSelectedCells(), setFillType(), and setRotation().

{
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('type', $pStyles)) {
$this->setFillType($pStyles['type']);
}
if (array_key_exists('rotation', $pStyles)) {
$this->setRotation($pStyles['rotation']);
}
if (array_key_exists('startcolor', $pStyles)) {
$this->getStartColor()->applyFromArray($pStyles['startcolor']);
}
if (array_key_exists('endcolor', $pStyles)) {
$this->getEndColor()->applyFromArray($pStyles['endcolor']);
}
if (array_key_exists('color', $pStyles)) {
$this->getStartColor()->applyFromArray($pStyles['color']);
}
}
} else {
throw new Exception("Invalid style array passed.");
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Style_Fill::bindParent (   $parent)

Bind parent.

Only used for supervisor

Parameters
PHPExcel_Style$parent
Returns
PHPExcel_Style_Fill

Definition at line 152 of file Fill.php.

{
$this->_parent = $parent;
return $this;
}
PHPExcel_Style_Fill::getActiveSheet ( )

Get the currently active sheet.

Only used for supervisor

Returns
PHPExcel_Worksheet

Definition at line 184 of file Fill.php.

Referenced by applyFromArray(), getXActiveCell(), getXSelectedCells(), setEndColor(), setFillType(), setRotation(), and setStartColor().

{
return $this->_parent->getActiveSheet();
}

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::getEndColor ( )

Get End Color.

Returns
PHPExcel_Style_Color

Definition at line 361 of file Fill.php.

References $_endColor.

Referenced by applyFromArray(), getHashCode(), and setEndColor().

{
}

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::getFillType ( )

Get Fill Type.

Returns
string

Definition at line 276 of file Fill.php.

References $_fillType, and getSharedComponent().

Referenced by PHPExcel_Writer_HTML\_createCSSStyleFill(), and getHashCode().

{
if ($this->_isSupervisor) {
return $this->getSharedComponent()->getFillType();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 390 of file Fill.php.

References getEndColor(), getFillType(), getRotation(), getSharedComponent(), and getStartColor().

{
if ($this->_isSupervisor) {
return $this->getSharedComponent()->getHashCode();
}
return md5(
$this->getFillType()
. $this->getRotation()
. $this->getStartColor()->getHashCode()
. $this->getEndColor()->getHashCode()
. __CLASS__
);
}

+ Here is the call graph for this function:

PHPExcel_Style_Fill::getHashIndex ( )

Get hash index.

Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.

Returns
string Hash index

Implements PHPExcel_IComparable.

Definition at line 418 of file Fill.php.

References $_hashIndex.

{
}
PHPExcel_Style_Fill::getIsSupervisor ( )

Is this a supervisor or a real style component?

Returns
boolean

Definition at line 163 of file Fill.php.

References $_isSupervisor.

{
}
PHPExcel_Style_Fill::getRotation ( )

Get Rotation.

Returns
double

Definition at line 304 of file Fill.php.

References $_rotation, and getSharedComponent().

Referenced by getHashCode().

{
if ($this->_isSupervisor) {
return $this->getSharedComponent()->getRotation();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::getSharedComponent ( )

Get the shared style component for the currently active cell in currently active sheet.

Only used for style supervisor

Returns
PHPExcel_Style_Fill

Definition at line 174 of file Fill.php.

Referenced by getFillType(), getHashCode(), and getRotation().

{
return $this->_parent->getSharedComponent()->getFill();
}

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::getStartColor ( )

Get Start Color.

Returns
PHPExcel_Style_Color

Definition at line 332 of file Fill.php.

References $_startColor.

Referenced by PHPExcel_Writer_HTML\_createCSSStyleFill(), applyFromArray(), getHashCode(), and setStartColor().

{
}

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::getStyleArray (   $array)

Build style array from subcomponents.

Parameters
array$array
Returns
array

Definition at line 217 of file Fill.php.

Referenced by applyFromArray(), setFillType(), and setRotation().

{
return array('fill' => $array);
}

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::getXActiveCell ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 206 of file Fill.php.

References getActiveSheet().

{
return $this->getActiveSheet()->getXActiveCell();
}

+ Here is the call graph for this function:

PHPExcel_Style_Fill::getXSelectedCells ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 195 of file Fill.php.

References getActiveSheet().

Referenced by applyFromArray(), setEndColor(), setFillType(), setRotation(), and setStartColor().

{
return $this->getActiveSheet()->getXSelectedCells();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::setEndColor ( PHPExcel_Style_Color  $pValue = null)

Set End Color.

Parameters
PHPExcel_Style_Color$pValue
Exceptions
Exception
Returns
PHPExcel_Style_Fill

Definition at line 372 of file Fill.php.

References getActiveSheet(), getEndColor(), and getXSelectedCells().

{
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
if ($this->_isSupervisor) {
$styleArray = $this->getEndColor()->getStyleArray(array('argb' => $color->getARGB()));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
} else {
$this->_endColor = $color;
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_Style_Fill::setFillType (   $pValue = PHPExcel_Style_Fill::FILL_NONE)

Set Fill Type.

Parameters
string$pValuePHPExcel_Style_Fill fill type
Returns
PHPExcel_Style_Fill

Definition at line 289 of file Fill.php.

References getActiveSheet(), getStyleArray(), and getXSelectedCells().

Referenced by applyFromArray().

{
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('type' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
} else {
$this->_fillType = $pValue;
}
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::setHashIndex (   $value)

Set hash index.

Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.

Parameters
string$valueHash index

Implements PHPExcel_IComparable.

Definition at line 430 of file Fill.php.

{
$this->_hashIndex = $value;
}
PHPExcel_Style_Fill::setRotation (   $pValue = 0)

Set Rotation.

Parameters
double$pValue
Returns
PHPExcel_Style_Fill

Definition at line 317 of file Fill.php.

References getActiveSheet(), getStyleArray(), and getXSelectedCells().

Referenced by applyFromArray().

{
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('rotation' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
} else {
$this->_rotation = $pValue;
}
return $this;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Style_Fill::setStartColor ( PHPExcel_Style_Color  $pValue = null)

Set Start Color.

Parameters
PHPExcel_Style_Color$pValue
Exceptions
Exception
Returns
PHPExcel_Style_Fill

Definition at line 343 of file Fill.php.

References getActiveSheet(), getStartColor(), and getXSelectedCells().

{
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
if ($this->_isSupervisor) {
$styleArray = $this->getStartColor()->getStyleArray(array('argb' => $color->getARGB()));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
} else {
$this->_startColor = $color;
}
return $this;
}

+ Here is the call graph for this function:

Field Documentation

PHPExcel_Style_Fill::$_endColor
private

Definition at line 102 of file Fill.php.

Referenced by getEndColor().

PHPExcel_Style_Fill::$_fillType
private

Definition at line 81 of file Fill.php.

Referenced by getFillType().

PHPExcel_Style_Fill::$_hashIndex
private

Definition at line 408 of file Fill.php.

Referenced by getHashIndex().

PHPExcel_Style_Fill::$_isSupervisor
private

Definition at line 116 of file Fill.php.

Referenced by getIsSupervisor().

PHPExcel_Style_Fill::$_parent
private

Definition at line 123 of file Fill.php.

PHPExcel_Style_Fill::$_parentPropertyName
private

Definition at line 109 of file Fill.php.

PHPExcel_Style_Fill::$_rotation
private

Definition at line 88 of file Fill.php.

Referenced by getRotation().

PHPExcel_Style_Fill::$_startColor
private

Definition at line 95 of file Fill.php.

Referenced by getStartColor().

const PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR = 'linear'
const PHPExcel_Style_Fill::FILL_GRADIENT_PATH = 'path'
const PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN = 'darkDown'
const PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY = 'darkGray'
const PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID = 'darkGrid'
const PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL = 'darkHorizontal'
const PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS = 'darkTrellis'
const PHPExcel_Style_Fill::FILL_PATTERN_DARKUP = 'darkUp'
const PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL = 'darkVertical'
const PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625 = 'gray0625'
const PHPExcel_Style_Fill::FILL_PATTERN_GRAY125 = 'gray125'
const PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN = 'lightDown'
const PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY = 'lightGray'
const PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID = 'lightGrid'
const PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL = 'lightHorizontal'
const PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS = 'lightTrellis'
const PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP = 'lightUp'
const PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL = 'lightVertical'
const PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY = 'mediumGray'
const PHPExcel_Style_Fill::FILL_SOLID = 'solid'

The documentation for this class was generated from the following file: