/framework/experimental/graphic/GraphicContainer.php
http://zoop.googlecode.com/ · PHP · 32 lines · 28 code · 4 blank · 0 comment · 1 complexity · 997e73dcbaa96917e866418fe898e372 MD5 · raw file
- <?php
- abstract class GraphicContainer extends GraphicObject
- {
- protected $children = array();
-
- function getNewChild($type)
- {
- $newChild = new $type($this);
- assert(is_a($newChild, 'GraphicObject'));
- $this->children[] = $newChild;
- return $newChild;
- }
-
- function isInline()
- {
- return false;
- }
-
- function getObjectTree($indentLevel = 0)
- {
- $tabs = '';
- for($i = 0; $i < $indentLevel; $i++)
- $tabs .= ' ';
-
- echo $tabs . '<' . get_class($this) . '><br>';
- foreach($this->children as $thisChild)
- {
- $thisChild->getObjectTree($indentLevel + 1);
- }
- echo $tabs . '</' . get_class($this) . '><br>';
- }
- }