Exemplo n.º 1
0
    def __init__(self, id=None):
        """Constructor.  Initialize the ClassItem.  This will also call the
        ClassifierItem constructor.
        
        The drawing style is set here as well.  The class item will create
        two compartments - one for attributes and another for operations."""
        
        ClassifierItem.__init__(self, id)
        self.drawing_style = self.DRAW_COMPARTMENT
        self._attributes = self.create_compartment('attributes')
        self._operations = self.create_compartment('operations')
        self._operations.use_extra_space = True

        self.watch('subject<Class>.ownedOperation', self.on_class_owned_operation)\
            .watch('subject<Class>.ownedAttribute.association', self.on_class_owned_attribute) \
            .watch('subject<Class>.ownedAttribute.name') \
            .watch('subject<Class>.ownedAttribute.isStatic') \
            .watch('subject<Class>.ownedAttribute.isDerived') \
            .watch('subject<Class>.ownedAttribute.visibility') \
            .watch('subject<Class>.ownedAttribute.lowerValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedAttribute.upperValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedAttribute.defaultValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedAttribute.typeValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedOperation.name') \
            .watch('subject<Class>.ownedOperation.isAbstract', self.on_operation_is_abstract) \
            .watch('subject<Class>.ownedOperation.isStatic') \
            .watch('subject<Class>.ownedOperation.visibility') \
            .watch('subject<Class>.ownedOperation.returnResult.lowerValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedOperation.returnResult.upperValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedOperation.returnResult.typeValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedOperation.formalParameter.lowerValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedOperation.formalParameter.upperValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedOperation.formalParameter.typeValue<LiteralSpecification>.value') \
            .watch('subject<Class>.ownedOperation.formalParameter.defaultValue<LiteralSpecification>.value')
Exemplo n.º 2
0
 def __init__(self, id=None):
     ClassifierItem.__init__(self, id)
     self.height = 50
     self.width = 120
     # Set drawing style to compartment w/ small icon
     self.drawing_style = self.DRAW_COMPARTMENT_ICON
     self._line = []
Exemplo n.º 3
0
    def save(self, save_func):
        """Store the show- properties *before* the width/height properties,
		otherwise the classes will unintentionally grow due to "visible"
		attributes or operations."""

        self.save_property(save_func, "show-attributes")
        self.save_property(save_func, "show-operations")
        ClassifierItem.save(self, save_func)
Exemplo n.º 4
0
 def save(self, save_func):
     """Store the show- properties *before* the width/height properties,
     otherwise the classes will unintentionally grow due to "visible"
     attributes or operations."""
     
     self.save_property(save_func, 'show-attributes')
     self.save_property(save_func, 'show-operations')
     ClassifierItem.save(self, save_func)
Exemplo n.º 5
0
    def __init__(self, id=None, model=None):
        """Constructor.  Initialize the ClassItem.  This will also call the
		ClassifierItem constructor.

		The drawing style is set here as well.  The class item will create
		two compartments - one for attributes and another for operations."""

        ClassifierItem.__init__(self, id, model)
        self.drawing_style = self.DRAW_COMPARTMENT
        self._attributes = self.create_compartment("attributes")
        self._attributes.font = self.style.feature_font
        self._operations = self.create_compartment("operations")
        self._operations.font = self.style.feature_font
        self._operations.use_extra_space = True

        self.watch(
            "subject<Class>.ownedOperation", self.on_class_owned_operation
        ).watch(
            "subject<Class>.ownedAttribute.association",
            self.on_class_owned_attribute
        ).watch("subject<Class>.ownedAttribute.name").watch(
            "subject<Class>.ownedAttribute.isStatic"
        ).watch("subject<Class>.ownedAttribute.isDerived").watch(
            "subject<Class>.ownedAttribute.visibility"
        ).watch("subject<Class>.ownedAttribute.lowerValue").watch(
            "subject<Class>.ownedAttribute.upperValue"
        ).watch("subject<Class>.ownedAttribute.defaultValue").watch(
            "subject<Class>.ownedAttribute.typeValue"
        ).watch("subject<Class>.ownedOperation.name").watch(
            "subject<Class>.ownedOperation.isAbstract",
            self.on_operation_is_abstract
        ).watch("subject<Class>.ownedOperation.isStatic").watch(
            "subject<Class>.ownedOperation.visibility"
        ).watch("subject<Class>.ownedOperation.returnResult.lowerValue").watch(
            "subject<Class>.ownedOperation.returnResult.upperValue"
        ).watch("subject<Class>.ownedOperation.returnResult.typeValue").watch(
            "subject<Class>.ownedOperation.formalParameter.lowerValue").watch(
                "subject<Class>.ownedOperation.formalParameter.upperValue"
            ).watch(
                "subject<Class>.ownedOperation.formalParameter.typeValue"
            ).watch(
                "subject<Class>.ownedOperation.formalParameter.defaultValue")
Exemplo n.º 6
0
 def __init__(self, id=None):
     ClassifierItem.__init__(self, id)
     # Set drawing style to compartment w// small icon
     self.drawing_style = self.DRAW_COMPARTMENT_ICON
Exemplo n.º 7
0
    def __init__(self, id = None):
        ClassifierItem.__init__(self, id)

        self.drawing_style = self.DRAW_ICON
Exemplo n.º 8
0
Arquivo: actor.py Projeto: Nyox/gaphor
    def __init__(self, id = None):
        ClassifierItem.__init__(self, id)

        self.drawing_style = self.DRAW_ICON
Exemplo n.º 9
0
 def __init__(self, id=None):
     ClassifierItem.__init__(self, id)
     self.drawing_style = self.DRAW_COMPARTMENT
     self.height = 50
     self.width = 120
Exemplo n.º 10
0
 def __init__(self, id=None):
     ClassifierItem.__init__(self, id)
     # Set drawing style to compartment w// small icon
     self.drawing_style = self.DRAW_COMPARTMENT_ICON
Exemplo n.º 11
0
Arquivo: node.py Projeto: Nyox/gaphor
 def __init__(self, id=None):
     ClassifierItem.__init__(self, id)
     self.drawing_style = self.DRAW_COMPARTMENT
     self.height = 50
     self.width = 120