当前位置: 首页>>代码示例>>Python>>正文


Python NDImplementationDecorator.updateButtonLabel方法代码示例

本文整理汇总了Python中NDImplementationDecorator.NDImplementationDecorator.updateButtonLabel方法的典型用法代码示例。如果您正苦于以下问题:Python NDImplementationDecorator.updateButtonLabel方法的具体用法?Python NDImplementationDecorator.updateButtonLabel怎么用?Python NDImplementationDecorator.updateButtonLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NDImplementationDecorator.NDImplementationDecorator的用法示例。


在下文中一共展示了NDImplementationDecorator.updateButtonLabel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateButtonLabel [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()
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:35,代码来源:AssetAssociationNodeDialog.py

示例2: __init__

# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateButtonLabel [as 别名]
class GoalRefinementNodeDialog:
  def __init__(self,objt,environmentName,builder,goalIndicator,gName,reqIndicator = False):
    self.window = builder.get_object("GoalRefinementNodeDialog")
    b = Borg()
    self.dbProxy = b.dbProxy
    self.theEnvironmentName = environmentName
    self.decorator = NDImplementationDecorator(builder)
    self.reqIndicator = reqIndicator

    refTypes = ['and','or']
    goals = self.dbProxy.environmentGoals(self.theEnvironmentName)
    if (self.reqIndicator == True):
      refTypes = ['and']
      goals = self.dbProxy.getDimensionNames('requirement')

    self.decorator.updateComboCtrl("goalRefNameCtrl",goals,'')
    self.decorator.updateComboCtrl("goalRefinementCtrl",refTypes,'')
    self.decorator.updateButtonLabel("goalRefinementOkButton","Create")
    self.window.resize(350,200)
    self.goalIndicator = goalIndicator
    self.inputGoalName = gName

  def on_goalRefinementOkButton_clicked(self,callback_data):
    goalName = self.decorator.getComboValue("goalRefNameCtrl")
    assocType = self.decorator.getComboValue("goalRefinementCtrl")
    if (self.reqIndicator == True):
      parameters = GoalAssociationParameters(self.theEnvironmentName,self.inputGoalName,'goal','and',goalName,'requirement')
    elif (self.goalIndicator == True):
      parameters = GoalAssociationParameters(self.theEnvironmentName,goalName,'goal',assocType,self.inputGoalName,'goal')
    else:
      parameters = GoalAssociationParameters(self.theEnvironmentName,self.inputGoalName,'goal',assocType,goalName,'goal')
    self.dbProxy.addGoalAssociation(parameters)
    self.window.destroy()

  def show(self):
    self.window.show()
开发者ID:AntonP1337,项目名称:cairis,代码行数:38,代码来源:GoalRefinementNodeDialog.py

示例3: __init__

# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateButtonLabel [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()
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:82,代码来源:GoalNodeDialog.py

示例4: __init__

# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateButtonLabel [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()
开发者ID:failys,项目名称:cairis,代码行数:77,代码来源:ObstacleNodeDialog.py


注:本文中的NDImplementationDecorator.NDImplementationDecorator.updateButtonLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。