Beispiel #1
0
 def _loadWidgets(self):
     """
     Load the widgets in the Groupbox
     """
     baseNumberChoices = ('None (default)',  
                          'Strands and segments',
                          'Strands only', 
                          'Segments only')
     
     self._baseNumberComboBox = \
         PM_ComboBox( self,
                      label         =  "Base numbers:",
                      choices       =  baseNumberChoices,
                      setAsDefault  =  True)
     
     numberingOrderChoices = ('5\' to 3\' (default)', 
                        '3\' to 5\'' )         
                        
     self._baseNumberingOrderComboBox = \
         PM_ComboBox( self,
                      label         =  "Base numbers:",
                      choices       =  numberingOrderChoices,
                      setAsDefault  =  True)
     
     prefs_key = dnaBaseNumberLabelColor_prefs_key
     self._baseNumberLabelColorChooser = \
         PM_ColorComboBox(self,
                          color      = env.prefs[prefs_key])
Beispiel #2
0
    def _loadGroupBox2(self, pmGroupBox):
        """
        Load widgets in group box 4.
        """

        self.conformationComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Conformation:",
                         choices       =  ["B-DNA"],
                         setAsDefault  =  True)

        dnaModelChoices = ['PAM3', 'PAM5']
        self.dnaModelComboBox = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Model:",
                         choices       =  dnaModelChoices,
                         setAsDefault  =  True)


        self.basesPerTurnDoubleSpinBox  =  \
            PM_DoubleSpinBox( pmGroupBox,
                              label         =  "Bases per turn:",
                              value         =  env.prefs[bdnaBasesPerTurn_prefs_key],
                              setAsDefault  =  True,
                              minimum       =  8.0,
                              maximum       =  20.0,
                              decimals      =  2,
                              singleStep    =  0.1 )


        self.duplexRiseDoubleSpinBox  =  \
            PM_DoubleSpinBox( pmGroupBox,
                              label         =  "Rise:",
                              value         =  env.prefs[bdnaRise_prefs_key],
                              setAsDefault  =  True,
                              minimum       =  2.0,
                              maximum       =  4.0,
                              decimals      =  3,
                              singleStep    =  0.01 )

        # Strand Length (i.e. the number of bases)
        self.numberOfBasePairsSpinBox = \
            PM_SpinBox( pmGroupBox,
                        label         =  "Base pairs:",
                        value         =  self._numberOfBases,
                        setAsDefault  =  False,
                        minimum       =  0,
                        maximum       =  10000 )

        self.numberOfBasePairsSpinBox.setDisabled(True)

        # Duplex Length
        self.duplexLengthLineEdit  =  \
            PM_LineEdit( pmGroupBox,
                         label         =  "Duplex length: ",
                         text          =  "0.0 Angstroms",
                         setAsDefault  =  False)

        self.duplexLengthLineEdit.setDisabled(True)
Beispiel #3
0
 def _loadPM_ComboBox(self, inPmGroupBox):
     """
     PM_ComboBox widgets.
     """
     
     choices = [ "First", "Second", "Third (Default)", "Forth" ]
     
     self.comboBox1= \
         PM_ComboBox( inPmGroupBox,
                      label        = 'Choices: ', 
                      choices      = choices, 
                      index        = 2, 
                      setAsDefault = True,
                      spanWidth    = False )
     
     self.comboBox2= \
         PM_ComboBox( inPmGroupBox,
                      label        = ' :Choices', 
                      labelColumn  = 1,
                      choices      = choices, 
                      index        = 2, 
                      setAsDefault = True,
                      spanWidth    = False )
     
     self.comboBox3= \
         PM_ComboBox( inPmGroupBox,
                      label        = ' Choices (SpanWidth = True):', 
                      labelColumn  = 1,
                      choices      = choices, 
                      index        = 2, 
                      setAsDefault = True,
                      spanWidth    = True )      
     
     self.nestedGroupBox1 = \
         PM_GroupBox( inPmGroupBox, 
                      title          = "Group Box Title" )
         
     self.comboBox4= \
         PM_ComboBox( self.nestedGroupBox1,
                      label        = "Choices:", 
                      choices      = choices, 
                      index        = 2, 
                      setAsDefault = True,
                      spanWidth    = False )
     
     self.nestedGroupBox2 = \
         PM_GroupBox( inPmGroupBox, 
                      title          = "Group Box Title" )
         
     self.comboBox6= \
         PM_ComboBox( self.nestedGroupBox2,
                      label        = "Choices:", 
                      choices      = choices, 
                      index        = 2, 
                      setAsDefault = True,
                      spanWidth    = True )
    def _loadGroupBox2(self, pmGroupBox):
        """
        Load widgets in group box.
        """
        dnaRenditionChoices = ['3D (default)',
                               '2D with base letters',
                               '2D ball and stick',
                               '2D ladder']

        self.dnaRenditionComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Rendition:",
                         choices       =  dnaRenditionChoices,
                         setAsDefault  =  True)

        dnaComponentChoices = ['Axis',
                                'Strands',
                                'Struts',
                                'Nucleotides']

        self.dnaComponentComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Component:",
                         choices       =  dnaComponentChoices,
                         setAsDefault  =  True)

        self._loadAxisGroupBox()
        self._loadStrandsGroupBox()
        self._loadStrutsGroupBox()
        self._loadNucleotidesGroupBox()

        widgetList = [self.axisGroupBox,
                      self.strandsGroupBox,
                      self.strutsGroupBox,
                      self.nucleotidesGroupBox]

        self.dnaComponentStackedWidget = \
            PM_StackedWidget( pmGroupBox,
                              self.dnaComponentComboBox,
                              widgetList )

        standLabelColorChoices = ['Hide',
                                  'Show (in strand color)',
                                  'Black',
                                  'White',
                                  'Custom color...']

        self.standLabelColorComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Strand labels:",
                         choices       =  standLabelColorChoices,
                         setAsDefault  =  True)

        # This disables "Component" widgets if rendition style is 2D.
        self.change_dnaRendition(env.prefs[dnaRendition_prefs_key])
Beispiel #5
0
    def _loadGroupBox2(self, pmGroupBox):
        """
        Load widgets in group box.
        
        @param pmGroupBox: group box that contains protein display choices
        @see: L{PM_GroupBox}  
        
        """
        proteinStyleChoices = [
            'CA trace (wire)', 'CA trace (cylinders)',
            'CA trace (ball and stick)', 'Tube', 'Ladder', 'Zigzag',
            'Flat ribbon', 'Solid ribbon', 'Cartoons', 'Fancy cartoons',
            'Peptide tiles'
        ]

        self.proteinStyleComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Style:",
                         choices       =  proteinStyleChoices,
                         setAsDefault  =  True)

        scaleChoices = ['Constant', 'Secondary structure', 'B-factor']

        self.scaleComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Scaling:",
                         choices       =  scaleChoices,
                         setAsDefault  =  True)
        self.scaleFactorDoubleSpinBox = \
            PM_DoubleSpinBox( pmGroupBox,
                              label         =  "Scaling factor:",
                              value         =  1.00,
                              setAsDefault  =  True,
                              minimum       =  0.1,
                              maximum       =  3.0,
                              decimals      =  1,
                              singleStep    =  0.1 )

        self.splineDoubleSpinBox = \
            PM_DoubleSpinBox( pmGroupBox,
                              label         =  "Resolution:",
                              value         =  3,
                              setAsDefault  =  True,
                              minimum       =  2,
                              maximum       =  8,
                              decimals      =  0,
                              singleStep    =  1 )

        self.smoothingCheckBox = \
            PM_CheckBox( pmGroupBox,
                         text         = "Smoothing",
                         setAsDefault = True)
Beispiel #6
0
    def _loadGroupBox3(self, pmGroupBox):
        """
        Load widgets in group box.
        """
        # hover highlighting style and color
        self.hoverHighlightingStyleComboBox = \
            PM_ComboBox( pmGroupBox,
                         label     =  "Highlighting:",
                         )

        self._loadHoverHighlightingStyleItems()

        hhColorList = [
            yellow, orange, red, magenta, cyan, blue, white, black, gray
        ]
        hhColorNames = [
            "Yellow (default)", "Orange", "Red", "Magenta", "Cyan", "Blue",
            "White", "Black", "Other color..."
        ]

        self.hoverHighlightingColorComboBox = \
            PM_ColorComboBox(pmGroupBox,
                             colorList = hhColorList,
                             colorNames = hhColorNames,
                             color = env.prefs[hoverHighlightingColor_prefs_key]
                             )

        # selection style and color
        self.selectionStyleComboBox = \
            PM_ComboBox( pmGroupBox,
                         label     =  "Selection:",
                         )

        self._loadSelectionStyleItems()

        selColorList = [
            darkgreen, green, orange, red, magenta, cyan, blue, white, black,
            gray
        ]
        selColorNames = [
            "Dark green (default)", "Green", "Orange", "Red", "Magenta",
            "Cyan", "Blue", "White", "Black", "Other color..."
        ]

        self.selectionColorComboBox = \
            PM_ColorComboBox(pmGroupBox,
                             colorList = selColorList,
                             colorNames = selColorNames,
                             color = env.prefs[selectionColor_prefs_key]
                             )
        return
    def _loadAxisGroupBox(self):
        """
        Load the Axis group box.
        """

        axisGroupBox = PM_GroupBox( None )
        self.axisGroupBox = axisGroupBox

        axisShapeChoices = ['None', 'Wide tube', 'Narrow tube']

        self.axisShapeComboBox = \
            PM_ComboBox( axisGroupBox ,
                         label         =  "Shape:",
                         choices       =  axisShapeChoices,
                         setAsDefault  =  True)

        self.axisScaleDoubleSpinBox  =  \
            PM_DoubleSpinBox( axisGroupBox,
                              label         =  "Scale:",
                              value         =  1.00,
                              setAsDefault  =  True,
                              minimum       =  0.1,
                              maximum       =  2.0,
                              decimals      =  2,
                              singleStep    =  0.1 )

        axisColorChoices = ['Same as chunk',
                            'Base order',
                            'Base order (discrete)',
                            'Base type',
                            'Strand order']

        self.axisColorComboBox = \
            PM_ComboBox( axisGroupBox ,
                         label         =  "Color:",
                         choices       =  axisColorChoices,
                         setAsDefault  =  True)

        endingTypeChoices = ['Flat',
                             'Taper start',
                             'Taper end',
                             'Taper both',
                             'Spherical']

        self.axisEndingStyleComboBox = \
            PM_ComboBox( axisGroupBox ,
                         label         =  "Ending style:",
                         choices       =  endingTypeChoices,
                         setAsDefault  =  True)
Beispiel #8
0
    def _loadGroupBox1(self, inPmGroupBox):
        """
        Load widgets into group box 1.
        """

        # User input to specify what type of element/atom to generate
        elementComboBoxItems = self._sElementSymbolList
        self.elementComboBox  =  \
            PM_ComboBox( inPmGroupBox,
                         label         =  "Elements :",
                         choices       =  elementComboBoxItems,
                         index         =  0,
                         setAsDefault  =  True,
                         spanWidth     =  False )

        # User input to specify x-coordinate
        # of the generated atom's position.
        self.xCoordinateField  =  \
            PM_DoubleSpinBox( inPmGroupBox,
                              label         =  "x :",
                              value         =  0.0,
                              setAsDefault  =  True,
                              minimum       =  self._sMinCoordinateValue,
                              maximum       =  self._sMaxCoordinateValue,
                              singleStep    =  self._sStepCoordinateValue,
                              decimals      =  self._sCoordinateDecimals,
                              suffix        =  ' ' + self._sCoordinateUnits )
        return
    def _loadProductSpecsGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Product specifications group box.
        @param inPmGroupBox: The roduct specifications box in the PM
        @type  inPmGroupBox: L{PM_GroupBox}
        """

        productChoices = ['Rod', 'Ring']

        self.extrude_productTypeComboBox = \
            PM_ComboBox( inPmGroupBox,
                         label        = 'Final product:',
                         labelColumn  = 0,
                         choices      = productChoices,
                         index        = 0,
                         setAsDefault = True,
                         spanWidth    = False )

        # names used in the code, same order
        #if you comment out items from combobox, you also have to remove them
        # from this list unless they are at the end!!!
        self.extrude_productTypeComboBox_ptypes = ["straight rod", \
                                                   "closed ring", \
                                                   "corkscrew"]

        self.extrudeSpinBox_n = \
            PM_SpinBox( inPmGroupBox,
                        label         =  "Number of copies:",
                        labelColumn   =  0,
                        value         =  3,
                        minimum       =  1,
                        maximum       =  99
                    )
        #@WARNING: This method initializes some instance varaiables for various
        #checkboxes. (Example: self.mergeCopiesCheckBox.default = False).
        #These values are needed in extrudemode.py. This
        #won't be needed once extrudeMode.py is cleaned up. -- ninad 2007-09-10

        self.extrudeBondCriterionSlider =  \
            PM_Slider( inPmGroupBox,
                       currentValue = 100,
                       minimum      = 0,
                       maximum      = 300,
                       label        = 'Tolerence'
                   )
        self.extrudeBondCriterionLabel = \
            self.extrudeBondCriterionSlider.labelWidget

        self.extrudeBondCriterionSlider_dflt = 100
        self.extrudeBondCriterionSlider.setPageStep(5)

        self.makeBondsCheckBox = \
            PM_CheckBox(inPmGroupBox,
                        text         = 'Make bonds' ,
                        widgetColumn = 0,
                        state        = Qt.Checked
                    )
        self.makeBondsCheckBox.default = True
        self.makeBondsCheckBox.attr = 'whendone_make_bonds'
        self.makeBondsCheckBox.repaintQ = False
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """

        includeStrandsChoices = [
            "All strands in model", "Selected strands only"
        ]

        self.includeStrandsComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Include strands:",
                         choices       =  includeStrandsChoices,
                         setAsDefault  =  True)

        self.numberOfBasesLineEdit  = \
            PM_LineEdit( pmGroupBox,
                         label  =  "Total nucleotides:",
                         text   = str(self.getNumberOfBases()))
        self.numberOfBasesLineEdit.setEnabled(False)

        self.numberOfXBasesLineEdit  = \
            PM_LineEdit( pmGroupBox,
                         label  =  "Unassigned:",
                         text   = str(self.getNumberOfBases(unassignedOnly = True)))
        self.numberOfXBasesLineEdit.setEnabled(False)

        self.viewDnaOrderFileButton = \
            PM_PushButton( pmGroupBox,
                           label     = "",
                           text      = "View DNA Order File...",
                           spanWidth = True)
        return
    def _loadDisplayOptionsGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Display Options groupbox.
        @param inPmGroupBox: The Display Options groupbox 
        @type  inPmGroupBox: L{PM_GroupBox} 
        """

        displayChoices = ['Tubes', 'Spheres']

        self.dispModeComboBox = \
            PM_ComboBox( inPmGroupBox,
                         label        = 'Display style:',
                         choices      = displayChoices,
                         index        = 0,
                         setAsDefault = False,
                         spanWidth    = False )

        self.gridLineCheckBox = PM_CheckBox(inPmGroupBox,
                                            text="Show grid lines",
                                            widgetColumn=0,
                                            state=Qt.Checked)

        self.fullModelCheckBox = PM_CheckBox(inPmGroupBox,
                                             text="Show model",
                                             widgetColumn=0,
                                             state=Qt.Unchecked)
    def _loadRotateGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Rotate group box, 
        @param inPmGroupBox: The Rotate GroupBox in the PM
        @type  inPmGroupBox: L{PM_GroupBox}
        """

        rotateChoices = ["Free Drag", "By Specified Angle"]

        self.rotateComboBox = \
            PM_ComboBox( inPmGroupBox,
                         label        = '',
                         choices      = rotateChoices,
                         index        = 0,
                         setAsDefault = False,
                         spanWidth    = True )

        self.rotateAsUnitCB = \
            PM_CheckBox( inPmGroupBox,
                         text         = 'Rotate as a unit' ,
                         widgetColumn = 0,
                         state        = Qt.Checked )

        self.freeDragRotateGroupBox = PM_GroupBox(inPmGroupBox)
        self._loadFreeDragRotateGroupBox(self.freeDragRotateGroupBox)

        self.bySpecifiedAngleGroupBox = PM_GroupBox(inPmGroupBox)
        self._loadBySpecifiedAngleGroupBox(self.bySpecifiedAngleGroupBox)

        self.updateRotateGroupBoxes(0)
Beispiel #13
0
    def _loadDisplayOptionsGroupBox(self, pmGroupBox):
        """
        Load widgets in the Display Options GroupBox
        @see: DnaOrCnt_PropertyManager. _loadDisplayOptionsGroupBox
        """
        #Call the superclass method that loads the cursor text checkboxes.
        #Note, as of 2008-05-19, the superclass, DnaOrCnt_PropertyManager
        #only loads the cursor text groupboxes. Subclasses like this can
        #call custom methods like self._loadCursorTextCheckBoxes etc if they
        #don't need all groupboxes that the superclass loads.
        _superclass._loadDisplayOptionsGroupBox(self, pmGroupBox)

        self._rubberbandLineGroupBox = PM_GroupBox(pmGroupBox,
                                                   title='Rubber band line:')

        dnaLineChoices = ['Ribbons', 'Ladder']
        self.dnaRubberBandLineDisplayComboBox = \
            PM_ComboBox( self._rubberbandLineGroupBox ,
                         label         =  " Display as:",
                         choices       =  dnaLineChoices,
                         setAsDefault  =  True)

        self.lineSnapCheckBox = \
            PM_CheckBox(self._rubberbandLineGroupBox ,
                        text         = 'Enable line snap' ,
                        widgetColumn = 1,
                        state        = Qt.Checked
                    )
    def _loadTranslateGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Translate group box.
        @param inPmGroupBox: The Translate group box in the PM
        @type  inPmGroupBox: L{PM_GroupBox}
        """

        translateChoices = ["Free Drag", "By Delta XYZ", "To XYZ Position"]

        self.translateComboBox = \
            PM_ComboBox( inPmGroupBox,
                         label        = '',
                         choices      = translateChoices,
                         index        = 0,
                         setAsDefault = False,
                         spanWidth    = True )

        self.freeDragTranslateGroupBox = PM_GroupBox(inPmGroupBox)
        self._loadFreeDragTranslateGroupBox(self.freeDragTranslateGroupBox)

        self.byDeltaGroupBox = PM_GroupBox(inPmGroupBox)
        self._loadByDeltaGroupBox(self.byDeltaGroupBox)

        self.toPositionGroupBox = PM_GroupBox(inPmGroupBox)
        self._loadToPositionGroupBox(self.toPositionGroupBox)

        self.updateTranslateGroupBoxes(0)
Beispiel #15
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box 1.
        @param pmGroupBox: group box that contains protein name combo box and 
                        number of amino acids spin box
        @see: L{PM_GroupBox}                
        """
        self._updateProteinList()
        if len(self.protein_name_list) >= 1:
            self.set_current_protein_chunk_name(self.protein_name_list[0])
        self.structureComboBox = PM_ComboBox(pmGroupBox,
                                             label="Name:",
                                             choices=self.protein_name_list,
                                             setAsDefault=False)

        #Urmi 20080713: May be useful to set the minimum value to not zero
        #Now it does not matter, since its disabled. But zero as the minimum
        #value in a spinbox does not work otherwise.
        self.numberOfAASpinBox = \
            PM_SpinBox( pmGroupBox,
                        label         =  "Amino Acids:",
                        value         =  0,
                        setAsDefault  =  False,
                        minimum       =  0,
                        maximum       =  10000 )
        #for now we do not allow changing number of residues
        self.numberOfAASpinBox.setEnabled(False)
        self.editPropertiesPushButton = PM_PushButton(pmGroupBox,
                                                      text="Edit Sequence",
                                                      setAsDefault=True)
    def _loadStrandsGroupBox(self):
        """
        Load the Strands group box.
        """

        strandsGroupBox = PM_GroupBox( None )
        self.strandsGroupBox = strandsGroupBox

        strandsShapeChoices = ['None', 'Cylinders', 'Tube']

        self.strandsShapeComboBox = \
            PM_ComboBox( strandsGroupBox ,
                         label         =  "Shape:",
                         choices       =  strandsShapeChoices,
                         setAsDefault  =  True)

        self.strandsScaleDoubleSpinBox  =  \
            PM_DoubleSpinBox( strandsGroupBox,
                              label         =  "Scale:",
                              value         =  1.00,
                              setAsDefault  =  True,
                              minimum       =  0.1,
                              maximum       =  5.0,
                              decimals      =  2,
                              singleStep    =  0.1 )

        strandsColorChoices = ['Same as chunk',
                               'Base order',
                               'Strand order']

        self.strandsColorComboBox = \
            PM_ComboBox( strandsGroupBox ,
                         label         =  "Color:",
                         choices       =  strandsColorChoices,
                         setAsDefault  =  True)

        strandsArrowsChoices = ['None',
                                '5\'',
                                '3\'',
                                '5\' and 3\'']

        self.strandsArrowsComboBox = \
            PM_ComboBox( strandsGroupBox ,
                         label         =  "Arrows:",
                         choices       =  strandsArrowsChoices,
                         setAsDefault  =  True)
Beispiel #17
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """

        self.nameLineEdit = PM_LineEdit(pmGroupBox, label="Name:")

        self.lengthLineEdit = PM_LineEdit(pmGroupBox, label="Length:")
        self.lengthLineEdit.setEnabled(False)

        self.currentResidueComboBox = PM_ComboBox(pmGroupBox,
                                                  label="Current residue:",
                                                  setAsDefault=False)

        BUTTON_LIST = [
            ("QToolButton", 1, "Previous residue",
             "ui/actions/Properties Manager/Previous.png", "",
             "Previous residue", 0),
            ("QToolButton", 2, "Next residue",
             "ui/actions/Properties Manager/Next.png", "", "Next residue", 1)
        ]

        self.prevNextButtonRow = \
            PM_ToolButtonRow( pmGroupBox,
                              title        =  "",
                              buttonList   =  BUTTON_LIST,
                              label        =  'Previous / Next:',
                              isAutoRaise  =  True,
                              isCheckable  =  False
                            )
        self.prevButton = self.prevNextButtonRow.getButtonById(1)
        self.nextButton = self.prevNextButtonRow.getButtonById(2)

        self.recenterViewCheckBox  = \
            PM_CheckBox( pmGroupBox,
                         text          =  "Center view on current residue",
                         setAsDefault  =  True,
                         state         =  Qt.Unchecked,
                         widgetColumn  =  0,
                         spanWidth     =  True)

        self.lockEditedCheckBox  = \
            PM_CheckBox( pmGroupBox,
                         text          =  "Lock edited rotamers",
                         setAsDefault  =  True,
                         state         =  Qt.Checked,
                         widgetColumn  =  0,
                         spanWidth     =  True)

        self.showAllResiduesCheckBox  = \
            PM_CheckBox( pmGroupBox,
                         text          =  "Show all residues",
                         setAsDefault  =  False,
                         state         =  Qt.Unchecked,
                         widgetColumn  =  0,
                         spanWidth     =  True)
        return
    def _loadNucleotidesGroupBox(self):
        """
        Load the Nucleotides group box.
        """
        nucleotidesGroupBox = PM_GroupBox( None )
        self.nucleotidesGroupBox = nucleotidesGroupBox

        nucleotidesShapeChoices = ['None',
                                   'Sugar spheres',
                                   'Base cartoons']

        self.nucleotidesShapeComboBox = \
            PM_ComboBox( nucleotidesGroupBox ,
                         label         =  "Shape:",
                         choices       =  nucleotidesShapeChoices,
                         setAsDefault  =  True)

        self.nucleotidesScaleDoubleSpinBox  =  \
            PM_DoubleSpinBox( nucleotidesGroupBox,
                              label         =  "Scale:",
                              value         =  1.00,
                              setAsDefault  =  True,
                              minimum       =  0.1,
                              maximum       =  3.0,
                              decimals      =  2,
                              singleStep    =  0.1 )

        nucleotidesColorChoices = ['Same as strand',
                                   'Base order',
                                   'Strand order',
                                   'Base type']

        self.nucleotidesColorComboBox = \
            PM_ComboBox( nucleotidesGroupBox ,
                         label         =  "Color:",
                         choices       =  nucleotidesColorChoices,
                         setAsDefault  =  True)

        self.dnaStyleBasesDisplayLettersCheckBox = \
            PM_CheckBox(nucleotidesGroupBox ,
                        text         = 'Display base letters',
                        widgetColumn = 1
                        )
    def _loadLayerPropertiesGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Layer Properties group box.
        @param inPmGroupBox: The Layer Properties groupbox in the PM
        @type  inPmGroupBox: L{PM_GroupBox} 
        """

        self.currentLayerComboBox = \
            PM_ComboBox( inPmGroupBox,
                         index     = 0,
                         spanWidth = True
                        )

        self.addLayerButton = PM_PushButton(inPmGroupBox)
        self.addLayerButton.setIcon(
            geticon('ui/actions/Properties Manager/addlayer.png'))
        self.addLayerButton.setFixedSize(QSize(26, 26))
        self.addLayerButton.setIconSize(QSize(22, 22))

        # A widget list to create a widget row.
        # Format:
        # - Widget type,
        # - widget object,
        # - column

        firstRowWidgetList = [('PM_ComboBox', self.currentLayerComboBox, 1),
                              ('PM_PushButton', self.addLayerButton, 2)]

        widgetRow = PM_WidgetRow(
            inPmGroupBox,
            title='',
            widgetList=firstRowWidgetList,
            label="Layer:",
            labelColumn=0,
        )

        self.layerCellsSpinBox = \
             PM_SpinBox( inPmGroupBox,
                        label         =  "Lattice cells:",
                        labelColumn   =  0,
                        value         =  2,
                        minimum       =  1,
                        maximum       =  25
                      )

        self.layerThicknessLineEdit = PM_LineEdit(inPmGroupBox,
                                                  label="Thickness:",
                                                  text="",
                                                  setAsDefault=False,
                                                  spanWidth=False)

        #self.layerThicknessLineEdit.setReadOnly(True)
        self.layerThicknessLineEdit.setDisabled(True)
        tooltip = "Thickness of layer in Angstroms"
        self.layerThicknessLineEdit.setToolTip(tooltip)
Beispiel #20
0
    def _loadGroupBox2(self, pmGroupBox):
        """
        Load widgets in group box 2.
        """

        self.modelComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Model :",
                         choices       =  self._modelChoices,
                         setAsDefault  =  True)

        self.conformationComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Conformation :",
                         choices       =  ["B-DNA"],
                         setAsDefault  =  True)

        self.connect(self.conformationComboBox,
                     SIGNAL("currentIndexChanged(int)"),
                     self.conformationComboBoxChanged)

        self.basesPerTurnComboBox= \
            PM_ComboBox( pmGroupBox,
                         label         =  "Bases Per Turn :",
                         choices       =  ["10.0", "10.5", "10.67"],
                         setAsDefault  =  True)

        # I may decide to reintroduce "base-pair chunks" at a later time.
        # Please talk to me if you have a strong feeling about including
        # this. Mark 2007-08-19.
        createChoices        =  ["Strand chunks", \
                                 "Single chunk" ]
        #@ "Base-pair chunks"]

        self.createComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Create :",
                         choices       =  createChoices,
                         index         =  0,
                         setAsDefault  =  True,
                         spanWidth     =  False )
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in 1st group box.
        
        @param pmGroupBox: The 1st group box in the PM.
        @type  pmGroupBox: L{PM_GroupBox}
        """

        self.axesCombobox = PM_ComboBox(pmGroupBox,
                                        label='Axes: ',
                                        choices=self._axes_display_choices,
                                        index=0,
                                        setAsDefault=True,
                                        spanWidth=False)

        self.basesCombobox = PM_ComboBox(pmGroupBox,
                                         label='Bases: ',
                                         choices=self._bases_display_choices,
                                         index=0,
                                         setAsDefault=True,
                                         spanWidth=False)
    def _loadStrutsGroupBox(self):
        """
        Load the Struts group box.
        """

        strutsGroupBox = PM_GroupBox( None )
        self.strutsGroupBox = strutsGroupBox

        strutsShapeChoices = ['None',
                              'Base-axis-base cylinders',
                              'Straight cylinders']

        self.strutsShapeComboBox = \
            PM_ComboBox( strutsGroupBox ,
                         label         =  "Shape:",
                         choices       =  strutsShapeChoices,
                         setAsDefault  =  True)

        self.strutsScaleDoubleSpinBox  =  \
            PM_DoubleSpinBox( strutsGroupBox,

                              label         =  "Scale:",
                              value         =  1.00,
                              setAsDefault  =  True,
                              minimum       =  0.1,
                              maximum       =  3.0,
                              decimals      =  2,
                              singleStep    =  0.1 )

        strutsColorChoices = ['Same as strand',
                              'Base order',
                              'Strand order',
                              'Base type']

        self.strutsColorComboBox = \
            PM_ComboBox( strutsGroupBox ,
                         label         =  "Color:",
                         choices       =  strutsColorChoices,
                         setAsDefault  =  True)
Beispiel #23
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """

        #stereoSettingsGroupBox = PM_GroupBox( None )

        self.stereoEnabledCheckBox = \
            PM_CheckBox(pmGroupBox,
                        text         = 'Enable Stereo View',
                        widgetColumn = 1
                        )

        stereoModeChoices = [
            'Relaxed view', 'Cross-eyed view', 'Red/blue anaglyphs',
            'Red/cyan anaglyphs', 'Red/green anaglyphs'
        ]

        self.stereoModeComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "Stereo Mode:",
                         choices       =  stereoModeChoices,
                         setAsDefault  =  True)

        self.stereoModeComboBox.setCurrentIndex(
            env.prefs[stereoViewMode_prefs_key] - 1)

        self.stereoSeparationSlider =  \
            PM_Slider( pmGroupBox,
                       currentValue = 50,
                       minimum      = 0,
                       maximum      = 300,
                       label        = 'Separation'
                       )

        self.stereoSeparationSlider.setValue(
            env.prefs[stereoViewSeparation_prefs_key])

        self.stereoAngleSlider =  \
            PM_Slider( pmGroupBox,
                       currentValue = 50,
                       minimum      = 0,
                       maximum      = 100,
                       label        = 'Angle'
                       )

        self.stereoAngleSlider.setValue(env.prefs[stereoViewAngle_prefs_key])

        self._updateWidgets()
 def _loadFuseOptionsGroupBox(self, inPmGroupBox):
     """
     Load the widgets inside the Fuse Options groupbox.
     """
     
     #@ Warning: If you change fuseChoices, you must also change the
     #  constants MAKEBONDS and FUSEATOMS in FuseChunks_Command.py.
     #  This implementation is fragile and should be fixed. Mark 2008-07-16
     
     fuseChoices = ['Make bonds between chunks', 
                    'Fuse overlapping atoms']
     
     self.fuseComboBox = \
         PM_ComboBox( inPmGroupBox,
                      label        = '', 
                      choices      = fuseChoices, 
                      index        = 0, 
                      setAsDefault = False,
                      spanWidth    = True)
     
     self.connect(self.fuseComboBox, 
                  SIGNAL("activated(const QString&)"), 
                  self.parentMode.change_fuse_mode)
     
     self.fusePushButton = PM_PushButton( inPmGroupBox,
                                          label     = "",
                                          text      = "Make Bonds",
                                          spanWidth = True )
     
     self.connect( self.fusePushButton,
                   SIGNAL("clicked()"),
                   self.parentMode.fuse_something)
     
     self.toleranceSlider =  PM_Slider( inPmGroupBox,
                                        currentValue = 100,
                                        minimum      = 0,
                                        maximum      = 300,
                                        label        = \
                                        'Tolerance:100% => 0 bondable pairs'
                                      )
     self.connect(self.toleranceSlider,
                    SIGNAL("valueChanged(int)"),
                    self.parentMode.tolerance_changed)
     
     self.mergeChunksCheckBox = PM_CheckBox( inPmGroupBox,
                                             text         = 'Merge chunks',
                                             widgetColumn = 0,
                                             state        = Qt.Checked )
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in groubox 1.
        """

        self.heightField = \
            PM_DoubleSpinBox( pmGroupBox,
                              label        = "Height :",
                              value        = 20.0,
                              setAsDefault = True,
                              minimum      = 1.0,
                              maximum      = 100.0,
                              singleStep   = 1.0,
                              decimals     = 3,
                              suffix       = ' Angstroms')
        self.widthField = \
            PM_DoubleSpinBox( pmGroupBox,
                              label        = "Width :",
                              value        = 20.0,
                              setAsDefault = True,
                              minimum      = 1.0,
                              maximum      = 100.0,
                              singleStep   = 1.0,
                              decimals     = 3,
                              suffix       = ' Angstroms')

        self.bondLengthField = \
            PM_DoubleSpinBox( pmGroupBox,
                              label        = "Bond Length :",
                              value        = CC_GRAPHITIC_BONDLENGTH,
                              setAsDefault = True,
                              minimum      = 1.0,
                              maximum      = 3.0,
                              singleStep   = 0.1,
                              decimals     = 3,
                              suffix       = ' Angstroms')

        endingChoices = ["None", "Hydrogen", "Nitrogen"]

        self.endingsComboBox= \
            PM_ComboBox( pmGroupBox,
                         label        = "Endings :",
                         choices      = endingChoices,
                         index        = 0,
                         setAsDefault = True,
                         spanWidth    = False )
    def _loadGroupBox2(self, pmGroupBox):
        """
        Load widgets in group box.
        """
        #background color combo box
        self.backgroundColorComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label     =  "Color:",
                         spanWidth = False)

        self._loadBackgroundColorItems()

        self.enableFogCheckBox = \
            PM_CheckBox( pmGroupBox, text = "Enable fog" )

        connect_checkbox_with_boolean_pref( self.enableFogCheckBox, fogEnabled_prefs_key )
        return
Beispiel #27
0
 def _loadWidgetSelectorGroupBox(self, inPmGroupBox):
     """
     Widget selector group box.
     """
     
     # The widget choices are set via self._getGroupBoxTitles() later.
     widgetTypeChoices = [ "PM_CheckBox" ]
     
     self.widgetSelectorComboBox = \
         PM_ComboBox( inPmGroupBox,
                      label        = "Select a PM widget:", 
                      choices      = widgetTypeChoices, 
                      index        = 0, 
                      setAsDefault = False,
                      spanWidth    = True )
     
     self.connect(self.widgetSelectorComboBox, 
                  SIGNAL("currentIndexChanged(int)"), 
                  self._updateGroupBoxes)
Beispiel #28
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """

        aa_list = []
        for mol in self.win.assy.molecules:
            if mol.isProteinChunk():
                aa_list = mol.protein.get_amino_acid_id_list()
                break

        self.aminoAcidsComboBox = PM_ComboBox(pmGroupBox,
                                              label="Residue:",
                                              choices=aa_list,
                                              setAsDefault=False)


        self.previousAAPushButton  = \
            PM_PushButton( pmGroupBox,
                         text         =  "Previous AA",
                         setAsDefault  =  True)

        self.nextAAPushButton  = \
            PM_PushButton( pmGroupBox,
                         text         =  "Next AA",
                         setAsDefault  =  True)

        self.recenterViewCheckBox  = \
            PM_CheckBox( pmGroupBox,
                         text          =  "Re-center view",
                         setAsDefault  =  True,
                         state         = Qt.Checked)

        self.expandAllPushButton  = \
            PM_PushButton( pmGroupBox,
                         text         =  "Expand All",
                         setAsDefault  =  True)

        self.collapseAllPushButton  = \
            PM_PushButton( pmGroupBox,
                         text         =  "Collapse All",
                         setAsDefault  =  True)
    def _loadGroupBox5(self, pmGroupBox):
        """
        Load widgets in group box 5.
        """
        self._rubberbandLineGroupBox = PM_GroupBox(pmGroupBox,
                                                   title='Rubber band Line:')

        ntLineChoices = ['Ladder']
        self.ntRubberBandLineDisplayComboBox = \
            PM_ComboBox( self._rubberbandLineGroupBox ,
                         label         =  " Display as:",
                         choices       =  ntLineChoices,
                         setAsDefault  =  True)

        self.lineSnapCheckBox = \
            PM_CheckBox(self._rubberbandLineGroupBox ,
                        text         = 'Enable line snap' ,
                        widgetColumn = 1,
                        state        = Qt.Checked
                        )
Beispiel #30
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box.
        """

        convertChoices = [
            "Convert from PAM3 to PAM5", "Convert from PAM5 to PAM3"
        ]

        self._convertChoiceComboBox  = \
            PM_ComboBox( pmGroupBox,
                         label         =  "",
                         choices       =  convertChoices,
                         index         =  0,
                         setAsDefault  =  True,
                         spanWidth     =  True)

        self._convertButton = \
            PM_PushButton( pmGroupBox,
                           label     = "",
                           text      = "Convert Selection Now",
                           spanWidth = True)
        return