コード例 #1
0
ファイル: compartment.py プロジェクト: gitter-badger/dabbler
    def __init__(self, id=None):
        NamedItem.__init__(self, id)
        self._compartments = []

        self._drawing_style = CompartmentItem.DRAW_NONE
        self.watch('subject.appliedStereotype', self.on_stereotype_change) \
            .watch('subject.appliedStereotype.slot', self.on_stereotype_attr_change) \
            .watch('subject.appliedStereotype.slot.definingFeature.name') \
            .watch('subject.appliedStereotype.slot.value')
        self._extra_space = 0
コード例 #2
0
ファイル: compartment.py プロジェクト: adamboduch/gaphor
    def __init__(self, id=None):
        NamedItem.__init__(self, id)
        self._compartments = []

        self._drawing_style = CompartmentItem.DRAW_NONE
        self.watch('subject.appliedStereotype', self.on_stereotype_change) \
            .watch('subject.appliedStereotype.slot', self.on_stereotype_attr_change) \
            .watch('subject.appliedStereotype.slot.definingFeature.name') \
            .watch('subject.appliedStereotype.slot.value')
        self._extra_space = 0
コード例 #3
0
    def __init__(self, id=None, model=None):
        NamedItem.__init__(self, id, model)
        self._compartments = []

        self._drawing_style = CompartmentItem.DRAW_NONE
        self.watch(
            "subject.appliedStereotype", self.on_stereotype_change).watch(
                "subject.appliedStereotype.slot",
                self.on_stereotype_attr_change).watch(
                    "subject.appliedStereotype.slot.definingFeature.name"
                ).watch("subject.appliedStereotype.slot.value")
        self._extra_space = 0
コード例 #4
0
    def __init__(self, id = None):
        NamedItem.__init__(self, id)

        self.is_destroyed = False

        self.lifetime = LifetimeItem()

        top = self.lifetime.top
        bottom = self.lifetime.bottom

        self._handles.append(top)
        self._handles.append(bottom)
        self._ports.append(self.lifetime.port)
コード例 #5
0
ファイル: lifeline.py プロジェクト: Nyox/gaphor
    def __init__(self, id = None):
        NamedItem.__init__(self, id)

        self.is_destroyed = False

        self.lifetime = LifetimeItem()

        top = self.lifetime.top
        bottom = self.lifetime.bottom

        self._handles.append(top)
        self._handles.append(bottom)
        self._ports.append(self.lifetime.port)
コード例 #6
0
ファイル: objectnode.py プロジェクト: adamboduch/gaphor
    def __init__(self, id = None):
        NamedItem.__init__(self, id)

        self._show_ordering = False

        self._upper_bound = self.add_text('upperBound',
            pattern='{ upperBound = %s }',
            style=self.STYLE_BOTTOM,
            visible=self.is_upper_bound_visible)

        self._ordering = self.add_text('ordering',
            pattern = '{ ordering = %s }',
            style = self.STYLE_BOTTOM,
            visible=self._get_show_ordering)

        self.watch('subject<ObjectNode>.upperBound', self.on_object_node_upper_bound)\
            .watch('subject<ObjectNode>.ordering', self.on_object_node_ordering)
コード例 #7
0
ファイル: objectnode.py プロジェクト: xqbumu/gaphor
    def __init__(self, id = None):
        NamedItem.__init__(self, id)

        self._show_ordering = False

        self._upper_bound = self.add_text('upperBound',
            pattern='{ upperBound = %s }',
            style=self.STYLE_BOTTOM,
            visible=self.is_upper_bound_visible)

        self._ordering = self.add_text('ordering',
            pattern = '{ ordering = %s }',
            style = self.STYLE_BOTTOM,
            visible=self._get_show_ordering)

        self.watch('subject<ObjectNode>.upperBound', self.on_object_node_upper_bound)\
            .watch('subject<ObjectNode>.ordering', self.on_object_node_ordering)
コード例 #8
0
ファイル: lifeline.py プロジェクト: adamboduch/gaphor
    def __init__(self, id = None):
        NamedItem.__init__(self, id)

        self.is_destroyed = False

        self.lifetime = LifetimeItem()

        top = self.lifetime.top
        bottom = self.lifetime.bottom

        self._handles.append(top)
        self._handles.append(bottom)
        self._ports.append(self.lifetime.port)

        # create constraints to:
        # - keep bottom handle below top handle
        # - keep top and bottom handle in the middle of the head
        self._constraints.append(CenterConstraint(self._handles[SW].pos.x, self._handles[SE].pos.x, bottom.pos.x))
        self.constraint(vertical=(top.pos, bottom.pos))
        self.constraint(horizontal=(self._handles[SW].pos, top.pos))
        self.lifetime._c_min_length = self.constraint(above=(top.pos, bottom.pos),
                delta=LifetimeItem.MIN_LENGTH)
コード例 #9
0
ファイル: objectnode.py プロジェクト: amolenaar/gaphor
    def __init__(self, id=None):
        NamedItem.__init__(self, id)

        self._show_ordering = False

        self._upper_bound = self.add_text(
            "upperBound",
            pattern="{ upperBound = %s }",
            style=self.STYLE_BOTTOM,
            visible=self.is_upper_bound_visible,
        )

        self._ordering = self.add_text(
            "ordering",
            pattern="{ ordering = %s }",
            style=self.STYLE_BOTTOM,
            visible=self._get_show_ordering,
        )

        self.watch(
            "subject<ObjectNode>.upperBound", self.on_object_node_upper_bound
        ).watch("subject<ObjectNode>.ordering", self.on_object_node_ordering)
コード例 #10
0
ファイル: objectnode.py プロジェクト: otomazeli/gaphor
    def __init__(self, id=None, model=None):
        NamedItem.__init__(self, id, model)

        self._show_ordering = False

        self._upper_bound = self.add_text(
            "upperBound",
            pattern="{ upperBound = %s }",
            style=self.STYLE_BOTTOM,
            visible=self.is_upper_bound_visible,
        )

        self._ordering = self.add_text(
            "ordering",
            pattern="{ ordering = %s }",
            style=self.STYLE_BOTTOM,
            visible=self._get_show_ordering,
        )

        self.watch("subject<ObjectNode>.upperBound",
                   self.on_object_node_upper_bound).watch(
                       "subject<ObjectNode>.ordering",
                       self.on_object_node_ordering)
コード例 #11
0
ファイル: compartment.py プロジェクト: gitter-badger/dabbler
 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, 'drawing-style')
     NamedItem.save(self, save_func)
コード例 #12
0
ファイル: compartment.py プロジェクト: adamboduch/gaphor
 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, 'drawing-style')
     NamedItem.save(self, save_func)
コード例 #13
0
ファイル: activitynodes.py プロジェクト: adamboduch/gaphor
 def __init__(self, id=None):
     NamedItem.__init__(self, id)
     # Do not allow resizing of the node
     for h in self._handles:
         h.movable = False
コード例 #14
0
ファイル: activitynodes.py プロジェクト: tonystark97/gaphor
 def __init__(self, id=None):
     NamedItem.__init__(self, id)
     # Do not allow resizing of the node
     for h in self._handles:
         h.movable = False