Author: Thiago Mata
(2009/08/11 22:37) Over 2 years ago
littles changes into the note element
72
73
protected $objActualMessage;
74
75
protected $objActualActor;
76
/**
77
* Set the code instrumentation receiver configuration
78
*
79
...
278
280
279
// get the actor what the message is bring from //
281
$objActorFrom = current( $this->arrStack );
282
283
//$objActorFrom = $this->arrStack[0];
if( $objActorFrom === false )
284
{
285
return $this;
286
347
}
350
348
351
349
array_unshift( $this->arrStack , $objActorTo );
352
353
354
$this->objActualActor = $objActorFrom;
355
356
357
393
398
394
399
395
400
401
reset( $this->arrStack );
396
$objActorFrom = array_shift( $this->arrStack );
402
397
403
// get the actor what the message is bring to //
404
405
//$objActorTo = $this->arrStack[0];
$objActorTo = current( $this->arrStack );
406
407
$boolCreateMessage = true;
408
436
$objMessage->setTimeEnd( microtime( true ) );
443
437
$this->objActualMessage = $objMessage;
444
438
445
446
$this->objActualActor = $objActorTo;
447
439
448
440
449
441
450
514
*/
523
515
public function getActualActor()
524
516
525
517
return current( $this->arrStack );
526
return $this->objActualActor;
518
527
519
528
520
529
12
13
class UmlSequenceDiagramPrinterToHtml implements UmlSequenceDiagramPrinterInterface
14
15
16
* Singleton of the UmlSequenceDiagramPrinterToHtml
17
18
* @see UmlSequenceDiagramPrinterInterface::$objInstance
19
* @var UmlSequenceDiagramPrinterToHtml
20
21
protected static $objInstance;
22
23
24
* Uml Sequence Diagram object what will be print
25
26
* @see UmlSequenceDiagramPrinterInterface->objUmlSequenceDiagram
27
* @var UmlSequenceDiagram
28
29
protected $objUmlSequenceDiagram;
30
31
32
* Configuration of this printer
332
333
$strResult = '';
334
$strNotesBefore = '';
335
$strNotesAfter = '';
336
$arrNotes = $objMessage->getNotesBefore();
337
foreach( $arrNotes as $objNote )
338
341
$arrNotes = $objMessage->getNotesAfter();
342
343
344
$strNotesBefore .= $this->getNote( $objNote , true );
345
$strNotesAfter .= $this->getNote( $objNote , true );
346
if( $objMessage->isReverse() )
432
433
434
$strMessages = $this->getTemplate( "messages.html" , $arrReplace );
435
$strMessages = $strNotesBefore . $strMessages;
$strMessages = $strNotesBefore . $strMessages . $strNotesAfter;
return $strMessages;
$arrActors = $objNote->getActor()->getUmlSequenceDiagram()->getActors();
442
$intPosition = $objNote->getActor()->getPosition();
$strResult = "";
foreach( $arrActors as $objActor )
38
$objPig2->buildHouse('Stick');
39
$objPig3->buildHouse('Brick');
40
41
CodeToDiagram::getInstance()->addNote( "Until, one day" );
42
CodeToDiagram::getInstance()->addNote( "One night the big bad wolf," );
43
$objWolf = new Wolf();
44
CodeToDiagram::getInstance()->addNote( "A Wolf show up" );
45
$objWolf->say( "Let me in, Let me in, little pig or I'll huff and I'll puff and I'll blow your house in!" );
46
$objWolf->blowIt( $objPig1->getHouse() );
47
$objWolf->blowIt( $objPig2->getHouse() );
48
$objWolf->blowIt( $objPig3->getHouse() );
->addItemName( "LittlePig" , UmlSequenceDiagramStereotype::getStereotypeByName( "controller" ) )
->addItemName( "House" , UmlSequenceDiagramStereotype::getStereotypeByName( "entity" ) )
;
CodeToDiagram::getInstance()->getConfiguration()->getGatekeeperMethods()->getForbiddenMatch()->addItemRegularExpression( "^set*|^get*");
33
34
35
CodeToDiagram::getInstance()->getPrinterConfiguration()->setWidth( 1300 );
36
CodeToDiagram::getInstance()->getPrinterConfiguration()->setPercentFont( 20 );
37
// 3. load the necessary classes
require_once( 'Wolf.class.php' );
require_once( 'Pig.class.php' );
{{{{return current( $this->arrStack );return $this->objActualActor;{{/**/*** Singleton of the UmlSequenceDiagramPrinterToHtml* Singleton of the UmlSequenceDiagramPrinterToHtml*** @see UmlSequenceDiagramPrinterInterface::$objInstance* @see UmlSequenceDiagramPrinterInterface::$objInstance* @var UmlSequenceDiagramPrinterToHtml* @var UmlSequenceDiagramPrinterToHtml*/*/protected static $objInstance;protected static $objInstance;/**/*** Uml Sequence Diagram object what will be print* Uml Sequence Diagram object what will be print*** @see UmlSequenceDiagramPrinterInterface->objUmlSequenceDiagram* @see UmlSequenceDiagramPrinterInterface->objUmlSequenceDiagram* @var UmlSequenceDiagram* @var UmlSequenceDiagram*/*/protected $objUmlSequenceDiagram;protected $objUmlSequenceDiagram;{{{{$strNotesBefore .= $this->getNote( $objNote , true );$strNotesAfter .= $this->getNote( $objNote , true );$strMessages = $strNotesBefore . $strMessages . $strNotesAfter;{{$objPig2->buildHouse('Stick');$objPig2->buildHouse('Stick');$objPig3->buildHouse('Brick');$objPig3->buildHouse('Brick');CodeToDiagram::getInstance()->addNote( "Until, one day" );CodeToDiagram::getInstance()->addNote( "A Wolf show up" );$objWolf->say( "Let me in, Let me in, little pig or I'll huff and I'll puff and I'll blow your house in!" );