Exemplo n.º 1
0
function display_comp(Package $component, TableCreator $table_creator)
{
    $string = "";
    $component->with('classes');
    foreach ($component->classes as $class) {
        $string .= display_class($class, $table_creator);
    }
    $component->with('packages');
    $nested = $component->packages;
    foreach ($nested as $nuc) {
        $string .= display_comp($nuc, $table_creator);
    }
    return $string;
}
Exemplo n.º 2
0
function display_comp($component, TableCreator $table_creator)
{
    $string = '';
    $id = $component->full_name();
    $name = $component->full_name("::\\-");
    //$actors = implode(', ',$useCase->actors());
    $string .= $table_creator->anchor($id, '') . "\n";
    $string .= $table_creator->title(2, $name);
    $string .= $table_creator->title(3, "Informazioni sul package");
    $string .= "\n    \\begin{figure}[H]\n        \\centering\n        \\scalegraphics{img/package/{$component->name}}\n        \\caption{Componente {$name}}\\label{fig:{$id}} \n    \\end{figure}\n    ";
    $string .= $table_creator->title(4, 'Descrizione');
    $string .= $component->description . ". \n";
    $component->with('packages');
    $nested = $component->packages;
    if (count($nested) > 0) {
        $string .= $table_creator->title(4, 'Package contenuti');
        $string .= $table_creator->begin_list();
        foreach ($nested as $nuc) {
            $name = $nuc->full_name();
            $string .= $table_creator->list_item($table_creator->link($name, $name));
        }
        $string .= $table_creator->end_list();
    }
    $allass = $component->get_dependencies(false);
    if (count($allass) > 0) {
        $skip = $component->all_descendant_id();
        $alldep = array();
        foreach ($allass as $dep) {
            if (!in_array($dep['id_from'], $skip)) {
                $alldep[] = $dep['id_from'];
            } else {
                if (!in_array($dep['id_to'], $skip)) {
                    $alldep[] = $dep['id_to'];
                }
            }
        }
        if (count($alldep) > 0) {
            $string .= $table_creator->title(4, 'Interazioni con altri componenti');
            $string .= $table_creator->begin_list();
            foreach ($alldep as $d) {
                $nuc = Package::model()->findByPk($d);
                $name = $nuc->full_name();
                $string .= $table_creator->list_item($table_creator->link($name, $name));
            }
            $string .= $table_creator->end_list();
        }
    }
    $component->with('classes');
    if (count($component->classes) > 0) {
        $string .= $table_creator->title(3, 'Classi');
        //$string .= $table_creator->begin_list();
        foreach ($component->classes as $class) {
            /*$name = $class->full_name();
              $string .= $table_creator->list_item(
                              $table_creator->link($name,$name)
                          );*/
            $string .= display_class($class, $table_creator);
        }
        //$string .= $table_creator->end_list();
    }
    foreach ($nested as $nuc) {
        $string .= display_comp($nuc, $table_creator);
    }
    return $string;
}
Exemplo n.º 3
0
function display_comp($component, TableCreator $table_creator)
{
    $string = '';
    $id = $component->full_name();
    $name = $component->full_name("::\\-");
    $component->with('classes');
    //$actors = implode(', ',$useCase->actors());
    /*if ( !empty($component->classes) )
      {*/
    $string .= $table_creator->anchor($id, '') . "\n";
    $string .= $table_creator->title(2, $name);
    $string .= "\n    \\begin{figure}[H]\n        \\centering\n        \\scalegraphics{img/package/{$component->name}}\n        \\caption{Componente {$name}}\\label{fig:{$id}} \n    \\end{figure}\n    ";
    //}
    $string .= $component->description . "\n    ";
    foreach ($component->classes as $class) {
        $string .= display_class($class, $table_creator);
    }
    $component->with('packages');
    $nested = $component->packages;
    foreach ($nested as $nuc) {
        $string .= display_comp($nuc, $table_creator);
    }
    return $string;
}