wcmf logo wemove logo

LayoutVisitor Class Reference
[Visitor]

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. More...

Inheritance diagram for LayoutVisitor:

Inheritance graph
[legend]

Public Member Functions

 LayoutVisitor ()
 visit (&$obj)
 getMap ()
 flip ()
 calculatePosition (&$obj)

Data Fields

 $_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@wemove.com>

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


Member Function Documentation

LayoutVisitor (  ) 

Constructor.

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

visit ( &$  obj  ) 

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

Parameters:
obj A reference to the current object.

Reimplemented from Visitor.

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

References calculatePosition().

Here is the call graph for this function:

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.

flip (  ) 

Flip layout (x <-> y).

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

calculatePosition ( &$  obj  ) 

Calculate the object's position using the described algorithm.

Attention:
Internal use only.
Parameters:
obj A reference to the current object.

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

Referenced by visit().


Field Documentation

$_map = array()

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


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

This page generated via doxygen 1.5.8 Mon Mar 30 01:58:43 2009.
Copyright © 2009 wemove digital solutions GmbH.
sourceforge logo