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


Python NDImplementationDecorator.NDImplementationDecorator类代码示例

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


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

示例1: __init__

class AssignResponsibilityNodeDialog:
  def __init__(self,objt,environmentName,builder,goalName,isGoal = True):
    self.window = builder.get_object("AssignResponsibilityNodeDialog")
    b = Borg()
    self.isGoalIndicator = isGoal
    self.dbProxy = b.dbProxy
    self.theEnvironmentName = environmentName
    self.theGoalName = goalName
    self.decorator = NDImplementationDecorator(builder)
    self.theObjtId = objt.id()

    roles = self.dbProxy.getDimensionNames('role')
    self.decorator.updateComboCtrl("roleRespNameCtrl",roles,'')
    self.window.resize(350,200)

  def on_roleResponsibilityOkButton_clicked(self,callback_data):
    roleName = self.decorator.getComboValue("roleRespNameCtrl")
    if (self.isGoalIndicator == False):
      roleId = self.dbProxy.getDimensionId(roleName,'role')
      self.dbProxy.addTrace('requirement_role',self.theObjtId,roleId)
    else: 
      goalDim = 'goal'
      if (self.isGoalIndicator == False):
        goalDim = 'requirement'
      parameters = GoalAssociationParameters(self.theEnvironmentName,self.theGoalName,goalDim,'responsible',roleName,'role')
      self.dbProxy.addGoalAssociation(parameters)
    self.window.destroy()

  def show(self):
    self.window.show()
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:30,代码来源:AssignResponsibilityNodeDialog.py

示例2: __init__

class ComponentNodeDialog:
  def __init__(self,objt,builder):
    self.window = builder.get_object("ComponentNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    componentName = objt.name()
    self.decorator.updateTextCtrl("componentNameCtrl",componentName)
    self.decorator.updateMLTextCtrl("componentDescriptionCtrl",objt.description())

    cifs  = []
    for cif in objt.interfaces():
      cifs.append([cif[0],cif[1]])
    self.decorator.updateListCtrl("componentInterfacesCtrl",['Name','Type'],gtk.ListStore(str,str),cifs)

    cStructure = []
    for csRow  in objt.structure():
      cStructure.append([csRow[0],csRow[1],csRow[2],csRow[3],csRow[4],csRow[5],csRow[6],csRow[7],csRow[8],csRow[9]])
    self.decorator.updateListCtrl("componentStructureCtrl",['Head Asset','Type','Nav','Nry','Role','Tail Role','Tail Nry','Tail Nav','Tail Type','Tail Asset'],gtk.ListStore(str,str,str,str,str,str,str,str,str,str),cStructure)

    reqs  = []
    for req in objt.requirements():
      reqs.append([req])
    self.decorator.updateListCtrl("componentRequirementsCtrl",['Name'],gtk.ListStore(str),reqs)

    self.window.resize(350,300)

  def on_componentOkButton_clicked(self,callback_data):
    self.window.destroy()

  def show(self):
    self.window.show()
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:30,代码来源:ComponentNodeDialog.py

示例3: __init__

class AttackerNodeDialog:
  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("AttackerNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("attackerNameCtrl",objt.name())
    roles = []
    for role in objt.roles(environmentName,dupProperty):
      roles.append([role]) 
    self.decorator.updateListCtrl("attackerRolesCtrl",['Role'],gtk.ListStore(str),roles)
    capabilities = []
    for cap,value in objt.capability(environmentName,dupProperty):
      capabilities.append([cap,value]) 
    self.decorator.updateListCtrl("attackerCapabilityCtrl",['Capability','Value'],gtk.ListStore(str,str),capabilities)
    motives = []
    for motive in objt.motives(environmentName,dupProperty):
      motives.append([motive]) 
    self.decorator.updateListCtrl("attackerMotiveCtrl",['Motive'],gtk.ListStore(str),motives)
    self.decorator.updateMLTextCtrl("attackerDescriptionCtrl",objt.description())

    self.window.resize(350,300)

  def on_attackerOkButton_clicked(self,callback_data):
    self.window.destroy()

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

示例4: __init__

class MitigateNodeDialog:
    def __init__(self, objt, environmentName, dupProperty, overridingEnvironment, builder):
        self.window = builder.get_object("MitigateNodeDialog")
        self.decorator = NDImplementationDecorator(builder)
        self.decorator.updateTextCtrl("mitigateNameCtrl", objt.name())
        self.decorator.updateTextCtrl("mitigateRiskCtrl", objt.risk())
        mitType = objt.type(environmentName, dupProperty, overridingEnvironment)
        self.decorator.updateTextCtrl("mitigateTypeCtrl", mitType)

        dpFrame = builder.get_object("mitigateDetectionPointFrame")
        dmFrame = builder.get_object("mitigateDetectionMechanismsFrame")
        if mitType == "Detect":
            self.decorator.updateTextCtrl(
                "mitigateDetectionPointCtrl", objt.detectionPoint(environmentName, dupProperty, overridingEnvironment)
            )
            dmFrame.hide()
        elif mitType == "React":
            dms = []
            for dm in objt.detectionMechanisms(environmentName, dupProperty, overridingEnvironment):
                dms.append([dm])
            self.decorator.updateListCtrl(
                "mitigateDetectionMechanismsCtrl", ["Detection Mechanism"], gtk.ListStore(str), dms
            )
            dpFrame.hide()
        else:
            dpFrame.hide()
            dmFrame.hide()
        self.window.resize(300, 300)

    def on_mitigateOkButton_clicked(self, callback_data):
        self.window.destroy()

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

示例5: __init__

class DomainPropertyNodeDialog:
    def __init__(self, objt, environmentName, dupProperty, overridingEnvironment, builder):
        self.window = builder.get_object("DomainPropertyNodeDialog")
        self.decorator = NDImplementationDecorator(builder)
        self.decorator.updateTextCtrl("domainPropertyNameCtrl", objt.name())
        self.decorator.updateTextCtrl("domainPropertyTypeCtrl", objt.type())
        self.decorator.updateMLTextCtrl("domainPropertyDescriptionCtrl", objt.description())

        self.window.resize(200, 200)

    def on_roleOkButton_clicked(self, callback_data):
        self.window.destroy()

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

示例6: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("UseCaseNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.theSteps = objt.steps(environmentName)
    ucName = objt.name()
    self.decorator.updateTextCtrl("usecaseNameCtrl",ucName)
    self.decorator.updateMLTextCtrl("usecaseDescriptionCtrl",objt.description())

    actors  = []
    for actor in objt.actors():
      actors.append([actor])
    self.decorator.updateListCtrl("usecaseActorsCtrl",['Actor'],gtk.ListStore(str),actors)

    self.decorator.updateMLTextCtrl("usecasePreconditionsCtrl",objt.preconditions(environmentName))

    steps = []
    for s in self.theSteps:
      steps.append([s]) 
    self.decorator.updateListCtrl("usecaseStepsCtrl",['Step'],gtk.ListStore(str),steps)

    stepExceptions = (self.theSteps[0]).exceptions()
    excs = []
    for e in stepExceptions:
      excs.append([e])
    self.decorator.updateListCtrl("usecaseExceptionCtrl",['Exception'],gtk.ListStore(str),excs)

    self.decorator.updateMLTextCtrl("usecasePostconditionsCtrl",objt.postconditions(environmentName))

    self.window.resize(350,300)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:29,代码来源:UseCaseNodeDialog.py

示例7: __init__

 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)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:31,代码来源:GoalNodeDialog.py

示例8: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("TaskNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    taskName = objt.name()
    self.decorator.updateTextCtrl("taskNameCtrl",taskName)
    self.decorator.updateTextCtrl("taskObjectiveCtrl",objt.objective())
    self.decorator.updateMLTextCtrl("taskDependenciesCtrl",objt.dependencies(environmentName,dupProperty))

    personas  = []
    for persona in objt.personas(environmentName,dupProperty,overridingEnvironment):
      personas.append([persona[0],persona[1],persona[2],persona[3],persona[4]])
    self.decorator.updateListCtrl("taskPersonasCtrl",['Persona','Duration','Frequency','Demands','Goal conflict'],gtk.ListStore(str,str,str,str,str),personas)

    assets = []
    for asset in objt.assets(environmentName,dupProperty):
      assets.append([asset])
    self.decorator.updateListCtrl("taskAssetsCtrl",['Asset'],gtk.ListStore(str),assets)

    b = Borg()
    proxy = b.dbProxy
    self.decorator.updateTextCtrl("taskUsabilityCtrl",str(proxy.taskUsabilityScore(taskName,environmentName)))

    taskId = proxy.getDimensionId(taskName,'task')
    environmentId = proxy.getDimensionId(environmentName,'environment')
    self.decorator.updateTextCtrl("taskTaskLoadCtrl",str(proxy.taskLoad(taskId,environmentId)))
    self.decorator.updateTextCtrl("taskCountermeasureLoadCtrl",str(proxy.countermeasureLoad(taskId,environmentId)))
    self.decorator.updateMLTextCtrl("taskNarrativeCtrl",objt.narrative(environmentName,dupProperty))
    self.window.resize(350,300)
开发者ID:AntonP1337,项目名称:cairis,代码行数:28,代码来源:TaskNodeDialog.py

示例9: __init__

 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)
开发者ID:failys,项目名称:cairis,代码行数:28,代码来源:ObstacleNodeDialog.py

示例10: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("CountermeasureNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("countermeasureNameCtrl",objt.name())
    self.decorator.updateMLTextCtrl("countermeasureDescriptionCtrl",objt.description())
    self.decorator.updateTextCtrl("countermeasureCostCtrl",objt.cost(environmentName,dupProperty,overridingEnvironment))

    reqs = []
    for req in set(objt.requirements(environmentName,dupProperty,overridingEnvironment)):
      reqs.append([req])
    self.decorator.updateListCtrl("countermeasureRequirementsCtrl",['Requirement'],gtk.ListStore(str),reqs)

    targets = []
    for target in objt.targets(environmentName,dupProperty,overridingEnvironment):
      targets.append([target.name(),target.effectiveness()])
    self.decorator.updateListCtrl("countermeasureTargetsCtrl",['Target','Effectiveness'],gtk.ListStore(str,str),targets)

    self.decorator.updateListCtrl("countermeasurePropertiesCtrl",['Property','Value'],gtk.ListStore(str,str),objt.propertyList(environmentName,dupProperty,overridingEnvironment))

    roles = []
    for role in objt.roles(environmentName,dupProperty,overridingEnvironment):
      roles.append([role])
    self.decorator.updateListCtrl("countermeasureRolesCtrl",['Role'],gtk.ListStore(str),roles)

    tps  = []
    for tp in objt.personas(environmentName,dupProperty,overridingEnvironment):
      tps.append([tp[0],tp[1],tp[2],tp[3],tp[4],tp[5]])
    self.decorator.updateListCtrl("countermeasureTaskPersonasCtrl",['Task','Persona','Duration','Frequency','Demands','Goals'],gtk.ListStore(str,str,str,str,str,str),tps)


    self.window.resize(500,300)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:31,代码来源:CountermeasureNodeDialog.py

示例11: __init__

  def __init__(self,refName,docName,docExc,builder):
    self.window = builder.get_object("DocumentReferenceNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("documentReferenceNameCtrl",refName)
    self.decorator.updateTextCtrl("documentReferenceDocumentCtrl",docName)
    self.decorator.updateMLTextCtrl("documentReferenceExcerptCtrl",docExc)

    self.window.resize(350,200)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:8,代码来源:DocumentReferenceNodeDialog.py

示例12: __init__

 def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
   self.window = builder.get_object("AssetNodeDialog")
   self.decorator = NDImplementationDecorator(builder)
   self.decorator.updateTextCtrl("assetNameCtrl",objt.name())
   self.decorator.updateMLTextCtrl("assetDescriptionCtrl",objt.description())
   self.decorator.updateMLTextCtrl("assetSignificanceCtrl",objt.significance())
   self.decorator.updateListCtrl("assetPropertiesCtrl",['Property','Value'],gtk.ListStore(str,str),objt.propertyList(environmentName,dupProperty,overridingEnvironment))
   self.window.resize(350,350)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:8,代码来源:AssetNodeDialog.py

示例13: __init__

 def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
   self.window = builder.get_object("AcceptNodeDialog")
   self.decorator = NDImplementationDecorator(builder)
   self.decorator.updateTextCtrl("acceptNameCtrl",objt.name())
   self.decorator.updateTextCtrl("acceptRiskCtrl",objt.risk())
   self.decorator.updateTextCtrl("acceptCostCtrl",objt.cost(environmentName,dupProperty,overridingEnvironment))
   self.decorator.updateMLTextCtrl("acceptRationaleCtrl",objt.description(environmentName,dupProperty,overridingEnvironment))
   self.window.resize(300,300)
开发者ID:AntonP1337,项目名称:cairis,代码行数:8,代码来源:AcceptNodeDialog.py

示例14: __init__

 def __init__(self,objt,builder):
   self.window = builder.get_object("DomainNodeDialog")
   self.decorator = NDImplementationDecorator(builder)
   self.decorator.updateTextCtrl("domainNameCtrl",objt.name())
   self.decorator.updateTextCtrl("domainTypeCtrl",objt.type())
   self.decorator.updateTextCtrl("domainShortCodeCtrl",objt.shortCode())
   self.decorator.updateMLTextCtrl("domainDescriptionCtrl",objt.description())
   self.window.resize(350,350)
开发者ID:AntonP1337,项目名称:cairis,代码行数:8,代码来源:DomainNodeDialog.py

示例15: __init__

  def __init__(self,refName,dimName,objtName,refDesc,builder):
    self.window = builder.get_object("ConceptReferenceNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("conceptReferenceNameCtrl",refName)
    self.decorator.updateTextCtrl("conceptReferenceTypeCtrl",dimName)
    self.decorator.updateTextCtrl("conceptReferenceArtifactCtrl",objtName)
    self.decorator.updateMLTextCtrl("conceptReferenceDescriptionCtrl",refDesc)

    self.window.resize(350,200)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:9,代码来源:ConceptReferenceNodeDialog.py


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