本文整理汇总了Python中Server.postCondition方法的典型用法代码示例。如果您正苦于以下问题:Python Server.postCondition方法的具体用法?Python Server.postCondition怎么用?Python Server.postCondition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server
的用法示例。
在下文中一共展示了Server.postCondition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createNewServer
# 需要导入模块: import Server [as 别名]
# 或者: from Server import postCondition [as 别名]
def createNewServer(self, wherex, wherey, screenCoordinates = 1):
self.fromClass = None
self.toClass = None
# try the global constraints...
res = self.ASGroot.preCondition(ASG.CREATE)
if res:
self.constraintViolation(res)
self.mode=self.IDLEMODE
return
new_semantic_obj = Server(self)
res = new_semantic_obj.preCondition ( ASGNode.CREATE )
if res: return self.constraintViolation(res)
new_semantic_obj.preAction ( ASGNode.CREATE )
ne = len(self.ASGroot.listNodes["Server"])
if new_semantic_obj.keyword_:
new_semantic_obj.keyword_.setValue(new_semantic_obj.keyword_.toString()+str(ne))
if screenCoordinates:
new_obj = graph_Server(self.UMLmodel.canvasx(wherex), self.UMLmodel.canvasy(wherey), new_semantic_obj)
else: # already in canvas coordinates
new_obj = graph_Server(wherex, wherey, new_semantic_obj)
new_obj.DrawObject(self.UMLmodel, self.editGGLabel)
self.UMLmodel.addtag_withtag("Server", new_obj.tag)
new_semantic_obj.graphObject_ = new_obj
self.ASGroot.addNode(new_semantic_obj)
res = self.ASGroot.postCondition(ASG.CREATE)
if res:
self.constraintViolation(res)
self.mode=self.IDLEMODE
return
res = new_semantic_obj.postCondition(ASGNode.CREATE)
if res:
self.constraintViolation(res)
self.mode=self.IDLEMODE
return
new_semantic_obj.postAction(ASGNode.CREATE)
self.mode=self.IDLEMODE
if self.editGGLabel :
self.statusbar.event(StatusBar.TRANSFORMATION, StatusBar.CREATE)
else:
self.statusbar.event(StatusBar.MODEL, StatusBar.CREATE)
return new_semantic_obj