function component_row(Package $package, $indentation, TableCreator $table_creator)
{
    $package->with('integration');
    $ret = $table_creator->row(array($package->full_name(), $package->integration == null ? 'Architettura del sistema' : $package->integration->public_id()));
    $nested = $package->with('packages')->packages;
    foreach ($nested as $nuc) {
        $ret .= component_row($nuc, $indentation + 1, $table_creator);
    }
    return $ret;
}
예제 #2
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;
}
function component_row(Package $component, $indentation, TableCreator $table_creator)
{
    $req_id = array();
    $component->with('requirements');
    foreach ($component->requirements as $rq) {
        array_push($req_id, $table_creator->link($rq->public_id(), $rq->public_id()));
    }
    array_unique($req_id);
    $cells = array($table_creator->child_indentation($indentation), $table_creator->link($component->full_name(), $component->full_name("::\\-")), implode("\n\n", $req_id));
    $ret = $table_creator->row($cells);
    $nested = $component->with('packages')->packages;
    foreach ($nested as $nuc) {
        $ret .= component_row($nuc, $indentation + 1, $table_creator);
    }
    return $ret;
}
function component_row(Package $package, $indentation, TableCreator $table_creator)
{
    $ret = $table_creator->row(array($package->full_name(), $package->afferente(), $package->efferente(), round($package->instability(), 2)));
    $nested = $package->with('packages')->packages;
    foreach ($nested as $nuc) {
        $ret .= component_row($nuc, $indentation + 1, $table_creator);
    }
    return $ret;
}
예제 #5
0
function ns_build_package(Package $package, $namespace, &$namespace_array)
{
    $namespace_array[] = $namespace . $package->name;
    $package->with('packages,classes');
    $sub_scope = $namespace . $package->name . '::';
    if (isset($package->packages)) {
        foreach ($package->packages as $c) {
            ns_build_package($c, $sub_scope, $namespace_array);
        }
    }
    if (isset($package->classes)) {
        foreach ($package->classes as $class) {
            $namespace_array[] = $sub_scope . $class->name;
        }
    }
}
예제 #6
0
function display_package(Package $pack, $indentation, TableCreator $table_creator)
{
    $txt = "";
    /*$name = $pack->full_name("::");
      if ( !$pack->virtual )
      {
          $txt .= $table_creator->anchor($name,'')."\n";
          $txt .= $table_creator->title(2,$name);
          $txt .= $pack->description."\n\n";
      }*/
    if ($indentation == 1) {
        $txt .= $table_creator->title(2, $pack->name);
    }
    //else if ( $indentation == 2 )
    //    $txt .= $table_creator->title(3,$pack->name);
    $pack->with('classes', 'packages');
    foreach ($pack->classes as $c) {
        $txt .= display_class($c, $table_creator);
    }
    foreach ($pack->packages as $p) {
        $txt .= display_package($p, $indentation + 1, $table_creator);
    }
    return $txt;
}
예제 #7
0
 function package(Package $package, $assoc)
 {
     $package->with('parent0, packages, classes');
     $id = $this->package_id($package->id_package);
     $namespace = $this->package_id($package->parent);
     $this->open_uml_simple_element('Namespace.ownedElement');
     $this->open_uml_element('Package', $id, $package->name, $namespace);
     $this->open_uml_simple_element('Namespace.ownedElement');
     foreach ($package->packages as $c) {
         $this->package($c, $assoc);
     }
     foreach ($package->classes as $c) {
         $this->print_class($c, $assoc);
     }
     if ($assoc) {
         $ass = Association::model()->findAll(array('join' => 'Join class c on c.id_class = class_from', 'condition' => 'id_package = :idp', 'params' => array('idp' => $package->id_package)));
         foreach ($ass as $hole) {
             $this->association($hole, $id);
         }
     }
     $sig = Connect::model()->findAll(array('join' => 'Join method sl on sl.id_method = t.slot
                        join class c on c.id_class = sl.id_class', 'condition' => 'c.id_package = :idp', 'params' => array('idp' => $package->id_package)));
     foreach ($sig as $segv) {
         $this->signal($segv, $id);
     }
     foreach ($package->packages as $child) {
         $dep = $child->get_dependencies(false);
         $child_id = $this->package_id($child->id_package);
         foreach ($dep as $d) {
             if ($d['id_from'] != $child->id_package) {
                 continue;
             }
             $did = $this->generic_id('UMLDependency');
             $dit = $this->package_id($d['id_to']);
             $this->open_uml_element('Dependency', "", $child_id, null, array('client' => $id, 'supplier' => $dit));
         }
     }
     $this->close_element();
     $this->close_element();
     $this->close_element();
 }