ILIAS  eassessment Revision 61809
 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.
 getSelectedCells ()
 Get the currently active cell coordinate in currently active sheet.
 getActiveCell ()
 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.
 __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 = PHPExcel_Style_Fill::FILL_NONE
 $_rotation = 0
 $_startColor
 $_endColor
 $_parentPropertyName
 $_isSupervisor
 $_parent

Detailed Description

Definition at line 36 of file Fill.php.

Constructor & Destructor Documentation

PHPExcel_Style_Fill::__construct (   $isSupervisor = false)

Create a new PHPExcel_Style_Fill.

Definition at line 113 of file Fill.php.

References PHPExcel_Style_Color\COLOR_BLACK, and PHPExcel_Style_Color\COLOR_WHITE.

{
// Supervisor?
$this->_isSupervisor = $isSupervisor;
// Initialise values
$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 389 of file Fill.php.

{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if ((is_object($value)) && ($key != '_parent')) {
$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 227 of file Fill.php.

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

{
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getSelectedCells())->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 135 of file Fill.php.

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

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 189 of file Fill.php.

References getActiveSheet().

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

+ Here is the call graph for this function:

PHPExcel_Style_Fill::getActiveSheet ( )

Get the currently active sheet.

Only used for supervisor

Returns
PHPExcel_Worksheet

Definition at line 167 of file Fill.php.

Referenced by applyFromArray(), getActiveCell(), getSelectedCells(), 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 344 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 259 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 373 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::getIsSupervisor ( )

Is this a supervisor or a real style component?

Returns
boolean

Definition at line 146 of file Fill.php.

References $_isSupervisor.

{
}
PHPExcel_Style_Fill::getRotation ( )

Get Rotation.

Returns
double

Definition at line 287 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::getSelectedCells ( )

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns
string E.g. 'A1'

Definition at line 178 of file Fill.php.

References getActiveSheet().

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

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

+ 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 157 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 315 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 200 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::setEndColor ( PHPExcel_Style_Color  $pValue = null)

Set End Color.

Parameters
PHPExcel_Style_Color$pValue
Exceptions
Exception
Returns
PHPExcel_Style_Fill

Definition at line 355 of file Fill.php.

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

{
// 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->getSelectedCells())->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 272 of file Fill.php.

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

Referenced by applyFromArray().

{
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('type' => $pValue));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->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::setRotation (   $pValue = 0)

Set Rotation.

Parameters
double$pValue
Returns
PHPExcel_Style_Fill

Definition at line 300 of file Fill.php.

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

Referenced by applyFromArray().

{
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('rotation' => $pValue));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->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 326 of file Fill.php.

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

{
// 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->getSelectedCells())->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 87 of file Fill.php.

Referenced by getEndColor().

PHPExcel_Style_Fill::$_fillType = PHPExcel_Style_Fill::FILL_NONE
private

Definition at line 66 of file Fill.php.

Referenced by getFillType().

PHPExcel_Style_Fill::$_isSupervisor
private

Definition at line 101 of file Fill.php.

Referenced by getIsSupervisor().

PHPExcel_Style_Fill::$_parent
private

Definition at line 108 of file Fill.php.

PHPExcel_Style_Fill::$_parentPropertyName
private

Definition at line 94 of file Fill.php.

PHPExcel_Style_Fill::$_rotation = 0
private

Definition at line 73 of file Fill.php.

Referenced by getRotation().

PHPExcel_Style_Fill::$_startColor
private

Definition at line 80 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: