本文整理匯總了Python中gaphor.UML.format方法的典型用法代碼示例。如果您正苦於以下問題:Python UML.format方法的具體用法?Python UML.format怎麽用?Python UML.format使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gaphor.UML
的用法示例。
在下文中一共展示了UML.format方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _set_object_value
# 需要導入模塊: from gaphor import UML [as 別名]
# 或者: from gaphor.UML import format [as 別名]
def _set_object_value(self, row, col, value):
attr = row[-1]
if col == 0:
UML.parse(attr, value)
row[0] = UML.format(attr)
elif col == 1:
attr.isStatic = not attr.isStatic
row[1] = attr.isStatic
elif col == 2:
# Value in attribute object changed:
row[0] = UML.format(attr)
row[1] = attr.isStatic
示例2: render
# 需要導入模塊: from gaphor import UML [as 別名]
# 或者: from gaphor.UML import format [as 別名]
def render(self):
"""Render the OperationItem."""
return UML.format(self.subject,\
visibility=True,\
type=True,\
multiplicity=True,\
default=True) or ''
示例3: handler
# 需要導入模塊: from gaphor import UML [as 別名]
# 或者: from gaphor.UML import format [as 別名]
def handler(event):
if not entry.props.has_focus:
entry.handler_block(changed_id)
entry.set_text(UML.format(self.subject,
visibility=True, is_derived=True,
multiplicity=True) or '')
#entry.set_text(UML.format(self.subject, multiplicity=True) or '')
entry.handler_unblock(changed_id)
示例4: get_text
# 需要導入模塊: from gaphor import UML [as 別名]
# 或者: from gaphor.UML import format [as 別名]
def get_text(self):
if self._edit is self._item:
return self._edit.subject.name
return UML.format(
self._edit.subject,
visibility=True,
is_derived=True,
type=True,
multiplicity=True,
default=True,
)
示例5: set_text
# 需要導入模塊: from gaphor import UML [as 別名]
# 或者: from gaphor.UML import format [as 別名]
def set_text(self):
"""
Set the text on the association end.
"""
if self.subject:
try:
n, m = UML.format(self.subject)
except ValueError:
# need more than 0 values to unpack: property was rendered as
# attribute while in a UNDO action for example.
pass
else:
self._name = n
self._mult = m
self.request_update()
示例6: get_text
# 需要導入模塊: from gaphor import UML [as 別名]
# 或者: from gaphor.UML import format [as 別名]
def get_text(self):
return UML.format(editable(self._edit.subject))
示例7: render
# 需要導入模塊: from gaphor import UML [as 別名]
# 或者: from gaphor.UML import format [as 別名]
def render(self):
"""
Return a rendered feature, as a string.
"""
return UML.format(self.subject, pattern=self.pattern) or ''
示例8: _get_rows
# 需要導入模塊: from gaphor import UML [as 別名]
# 或者: from gaphor.UML import format [as 別名]
def _get_rows(self):
for operation in self._item.subject.ownedOperation:
yield [UML.format(operation), operation.isAbstract, operation.isStatic, operation]