# Path: omelette/fromage/common.py
# class DrawableNode(Drawable):
#     """Base class for node-like diagram elements (e.g. classes, use cases)."""
# 
#     def __init__(self, uml_object):
#         super(DrawableNode, self).__init__(uml_object)
# 
# class DrawableEdge(Drawable):
#     """Base class for edgy things (e.g. lines, relations)."""
# 
#     def __init__(self, uml_object):
#         super(DrawableEdge, self).__init__(uml_object)
# 
#         self.source_anchor = None
#         self.target_anchor = None
# 
# class Anchor(object):
#     """
#     Class representing connection between edge (connector) and something else
#     (slot).
#     """
# 
#     def __init__(self):
#         self.connector = None
#         self.slot = None


import inspect
from omelette.fromage.common import DrawableNode, DrawableEdge, Anchor
        self.nodes = {}
        self.edges = {}

    def add(self, uml_object):
        drawable = self.factory.create(uml_object)

        if isinstance(drawable, DrawableNode):
            self.nodes[uml_object.name] = drawable
        elif isinstance(drawable, DrawableEdge):
            self.edges[uml_object.name] = drawable
        else:
            raise AttributeError("Tried to create an object from a corrupted " +
                "module")

    def elements(self):
        return self.nodes.values() + self.edges.values()

    def set_anchors(self):
        for edge in self.edges.values():
            source, target = self.__get_slots(edge)
            source_anchor, target_anchor = self.__create_anchors(edge)

            edge.source_anchor = source_anchor
            edge.target_anchor = target_anchor

            source.anchors.append(source_anchor)
            target.anchors.append(target_anchor)

    def __create_anchors(self, edge):
        target_anchor = Anchor()

# Path: omelette/fromage/common.py
# class DrawableNode(Drawable):
#     """Base class for node-like diagram elements (e.g. classes, use cases)."""
# 
#     def __init__(self, uml_object):
#         super(DrawableNode, self).__init__(uml_object)
# 
# class DrawableEdge(Drawable):
#     """Base class for edgy things (e.g. lines, relations)."""
# 
#     def __init__(self, uml_object):
#         super(DrawableEdge, self).__init__(uml_object)
# 
#         self.source_anchor = None
#         self.target_anchor = None
# 
# class Anchor(object):
#     """
#     Class representing connection between edge (connector) and something else
#     (slot).
#     """
# 
#     def __init__(self):
#         self.connector = None
#         self.slot = None


# Path: omelette/fromage/diagram.py
import inspect
from omelette.fromage.common import DrawableNode, DrawableEdge, Anchor

        self.nodes = {}
        self.edges = {}

    def add(self, uml_object):
        drawable = self.factory.create(uml_object)

        if isinstance(drawable, DrawableNode):
            self.nodes[uml_object.name] = drawable
        elif isinstance(drawable, DrawableEdge):
            self.edges[uml_object.name] = drawable
        else:
            raise AttributeError("Tried to create an object from a corrupted " +
                "module")

    def elements(self):
        return self.nodes.values() + self.edges.values()

    def set_anchors(self):
        for edge in self.edges.values():
            source, target = self.__get_slots(edge)
            source_anchor, target_anchor = self.__create_anchors(edge)

            edge.source_anchor = source_anchor
            edge.target_anchor = target_anchor

            source.anchors.append(source_anchor)
            target.anchors.append(target_anchor)

    def __create_anchors(self, edge):
        target_anchor = Anchor()

        source_anchor = Anchor()