wCMF
3.6
|
Public Member Functions | |
LayoutVisitor () | |
visit (&$obj) | |
getMap () | |
flip () | |
calculatePosition (&$obj) | |
Public Member Functions inherited from Visitor | |
startIterator (&$iterator) | |
startArray (&$array) | |
visit (&$obj) | |
doPreVisit () | |
doPostVisit () | |
Public Attributes | |
$_map = array() | |
The LayoutVisitor is used to position a tree of objects on a plane (the objects must implement the getParent()). It uses a simple algorithm that positions the objects on a discrete array with distance 1 so that all leaves are equal distant from their neighbours. The positions are stored in a map that is provided by the getMap() method.
Definition at line 36 of file class.LayoutVisitor.php.
LayoutVisitor::LayoutVisitor | ( | ) |
LayoutVisitor::visit | ( | & | $obj | ) |
Visit the current object in iteration and position it on the map.
obj | A reference to the current object. |
Definition at line 52 of file class.LayoutVisitor.php.
References calculatePosition().
LayoutVisitor::getMap | ( | ) |
Visit the current object in iteration and position it on the map.
Definition at line 61 of file class.LayoutVisitor.php.
References $_map.
LayoutVisitor::flip | ( | ) |
Flip layout (x <-> y).
Definition at line 68 of file class.LayoutVisitor.php.
LayoutVisitor::calculatePosition | ( | & | $obj | ) |
Calculate the object's position using the described algorithm.
obj | A reference to the current object. |
Definition at line 85 of file class.LayoutVisitor.php.
Referenced by visit().
LayoutVisitor::$_map = array() |
Definition at line 38 of file class.LayoutVisitor.php.
Referenced by getMap().