threeLittlePigs4.php

Go to the documentation of this file.
00001 <?php
00017 // 1. require once the code to diagram started
00018 require_once( '../../public/codetodiagram.php' );
00019 
00020 // 2. start the code to diagram
00021 
00022 CodeToDiagram::getInstance()->start();
00023 
00024 CodeToDiagram::getInstance()->getConfiguration()->getMatchGroupStereotypes()
00025     ->addItemName( "History"   , UmlSequenceDiagramStereotype::getStereotypeByName( "boundary" ) )
00026     ->addItemName( "Wolf"      , UmlSequenceDiagramStereotype::getStereotypeByName( "user" ) )
00027     ->addItemName( "LittlePig" , UmlSequenceDiagramStereotype::getStereotypeByName( "controller" ) )
00028     ->addItemName( "House"     , UmlSequenceDiagramStereotype::getStereotypeByName( "entity" ) )
00029 ;
00030 
00031 // recursive calls should be ignored into this diagram //
00032 CodeToDiagram::getInstance()->getConfiguration()
00033     ->setIgnoreRecursiveCalls( true )
00034     ->setMergeSameClassObjects( false);
00035 
00036 // the class history should be ignored //
00037 // all the gets and sets should be ignored //
00038 CodeToDiagram::getInstance()->getConfiguration()
00039     ->getGatekeeperClasses()->getForbiddenMatch()
00040         ->addItemName( "History" )
00041         ->addItemRegularExpression( "^(get(.*)|set(.*))$" )
00042 ;
00043 
00044 CodeToDiagram::getInstance()
00045     ->getPrinterConfiguration()
00046         ->setWidth( 1000 );
00047 
00048 // an alternative way to remove the class house //
00049 // just to show how to regular expression can be flexibe //
00050 //CodeToDiagram::getInstance()->addIgnoredMethodRegex( "^House::(.*)$" );
00051 
00052 // 3. load the necessary classes
00053 require_once( 'Wolf.class.php' );
00054 require_once( 'Pig.class.php' );
00055 require_once( 'House.class.php' );
00056 require_once( 'History.class.php' );
00057 
00058 // 4. start the history
00059 new History();
00060 
00061 ?>

Generated on Sat Apr 7 14:19:11 2012 for CodeToDiagram by  doxygen 1.5.9