本文整理汇总了Python中NDImplementationDecorator.NDImplementationDecorator.getText方法的典型用法代码示例。如果您正苦于以下问题:Python NDImplementationDecorator.getText方法的具体用法?Python NDImplementationDecorator.getText怎么用?Python NDImplementationDecorator.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NDImplementationDecorator.NDImplementationDecorator
的用法示例。
在下文中一共展示了NDImplementationDecorator.getText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import getText [as 别名]
class AssetAssociationNodeDialog:
def __init__(self,objt,environmentName,builder):
self.window = builder.get_object("AssetAssociationNodeDialog")
b = Borg()
self.dbProxy = b.dbProxy
self.theCurrentEnvironment = environmentName
self.theHeadName = objt.name()
self.decorator = NDImplementationDecorator(builder)
assets = self.dbProxy.environmentAssets(self.theCurrentEnvironment)
associationTypes = ['Inheritance','Association','Aggregation','Composition','Dependency']
multiplicityTypes = ['1','*','1..*']
self.decorator.updateComboCtrl("assetAssociationHeadAdornmentCtrl",associationTypes,'')
self.decorator.updateComboCtrl("assetAssociationHeadNryCtrl",multiplicityTypes,'')
self.decorator.updateComboCtrl("assetAssociationTailNryCtrl",multiplicityTypes,'')
self.decorator.updateComboCtrl("assetAssociationTailAdornmentCtrl",associationTypes,'')
self.decorator.updateComboCtrl("assetAssociationTailNameCtrl",assets,'')
self.decorator.updateButtonLabel("assetAssociationOkButton","Create")
def on_assetAssociationOkButton_clicked(self,callback_data):
headAdornment = self.decorator.getComboValue("assetAssociationHeadAdornmentCtrl")
headNry = self.decorator.getComboValue("assetAssociationHeadNryCtrl")
headRole = self.decorator.getText("assetAssociationHeadRoleCtrl")
tailRole = self.decorator.getText("assetAssociationTailRoleCtrl")
tailNry = self.decorator.getComboValue("assetAssociationTailNryCtrl")
tailAdornment = self.decorator.getComboValue("assetAssociationTailAdornmentCtrl")
tailName = self.decorator.getComboValue("assetAssociationTailNameCtrl")
parameters = ClassAssociationParameters(self.theCurrentEnvironment,self.theHeadName,'asset',tailAdornment,tailNry,tailRole,headRole,headNry,headAdornment,'asset',tailName)
self.dbProxy.addClassAssociation(parameters)
self.window.destroy()
def show(self):
self.window.show()
示例2: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import getText [as 别名]
class GoalNodeDialog:
def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
self.window = builder.get_object("GoalNodeDialog")
b = Borg()
self.dbProxy = b.dbProxy
self.theEnvironmentName = environmentName
self.theGoalAssociation = None
self.theGoalId = -1
self.decorator = NDImplementationDecorator(builder)
goalCategories = self.dbProxy.getDimensionNames('goal_category_type')
priorityTypes = self.dbProxy.getDimensionNames('priority_type')
self.goalAssociations = []
self.subGoalAssociations= []
if (objt == None):
self.decorator.updateComboCtrl("goalCategoryCtrl",goalCategories,'')
self.decorator.updateComboCtrl("goalPriorityCtrl",priorityTypes,'')
self.decorator.updateButtonLabel("goalOkButton","Create")
self.isCreate = True
else:
self.theGoalId = objt.id()
envProperty = objt.environmentProperty(self.theEnvironmentName)
self.goalAssociations = envProperty.goalRefinements()
self.subGoalAssociations = envProperty.subGoalRefinements()
self.decorator.updateTextCtrl("goalNameCtrl",objt.name())
self.decorator.updateMLTextCtrl("goalDefinitionCtrl",objt.definition(environmentName,dupProperty))
self.decorator.updateComboCtrl("goalCategoryCtrl",goalCategories,objt.category(environmentName,dupProperty))
self.decorator.updateComboCtrl("goalPriorityCtrl",priorityTypes,objt.priority(environmentName,dupProperty))
self.decorator.updateMLTextCtrl("goalFitCriterionCtrl",objt.fitCriterion(environmentName,dupProperty))
self.decorator.updateMLTextCtrl("goalIssueCtrl",objt.issue(environmentName,dupProperty))
self.decorator.updateButtonLabel("goalOkButton","Update")
self.isCreate = False
self.window.resize(350,600)
def environmentProperties(self):
goalDef = self.decorator.getMLText("goalDefinitionCtrl")
goalCat = self.decorator.getComboValue("goalCategoryCtrl")
goalPri = self.decorator.getComboValue("goalPriorityCtrl")
goalFC = self.decorator.getMLText("goalFitCriterionCtrl")
goalIssue = self.decorator.getMLText("goalIssueCtrl")
envProperties = GoalEnvironmentProperties(self.theEnvironmentName,'',goalDef,goalCat,goalPri,goalFC,goalIssue,self.goalAssociations,self.subGoalAssociations)
return envProperties
def newGoalParameters(self):
goalName = self.decorator.getText("goalNameCtrl")
envProperties = self.environmentProperties()
parameters = GoalParameters(goalName,'None',[],[envProperties])
parameters.setId(self.theGoalId)
return parameters
def existingGoalParameters(self):
goalName = self.decorator.getText("goalNameCtrl")
modifiedProperties = self.environmentProperties()
goalEnvProperties = self.dbProxy.goalEnvironmentProperties(self.theGoalId)
for idx,p in enumerate(goalEnvProperties):
if (p.name() == self.theEnvironmentName):
goalEnvProperties[idx] = modifiedProperties
parameters = GoalParameters(goalName,'None',[],goalEnvProperties)
parameters.setId(self.theGoalId)
return parameters
def parentGoal(self,goalName,assocType):
self.theGoalAssociation = GoalAssociationParameters(self.theEnvironmentName,goalName,'goal',assocType)
def on_goalOkButton_clicked(self,callback_data):
if (self.isCreate):
parameters = self.newGoalParameters()
self.dbProxy.addGoal(parameters)
self.theGoalAssociation.theSubGoal = parameters.name()
self.theGoalAssociation.theSubGoalDimension = 'goal'
self.theGoalAssociation.theAlternativeId = 0
self.theGoalAssociation.theRationale = ''
self.dbProxy.addGoalAssociation(self.theGoalAssociation)
else:
parameters = self.existingGoalParameters()
self.dbProxy.updateGoal(parameters)
self.window.destroy()
def show(self):
self.window.show()
示例3: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import getText [as 别名]
class ObstacleNodeDialog:
def __init__(self, objt, environmentName, dupProperty, overridingEnvironment, builder):
self.window = builder.get_object("ObstacleNodeDialog")
b = Borg()
self.dbProxy = b.dbProxy
self.theEnvironmentName = environmentName
self.theObstacleAssociation = None
self.theObstacleId = -1
self.decorator = NDImplementationDecorator(builder)
obstacleCategories = self.dbProxy.getDimensionNames("obstacle_category_type")
self.obstacleAssociations = []
self.subObstacleAssociations = []
if objt == None:
self.decorator.updateComboCtrl("obstacleCategoryCtrl", obstacleCategories, "")
self.decorator.updateButtonLabel("obstacleOkButton", "Create")
self.isCreate = True
else:
self.theObstacleId = objt.id()
envProperty = objt.environmentProperty(self.theEnvironmentName)
self.obstacleAssociations = envProperty.goalRefinements()
self.subObstacleAssociations = envProperty.subGoalRefinements()
self.decorator.updateTextCtrl("obstacleNameCtrl", objt.name())
self.decorator.updateComboCtrl(
"obstacleCategoryCtrl", obstacleCategories, objt.category(environmentName, dupProperty)
)
self.decorator.updateMLTextCtrl("obstacleDefinitionCtrl", objt.definition(environmentName, dupProperty))
self.decorator.updateButtonLabel("obstacleOkButton", "Update")
self.isCreate = False
self.window.resize(350, 600)
def environmentProperties(self):
obsCat = self.decorator.getComboValue("obstacleCategoryCtrl")
obsDef = self.decorator.getMLText("obstacleDefinitionCtrl")
envProperties = ObstacleEnvironmentProperties(
self.theEnvironmentName, "", obsDef, obsCat, self.obstacleAssociations, self.subObstacleAssociations
)
return envProperties
def newObstacleParameters(self):
obsName = self.decorator.getText("obstacleNameCtrl")
envProperties = self.environmentProperties()
parameters = ObstacleParameters(obsName, "Obstacle refinement", [], [envProperties])
parameters.setId(self.theObstacleId)
return parameters
def existingObstacleParameters(self):
obsName = self.decorator.getText("obstacleNameCtrl")
modifiedProperties = self.environmentProperties()
envProperties = self.dbProxy.obstacleEnvironmentProperties(self.theObstacleId)
for idx, p in enumerate(envProperties):
if p.name() == self.theEnvironmentName:
envProperties[idx] = modifiedProperties
parameters = ObstacleParameters(obsName, "Obstacle refinement", [], envProperties)
parameters.setId(self.theObstacleId)
return parameters
def parentObstacle(self, obsName, assocType):
self.theObstacleAssociation = GoalAssociationParameters(self.theEnvironmentName, obsName, "obstacle", assocType)
def on_obstacleOkButton_clicked(self, callback_data):
if self.isCreate:
parameters = self.newObstacleParameters()
self.dbProxy.addObstacle(parameters)
self.theObstacleAssociation.theSubGoal = parameters.name()
self.theObstacleAssociation.theSubGoalDimension = "obstacle"
self.theObstacleAssociation.theAlternativeId = 0
self.theObstacleAssociation.theRationale = ""
self.dbProxy.addGoalAssociation(self.theObstacleAssociation)
else:
parameters = self.existingObstacleParameters()
self.dbProxy.updateObstacle(parameters)
self.window.destroy()
def show(self):
self.window.show()