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
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
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)
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)
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)
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)
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)
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)
def __init__(self, id=None): NamedItem.__init__(self, id) # Do not allow resizing of the node for h in self._handles: h.movable = False