def _loadMergeOptionsGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Merge Options groupbox (which is a groupbox within
        the B{Advanced Options group box}).
        @param inPmGroupBox: The Merge Options groupbox
        @type  inPmGroupBox: L{PM_GroupBox}
        @WARNING: This method initializes some instance varaiables for various
        checkboxes. (Example: self.mergeCopiesCheckBox.default = False). This
        won't be needed once extrudeMode.py is cleaned up.
        """
        self.mergeCopiesCheckBox = \
            PM_CheckBox(inPmGroupBox,
                        text         = 'Merge copies' ,
                        widgetColumn = 1,
                        state        = Qt.Unchecked
                    )
        self.mergeCopiesCheckBox.default = False
        self.mergeCopiesCheckBox.attr = 'whendone_all_one_part'
        self.mergeCopiesCheckBox.repaintQ = False


        self.extrudePrefMergeSelection = \
            PM_CheckBox(inPmGroupBox,
                        text         = 'Merge selection' ,
                        widgetColumn = 1,
                        state        = Qt.Unchecked
                    )
        self.extrudePrefMergeSelection.default = False
        self.extrudePrefMergeSelection.attr = 'whendone_merge_selection'
        self.extrudePrefMergeSelection.repaintQ = False
 def _loadJoinOptionsGroupbox(self, pmGroupBox):
     """
     Load widgets in this group box.
     """        
     
     self.clickToJoinDnaStrandsCheckBox = \
         PM_CheckBox(pmGroupBox ,
                     text         = 'Click on strand to join',
                     widgetColumn = 0, 
                     spanWidth = True)
     
     connect_checkbox_with_boolean_pref(
         self.clickToJoinDnaStrandsCheckBox, 
         joinStrandsCommand_clickToJoinDnaStrands_prefs_key )
     
     self.recursive_clickToJoinDnaStrandsCheckBox = \
         PM_CheckBox(pmGroupBox ,
                     text         = 'Recursively join strands',
                     widgetColumn = 1, 
                     spanWidth = True)
     
     connect_checkbox_with_boolean_pref(
         self.recursive_clickToJoinDnaStrandsCheckBox, 
         joinStrandsCommand_recursive_clickToJoinDnaStrands_prefs_key)
     
     if not env.prefs[joinStrandsCommand_clickToJoinDnaStrands_prefs_key]:
         self.recursive_clickToJoinDnaStrandsCheckBox.setEnabled(False)
    def _loadDisplayOptionsGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Display Options groupbox (which is a groupbox within
        the B{Advanced Options group box} ) .
        @param inPmGroupBox: The Display Options groupbox
        @type  inPmGroupBox: L{PM_GroupBox}
        @WARNING: This method initializes some instance varaiables for various
        checkboxes. (Example: self.mergeCopiesCheckBox.default = False). This
        won't be needed once extrudeMode.py is cleaned up.
        """
        self.showEntireModelCheckBox = \
            PM_CheckBox(inPmGroupBox,
                        text         = 'Show entire model' ,
                        widgetColumn = 1,
                        state        = Qt.Unchecked
                    )
        self.showEntireModelCheckBox.default = False
        self.showEntireModelCheckBox.attr = 'show_entire_model'
        self.showEntireModelCheckBox.repaintQ = True

        self.showBondOffsetCheckBox = \
            PM_CheckBox(inPmGroupBox,
                        text         = 'Show bond-offset spheres' ,
                        widgetColumn = 1,
                        state        = Qt.Unchecked
                    )
        self.showBondOffsetCheckBox.default = False
        self.showBondOffsetCheckBox.attr = 'show_bond_offsets'
        self.showBondOffsetCheckBox.repaintQ = True
Esempio n. 4
0
 def _loadPM_CheckBox(self, inPmGroupBox):
     """
     PM_CheckBox.
     """
     self.checkBoxGroupBox = \
         PM_GroupBox( inPmGroupBox, 
                      title          = "<b> PM_CheckBox examples</b>" )
     
     self.checkBox1 = \
         PM_CheckBox( self.checkBoxGroupBox,
                      text         = "Label on left:",
                      widgetColumn = 1,
                      state        = Qt.Checked,
                      setAsDefault = True,
                     )
     
     self.checkBox2 = \
         PM_CheckBox( self.checkBoxGroupBox,
                      text          = ": Label on right",
                      widgetColumn  = 1,
                      state         = Qt.Checked,
                      setAsDefault  = True,
                     )
     
     self.checkBox3 = \
         PM_CheckBox( self.checkBoxGroupBox,
                      text         = "CheckBox (spanWidth = True):",
                      state        = Qt.Unchecked,
                      setAsDefault = False,
                    )
    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)
Esempio n. 6
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 _loadSelectionOptionsGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Selection Options group box.
        @param inPmGroupBox: The Selection Options box in the PM
        @type  inPmGroupBox: L{PM_GroupBox} 
        """

        self.selectionFilterCheckBox = \
            PM_CheckBox( inPmGroupBox,
                         text  = "Enable atom selection filter",
                         widgetColumn = 0,
                         state        = Qt.Unchecked  )
        self.selectionFilterCheckBox.setDefaultValue(False)

        self.filterlistLE = PM_LineEdit(inPmGroupBox,
                                        label="",
                                        text="",
                                        setAsDefault=False,
                                        spanWidth=True)
        self.filterlistLE.setReadOnly(True)

        if self.selectionFilterCheckBox.isChecked():
            self.filterlistLE.setEnabled(True)
        else:
            self.filterlistLE.setEnabled(False)

        self.showSelectedAtomInfoCheckBox = \
            PM_CheckBox(
                inPmGroupBox,
                text  = "Show Selected Atom Info",
                widgetColumn = 0,
                state        = Qt.Unchecked)

        self.selectedAtomPosGroupBox = \
            PM_GroupBox( inPmGroupBox, title = "")
        self._loadSelectedAtomPosGroupBox(self.selectedAtomPosGroupBox)

        self.toggle_selectedAtomPosGroupBox(show=0)
        self.enable_or_disable_selectedAtomPosGroupBox(bool_enable=False)

        self.reshapeSelectionCheckBox = \
            PM_CheckBox( inPmGroupBox,
                         text         = 'Dragging reshapes selection',
                         widgetColumn = 0,
                         state        = Qt.Unchecked  )

        connect_checkbox_with_boolean_pref(self.reshapeSelectionCheckBox,
                                           reshapeAtomsSelection_prefs_key)

        env.prefs[reshapeAtomsSelection_prefs_key] = False

        self.waterCheckBox = \
            PM_CheckBox( inPmGroupBox,
                         text         = "Z depth filter (water surface)",
                         widgetColumn = 0,
                         state        = Qt.Unchecked  )
    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
Esempio n. 9
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 _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box 1.
        """

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

        self.numberOfBasesSpinBox = \
            PM_SpinBox( pmGroupBox,
                        label         =  "Number of bases:",
                        value         =  self._numberOfBases,
                        setAsDefault  =  False,
                        minimum       =  2,
                        maximum       =  10000 )

        self.disableStructHighlightingCheckbox = \
            PM_CheckBox( pmGroupBox,
                         text         = "Don't highlight while editing DNA",
                         widgetColumn  = 0,
                         state        = Qt.Unchecked,
                         setAsDefault = True,
                         spanWidth = True
                         )

        #As of 2008-03-31, the properties such as number of bases will be
        #editable only by using the resize handles.
        self.numberOfBasesSpinBox.setEnabled(False)
        return
Esempio n. 11
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        load widgets in groupbox1
        """

        self._loadSegmentListWidget(pmGroupBox)
        self.crossoversBetGivenSegmentsOnly_checkBox = PM_CheckBox(
            pmGroupBox,
            text="Between above segments only",
            widgetColumn=0,
            setAsDefault=True,
            spanWidth=True,
        )

        #If this preferece value is True, the search algotithm will search for
        #the potential crossover sites only *between* the segments in the
        #segment list widget (thus ignoring other segments not in that list)
        if env.prefs[
                makeCrossoversCommand_crossoverSearch_bet_given_segments_only_prefs_key]:
            self.crossoversBetGivenSegmentsOnly_checkBox.setCheckState(
                Qt.Checked)
        else:
            self.crossoversBetGivenSegmentsOnly_checkBox.setCheckState(
                Qt.Unchecked)

        self.makeCrossoverPushButton = PM_PushButton(
            pmGroupBox, label="", text="Make All Crossovers", spanWidth=True)
    def _loadGroupBox3(self, pmGroupBox):
        """
        Load widgets in group box.
        """

        self.enableMaterialPropertiesComboBox = \
            PM_CheckBox( pmGroupBox, text = "On")
        self.finishDoubleSpinBox = \
            PM_DoubleSpinBox(pmGroupBox,
                             maximum = 1.0,
                             minimum = 0.0,
                             decimals = 2,
                             singleStep = .1,
                             label = "Finish:")
        self.shininessDoubleSpinBox = \
            PM_DoubleSpinBox(pmGroupBox,
                             maximum = 60,
                             minimum = 15,
                             decimals = 2,
                             label = "Shininess:")
        self.brightnessDoubleSpinBox = \
            PM_DoubleSpinBox(pmGroupBox,
                             maximum = 1.0,
                             minimum = 0.0,
                             decimals = 2,
                             singleStep = .1,
                             label = "Brightness:")
        return
    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)
Esempio n. 14
0
    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.widthDblSpinBox = \
            PM_DoubleSpinBox(pmGroupBox,
                             label        = "Width:",
                             value        = 16.0,
                             setAsDefault = True,
                             minimum      = 1.0,
                             maximum      = 10000.0, # 1000 nm
                             singleStep   = 1.0,
                             decimals     = 1,
                             suffix       = ' Angstroms')



        self.heightDblSpinBox = \
            PM_DoubleSpinBox(pmGroupBox,
                             label        =" Height:",
                             value        = 16.0,
                             setAsDefault = True,
                             minimum      = 1.0,
                             maximum      = 10000.0, # 1000 nm
                             singleStep   = 1.0,
                             decimals     = 1,
                             suffix       = ' Angstroms')



        self.aspectRatioCheckBox = \
            PM_CheckBox(pmGroupBox,
                        text         = 'Maintain Aspect Ratio of:' ,
                        widgetColumn = 1,
                        state        = Qt.Unchecked
                        )


        self.aspectRatioSpinBox = \
            PM_DoubleSpinBox( pmGroupBox,
                              label         =  "",
                              value         =  1.0,
                              setAsDefault  =  True,
                              minimum       =  0.1,
                              maximum       =  10.0,
                              singleStep    =  0.1,
                              decimals      =  2,
                              suffix        =  " to 1.00")

        if self.aspectRatioCheckBox.isChecked():
            self.aspectRatioSpinBox.setEnabled(True)
        else:
            self.aspectRatioSpinBox.setEnabled(False)
    def _loadAdvancedOptionsGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Advanced Options group box.
        @param inPmGroupBox: The Advanced Options box in the PM
        @type  inPmGroupBox: L{PM_GroupBox} 
        """

        self.autoBondCheckBox = \
            PM_CheckBox( inPmGroupBox,
                         text         = 'Auto bond',
                         widgetColumn = 0,
                         state        = Qt.Checked  )

        self.highlightingCheckBox = \
            PM_CheckBox( inPmGroupBox,
                         text         = "Hover highlighting",
                         widgetColumn = 0,
                         state        = Qt.Checked )
Esempio n. 16
0
    def _loadGroupBox2(self, pmGroupBox):
        """
        Load widgets in the second group box.
        """

        self.headerdata_seq = ['', 'ID', 'Set', 'BR', 'Descriptor']

        self.recenterViewCheckBox  = \
            PM_CheckBox( pmGroupBox,
                         text          =  "Re-center view on selected residue",
                         setAsDefault  =  True,
                         widgetColumn  = 0,
                         state         = Qt.Unchecked)

        self.selectAllPushButton = PM_PushButton(pmGroupBox,
                                                 text="All",
                                                 setAsDefault=True)

        self.selectAllPushButton.setFixedHeight(25)

        self.selectNonePushButton = PM_PushButton(pmGroupBox,
                                                  text="None",
                                                  setAsDefault=True)

        self.selectNonePushButton.setFixedHeight(25)

        self.selectInvertPushButton = PM_PushButton(pmGroupBox,
                                                    text="Invert",
                                                    setAsDefault=True)

        self.selectInvertPushButton.setFixedHeight(25)

        buttonList = [('PM_PushButton', self.selectAllPushButton, 0, 0),
                      ('PM_PushButton', self.selectNonePushButton, 1, 0),
                      ('PM_PushButton', self.selectInvertPushButton, 2, 0)]

        self.buttonGrid = PM_WidgetGrid(pmGroupBox, widgetList=buttonList)

        self.sequenceTable = PM_TableWidget(pmGroupBox)
        #self.sequenceTable.setModel(self.tableModel)
        self.sequenceTable.resizeColumnsToContents()
        self.sequenceTable.verticalHeader().setVisible(False)
        #self.sequenceTable.setRowCount(0)
        self.sequenceTable.setColumnCount(5)

        self.checkbox = QCheckBox()

        self.sequenceTable.setFixedHeight(345)

        self.sequenceTable.setGridStyle(Qt.NoPen)

        self.sequenceTable.setHorizontalHeaderLabels(self.headerdata_seq)
        ###self._fillSequenceTable()
        self.showSequencePushButton = PM_PushButton(pmGroupBox,
                                                    text="Show Sequence",
                                                    setAsDefault=True,
                                                    spanWidth=True)
    def _loadAdvancedOptionsGroupBox(self, inPmGroupBox):
        """
        Load widgets in the Advanced Options group box.
        @param inPmGroupBox: The Advanced Options box in the PM
        @type  inPmGroupBox: L{PM_GroupBox} 
        """
        self.snapGridCheckBox = \
            PM_CheckBox(inPmGroupBox,
                        text = "Snap to grid",
                        state = Qt.Checked
                        )
        tooltip = "Snap selection point to a nearest cell grid point."
        self.snapGridCheckBox.setToolTip(tooltip)

        self.freeViewCheckBox = \
            PM_CheckBox(inPmGroupBox,
                        text = "Enable free view",
                        state = Qt.Unchecked
                    )
Esempio n. 18
0
    def _load5PrimeEndArrowAndCustomColor(self, pmGroupBox):
        """
        Loads 5' end custom color checkbox and color chooser dialog
        """
        self.pmGroupBox2 = PM_GroupBox(pmGroupBox, title="5' end:")
        self.arrowsOnFivePrimeEnds_checkBox = PM_CheckBox(
            self.pmGroupBox2,
            text="Show arrowhead",
            widgetColumn=0,
            setAsDefault=True,
            spanWidth=True)

        prefs_key = self._prefs_key_arrowsOnFivePrimeEnds()
        if env.prefs[prefs_key]:
            self.arrowsOnFivePrimeEnds_checkBox.setCheckState(Qt.Checked)
        else:
            self.arrowsOnFivePrimeEnds_checkBox.setCheckState(Qt.Unchecked)

        self.strandFivePrimeArrowheadsCustomColorCheckBox = PM_CheckBox(
            self.pmGroupBox2,
            text="Display custom color",
            widgetColumn=0,
            setAsDefault=True,
            spanWidth=True)

        prefs_key = self._prefs_key_dnaStrandFivePrimeArrowheadsCustomColor()
        self.fivePrimeEndColorChooser = \
            PM_ColorComboBox(self.pmGroupBox2,
                             color      = env.prefs[prefs_key]
                             )

        prefs_key = self._prefs_key_useCustomColorForFivePrimeArrowheads()
        if env.prefs[prefs_key]:
            self.strandFivePrimeArrowheadsCustomColorCheckBox.setCheckState(
                Qt.Checked)
            self.fivePrimeEndColorChooser.show()
        else:
            self.strandFivePrimeArrowheadsCustomColorCheckBox.setCheckState(
                Qt.Unchecked)
            self.fivePrimeEndColorChooser.hide()

        return
Esempio n. 19
0
 def _loadArrowOnBackBone(self, pmGroupBox):
     """
     Loads Arrow on the backbone checkbox
     """
     self.pmGroupBox4 = PM_GroupBox(pmGroupBox, title="Global preference:")
     self.arrowsOnBackBones_checkBox = PM_CheckBox(
         self.pmGroupBox4,
         text="Show arrows on back bones",
         widgetColumn=0,
         setAsDefault=True,
         spanWidth=True)
     return
Esempio n. 20
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in group box 4.
        """

        self.nameLineEdit = PM_LineEdit(pmGroupBox,
                                        label="Strand name:",
                                        text="",
                                        setAsDefault=False)

        self.numberOfBasesSpinBox = \
            PM_SpinBox( pmGroupBox,
                        label         =  "Number of bases:",
                        value         =  self._numberOfBases,
                        setAsDefault  =  False,
                        minimum       =  2,
                        maximum       =  10000 )

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

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

        self.disableStructHighlightingCheckbox = \
            PM_CheckBox( pmGroupBox,
                         text         = "Don't highlight while editing DNA",
                         widgetColumn  = 0,
                         state        = Qt.Unchecked,
                         setAsDefault = True,
                         spanWidth = True
                         )

        #As of 2008-03-31, the properties such as number of bases will be
        #editable only by using the resize handles. post FNANO we will support
        #the
        self.numberOfBasesSpinBox.setEnabled(False)
        self.basesPerTurnDoubleSpinBox.setEnabled(False)
        self.duplexRiseDoubleSpinBox.setEnabled(False)
Esempio n. 21
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)
 def _loadBreakOptionsGroupbox(self, pmGroupBox):
     """
     Load widgets in this group box.
     """
             
     self.assignColorToBrokenDnaStrandsCheckBox = \
         PM_CheckBox(pmGroupBox ,
                     text         = 'Assign new color to broken strands',
                     widgetColumn = 1   )
     
     connect_checkbox_with_boolean_pref(
         self.assignColorToBrokenDnaStrandsCheckBox, 
         assignColorToBrokenDnaStrands_prefs_key )
Esempio n. 23
0
    def loadCheckBoxGroupBox(self, inPmGroupBox):
        """
        Load PM_CheckBox test widgets in group box.
        """
        self.checkBoxGroupBox = \
            PM_GroupBox( inPmGroupBox,
                         title          = "<b> PM_CheckBox examples</b>" )

        self.checkBox1 = \
            PM_CheckBox( self.checkBoxGroupBox,
                         text         = "Widget on left:",
                         widgetColumn = 1,
                         state        = Qt.Checked,
                         setAsDefault = True,
                        )

        self.checkBox2 = \
            PM_CheckBox( self.checkBoxGroupBox,
                         text         = "Widget on right",
                         widgetColumn  = 1,
                         state        = Qt.Checked,
                         setAsDefault = True,
                         )
Esempio n. 24
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 _addCheckBoxes(self, paramsForCheckBoxes):
        """
        Creates PM_CheckBoxes within the groupbox and also connects each one
        with its individual prefs key.
        """
        for checkBoxText, prefs_key in paramsForCheckBoxes:
            checkBox = \
                PM_CheckBox( self,
                             text  = checkBoxText,
                             widgetColumn = self._checkBoxColumn,
                             state        = Qt.Checked)

            connect_checkbox_with_boolean_pref(checkBox, prefs_key)

            self.checkBoxes.append(checkBox)
 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 )
Esempio n. 27
0
    def _loadGroupBox1(self, pmGroupBox):
        """
        Load widgets in MotorParamsGroupBox.
        """
        if self.editCommand and self.editCommand.struct:
            force = self.editCommand.struct.force
            stiffness = self.editCommand.struct.stiffness
            enable_minimize = self.editCommand.struct.enable_minimize
        else:
            force = 0.0
            stiffness = 0.0
            enable_minimize = False

        self.forceDblSpinBox = \
            PM_DoubleSpinBox(pmGroupBox,
                             label = "Force:",
                             value = force,
                             setAsDefault = True,
                             minimum    = 0.0,
                             maximum    = 5000.0,
                             singleStep = 1.0,
                             decimals   = 1,
                             suffix     =' pN')
        self.stiffnessDblSpinBox = \
            PM_DoubleSpinBox(pmGroupBox,
                             label = "Stiffness:",
                             value = stiffness,
                             setAsDefault = True,
                             minimum    = 0.0,
                             maximum    = 1000.0,
                             singleStep = 1.0,
                             decimals   = 1,
                             suffix     =' N/m')

        self.enableMinimizeCheckBox = \
            PM_CheckBox(pmGroupBox,
                        text ="Enable in minimize",
                        widgetColumn = 1
                        )
        self.enableMinimizeCheckBox.setChecked(enable_minimize)

        self.directionPushButton = \
            PM_PushButton(pmGroupBox,
                          label = "Direction :",
                          text = "Reverse",
                          spanWidth = False)
        return
    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
 def _loadMovieControlsGroupBox(self, inPmGroupBox):
     """
     Load widgets in the Movie Controls group box.
     @param inPmGroupBox: The Movie Controls groupbox in the PM
     @type  inPmGroupBox: L{PM_GroupBox} 
     """
     #Movie Slider
     self.frameNumberSlider = \
         PM_Slider( inPmGroupBox,
                    currentValue = 0,
                    minimum      = 0,
                    maximum      = 999999,
                    label        = 'Current Frame: 0/900'
                  )
     
     self.movieFrameUpdateLabel = self.frameNumberSlider.labelWidget
     
     #Movie Controls
     
     self.movieButtonsToolBar = NE1ToolBar(inPmGroupBox)
     
     _movieActionList = [self.movieResetAction,
                         self.moviePlayRevActiveAction,
                         self.moviePlayRevAction,
                         self.moviePauseAction,
                         self.moviePlayAction,
                         self.moviePlayActiveAction,
                         self.movieMoveToEndAction
                         ]
     
     for _action in _movieActionList:
         self.movieButtonsToolBar.addAction(_action)
             
     self.moviePlayActiveAction.setVisible(0)
     self.moviePlayRevActiveAction.setVisible(0)
     
     WIDGET_LIST = [("PM_", self.movieButtonsToolBar, 0)]
     
     self.moviecontrolsWidgetRow = PM_WidgetRow(inPmGroupBox, 
                                                widgetList = WIDGET_LIST,
                                                spanWidth = True)
     
     self.movieLoop_checkbox = PM_CheckBox(inPmGroupBox,
                                           text = "Loop",
                                           widgetColumn = 0,
                                           state = Qt.Unchecked)
Esempio n. 30
0
    def _loadBreakOptionsGroupbox(self, pmGroupBox):
        """
        Load widgets in this group box.
        """

        self.assignColorToBrokenDnaStrandsCheckBox = \
            PM_CheckBox(pmGroupBox ,
                        text         = 'Assign new color to broken strands',
                        widgetColumn = 0,
                        spanWidth = True)

        connect_checkbox_with_boolean_pref(
            self.assignColorToBrokenDnaStrandsCheckBox,
            assignColorToBrokenDnaStrands_prefs_key)



        self.basesBeforeNextBreakSpinBox = \
            PM_SpinBox( pmGroupBox,
                        label         =  "Break Every:",
                        value         =  3,
                        setAsDefault  =  False,
                        minimum       =  1,
                        maximum       =  10000,
                        suffix       = " bases"
                        )

        connect_spinBox_with_pref(
            self.basesBeforeNextBreakSpinBox,
            breakStrandsCommand_numberOfBasesBeforeNextBreak_prefs_key)

        self.breakAllStrandsButton = PM_PushButton(pmGroupBox,
                                                   label="",
                                                   text="do it")

        self._dnaStrandChooserGroupBox = PM_ObjectChooser(
            pmGroupBox,
            self.command,
            modelObjectType=self.win.assy.DnaStrand,
            title="Choose strands ")

        if not DEBUG_BREAK_OPTIONS_FEATURE:
            self._dnaStrandChooserGroupBox.hide()
            self.breakAllStrandsButton.hide()
            self.basesBeforeNextBreakSpinBox.hide()