Changeset 178

User picture

Author: Thiago Mata

(2009/08/11 22:37) Over 2 years ago

littles changes into the note element

Affected files

Updated components/codeInstrumentation/CodeInstrumentationReceiver.class.php Download diff

177178
72
72
73
    protected $objActualMessage;
73
    protected $objActualMessage;
74
74
75
    protected $objActualActor;
76
    
75
    /**
77
    /**
76
     * Set the code instrumentation receiver configuration
78
     * Set the code instrumentation receiver configuration
77
     * 
79
     * 
...
...
278
        
280
        
279
        // get the actor what the message is bring from  //
281
        // get the actor what the message is bring from  //
280
        $objActorFrom = current( $this->arrStack );
282
        $objActorFrom = current( $this->arrStack );
283
        //$objActorFrom = $this->arrStack[0];
281
        if( $objActorFrom  === false )
284
        if( $objActorFrom  === false )
282
        {
285
        {
283
            return $this;
286
            return $this;
...
...
347
        }
350
        }
348
        
351
        
349
        array_unshift( $this->arrStack , $objActorTo );
352
        array_unshift( $this->arrStack , $objActorTo );
353
354
        $this->objActualActor = $objActorFrom;
350
        return $this;
355
        return $this;
351
    }
356
    }
352
357
...
...
393
        }
398
        }
394
                
399
                
395
        // get the actor what the message is bring from //
400
        // get the actor what the message is bring from //
401
        reset( $this->arrStack );
396
        $objActorFrom = array_shift( $this->arrStack );
402
        $objActorFrom = array_shift( $this->arrStack );
397
        
403
        
398
        // get the actor what the message is bring to //
404
        // get the actor what the message is bring to //
405
        //$objActorTo = $this->arrStack[0];
399
        $objActorTo = current( $this->arrStack );
406
        $objActorTo = current( $this->arrStack );
400
407
401
        $boolCreateMessage = true;
408
        $boolCreateMessage = true;
...
...
436
            $objMessage->setTimeEnd( microtime( true ) );
443
            $objMessage->setTimeEnd( microtime( true ) );
437
            $this->objActualMessage = $objMessage;
444
            $this->objActualMessage = $objMessage;
438
        }
445
        }
446
        $this->objActualActor = $objActorTo;
447
        
439
        return $this;
448
        return $this;
440
    }
449
    }
441
450
...
...
514
     */
523
     */
515
    public function getActualActor()
524
    public function getActualActor()
516
    {
525
    {
517
        return current( $this->arrStack );
526
        return $this->objActualActor;
518
    }
527
    }
519
528
520
    /**
529
    /**

Updated components/umlSequenceDiagram/UmlSequenceDiagramPrinterToHtml.class.php Download diff

177178
12
 */
12
 */
13
class UmlSequenceDiagramPrinterToHtml implements UmlSequenceDiagramPrinterInterface
13
class UmlSequenceDiagramPrinterToHtml implements UmlSequenceDiagramPrinterInterface
14
{
14
{
15
	/**
15
    /**
16
	 * Singleton of the UmlSequenceDiagramPrinterToHtml
16
     * Singleton of the UmlSequenceDiagramPrinterToHtml
17
	 *
17
     *
18
	 * @see UmlSequenceDiagramPrinterInterface::$objInstance
18
     * @see UmlSequenceDiagramPrinterInterface::$objInstance
19
	 * @var UmlSequenceDiagramPrinterToHtml
19
     * @var UmlSequenceDiagramPrinterToHtml
20
	 */
20
     */
21
	protected static $objInstance;
21
    protected static $objInstance;
22
22
23
	/**
23
    /**
24
	 * Uml Sequence Diagram object what will be print
24
     * Uml Sequence Diagram object what will be print
25
	 *
25
     *
26
	 * @see UmlSequenceDiagramPrinterInterface->objUmlSequenceDiagram
26
     * @see UmlSequenceDiagramPrinterInterface->objUmlSequenceDiagram
27
	 * @var UmlSequenceDiagram
27
     * @var UmlSequenceDiagram
28
	 */
28
     */
29
	protected $objUmlSequenceDiagram;
29
    protected $objUmlSequenceDiagram;
30
30
31
    /**
31
    /**
32
     * Configuration of this printer
32
     * Configuration of this printer
...
...
332
    {
332
    {
333
        $strResult = '';
333
        $strResult = '';
334
        $strNotesBefore = '';
334
        $strNotesBefore = '';
335
        $strNotesAfter = '';
335
336
336
        $arrNotes = $objMessage->getNotesBefore();
337
        $arrNotes = $objMessage->getNotesBefore();
337
        foreach( $arrNotes as $objNote )
338
        foreach( $arrNotes as $objNote )
...
...
341
        $arrNotes = $objMessage->getNotesAfter();
342
        $arrNotes = $objMessage->getNotesAfter();
342
        foreach( $arrNotes as $objNote )
343
        foreach( $arrNotes as $objNote )
343
        {
344
        {
344
            $strNotesBefore .= $this->getNote( $objNote , true );
345
            $strNotesAfter .= $this->getNote( $objNote , true );
345
        }
346
        }
346
347
347
        if( $objMessage->isReverse() )
348
        if( $objMessage->isReverse() )
...
...
432
433
433
434
434
        $strMessages = $this->getTemplate( "messages.html" , $arrReplace );
435
        $strMessages = $this->getTemplate( "messages.html" , $arrReplace );
435
        $strMessages = $strNotesBefore . $strMessages;
436
        $strMessages = $strNotesBefore . $strMessages . $strNotesAfter;
436
        return $strMessages;
437
        return $strMessages;
437
    }
438
    }
438
439
...
...
440
    {
441
    {
441
        $arrActors = $objNote->getActor()->getUmlSequenceDiagram()->getActors();
442
        $arrActors = $objNote->getActor()->getUmlSequenceDiagram()->getActors();
442
        $intPosition = $objNote->getActor()->getPosition();
443
        $intPosition = $objNote->getActor()->getPosition();
444
443
        $strResult = "";
445
        $strResult = "";
444
446
445
        foreach( $arrActors as $objActor )
447
        foreach( $arrActors as $objActor )

Updated examples/ThreeLittlePigs/History.class.php Download diff

177178
38
        $objPig2->buildHouse('Stick');
38
        $objPig2->buildHouse('Stick');
39
        $objPig3->buildHouse('Brick');
39
        $objPig3->buildHouse('Brick');
40
40
41
        CodeToDiagram::getInstance()->addNote( "Until, one day" );
42
41
42
        CodeToDiagram::getInstance()->addNote( "One night the big bad wolf," );
43
        $objWolf = new Wolf();
43
        $objWolf = new Wolf();
44
        CodeToDiagram::getInstance()->addNote( "A Wolf show up" );
44
45
        
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() );
46
        $objWolf->blowIt( $objPig1->getHouse() );
47
        $objWolf->blowIt( $objPig2->getHouse() );
47
        $objWolf->blowIt( $objPig2->getHouse() );
48
        $objWolf->blowIt( $objPig3->getHouse() );
48
        $objWolf->blowIt( $objPig3->getHouse() );

Updated examples/ThreeLittlePigs/threeLittlePigs3.php Download diff

177178
29
        ->addItemName( "LittlePig" , UmlSequenceDiagramStereotype::getStereotypeByName( "controller" ) )
29
        ->addItemName( "LittlePig" , UmlSequenceDiagramStereotype::getStereotypeByName( "controller" ) )
30
        ->addItemName( "House"     , UmlSequenceDiagramStereotype::getStereotypeByName( "entity" ) )
30
        ->addItemName( "House"     , UmlSequenceDiagramStereotype::getStereotypeByName( "entity" ) )
31
;
31
;
32
CodeToDiagram::getInstance()->getConfiguration()->getGatekeeperMethods()->getForbiddenMatch()->addItemRegularExpression( "^set*|^get*");
32
33
33
34
35
CodeToDiagram::getInstance()->getPrinterConfiguration()->setWidth( 1300 );
36
CodeToDiagram::getInstance()->getPrinterConfiguration()->setPercentFont( 20 );
37
34
// 3. load the necessary classes
38
// 3. load the necessary classes
35
require_once( 'Wolf.class.php' );
39
require_once( 'Wolf.class.php' );
36
require_once( 'Pig.class.php' );
40
require_once( 'Pig.class.php' );