wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
LayoutVisitor Class Reference
+ Inheritance diagram for LayoutVisitor:

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()
 

Detailed Description

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.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 36 of file class.LayoutVisitor.php.

Member Function Documentation

LayoutVisitor::LayoutVisitor ( )

Constructor.

Definition at line 43 of file class.LayoutVisitor.php.

References MAPTYPE_HORIZONTAL.

LayoutVisitor::visit ( $obj)

Visit the current object in iteration and position it on the map.

Parameters
objA reference to the current object.

Definition at line 52 of file class.LayoutVisitor.php.

References calculatePosition().

+ Here is the call graph for this function:

LayoutVisitor::getMap ( )

Visit the current object in iteration and position it on the map.

Returns
The object map as assioziative array (key: object Id, value: Position). map["type"] = MAPTYPE_HORIZONTAL | MAPTYPE_VERTICAL

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.

Attention
Internal use only.
Parameters
objA reference to the current object.

Definition at line 85 of file class.LayoutVisitor.php.

Referenced by visit().

Member Data Documentation

LayoutVisitor::$_map = array()

Definition at line 38 of file class.LayoutVisitor.php.

Referenced by getMap().


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