Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@side.setter
@observed
def side(self, side):
self._side = side
self.direction = None
if self.side is SnappedSide.LEFT:
self.direction = Direction.RIGHT if self._is_in_port else Direction.LEFT
elif self.side is SnappedSide.TOP:
self.direction = Direction.DOWN if self._is_in_port else Direction.UP
elif self.side is SnappedSide.RIGHT:
self.direction = Direction.LEFT if self._is_in_port else Direction.RIGHT
elif self.side is SnappedSide.BOTTOM:
self.direction = Direction.UP if self._is_in_port else Direction.DOWN
@observed
def _set_show_operations(self, value):
"""Sets the show operations property. This will either show or hide
the operations compartment of the ClassItem. This is part of the
show_operations property."""
self._operations.visible = value
self._operations.use_extra_space = value
self._attributes.use_extra_space = not self._operations.visible
@observed
def _set_combined(self, value):
# self.preserve_property('combined')
self._combined = value
@observed
def side(self, side):
self._side = side
self.direction = None
if self.side is SnappedSide.LEFT:
self.direction = Direction.RIGHT if self._is_in_port else Direction.LEFT
elif self.side is SnappedSide.TOP:
self.direction = Direction.DOWN if self._is_in_port else Direction.UP
elif self.side is SnappedSide.RIGHT:
self.direction = Direction.LEFT if self._is_in_port else Direction.RIGHT
elif self.side is SnappedSide.BOTTOM:
self.direction = Direction.UP if self._is_in_port else Direction.DOWN
@observed
def _set_show_attributes(self, value):
"""Sets the show attributes property. This will either show or hide
the attributes compartment of the ClassItem. This is part of the
show_attributes property."""
self._attributes.visible = value
@observed
def _set_show_ordering(self, value):
self._show_ordering = value
self.request_update()
@observed
def set_drawing_style(self, style):
"""
In addition to setting the drawing style, the handles are
make non-movable if the icon (folded) style is used.
"""
super(InterfaceItem, self).set_drawing_style(style)
if self._drawing_style == self.DRAW_ICON:
self.folded = self.FOLDED_PROVIDED # set default folded mode
else:
self.folded = self.FOLDED_NONE # unset default folded mode
@observed
def set_drawing_style(self, style):
"""
Set the drawing style for this classifier: DRAW_COMPARTMENT,
DRAW_COMPARTMENT_ICON or DRAW_ICON.
"""
if style != self._drawing_style:
self._drawing_style = style
self.request_update()
if self._drawing_style == self.DRAW_COMPARTMENT:
self.draw = self.draw_compartment
self.pre_update = self.pre_update_compartment
self.post_update = self.post_update_compartment
elif self._drawing_style == self.DRAW_COMPARTMENT_ICON:
self.draw = self.draw_compartment_icon
@observed
def _set_show_stereotypes_attrs(self, value):
self._show_stereotypes_attrs = value
self.update_stereotypes_attrs()