public function generateFromMetadata(
        array $metadata,
        $showFieldsDescription = false,
        $colors = array(),
        $notes = array()
    ) {
        $this->classStore = new ClassStore($metadata);
        $this->stringGenerator = new StringGenerator($this->classStore);
        $this->colorManager = new ColorManager($this->stringGenerator, $this->classStore);

        $this->stringGenerator->setShowFieldsDescription($showFieldsDescription);

        $annotations = $this->annotationParser->getAnnotations($metadata);

        $colors = array_merge($colors, $annotations['colors']);
        $notes = array_merge($notes, $annotations['notes']);

        foreach ($metadata as $class) {
            $this->writeParentAssociation($class);
            $this->dispatchStringWriter($class, $class->getAssociationNames());
        }

        $this->addColors($metadata, $colors);
        $this->addNotes($notes);

        return implode(',', $this->str);
    }