示例#1
0
 def __init__(self, parent):
     wx.Panel.__init__(self, parent, armid.STEPSYNOPSIS_ID)
     b = Borg()
     self.dbProxy = b.dbProxy
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Synopsis', (87, 30),
                                      armid.STEPSYNOPSIS_TEXTSYNOPSIS_ID),
         0, wx.EXPAND)
     actorSizer = wx.BoxSizer(wx.HORIZONTAL)
     mainSizer.Add(actorSizer, 0, wx.EXPAND)
     actorSizer.Add(
         WidgetFactory.buildComboSizerList(
             self, 'Actor Type', (87, 30),
             armid.STEPSYNOPSIS_COMBOACTORTYPE_ID, ['asset', 'role']), 1,
         wx.EXPAND)
     actorSizer.Add(
         WidgetFactory.buildComboSizerList(
             self, 'Actor', (87, 30), armid.STEPSYNOPSIS_COMBOACTORNAME_ID,
             ['']), 1, wx.EXPAND)
     mainSizer.Add(wx.StaticText(self, -1, ''), 1, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildCommitButtonSizer(
             self, armid.STEPSYNOPSIS_BUTTONCOMMIT_ID, True), 0,
         wx.ALIGN_CENTER)
     self.SetSizer(mainSizer)
     wx.EVT_COMBOBOX(self, armid.STEPSYNOPSIS_COMBOACTORTYPE_ID,
                     self.onActorType)
  def __init__(self,parent,firstName = '',surname='',affiliation='',role=''):
    wx.Dialog.__init__(self,parent,CONTRIBUTORENTRY_ID,'Add Contributor',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(500,300))
    self.theFirstName = firstName
    self.theSurname = surname
    self.theAffiliation = affiliation
    self.theRole = role
    mainSizer = wx.BoxSizer(wx.VERTICAL)

    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Firstname',(87,30),CONTRIBUTORENTRY_TEXTFIRSTNAME_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Surname',(87,30),CONTRIBUTORENTRY_TEXTSURNAME_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Affiliation',(87,30),CONTRIBUTORENTRY_TEXTAFFILIATION_ID),0,wx.EXPAND)
    participantRoles = ['Participant','Facilitator','Scribe']
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Role',(87,30),CONTRIBUTORENTRY_COMBOROLE_ID,participantRoles),0,wx.EXPAND)
    mainSizer.Add(wx.StaticText(self,-1),1,wx.EXPAND)

    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,CONTRIBUTORENTRY_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,CONTRIBUTORENTRY_BUTTONCOMMIT_ID,self.onCommit)
    self.commitLabel = 'Add'
    if (len(self.theFirstName) > 0):
      self.commitLabel = 'Edit'
      self.SetLabel('Edit Contributor')
      firstNameCtrl = self.FindWindowById(CONTRIBUTORENTRY_TEXTFIRSTNAME_ID)
      firstNameCtrl.SetValue(self.theFirstName)
      surnameCtrl = self.FindWindowById(CONTRIBUTORENTRY_TEXTSURNAME_ID)
      surnameCtrl.SetValue(self.theSurname)
      affiliationCtrl = self.FindWindowById(CONTRIBUTORENTRY_TEXTAFFILIATION_ID)
      affiliationCtrl.SetValue(self.theAffiliation)
      roleCtrl = self.FindWindowById(CONTRIBUTORENTRY_COMBOROLE_ID)
      roleCtrl.SetStringSelection(self.theRole)
      buttonCtrl = self.FindWindowById(CONTRIBUTORENTRY_BUTTONCOMMIT_ID)
      buttonCtrl.SetLabel('Edit')
示例#3
0
    def __init__(self, parent, setCapabilities, dp):
        wx.Dialog.__init__(self,
                           parent,
                           armid.CAPABILITY_ID,
                           'Add Capability',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(400, 150))
        self.theCapabilityName = ''
        self.theCapabilityValue = ''
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        defaultCapabilities = set(dp.getDimensionNames('capability'))
        capabilityList = list(defaultCapabilities.difference(setCapabilities))
        mainSizer.Add(
            WidgetFactory.buildComboSizerList(
                self, 'Capability', (87, 30),
                armid.CAPABILITY_COMBOCAPABILITY_ID, capabilityList), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildComboSizerList(self, 'Value', (87, 30),
                                              armid.CAPABILITY_COMBOVALUE_ID,
                                              ['Low', 'Medium', 'High']), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(
                self, armid.CAPABILITY_BUTTONADD_ID), 0, wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, armid.CAPABILITY_BUTTONADD_ID, self.onAdd)
示例#4
0
  def __init__(self,parent,dLabel,dName,dType,dDesc):
    wx.Dialog.__init__(self,parent,DIRECTORYENTRY_ID,'Directory Entry',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(500,300))
    mainSizer = wx.BoxSizer(wx.VERTICAL)

    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Label',(87,30),DIRECTORYENTRY_TEXTLABEL_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),DIRECTORYENTRY_TEXTNAME_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Type',(87,30),DIRECTORYENTRY_TEXTTYPE_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),DIRECTORYENTRY_TEXTDESCRIPTION_ID),1,wx.EXPAND)

    buttonSizer = wx.BoxSizer(wx.ALIGN_CENTER)
    okButton = wx.Button(self,wx.ID_OK,'Ok')
    buttonSizer.Add(okButton)
    mainSizer.Add(buttonSizer,0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    labelCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTLABEL_ID)
    labelCtrl.SetValue(dLabel)
    labelCtrl.Disable()
    nameCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTNAME_ID)
    nameCtrl.SetValue(dName)
    nameCtrl.Disable()
    typeCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTTYPE_ID)
    typeCtrl.SetValue(dType)
    typeCtrl.Disable()
    descCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTDESCRIPTION_ID)
    descCtrl.SetValue(dDesc)
    descCtrl.Disable()
示例#5
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           armid.CHANNEL_ID,
                           'Add Channel',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(400, 150))
        self.theChannelName = ''
        self.theDataType = ''
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Channel', (87, 30),
                                         armid.CHANNEL_TEXTCHANNEL_ID), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Data Type', (87, 30),
                                         armid.CHANNEL_TEXTDATATYPE_ID), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(
                self, armid.CHANNEL_BUTTONADD_ID), 0, wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, armid.CHANNEL_BUTTONADD_ID, self.onAdd)
示例#6
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, OBSTACLE_ID)
        b = Borg()
        self.dbProxy = b.dbProxy
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Name', (87, 30),
                                         OBSTACLE_TEXTNAME_ID), 0, wx.EXPAND)
        self.nameCtrl = self.FindWindowById(OBSTACLE_TEXTNAME_ID)
        self.notebook = ObstacleEnvironmentNotebook(self, self.dbProxy)

        mainSizer.Add(self.notebook, 1, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildCommitButtonSizer(self,
                                                 OBSTACLE_BUTTONCOMMIT_ID,
                                                 True), 0, wx.CENTER)
        self.definitionCtrl = self.notebook.FindWindowById(
            OBSTACLE_TEXTDEFINITION_ID)
        self.categoryCtrl = self.notebook.FindWindowById(
            OBSTACLE_COMBOCATEGORY_ID)
        self.goalAssociationCtrl = self.notebook.FindWindowById(
            OBSTACLE_LISTGOALS_ID)
        self.subGoalAssociationCtrl = self.notebook.FindWindowById(
            OBSTACLE_LISTSUBGOALS_ID)
        self.cCtrl = self.notebook.FindWindowById(OBSTACLE_LISTCONCERNS_ID)
        self.SetSizer(mainSizer)
示例#7
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, armid.GOAL_ID)
        b = Borg()
        self.dbProxy = b.dbProxy
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        mainSizer.Add(WidgetFactory.buildTextSizer(self, "Name", (87, 30), armid.GOAL_TEXTNAME_ID), 0, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, "Originator", (87, 30), armid.GOAL_TEXTORIGINATOR_ID), 0, wx.EXPAND
        )
        self.nameCtrl = self.FindWindowById(armid.GOAL_TEXTNAME_ID)
        self.notebook = GoalEnvironmentNotebook(self, self.dbProxy, True)

        mainSizer.Add(self.notebook, 1, wx.EXPAND)
        mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self, armid.GOAL_BUTTONCOMMIT_ID, True), 0, wx.CENTER)
        self.definitionCtrl = self.notebook.FindWindowById(armid.GOAL_TEXTDEFINITION_ID)
        self.categoryCtrl = self.notebook.FindWindowById(armid.GOAL_COMBOCATEGORY_ID)
        self.priorityCtrl = self.notebook.FindWindowById(armid.GOAL_COMBOPRIORITY_ID)
        self.fitCriterionCtrl = self.notebook.FindWindowById(armid.GOAL_TEXTFITCRITERION_ID)
        self.issueCtrl = self.notebook.FindWindowById(armid.GOAL_TEXTISSUE_ID)
        self.goalAssociationCtrl = self.notebook.FindWindowById(armid.GOAL_LISTGOALREFINEMENTS_ID)
        self.subGoalAssociationCtrl = self.notebook.FindWindowById(armid.GOAL_LISTSUBGOALREFINEMENTS_ID)
        self.cCtrl = self.notebook.FindWindowById(armid.GOAL_LISTCONCERNS_ID)
        self.caCtrl = self.notebook.FindWindowById(armid.GOAL_LISTCONCERNASSOCIATIONS_ID)
        self.ctCtrl = self.notebook.FindWindowById(armid.GOAL_COMBOCONTRIBUTIONTYPE_ID)
        self.SetSizer(mainSizer)
 def buildControls(self):
   mainSizer = wx.BoxSizer(wx.VERTICAL)
   mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),ENVIRONMENT_TEXTNAME_ID),0,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildTextSizer(self,'Short Code',(87,30),ENVIRONMENT_TEXTSHORTCODE_ID),0,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),ENVIRONMENT_TEXTDESCRIPTION_ID),1,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,ENVIRONMENT_BUTTONCOMMIT_ID,True))
   self.SetSizer(mainSizer)
示例#9
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           RESPONSECOST_ID,
                           'Add Response Cost',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(400, 100))
        b = Borg()
        self.dbProxy = b.dbProxy
        self.theResponseName = ''
        self.theResponseCost = ''
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        responseList = self.dbProxy.getDimensionNames('response')
        mainSizer.Add(
            WidgetFactory.buildComboSizerList(self, 'Response', (87, 30),
                                              RESPONSECOST_COMBORESPONSE_ID,
                                              responseList), 0, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildComboSizerList(self, 'Cost', (87, 30),
                                              RESPONSECOST_COMBOCOST_ID,
                                              ['Low', 'Medium', 'High']), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(self,
                                                    RESPONSECOST_BUTTONADD_ID),
            0, wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, RESPONSECOST_BUTTONADD_ID, self.onAdd)
示例#10
0
 def __init__(self, parent):
     wx.Panel.__init__(self, parent, armid.STEPSYNOPSIS_ID)
     b = Borg()
     self.dbProxy = b.dbProxy
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, "Synopsis", (87, 30), armid.STEPSYNOPSIS_TEXTSYNOPSIS_ID), 0, wx.EXPAND
     )
     actorSizer = wx.BoxSizer(wx.HORIZONTAL)
     mainSizer.Add(actorSizer, 0, wx.EXPAND)
     actorSizer.Add(
         WidgetFactory.buildComboSizerList(
             self, "Actor Type", (87, 30), armid.STEPSYNOPSIS_COMBOACTORTYPE_ID, ["asset", "role"]
         ),
         1,
         wx.EXPAND,
     )
     actorSizer.Add(
         WidgetFactory.buildComboSizerList(self, "Actor", (87, 30), armid.STEPSYNOPSIS_COMBOACTORNAME_ID, [""]),
         1,
         wx.EXPAND,
     )
     mainSizer.Add(wx.StaticText(self, -1, ""), 1, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildCommitButtonSizer(self, armid.STEPSYNOPSIS_BUTTONCOMMIT_ID, True), 0, wx.ALIGN_CENTER
     )
     self.SetSizer(mainSizer)
     wx.EVT_COMBOBOX(self, armid.STEPSYNOPSIS_COMBOACTORTYPE_ID, self.onActorType)
示例#11
0
  def __init__(self,parent,fromName = '',toName = '',rType = ''):
    wx.Dialog.__init__(self,parent,CODERELATIONSHIP_ID,'Add Code Relationship',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,200))

    self.rtLookup = {'==':'associated','=>':'implies','<>':'conflict','[]':'part-of'}
    self.lookupRt = {'':'','associated':'==','implies':'=>','conflict':'<>','part-of':'[]'}

    self.theFromName = fromName
    self.theToName = toName
    self.theRelationship = self.lookupRt[rType]
    self.commitLabel = 'Add'
    mainSizer = wx.BoxSizer(wx.VERTICAL)


    b = Borg()
    codeList = b.dbProxy.getDimensionNames('code')
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'From',(87,30),CODERELATIONSHIP_COMBOFROMCODE_ID,codeList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'To',(87,30),CODERELATIONSHIP_COMBOTOCODE_ID,codeList),0,wx.EXPAND)
    rtList = ['==','=>','<>','[]']
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Relationship',(87,30),CODERELATIONSHIP_COMBORTTYPE_ID,rtList),0,wx.EXPAND)
    mainSizer.Add(wx.StaticText(self,-1,''),1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,CODERELATIONSHIP_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)
    wx.EVT_BUTTON(self,CODERELATIONSHIP_BUTTONADD_ID,self.onCommit)

    if self.theFromName != '':
      fromCtrl = self.FindWindowById(CODERELATIONSHIP_COMBOFROMCODE_ID)
      toCtrl = self.FindWindowById(CODERELATIONSHIP_COMBOTOCODE_ID)
      rtCtrl = self.FindWindowById(CODERELATIONSHIP_COMBORTTYPE_ID)
      fromCtrl.SetValue(self.theFromName)
      toCtrl.SetValue(self.theToName)
      rtCtrl.SetValue(self.theRelationship)
示例#12
0
    def __init__(self,
                 parent,
                 firstName='',
                 surname='',
                 affiliation='',
                 role=''):
        wx.Dialog.__init__(self,
                           parent,
                           CONTRIBUTORENTRY_ID,
                           'Add Contributor',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(500, 300))
        self.theFirstName = firstName
        self.theSurname = surname
        self.theAffiliation = affiliation
        self.theRole = role
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Firstname', (87, 30),
                                         CONTRIBUTORENTRY_TEXTFIRSTNAME_ID), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Surname', (87, 30),
                                         CONTRIBUTORENTRY_TEXTSURNAME_ID), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Affiliation', (87, 30),
                                         CONTRIBUTORENTRY_TEXTAFFILIATION_ID),
            0, wx.EXPAND)
        participantRoles = ['Participant', 'Facilitator', 'Scribe']
        mainSizer.Add(
            WidgetFactory.buildComboSizerList(self, 'Role', (87, 30),
                                              CONTRIBUTORENTRY_COMBOROLE_ID,
                                              participantRoles), 0, wx.EXPAND)
        mainSizer.Add(wx.StaticText(self, -1), 1, wx.EXPAND)

        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(
                self, CONTRIBUTORENTRY_BUTTONCOMMIT_ID), 0, wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, CONTRIBUTORENTRY_BUTTONCOMMIT_ID, self.onCommit)
        self.commitLabel = 'Add'
        if (len(self.theFirstName) > 0):
            self.commitLabel = 'Edit'
            self.SetLabel('Edit Contributor')
            firstNameCtrl = self.FindWindowById(
                CONTRIBUTORENTRY_TEXTFIRSTNAME_ID)
            firstNameCtrl.SetValue(self.theFirstName)
            surnameCtrl = self.FindWindowById(CONTRIBUTORENTRY_TEXTSURNAME_ID)
            surnameCtrl.SetValue(self.theSurname)
            affiliationCtrl = self.FindWindowById(
                CONTRIBUTORENTRY_TEXTAFFILIATION_ID)
            affiliationCtrl.SetValue(self.theAffiliation)
            roleCtrl = self.FindWindowById(CONTRIBUTORENTRY_COMBOROLE_ID)
            roleCtrl.SetStringSelection(self.theRole)
            buttonCtrl = self.FindWindowById(CONTRIBUTORENTRY_BUTTONCOMMIT_ID)
            buttonCtrl.SetLabel('Edit')
示例#13
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, GOAL_ID)
        b = Borg()
        self.dbProxy = b.dbProxy
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Name', (87, 30),
                                         GOAL_TEXTNAME_ID), 0, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Originator', (87, 30),
                                         GOAL_TEXTORIGINATOR_ID), 0, wx.EXPAND)
        self.nameCtrl = self.FindWindowById(GOAL_TEXTNAME_ID)
        self.notebook = GoalEnvironmentNotebook(self, self.dbProxy, True)

        mainSizer.Add(self.notebook, 1, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildCommitButtonSizer(self, GOAL_BUTTONCOMMIT_ID,
                                                 True), 0, wx.CENTER)
        self.definitionCtrl = self.notebook.FindWindowById(
            GOAL_TEXTDEFINITION_ID)
        self.categoryCtrl = self.notebook.FindWindowById(GOAL_COMBOCATEGORY_ID)
        self.priorityCtrl = self.notebook.FindWindowById(GOAL_COMBOPRIORITY_ID)
        self.fitCriterionCtrl = self.notebook.FindWindowById(
            GOAL_TEXTFITCRITERION_ID)
        self.issueCtrl = self.notebook.FindWindowById(GOAL_TEXTISSUE_ID)
        self.goalAssociationCtrl = self.notebook.FindWindowById(
            GOAL_LISTGOALREFINEMENTS_ID)
        self.subGoalAssociationCtrl = self.notebook.FindWindowById(
            GOAL_LISTSUBGOALREFINEMENTS_ID)
        self.cCtrl = self.notebook.FindWindowById(GOAL_LISTCONCERNS_ID)
        self.caCtrl = self.notebook.FindWindowById(
            GOAL_LISTCONCERNASSOCIATIONS_ID)
        self.ctCtrl = self.notebook.FindWindowById(
            GOAL_COMBOCONTRIBUTIONTYPE_ID)
        self.SetSizer(mainSizer)
示例#14
0
  def __init__(self,parent,fromName = '',toName = '',rType = ''):
    wx.Dialog.__init__(self,parent,CODERELATIONSHIP_ID,'Add Code Relationship',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,200))

    self.rtLookup = {'==':'associated','=>':'implies','<>':'conflict','[]':'part-of'}
    self.lookupRt = {'':'','associated':'==','implies':'=>','conflict':'<>','part-of':'[]'}

    self.theFromName = fromName
    self.theToName = toName
    self.theRelationship = self.lookupRt[rType]
    self.commitLabel = 'Add'
    mainSizer = wx.BoxSizer(wx.VERTICAL)


    b = Borg()
    codeList = b.dbProxy.getDimensionNames('code')
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'From',(87,30),CODERELATIONSHIP_COMBOFROMCODE_ID,codeList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'To',(87,30),CODERELATIONSHIP_COMBOTOCODE_ID,codeList),0,wx.EXPAND)
    rtList = ['==','=>','<>','[]']
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Relationship',(87,30),CODERELATIONSHIP_COMBORTTYPE_ID,rtList),0,wx.EXPAND)
    mainSizer.Add(wx.StaticText(self,-1,''),1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,CODERELATIONSHIP_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)
    wx.EVT_BUTTON(self,CODERELATIONSHIP_BUTTONADD_ID,self.onCommit)

    if self.theFromName != '':
      fromCtrl = self.FindWindowById(CODERELATIONSHIP_COMBOFROMCODE_ID)
      toCtrl = self.FindWindowById(CODERELATIONSHIP_COMBOTOCODE_ID)
      rtCtrl = self.FindWindowById(CODERELATIONSHIP_COMBORTTYPE_ID)
      fromCtrl.SetValue(self.theFromName)
      toCtrl.SetValue(self.theToName)
      rtCtrl.SetValue(self.theRelationship)
  def __init__(self,parent,dp,envName,assetProperties,headNav = 0,headAdornment = '',headNry = '',headRole='',tailRole='',tailNry='',tailAdornment='',tailNav = 0,tailName = ''):
    wx.Dialog.__init__(self,parent,ASSETASSOCIATION_ID,'Add Asset Association',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,500))
    self.dbProxy = dp
    self.theAssetProperties = assetProperties
    self.theCurrentEnvironment = envName
    self.theHeadNav = int(headNav)
    self.theHeadAdornment = headAdornment
    self.theHeadNry = headNry
    self.theHeadRole = headRole
    self.theTailRole = tailRole
    self.theTailNry = tailNry
    self.theTailAdornment = tailAdornment
    self.theTailNav = int(tailNav)
    self.theTailName = tailName
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    assets = self.dbProxy.environmentAssets(self.theCurrentEnvironment)
    associationTypes = ['Inheritance','Association','Aggregation','Composition','Dependency']
    multiplicityTypes = ['1','*','1..*']
    navs = ['0','1','-1']

    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Navigation',(87,30),ASSETASSOCIATION_COMBOHEADNAV_ID,navs),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Adornment',(87,30),ASSETASSOCIATION_COMBOHEADTYPE_ID,associationTypes),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'nry',(87,30),ASSETASSOCIATION_COMBOHEADMULTIPLICITY_ID,multiplicityTypes),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Role',(87,30),ASSETASSOCIATION_TEXTHEADROLE_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Role',(87,30),ASSETASSOCIATION_TEXTTAILROLE_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'nry',(87,30),ASSETASSOCIATION_COMBOTAILMULTIPLICITY_ID,multiplicityTypes),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Adornment',(87,30),ASSETASSOCIATION_COMBOTAILTYPE_ID,associationTypes),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Navigation',(87,30),ASSETASSOCIATION_COMBOTAILNAV_ID,navs),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Tail',(87,30),ASSETASSOCIATION_COMBOTAILASSET_ID,assets),0,wx.EXPAND)

    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,ASSETASSOCIATION_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,ASSETASSOCIATION_BUTTONCOMMIT_ID,self.onCommit)
    self.commitLabel = 'Add'
    if (len(self.theTailName) > 0):
      self.commitLabel = 'Edit'
      self.SetLabel('Edit Asset Association')
      headNavCtrl = self.FindWindowById(ASSETASSOCIATION_COMBOHEADNAV_ID)
      headNavCtrl.SetValue(str(self.theHeadNav))
      headTypeCtrl = self.FindWindowById(ASSETASSOCIATION_COMBOHEADTYPE_ID)
      headTypeCtrl.SetValue(self.theHeadAdornment)
      headNryCtrl = self.FindWindowById(ASSETASSOCIATION_COMBOHEADMULTIPLICITY_ID)
      headNryCtrl.SetValue(self.theHeadNry)
      headRoleCtrl = self.FindWindowById(ASSETASSOCIATION_TEXTHEADROLE_ID)
      headRoleCtrl.SetValue(self.theHeadRole)
      tailRoleCtrl = self.FindWindowById(ASSETASSOCIATION_TEXTTAILROLE_ID)
      tailRoleCtrl.SetValue(self.theTailRole)
      tailNryCtrl = self.FindWindowById(ASSETASSOCIATION_COMBOTAILMULTIPLICITY_ID)
      tailNryCtrl.SetValue(self.theTailNry)
      tailTypeCtrl = self.FindWindowById(ASSETASSOCIATION_COMBOTAILTYPE_ID)
      tailTypeCtrl.SetValue(self.theTailAdornment)
      tailNavCtrl = self.FindWindowById(ASSETASSOCIATION_COMBOTAILNAV_ID)
      tailNavCtrl.SetValue(str(self.theTailNav))
      tailCtrl = self.FindWindowById(ASSETASSOCIATION_COMBOTAILASSET_ID)
      tailCtrl.SetValue(self.theTailName)
      buttonCtrl = self.FindWindowById(ASSETASSOCIATION_BUTTONCOMMIT_ID)
      buttonCtrl.SetLabel('Edit')
  def __init__(self,parent,dp,envName,assetProperties,headNav = 0,headAdornment = '',headNry = '',headRole='',tailRole='',tailNry='',tailAdornment='',tailNav = 0,tailName = ''):
    wx.Dialog.__init__(self,parent,armid.ASSETASSOCIATION_ID,'Add Asset Association',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,500))
    self.dbProxy = dp
    self.theAssetProperties = assetProperties
    self.theCurrentEnvironment = envName
    self.theHeadNav = int(headNav)
    self.theHeadAdornment = headAdornment
    self.theHeadNry = headNry
    self.theHeadRole = headRole
    self.theTailRole = tailRole
    self.theTailNry = tailNry
    self.theTailAdornment = tailAdornment
    self.theTailNav = int(tailNav)
    self.theTailName = tailName
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    assets = self.dbProxy.environmentAssets(self.theCurrentEnvironment)
    associationTypes = ['Inheritance','Association','Aggregation','Composition','Dependency']
    multiplicityTypes = ['1','*','1..*']
    navs = ['0','1','-1']

    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Navigation',(87,30),armid.ASSETASSOCIATION_COMBOHEADNAV_ID,navs),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Adornment',(87,30),armid.ASSETASSOCIATION_COMBOHEADTYPE_ID,associationTypes),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'nry',(87,30),armid.ASSETASSOCIATION_COMBOHEADMULTIPLICITY_ID,multiplicityTypes),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Role',(87,30),armid.ASSETASSOCIATION_TEXTHEADROLE_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Role',(87,30),armid.ASSETASSOCIATION_TEXTTAILROLE_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'nry',(87,30),armid.ASSETASSOCIATION_COMBOTAILMULTIPLICITY_ID,multiplicityTypes),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Adornment',(87,30),armid.ASSETASSOCIATION_COMBOTAILTYPE_ID,associationTypes),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Navigation',(87,30),armid.ASSETASSOCIATION_COMBOTAILNAV_ID,navs),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Tail',(87,30),armid.ASSETASSOCIATION_COMBOTAILASSET_ID,assets),0,wx.EXPAND)

    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,armid.ASSETASSOCIATION_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,armid.ASSETASSOCIATION_BUTTONCOMMIT_ID,self.onCommit)
    self.commitLabel = 'Add'
    if (len(self.theTailName) > 0):
      self.commitLabel = 'Edit'
      self.SetLabel('Edit Asset Association')
      headNavCtrl = self.FindWindowById(armid.ASSETASSOCIATION_COMBOHEADNAV_ID)
      headNavCtrl.SetValue(str(self.theHeadNav))
      headTypeCtrl = self.FindWindowById(armid.ASSETASSOCIATION_COMBOHEADTYPE_ID)
      headTypeCtrl.SetValue(self.theHeadAdornment)
      headNryCtrl = self.FindWindowById(armid.ASSETASSOCIATION_COMBOHEADMULTIPLICITY_ID)
      headNryCtrl.SetValue(self.theHeadNry)
      headRoleCtrl = self.FindWindowById(armid.ASSETASSOCIATION_TEXTHEADROLE_ID)
      headRoleCtrl.SetValue(self.theHeadRole)
      tailRoleCtrl = self.FindWindowById(armid.ASSETASSOCIATION_TEXTTAILROLE_ID)
      tailRoleCtrl.SetValue(self.theTailRole)
      tailNryCtrl = self.FindWindowById(armid.ASSETASSOCIATION_COMBOTAILMULTIPLICITY_ID)
      tailNryCtrl.SetValue(self.theTailNry)
      tailTypeCtrl = self.FindWindowById(armid.ASSETASSOCIATION_COMBOTAILTYPE_ID)
      tailTypeCtrl.SetValue(self.theTailAdornment)
      tailNavCtrl = self.FindWindowById(armid.ASSETASSOCIATION_COMBOTAILNAV_ID)
      tailNavCtrl.SetValue(str(self.theTailNav))
      tailCtrl = self.FindWindowById(armid.ASSETASSOCIATION_COMBOTAILASSET_ID)
      tailCtrl.SetValue(self.theTailName)
      buttonCtrl = self.FindWindowById(armid.ASSETASSOCIATION_BUTTONCOMMIT_ID)
      buttonCtrl.SetLabel('Edit')
示例#17
0
 def buildControls(self,isCreate):
   mainSizer = wx.BoxSizer(wx.VERTICAL)
   mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),armid.ROLE_TEXTNAME_ID),0,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildTextSizer(self,'Short Code',(87,30),armid.ROLE_TEXTSHORTCODE_ID),0,wx.EXPAND)
   roleTypes = self.dbProxy.getDimensionNames('role_type')
   mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),armid.ROLE_COMBOTYPE_ID,roleTypes),0,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,80),armid.ROLE_TEXTDESCRIPTION_ID),0,wx.EXPAND)
   mainSizer.Add(RoleEnvironmentPanel(self,self.dbProxy),1,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,armid.ROLE_BUTTONCOMMIT_ID,isCreate),0,wx.ALIGN_CENTER)
   self.SetSizer(mainSizer)
示例#18
0
  def buildControls(self,parameters):
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    associationSizer = wx.BoxSizer(wx.HORIZONTAL)
    mainSizer.Add(WidgetFactory.buildCheckSizer(self,'Alternative',GOALASSOCIATION_CHECKALTERNATIVE_ID,False),0,wx.EXPAND)
    mainSizer.Add(associationSizer,0,wx.EXPAND)
    environments = self.dbProxy.getDimensionNames('environment')
    goals = []
    associationTypes = ['and','or','conflict','responsible','obstruct','resolve']
    goalDimensions = ['goal','requirement','countermeasure','obstacle']
    subGoalDimensions = ['goal','requirement','role','task','usecase','countermeasure','domainproperty','obstacle','threat','vulnerability']

    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Environment',(87,30),GOALASSOCIATION_COMBOENVIRONMENT_ID,environments),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dimension',(87,30),GOALASSOCIATION_COMBOGOALDIM_ID,goalDimensions),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Goal',(87,30),GOALASSOCIATION_COMBOGOAL_ID,goals),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),GOALASSOCIATION_COMBOATYPE_ID,associationTypes),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dimension',(87,30),GOALASSOCIATION_COMBOSUBGOALDIM_ID,subGoalDimensions),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Sub-Goal',(87,30),GOALASSOCIATION_COMBOSUBGOAL_ID,goals),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),GOALASSOCIATION_TEXTRATIONALE_ID),1,wx.EXPAND,1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,GOALASSOCIATION_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,GOALASSOCIATION_BUTTONCOMMIT_ID,self.onCommit)
    wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOENVIRONMENT_ID,self.onEnvironmentChange)
    wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOGOALDIM_ID,self.onGoalDimChange)
    wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOSUBGOALDIM_ID,self.onSubGoalDimChange)
示例#19
0
  def buildControls(self,parameters):
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    associationSizer = wx.BoxSizer(wx.HORIZONTAL)
    mainSizer.Add(WidgetFactory.buildCheckSizer(self,'Alternative',GOALASSOCIATION_CHECKALTERNATIVE_ID,False),0,wx.EXPAND)
    mainSizer.Add(associationSizer,0,wx.EXPAND)
    environments = self.dbProxy.getDimensionNames('environment')
    goals = []
    associationTypes = ['and','or','conflict','responsible','obstruct','resolve']
    goalDimensions = ['goal','requirement','countermeasure','obstacle']
    subGoalDimensions = ['goal','requirement','role','task','usecase','countermeasure','domainproperty','obstacle','threat','vulnerability']

    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Environment',(87,30),GOALASSOCIATION_COMBOENVIRONMENT_ID,environments),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dimension',(87,30),GOALASSOCIATION_COMBOGOALDIM_ID,goalDimensions),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Goal',(87,30),GOALASSOCIATION_COMBOGOAL_ID,goals),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),GOALASSOCIATION_COMBOATYPE_ID,associationTypes),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dimension',(87,30),GOALASSOCIATION_COMBOSUBGOALDIM_ID,subGoalDimensions),0,wx.EXPAND)
    associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Sub-Goal',(87,30),GOALASSOCIATION_COMBOSUBGOAL_ID,goals),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),GOALASSOCIATION_TEXTRATIONALE_ID),1,wx.EXPAND,1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,GOALASSOCIATION_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,GOALASSOCIATION_BUTTONCOMMIT_ID,self.onCommit)
    wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOENVIRONMENT_ID,self.onEnvironmentChange)
    wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOGOALDIM_ID,self.onGoalDimChange)
    wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOSUBGOALDIM_ID,self.onSubGoalDimChange)
示例#20
0
  def __init__(self,parent):
    wx.Dialog.__init__(self,parent,armid.CHANNEL_ID,'Add Channel',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,150))
    self.theChannelName = ''
    self.theDataType = ''
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Channel',(87,30),armid.CHANNEL_TEXTCHANNEL_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Data Type',(87,30),armid.CHANNEL_TEXTDATATYPE_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,armid.CHANNEL_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,armid.CHANNEL_BUTTONADD_ID,self.onAdd)
示例#21
0
  def buildControls(self):
    mainSizer = wx.BoxSizer(wx.VERTICAL)

    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),armid.DOMAIN_TEXTNAME_ID),0,wx.EXPAND)
    self.notebook = DomainNotebook(self)
    mainSizer.Add(self.notebook,1,wx.EXPAND)

    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,armid.DOMAIN_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,armid.DOMAIN_BUTTONCOMMIT_ID,self.onCommit)
示例#22
0
  def __init__(self,parent):
    wx.Dialog.__init__(self,parent,REVISIONENTRY_ID,'Add Revision',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(300,300))
    self.theRemarks = ''
    mainSizer = wx.BoxSizer(wx.VERTICAL)

    mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Remarks',(87,30),REVISIONENTRY_TEXTREMARKS_ID),1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,REVISIONENTRY_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,REVISIONENTRY_BUTTONCOMMIT_ID,self.onCommit)
    self.commitLabel = 'Add'
 def __init__(self,parent):
   wx.Dialog.__init__(self,parent,armid.NEWENVIRONMENT_ID,'New Environment',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(300,200))
   self.environmentName = ''
   self.environmentDescription = ''
   mainSizer = wx.BoxSizer(wx.VERTICAL)
   mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),armid.NEWENVIRONMENT_TEXTNAME_ID),0,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildTextSizer(self,'Short Code',(87,30),armid.NEWENVIRONMENT_TEXTSHORTCODE_ID),0,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),armid.NEWENVIRONMENT_TEXTDESCRIPTION_ID),1,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,armid.NEWENVIRONMENT_BUTTONCOMMIT_ID,True))
   self.SetSizer(mainSizer)
   wx.EVT_BUTTON(self,armid.NEWENVIRONMENT_BUTTONCOMMIT_ID,self.onCreate)
示例#24
0
 def buildControls(self, isCreate, isUpdateable=True):
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     mainSizer.Add(
         WidgetFactory.buildDimensionListSizer(self, 'Risks', (100, 82),
                                               RESPONSE_LISTRISKS_ID,
                                               'risk', self.dbProxy), 0,
         wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildMLTextSizer(self, 'Description', (87, 60),
                                        RESPONSE_TEXTDESCRIPTION_ID), 1,
         wx.EXPAND)
     self.SetSizer(mainSizer)
示例#25
0
  def buildControls(self,isCreate = True):
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),armid.MISUSECASE_TEXTNAME_ID,isReadOnly=True),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Risk',(87,30),armid.MISUSECASE_TEXTRISK_ID,isReadOnly=True),0,wx.EXPAND)
    thrSizer = wx.BoxSizer(wx.HORIZONTAL)

    self.environmentPanel = MisuseCaseEnvironmentPanel(self,self.dbProxy)
    mainSizer.Add(self.environmentPanel,1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,armid.MISUSECASE_BUTTONCOMMIT_ID,isCreate),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    self.nameCtrl = self.FindWindowById(armid.MISUSECASE_TEXTNAME_ID)
    self.riskCtrl = self.FindWindowById(armid.MISUSECASE_TEXTRISK_ID)
示例#26
0
  def __init__(self,parent,setCapabilities,dp):
    wx.Dialog.__init__(self,parent,armid.CAPABILITY_ID,'Add Capability',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,150))
    self.theCapabilityName = ''
    self.theCapabilityValue = ''
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    defaultCapabilities = set(dp.getDimensionNames('capability'))
    capabilityList = list(defaultCapabilities.difference(setCapabilities))
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Capability',(87,30),armid.CAPABILITY_COMBOCAPABILITY_ID,capabilityList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Value',(87,30),armid.CAPABILITY_COMBOVALUE_ID,['Low','Medium','High']),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,armid.CAPABILITY_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,armid.CAPABILITY_BUTTONADD_ID,self.onAdd)
示例#27
0
 def __init__(self, parent):
     wx.Panel.__init__(self, parent, GOAL_PANELSUMMARY_ID)
     topSizer = wx.BoxSizer(wx.VERTICAL)
     topSizer.Add(
         WidgetFactory.buildTextSizer(
             self, 'Short Code', (87, 30), ENVIRONMENT_TEXTSHORTCODE_ID,
             'Code which prefixes requirements which are specific to this environment'
         ), 0, wx.EXPAND)
     topSizer.Add(
         WidgetFactory.buildMLTextSizer(self, 'Description', (87, 30),
                                        ENVIRONMENT_TEXTDESCRIPTION_ID), 1,
         wx.EXPAND)
     self.SetSizer(topSizer)
示例#28
0
  def __init__(self,parent):
    wx.Dialog.__init__(self,parent,RESPONSECOST_ID,'Add Response Cost',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,100))
    b = Borg()
    self.dbProxy = b.dbProxy
    self.theResponseName = ''
    self.theResponseCost = ''
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    responseList = self.dbProxy.getDimensionNames('response')
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Response',(87,30),RESPONSECOST_COMBORESPONSE_ID,responseList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Cost',(87,30),RESPONSECOST_COMBOCOST_ID,['Low','Medium','High']),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,RESPONSECOST_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,RESPONSECOST_BUTTONADD_ID,self.onAdd)
示例#29
0
    def buildControls(self):
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Name', (87, 30),
                                         armid.DOMAIN_TEXTNAME_ID), 0,
            wx.EXPAND)
        self.notebook = DomainNotebook(self)
        mainSizer.Add(self.notebook, 1, wx.EXPAND)

        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(
                self, armid.DOMAIN_BUTTONCOMMIT_ID), 0, wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, armid.DOMAIN_BUTTONCOMMIT_ID, self.onCommit)
示例#30
0
    def __init__(self,
                 parent,
                 assets,
                 reqName='',
                 reqDesc='',
                 reqType='',
                 reqRationale='',
                 reqFC='',
                 reqAsset=''):
        wx.Dialog.__init__(self,
                           parent,
                           armid.PATTERNREQUIREMENT_ID,
                           'Add Pattern Requirement',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(400, 475))
        self.theTemplateAssets = assets
        self.theRequirementName = reqName
        self.theRequirementDescription = reqDesc
        self.theRequirementType = reqType
        self.theRequirementRationale = reqRationale
        self.theRequirementFitCriterion = reqFC
        self.theRequirementAsset = reqAsset
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(RequirementNotebook(self, self.theTemplateAssets), 1,
                      wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(
                self, armid.PATTERNREQUIREMENT_BUTTONCOMMIT_ID), 0,
            wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, armid.PATTERNREQUIREMENT_BUTTONCOMMIT_ID,
                      self.onCommit)
        self.commitLabel = 'Add'
        if (len(self.theRequirementDescription) > 0):
            self.commitLabel = 'Edit'
            self.SetLabel('Edit Requirement')
            typeCtrl = self.FindWindowById(
                armid.PATTERNREQUIREMENT_COMBOTYPE_ID)
            typeCtrl.SetStringSelection(self.theRequirementType)
            assetCtrl = self.FindWindowById(
                armid.PATTERNREQUIREMENT_COMBOASSET_ID)
            assetCtrl.SetStringSelection(self.theRequirementAsset)
            nameCtrl = self.FindWindowById(
                armid.PATTERNREQUIREMENT_TEXTNAME_ID)
            nameCtrl.SetValue(self.theRequirementName)
            descCtrl = self.FindWindowById(
                armid.PATTERNREQUIREMENT_TEXTDESCRIPTION_ID)
            descCtrl.SetValue(self.theRequirementDescription)
            rationaleCtrl = self.FindWindowById(
                armid.PATTERNREQUIREMENT_TEXTRATIONALE_ID)
            rationaleCtrl.SetValue(self.theRequirementRationale)
            fcCtrl = self.FindWindowById(
                armid.PATTERNREQUIREMENT_TEXTFITCRITERION_ID)
            fcCtrl.SetValue(self.theRequirementFitCriterion)
            buttonCtrl = self.FindWindowById(
                armid.PATTERNREQUIREMENT_BUTTONCOMMIT_ID)
            buttonCtrl.SetLabel('Edit')
 def __init__(self,parent,exposedCMs):
   wx.Panel.__init__(self,parent,-1)
   b = Borg()
   self.dbProxy = b.dbProxy
   eValues = ['Low','Medium','High']
   mainSizer = wx.BoxSizer(wx.VERTICAL)
   cmSizer = wx.BoxSizer(wx.VERTICAL)
   mainSizer.Add(cmSizer,1,wx.EXPAND)
   isFirst = True
   self.cmAssets = {}
   for envName,cmName,assetName,cmEffectiveness in exposedCMs:
     cmKey = envName + '/' + cmName + ' (' + assetName + ')'
     self.cmAssets[cmKey] = assetName
     ecBox = wx.StaticBox(self,-1,cmKey)
     ecBoxSizer = wx.StaticBoxSizer(ecBox,wx.HORIZONTAL)
     cmSizer.Add(ecBoxSizer,0,wx.EXPAND)
     for eValue in eValues:
       if (isFirst == True):
         rb = wx.RadioButton(self,-1,eValue,pos=wx.DefaultPosition,style=wx.RB_GROUP)
         isFirst = False
       else:
         rb = wx.RadioButton(self,-1,eValue)
       ecBoxSizer.Add(rb,0,wx.EXPAND)
       if (eValue == cmEffectiveness):
         rb.SetValue(True)
       else:
         rb.SetValue(False)
         isFirst = False
     isFirst = True
   mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,EXPOSEDCOUNTERMEASURE_BUTTONCOMMIT_ID,True),0,wx.CENTER)
   self.SetSizer(mainSizer)
示例#32
0
  def __init__(self,parent,assets,reqName= '',reqDesc = '',reqType = '',reqRationale = '',reqFC ='',reqAsset =''):
    wx.Dialog.__init__(self,parent,PATTERNREQUIREMENT_ID,'Add Pattern Requirement',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,475))
    self.theTemplateAssets = assets
    self.theRequirementName = reqName
    self.theRequirementDescription = reqDesc
    self.theRequirementType = reqType
    self.theRequirementRationale = reqRationale
    self.theRequirementFitCriterion = reqFC
    self.theRequirementAsset = reqAsset
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    
    mainSizer.Add(RequirementNotebook(self,self.theTemplateAssets),1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,PATTERNREQUIREMENT_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,PATTERNREQUIREMENT_BUTTONCOMMIT_ID,self.onCommit)
    self.commitLabel = 'Add'
    if (len(self.theRequirementDescription) > 0):
      self.commitLabel = 'Edit'
      self.SetLabel('Edit Requirement')
      typeCtrl = self.FindWindowById(PATTERNREQUIREMENT_COMBOTYPE_ID)
      typeCtrl.SetStringSelection(self.theRequirementType)
      assetCtrl = self.FindWindowById(PATTERNREQUIREMENT_COMBOASSET_ID)
      assetCtrl.SetStringSelection(self.theRequirementAsset)
      nameCtrl = self.FindWindowById(PATTERNREQUIREMENT_TEXTNAME_ID)
      nameCtrl.SetValue(self.theRequirementName)
      descCtrl = self.FindWindowById(PATTERNREQUIREMENT_TEXTDESCRIPTION_ID)
      descCtrl.SetValue(self.theRequirementDescription)
      rationaleCtrl = self.FindWindowById(PATTERNREQUIREMENT_TEXTRATIONALE_ID)
      rationaleCtrl.SetValue(self.theRequirementRationale)
      fcCtrl = self.FindWindowById(PATTERNREQUIREMENT_TEXTFITCRITERION_ID)
      fcCtrl.SetValue(self.theRequirementFitCriterion)
      buttonCtrl = self.FindWindowById(PATTERNREQUIREMENT_BUTTONCOMMIT_ID)
      buttonCtrl.SetLabel('Edit')
  def __init__(self,parent,parameters):
    wx.Dialog.__init__(self,parent,parameters.id(),parameters.label(),style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(700,300))
    self.theTaskName = ''
    self.theModalQualifier = ''
    self.theCharacteristic = ''
    self.theGrounds = []
    self.theWarrant = []
    self.theBacking = []
    self.theRebuttal = []
    self.isCreate = True
    self.showTaskCombo = True

    self.theId = -1
    self.panel = 0
    self.inTask = False
    if (parameters.__class__.__name__ == 'TaskCharacteristicDialogParameters'):
      self.inTask = True
      self.showTaskCombo = parameters.showTask()

    if (self.inTask):
      self.theTaskName = parameters.task()

    self.commitVerb = 'Add'
    
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    self.panel = PersonaCharacteristicNotebook(self,True,self.showTaskCombo)
    mainSizer.Add(self.panel,1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,TASKCHARACTERISTIC_BUTTONCOMMIT_ID,True),0,wx.CENTER)

    self.SetSizer(mainSizer)
    wx.EVT_BUTTON(self,TASKCHARACTERISTIC_BUTTONCOMMIT_ID,self.onCommit)
示例#34
0
  def __init__(self,parent):
    wx.Panel.__init__(self,parent)
    topSizer = wx.BoxSizer(wx.VERTICAL)
    typeList = ['Causal','Biddable','Lexical']

    givenBox = wx.StaticBox(self,-1,'Given Domain')
    givenSizer = wx.StaticBoxSizer(givenBox,wx.HORIZONTAL)
    topSizer.Add(givenSizer,0,wx.EXPAND)
    self.givenCtrl = wx.CheckBox(self,DOMAIN_CHECKGIVEN_ID)
    self.givenCtrl.SetValue(True)
    givenSizer.Add(self.givenCtrl,0,wx.EXPAND)
    topSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),DOMAIN_COMBOTYPE_ID,typeList),0,wx.EXPAND)
    topSizer.Add(WidgetFactory.buildTextSizer(self,'Short Code',(87,30),DOMAIN_TEXTSHORTCODE_ID),0,wx.EXPAND)
    topSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),DOMAIN_TEXTDESCRIPTION_ID),1,wx.EXPAND)
    self.SetSizer(topSizer)
    self.Bind(wx.EVT_COMBOBOX, self.onDomainTypeChange,id = DOMAIN_COMBOTYPE_ID)
 def __init__(self,parent,exposedCMs):
   wx.Panel.__init__(self,parent,-1)
   b = Borg()
   self.dbProxy = b.dbProxy
   eValues = ['Low','Medium','High']
   mainSizer = wx.BoxSizer(wx.VERTICAL)
   cmSizer = wx.BoxSizer(wx.VERTICAL)
   mainSizer.Add(cmSizer,1,wx.EXPAND)
   isFirst = True
   self.cmAssets = {}
   for envName,cmName,assetName,cmEffectiveness in exposedCMs:
     cmKey = envName + '/' + cmName + ' (' + assetName + ')'
     self.cmAssets[cmKey] = assetName
     ecBox = wx.StaticBox(self,-1,cmKey)
     ecBoxSizer = wx.StaticBoxSizer(ecBox,wx.HORIZONTAL)
     cmSizer.Add(ecBoxSizer,0,wx.EXPAND)
     for eValue in eValues:
       if (isFirst == True):
         rb = wx.RadioButton(self,-1,eValue,pos=wx.DefaultPosition,style=wx.RB_GROUP)
         isFirst = False
       else:
         rb = wx.RadioButton(self,-1,eValue)
       ecBoxSizer.Add(rb,0,wx.EXPAND)
       if (eValue == cmEffectiveness):
         rb.SetValue(True)
       else:
         rb.SetValue(False)
         isFirst = False
     isFirst = True
   mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,armid.EXPOSEDCOUNTERMEASURE_BUTTONCOMMIT_ID,True),0,wx.CENTER)
   self.SetSizer(mainSizer)
示例#36
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           SINGLEREQUIREMENT_ID,
                           'Add Requirement',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(400, 475))
        self.theType = ''
        self.theReferrerType = 'asset'
        self.theReferrer = ''
        self.thePriority = '1'
        self.theDescription = ''
        self.theRationale = ''
        self.theFitCriterion = ''
        self.theOriginator = ''
        self.theContributionType = 'and'
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(SingleRequirementNotebook(self), 1, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(
                self, SINGLEREQUIREMENT_BUTTONCOMMIT_ID), 0, wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, SINGLEREQUIREMENT_BUTTONCOMMIT_ID, self.onCommit)
        self.commitLabel = 'Add'
示例#37
0
    def __init__(self, parent, setProperties, values):
        wx.Dialog.__init__(self,
                           parent,
                           PROPERTY_ID,
                           'Add Security Property',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(400, 300))

        weights = {
            "Confidentiality": 0,
            "Integrity": 1,
            "Availability": 2,
            "Accountability": 3,
            "Anonymity": 4,
            "Pseudonymity": 5,
            "Unlinkability": 6,
            "Unobservability": 7
        }
        self.thePropertyName = ''
        self.thePropertyValue = ''
        self.thePropertyRationale = 'None'
        self.commitLabel = 'Add'
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        #    defaultProperties = set(['Confidentiality','Integrity','Availability','Accountability','Anonymity','Pseudonymity','Unlinkability','Unobservability'])
        defaultProperties = set(weights.keys())
        propertyList = sorted(list(
            defaultProperties.difference(setProperties)),
                              key=lambda x: weights[x])
        mainSizer.Add(
            WidgetFactory.buildComboSizerList(self, 'Property', (87, 30),
                                              PROPERTY_COMBOPROPERTY_ID,
                                              propertyList), 0, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildComboSizerList(self, 'Value', (87, 30),
                                              PROPERTY_COMBOVALUE_ID, values),
            0, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildMLTextSizer(self, 'Rationale', (87, 60),
                                           PROPERTY_TEXTRATIONALE_ID), 1,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(self,
                                                    PROPERTY_BUTTONADD_ID), 0,
            wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)
        wx.EVT_BUTTON(self, PROPERTY_BUTTONADD_ID, self.onCommit)
示例#38
0
  def __init__(self,parent):
    wx.Panel.__init__(self,parent,OBSTACLE_ID)
    b = Borg()
    self.dbProxy = b.dbProxy
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),OBSTACLE_TEXTNAME_ID),0,wx.EXPAND)
    self.nameCtrl = self.FindWindowById(OBSTACLE_TEXTNAME_ID)
    self.notebook = ObstacleEnvironmentNotebook(self,self.dbProxy)

    mainSizer.Add(self.notebook,1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,OBSTACLE_BUTTONCOMMIT_ID,True),0,wx.CENTER)
    self.definitionCtrl = self.notebook.FindWindowById(OBSTACLE_TEXTDEFINITION_ID)
    self.categoryCtrl = self.notebook.FindWindowById(OBSTACLE_COMBOCATEGORY_ID)
    self.goalAssociationCtrl = self.notebook.FindWindowById(OBSTACLE_LISTGOALS_ID)
    self.subGoalAssociationCtrl = self.notebook.FindWindowById(OBSTACLE_LISTSUBGOALS_ID)
    self.cCtrl = self.notebook.FindWindowById(OBSTACLE_LISTCONCERNS_ID)
    self.SetSizer(mainSizer)
示例#39
0
  def __init__(self,parent,envName):
    wx.Panel.__init__(self,parent,EXCEPTION_ID)
    b = Borg()
    self.dbProxy = b.dbProxy
    self.theEnvironmentName = envName
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),EXCEPTION_TEXTNAME_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildRadioButtonSizer(self,'Type',(87,30),[(EXCEPTION_RADIOGOAL_ID,'Goal'),(EXCEPTION_RADIOREQUIREMENT_ID,'Requirement')]))
    goalList = self.dbProxy.environmentGoals(self.theEnvironmentName)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Values',(87,30),EXCEPTION_COMBOGOALS_ID,goalList),0,wx.EXPAND)
    catList = ['Confidentiality Threat','Integrity Threat','Availability Threat','Accountability Threat','Anonymity Threat','Pseudonymity Threat','Unlinkability Threat','Unobservability Threat','Vulnerability','Duration','Frequency','Demands','Goal Support']
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Category',(87,30),EXCEPTION_COMBOCATEGORY_ID,catList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Definition',(87,30),EXCEPTION_TEXTDEFINITION_ID),1,wx.EXPAND)
    self.SetSizer(mainSizer)

    wx.EVT_RADIOBUTTON(self,EXCEPTION_RADIOGOAL_ID,self.onGoalSelected)
    wx.EVT_RADIOBUTTON(self,EXCEPTION_RADIOREQUIREMENT_ID,self.onRequirementSelected)
示例#40
0
    def __init__(self, parent, dLabel, dName, dType, dDesc):
        wx.Dialog.__init__(self,
                           parent,
                           DIRECTORYENTRY_ID,
                           'Directory Entry',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(500, 300))
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Label', (87, 30),
                                         DIRECTORYENTRY_TEXTLABEL_ID), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Name', (87, 30),
                                         DIRECTORYENTRY_TEXTNAME_ID), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Type', (87, 30),
                                         DIRECTORYENTRY_TEXTTYPE_ID), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildMLTextSizer(self, 'Description', (87, 30),
                                           DIRECTORYENTRY_TEXTDESCRIPTION_ID),
            1, wx.EXPAND)

        buttonSizer = wx.BoxSizer(wx.ALIGN_CENTER)
        okButton = wx.Button(self, wx.ID_OK, 'Ok')
        buttonSizer.Add(okButton)
        mainSizer.Add(buttonSizer, 0, wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        labelCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTLABEL_ID)
        labelCtrl.SetValue(dLabel)
        labelCtrl.Disable()
        nameCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTNAME_ID)
        nameCtrl.SetValue(dName)
        nameCtrl.Disable()
        typeCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTTYPE_ID)
        typeCtrl.SetValue(dType)
        typeCtrl.Disable()
        descCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTDESCRIPTION_ID)
        descCtrl.SetValue(dDesc)
        descCtrl.Disable()
  def __init__(self,parent,taskName,personaName,duration,frequency,demands,goalSupport):
    wx.Dialog.__init__(self,parent,TASKPERSONA_ID,'Add Task Persona',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,400))
    self.theDuration = ''
    self.theFrequency = ''
    self.theDemands = ''
    self.theGoalSupport = ''
    mainSizer = wx.BoxSizer(wx.VERTICAL)

    suPropertyValues = ['High Help','Medium Help','Low Help','None','Low Hindrance','Medium Hindrance','High Hindrance']
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Task',(87,30),COUNTERMEASURETASKPERSONA_TEXTTASK_ID,isReadOnly = True),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Persona',(87,30),COUNTERMEASURETASKPERSONA_TEXTPERSONA_ID,isReadOnly = True),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Duration',(87,30),COUNTERMEASURETASKPERSONA_COMBODURATION_ID,suPropertyValues),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Frequency',(87,30),COUNTERMEASURETASKPERSONA_COMBOFREQUENCY_ID,suPropertyValues),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Demands',(87,30),COUNTERMEASURETASKPERSONA_COMBODEMANDS_ID,suPropertyValues),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Goal Conflict',(87,30),COUNTERMEASURETASKPERSONA_COMBOGOALSUPPORT_ID,suPropertyValues),0,wx.EXPAND)
    mainSizer.Add(wx.StaticText(self,-1),1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,COUNTERMEASURETASKPERSONA_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,COUNTERMEASURETASKPERSONA_BUTTONADD_ID,self.onAdd)
   
    taskCtrl = self.FindWindowById(COUNTERMEASURETASKPERSONA_TEXTTASK_ID)
    taskCtrl.SetValue(taskName)
    personaCtrl = self.FindWindowById(COUNTERMEASURETASKPERSONA_TEXTPERSONA_ID)
    personaCtrl.SetValue(personaName)
    durCtrl = self.FindWindowById(COUNTERMEASURETASKPERSONA_COMBODURATION_ID)
    durCtrl.SetStringSelection(duration)
    freqCtrl = self.FindWindowById(COUNTERMEASURETASKPERSONA_COMBOFREQUENCY_ID)
    freqCtrl.SetStringSelection(frequency)
    demCtrl = self.FindWindowById(COUNTERMEASURETASKPERSONA_COMBODEMANDS_ID)
    demCtrl.SetStringSelection(demands)
    gsupCtrl = self.FindWindowById(COUNTERMEASURETASKPERSONA_COMBOGOALSUPPORT_ID)
    gsupCtrl.SetStringSelection(goalSupport)
示例#42
0
  def __init__(self,parent,setProperties,values):
    wx.Dialog.__init__(self,parent,armid.PROPERTY_ID,'Add Security Property',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,300))

    weights = {"Confidentiality":0,"Integrity":1,"Availability":2,"Accountability":3,"Anonymity":4,"Pseudonymity":5,"Unlinkability":6,"Unobservability":7}
    self.thePropertyName = ''
    self.thePropertyValue = ''
    self.thePropertyRationale = 'None'
    self.commitLabel = 'Add'
    mainSizer = wx.BoxSizer(wx.VERTICAL)
#    defaultProperties = set(['Confidentiality','Integrity','Availability','Accountability','Anonymity','Pseudonymity','Unlinkability','Unobservability'])
    defaultProperties = set(weights.keys())
    propertyList = sorted(list(defaultProperties.difference(setProperties)), key=lambda x:weights[x])
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Property',(87,30),armid.PROPERTY_COMBOPROPERTY_ID,propertyList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Value',(87,30),armid.PROPERTY_COMBOVALUE_ID,values),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),armid.PROPERTY_TEXTRATIONALE_ID),1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,armid.PROPERTY_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)
    wx.EVT_BUTTON(self,armid.PROPERTY_BUTTONADD_ID,self.onCommit)
示例#43
0
 def __init__(self,parent,reqList,setTargets,envName):
   wx.Dialog.__init__(self,parent,PROPERTY_ID,'Add Target',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,250))
   b = Borg()
   self.dbProxy = b.dbProxy
   self.theTarget = ''
   self.theEffectiveness = ''
   self.theRationale = ''
   self.commitLabel = 'Add'
   mainSizer = wx.BoxSizer(wx.VERTICAL)
   self.theTargetDictionary = self.dbProxy.targetNames(reqList,envName)
   defaultTargets = set(self.theTargetDictionary.keys())
   targetList = list(defaultTargets.difference(setTargets))
   mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Target',(87,30),TARGET_COMBOTARGET_ID,targetList),0,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Effectiveness',(87,30),TARGET_COMBOEFFECTIVENESS_ID,['None','Low','Medium','High']),0,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),TARGET_TEXTRATIONALE_ID),1,wx.EXPAND)
   mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,TARGET_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
   self.SetSizer(mainSizer)
   wx.EVT_BUTTON(self,TARGET_BUTTONCOMMIT_ID,self.onCommit)
 def buildControls(self):
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Name', (87, 30),
                                      armid.ENVIRONMENT_TEXTNAME_ID), 0,
         wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Short Code', (87, 30),
                                      armid.ENVIRONMENT_TEXTSHORTCODE_ID),
         0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildMLTextSizer(
             self, 'Description', (87, 30),
             armid.ENVIRONMENT_TEXTDESCRIPTION_ID), 1, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildCommitButtonSizer(
             self, armid.ENVIRONMENT_BUTTONCOMMIT_ID, True))
     self.SetSizer(mainSizer)
示例#45
0
  def __init__(self,parent):
    wx.Dialog.__init__(self,parent,DOMAINENTRY_ID,'Add domain interface',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(300,300))
    b = Borg()
    self.dbProxy = b.dbProxy
    self.theDomain = ''
    self.theConnectionDomain = ''
    self.thePhenomena = ''
    mainSizer = wx.BoxSizer(wx.VERTICAL)

    domList = self.dbProxy.getDimensionNames('domain')
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Domain',(87,30),DOMAINENTRY_COMBODOMAIN_ID,domList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Phenomena',(87,30),DOMAINENTRY_TEXTPHENOMENA_ID),0,wx.EXPAND)
    cdList = [''] + domList
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Connection Domain',(87,30),DOMAINENTRY_COMBOCONNECTIONDOMAIN_ID,cdList),0,wx.EXPAND)
    mainSizer.Add(wx.StaticText(self,-1),1,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,DOMAINENTRY_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,DOMAINENTRY_BUTTONCOMMIT_ID,self.onCommit)
    self.commitLabel = 'Add'
示例#46
0
 def buildControls(self,parameters):
   mainSizer = wx.BoxSizer(wx.VERTICAL)
   self.panel = UseCasePanel(self)
   mainSizer.Add(self.panel,1,wx.EXPAND)
   if (self.theCommitVerb == 'Create'):
     isCreate = True
   else:
     isCreate = False
   mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,USECASE_BUTTONCOMMIT_ID,isCreate),0,wx.ALIGN_CENTER)
   self.SetSizer(mainSizer)
   wx.EVT_BUTTON(self,USECASE_BUTTONCOMMIT_ID,self.onCommit)
示例#47
0
 def buildControls(self,parameters):
   mainSizer = wx.BoxSizer(wx.VERTICAL)
   self.panel = UseCasePanel(self)
   mainSizer.Add(self.panel,1,wx.EXPAND)
   if (self.theCommitVerb == 'Create'):
     isCreate = True
   else:
     isCreate = False
   mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,USECASE_BUTTONCOMMIT_ID,isCreate),0,wx.ALIGN_CENTER)
   self.SetSizer(mainSizer)
   wx.EVT_BUTTON(self,USECASE_BUTTONCOMMIT_ID,self.onCommit)
示例#48
0
    def __init__(self, parent, name='', definition=''):
        wx.Dialog.__init__(self,
                           parent,
                           armid.DICTIONARYENTRY_ID,
                           'Add Dictionary Entry',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(500, 300))
        self.theName = name
        self.theDefinition = definition
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(
            WidgetFactory.buildTextSizer(self, 'Name', (87, 30),
                                         armid.DICTIONARYENTRY_TEXTNAME_ID), 0,
            wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildMLTextSizer(
                self, 'Definition', (87, 30),
                armid.DICTIONARYENTRY_TEXTDEFINITION_ID), 1, wx.EXPAND)

        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(
                self, armid.DICTIONARYENTRY_BUTTONCOMMIT_ID), 0,
            wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, armid.DICTIONARYENTRY_BUTTONCOMMIT_ID,
                      self.onCommit)
        self.commitLabel = 'Add'
        if (len(self.theName) > 0):
            self.commitLabel = 'Edit'
            self.SetLabel('Edit Dictionary Entry')
            nameCtrl = self.FindWindowById(armid.DICTIONARYENTRY_TEXTNAME_ID)
            nameCtrl.SetValue(self.theName)
            defCtrl = self.FindWindowById(
                armid.DICTIONARYENTRY_TEXTDEFINITION_ID)
            defCtrl.SetValue(self.theDefinition)
            buttonCtrl = self.FindWindowById(
                armid.DICTIONARYENTRY_BUTTONCOMMIT_ID)
            buttonCtrl.SetLabel('Edit')
示例#49
0
  def buildControls(self,isCreate,isUpdateable=True):
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    allDimensionNames = self.dbProxy.getDimensionNames('trace_dimension')
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'From artifact',(87,30),TRACE_COMBOFROMOBJECT_ID,allDimensionNames),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'From name',(87,30),TRACE_COMBOFROMNAME_ID,[]),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'To artifact',(87,30),TRACE_COMBOTOOBJECT_ID,allDimensionNames),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'To name',(87,30),TRACE_COMBOTONAME_ID,[]),0,wx.EXPAND)
    mainSizer.Add(wx.StaticText(self,-1,''),1,wx.EXPAND)
    if (isUpdateable):
      mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,TRACE_BUTTONCOMMIT_ID,isCreate),0,wx.ALIGN_CENTRE)
    self.SetSizer(mainSizer)

    self.fromObjectCombo = self.FindWindowById(TRACE_COMBOFROMOBJECT_ID)
    self.fromNameCombo = self.FindWindowById(TRACE_COMBOFROMNAME_ID)
    self.toObjectCombo = self.FindWindowById(TRACE_COMBOTOOBJECT_ID)
    self.toNameCombo = self.FindWindowById(TRACE_COMBOTONAME_ID)

    self.fromObjectCombo.Bind(wx.EVT_COMBOBOX,self.onFromObjectChange)
    self.fromNameCombo.Bind(wx.EVT_COMBOBOX,self.onFromNameChange)
    self.toObjectCombo.Bind(wx.EVT_COMBOBOX,self.onToObjectChange)
    self.toNameCombo.Bind(wx.EVT_COMBOBOX,self.onToNameChange)
示例#50
0
  def __init__(self,parent,setPersonas,currentEnvironmentName,dp,pName='',pDur='',pFreq='',pDem='',pGsup=''):
    wx.Dialog.__init__(self,parent,TASKPERSONA_ID,'Add Task Persona',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,300))
    self.theName = pName
    self.theDuration = pDur
    self.theFrequency = pFreq
    self.theDemands = pDem
    self.theGoalSupport = pGsup
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    personaList = dp.getDimensionNames('persona',currentEnvironmentName)

    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Name',(87,30),TASKPERSONA_COMBONAME_ID,personaList),0,wx.EXPAND)
    suList = ['None','Low','Medium','High']
    durationList = ['Seconds','Minutes','Hours or longer']
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Duration',(87,30),TASKPERSONA_COMBODURATION_ID,durationList),0,wx.EXPAND)
    freqList = ['Hourly or more','Daily - Weekly','Monthly or less']
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Frequency',(87,30),TASKPERSONA_COMBOFREQUENCY_ID,freqList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Demands',(87,30),TASKPERSONA_COMBODEMANDS_ID,suList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Goal Conflict',(87,30),TASKPERSONA_COMBOGOALSUPPORT_ID,suList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,TASKPERSONA_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    if (self.theName != ''):
      self.SetLabel('Edit Task Persona')
      nameCtrl = self.FindWindowById(TASKPERSONA_COMBONAME_ID)
      nameCtrl.SetValue(self.theName)
      durCtrl = self.FindWindowById(TASKPERSONA_COMBODURATION_ID)
      durCtrl.SetStringSelection(self.theDuration)
      freqCtrl = self.FindWindowById(TASKPERSONA_COMBOFREQUENCY_ID)
      freqCtrl.SetStringSelection(self.theFrequency)
      demCtrl = self.FindWindowById(TASKPERSONA_COMBODEMANDS_ID)
      demCtrl.SetStringSelection(self.theDemands)
      gsupCtrl = self.FindWindowById(TASKPERSONA_COMBOGOALSUPPORT_ID)
      gsupCtrl.SetStringSelection(self.theGoalSupport)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,TASKPERSONA_BUTTONADD_ID,self.onAdd)
 def buildControls(self, isCreate, isUpdateable=True):
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Name', (87, 30),
                                      armid.EXTERNALDOCUMENT_TEXTNAME_ID),
         0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(
             self, 'Version', (87, 30),
             armid.EXTERNALDOCUMENT_TEXTVERSION_ID), 0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Date', (87, 30),
                                      armid.EXTERNALDOCUMENT_TEXTDATE_ID),
         0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(
             self, 'Authors', (87, 30),
             armid.EXTERNALDOCUMENT_TEXTAUTHORS_ID), 0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildMLTextSizer(
             self, 'Description', (87, 30),
             armid.EXTERNALDOCUMENT_TEXTDESCRIPTION_ID), 1, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildCommitButtonSizer(
             self, armid.EXTERNALDOCUMENT_BUTTONCOMMIT_ID, isCreate), 0,
         wx.CENTER)
     self.SetSizer(mainSizer)
示例#52
0
  def __init__(self,parent,setPersonas,currentEnvironmentName,dp,pName='',pDur='',pFreq='',pDem='',pGsup=''):
    wx.Dialog.__init__(self,parent,TASKPERSONA_ID,'Add Task Persona',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,300))
    self.theName = pName
    self.theDuration = pDur
    self.theFrequency = pFreq
    self.theDemands = pDem
    self.theGoalSupport = pGsup
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    personaList = dp.getDimensionNames('persona',currentEnvironmentName)

    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Name',(87,30),TASKPERSONA_COMBONAME_ID,personaList),0,wx.EXPAND)
    suList = ['None','Low','Medium','High']
    durationList = ['Seconds','Minutes','Hours or longer']
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Duration',(87,30),TASKPERSONA_COMBODURATION_ID,durationList),0,wx.EXPAND)
    freqList = ['Hourly or more','Daily - Weekly','Monthly or less']
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Frequency',(87,30),TASKPERSONA_COMBOFREQUENCY_ID,freqList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Demands',(87,30),TASKPERSONA_COMBODEMANDS_ID,suList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Goal Conflict',(87,30),TASKPERSONA_COMBOGOALSUPPORT_ID,suList),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,TASKPERSONA_BUTTONADD_ID),0,wx.ALIGN_CENTER)
    if (self.theName != ''):
      self.SetLabel('Edit Task Persona')
      nameCtrl = self.FindWindowById(TASKPERSONA_COMBONAME_ID)
      nameCtrl.SetValue(self.theName)
      durCtrl = self.FindWindowById(TASKPERSONA_COMBODURATION_ID)
      durCtrl.SetStringSelection(self.theDuration)
      freqCtrl = self.FindWindowById(TASKPERSONA_COMBOFREQUENCY_ID)
      freqCtrl.SetStringSelection(self.theFrequency)
      demCtrl = self.FindWindowById(TASKPERSONA_COMBODEMANDS_ID)
      demCtrl.SetStringSelection(self.theDemands)
      gsupCtrl = self.FindWindowById(TASKPERSONA_COMBOGOALSUPPORT_ID)
      gsupCtrl.SetStringSelection(self.theGoalSupport)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,TASKPERSONA_BUTTONADD_ID,self.onAdd)
示例#53
0
 def buildControls(self, isCreate, isUpdateable=True):
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Label', (87, 30),
                                      armid.REQUIREMENT_TEXTLABEL_ID), 0,
         wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildMLTextSizer(
             self, 'Description', (87, 60),
             armid.REQUIREMENT_TEXTDESCRIPTION_ID), 0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Priority', (87, 30),
                                      armid.REQUIREMENT_TEXTPRIORITY_ID), 0,
         wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Rationale', (87, 30),
                                      armid.REQUIREMENT_TEXTRATIONALE_ID),
         0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildMLTextSizer(
             self, 'Fit Criterion', (87, 60),
             armid.REQUIREMENT_TEXTFITCRITERION_ID), 0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Originator', (87, 30),
                                      armid.REQUIREMENT_TEXTORIGINATOR_ID),
         0, wx.EXPAND)
     self.SetSizer(mainSizer)
示例#54
0
 def buildControls(self, isCreate):
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Name', (87, 30),
                                      ROLE_TEXTNAME_ID), 0, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildTextSizer(self, 'Short Code', (87, 30),
                                      ROLE_TEXTSHORTCODE_ID), 0, wx.EXPAND)
     roleTypes = self.dbProxy.getDimensionNames('role_type')
     mainSizer.Add(
         WidgetFactory.buildComboSizerList(self, 'Type', (87, 30),
                                           ROLE_COMBOTYPE_ID, roleTypes), 0,
         wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildMLTextSizer(self, 'Description', (87, 80),
                                        ROLE_TEXTDESCRIPTION_ID), 0,
         wx.EXPAND)
     mainSizer.Add(RoleEnvironmentPanel(self, self.dbProxy), 1, wx.EXPAND)
     mainSizer.Add(
         WidgetFactory.buildCommitButtonSizer(self, ROLE_BUTTONCOMMIT_ID,
                                              isCreate), 0, wx.ALIGN_CENTER)
     self.SetSizer(mainSizer)
示例#55
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           armid.REVISIONENTRY_ID,
                           'Add Revision',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX
                           | wx.THICK_FRAME | wx.RESIZE_BORDER,
                           size=(300, 300))
        self.theRemarks = ''
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(
            WidgetFactory.buildMLTextSizer(self, 'Remarks', (87, 30),
                                           armid.REVISIONENTRY_TEXTREMARKS_ID),
            1, wx.EXPAND)
        mainSizer.Add(
            WidgetFactory.buildAddCancelButtonSizer(
                self, armid.REVISIONENTRY_BUTTONCOMMIT_ID), 0, wx.ALIGN_CENTER)
        self.SetSizer(mainSizer)

        wx.EVT_BUTTON(self, armid.REVISIONENTRY_BUTTONCOMMIT_ID, self.onCommit)
        self.commitLabel = 'Add'
  def __init__(self,parent,name = '',definition = ''):
    wx.Dialog.__init__(self,parent,armid.DICTIONARYENTRY_ID,'Add Dictionary Entry',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(500,300))
    self.theName = name
    self.theDefinition = definition
    mainSizer = wx.BoxSizer(wx.VERTICAL)

    mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),armid.DICTIONARYENTRY_TEXTNAME_ID),0,wx.EXPAND)
    mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Definition',(87,30),armid.DICTIONARYENTRY_TEXTDEFINITION_ID),1,wx.EXPAND)

    mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,armid.DICTIONARYENTRY_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
    self.SetSizer(mainSizer)

    wx.EVT_BUTTON(self,armid.DICTIONARYENTRY_BUTTONCOMMIT_ID,self.onCommit)
    self.commitLabel = 'Add'
    if (len(self.theName) > 0):
      self.commitLabel = 'Edit'
      self.SetLabel('Edit Dictionary Entry')
      nameCtrl = self.FindWindowById(armid.DICTIONARYENTRY_TEXTNAME_ID)
      nameCtrl.SetValue(self.theName)
      defCtrl = self.FindWindowById(armid.DICTIONARYENTRY_TEXTDEFINITION_ID)
      defCtrl.SetValue(self.theDefinition)
      buttonCtrl = self.FindWindowById(armid.DICTIONARYENTRY_BUTTONCOMMIT_ID)
      buttonCtrl.SetLabel('Edit')