def _createActions(self, parentWidget):
        self.exitProteinAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.exitProteinAction.setText("Exit Protein")
        self.exitProteinAction.setIcon(
            geticon("ui/actions/Toolbars/Smart/Exit.png"))
        self.exitProteinAction.setCheckable(True)

        self.buildPeptideAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.buildPeptideAction.setText("Peptide")
        self.buildPeptideAction.setCheckable(True)
        self.buildPeptideAction.setIcon(
            geticon("ui/actions/Tools/Build Structures/Peptide.png"))

        self.editRotamersAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.editRotamersAction.setText("Rotamers")
        self.editRotamersAction.setCheckable(True)
        self.editRotamersAction.setIcon(
            geticon("ui/actions/Tools/Build Structures/Rotamer.png"))

        self.editResiduesAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.editResiduesAction.setText("Residues")
        self.editResiduesAction.setCheckable(True)
        self.editResiduesAction.setIcon(
            geticon("ui/actions/Tools/Build Structures/Rotamer.png"))

        self.displayProteinStyleAction = NE1_QWidgetAction(parentWidget,
                                                           win=self.win)

        self.displayProteinStyleAction.setText("Edit Style")
        self.displayProteinStyleAction.setCheckable(True)
        self.displayProteinStyleAction.setIcon(
            geticon("ui/actions/Edit/EditProteinDisplayStyle.png"))
Exemplo n.º 2
0
    def _createActions(self, parentWidget):
        self.exitDnaAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.exitDnaAction.setText("Exit DNA")
        self.exitDnaAction.setIcon(
            geticon("ui/actions/Toolbars/Smart/Exit.png"))
        self.exitDnaAction.setCheckable(True)

        self.dnaDuplexAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.dnaDuplexAction.setText("Insert DNA")
        self.dnaDuplexAction.setCheckable(True)
        self.dnaDuplexAction.setIcon(
            geticon("ui/actions/Tools/Build Structures/InsertDsDna.png"))

        self.breakStrandAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.breakStrandAction.setText("Break Strand")
        self.breakStrandAction.setCheckable(True)
        self.breakStrandAction.setIcon(
            geticon("ui/actions/Command Toolbar/Break_Strand.png"))

        self.joinStrandsAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.joinStrandsAction.setText("Join Strands")
        self.joinStrandsAction.setCheckable(True)
        self.joinStrandsAction.setIcon(
            geticon("ui/actions/Command Toolbar/Join_Strands.png"))

        self.makeCrossoversAction = NE1_QWidgetAction(parentWidget,
                                                      win=self.win)
        self.makeCrossoversAction.setText("Crossovers")
        self.makeCrossoversAction.setCheckable(True)
        self.makeCrossoversAction.setIcon(
            geticon("ui/actions/Command Toolbar/Crossover.png"))

        self.dnaOrigamiAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.dnaOrigamiAction.setText("Origami")
        self.dnaOrigamiAction.setIcon(
            geticon("ui/actions/Tools/Build Structures/DNA_Origami.png"))

        self.convertPAM3to5Action = NE1_QWidgetAction(parentWidget,
                                                      win=self.win)
        self.convertPAM3to5Action.setText("PAM3 to PAM5")
        self.convertPAM3to5Action.setIcon(
            geticon("ui/actions/Command Toolbar/Convert3to5.png"))

        self.convertPAM5to3Action = NE1_QWidgetAction(parentWidget,
                                                      win=self.win)
        self.convertPAM5to3Action.setText("PAM5 to PAM3")
        self.convertPAM5to3Action.setIcon(
            geticon("ui/actions/Command Toolbar/Convert5to3.png"))

        self.orderDnaAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.orderDnaAction.setText("Order DNA")
        self.orderDnaAction.setIcon(
            geticon("ui/actions/Command Toolbar/Order_DNA.png"))

        self.editDnaDisplayStyleAction = NE1_QWidgetAction(parentWidget,
                                                           win=self.win)
        self.editDnaDisplayStyleAction.setText("Edit Style")
        self.editDnaDisplayStyleAction.setCheckable(True)
        self.editDnaDisplayStyleAction.setIcon(
            geticon("ui/actions/Edit/EditDnaDisplayStyle.png"))
Exemplo n.º 3
0
    def _createSimulateProteinsActions(self, parentWidget):
        """
        Create the actions to be included in flyout toolbar, when the 'Simulate
        Proteins' is active. 
        
        @see: self._createActions() where this is called. 
        """

        self.subControlActionGroupForSimulateProtein = QActionGroup(
            parentWidget)
        # Shouldn't the parent be self.win?
        # Isn't parentWidget = BuildProteinPropertyManager?
        # Ask Bruce about this. --Mark 2008-12-07.
        self.subControlActionGroupForSimulateProtein.setExclusive(True)

        self.rosetta_fixedbb_design_Action = \
            NE1_QWidgetAction(self.subControlActionGroupForSimulateProtein, win = self.win)
        self.rosetta_fixedbb_design_Action.setText("Fixed BB")
        self.rosetta_fixedbb_design_Action.setCheckable(True)
        self.rosetta_fixedbb_design_Action.setIcon(
            geticon(
                "ui/actions/Command Toolbar/BuildProtein/FixedBackbone.png"))

        self.rosetta_backrub_Action = \
            NE1_QWidgetAction(self.subControlActionGroupForSimulateProtein, win = self.win)
        self.rosetta_backrub_Action.setText("Backrub")
        self.rosetta_backrub_Action.setCheckable(True)
        self.rosetta_backrub_Action.setIcon(
            geticon("ui/actions/Command Toolbar/BuildProtein/Backrub.png"))

        self.editResiduesAction = \
            NE1_QWidgetAction(self.subControlActionGroupForSimulateProtein, win = self.win)
        self.editResiduesAction.setText("Residues")
        self.editResiduesAction.setCheckable(True)
        self.editResiduesAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildProtein/Residues.png"))

        self.rosetta_score_Action = \
            NE1_QWidgetAction(self.subControlActionGroupForSimulateProtein, win = self.win)
        self.rosetta_score_Action.setText("Score")
        self.rosetta_score_Action.setCheckable(True)
        self.rosetta_score_Action.setIcon(
            geticon("ui/actions/Command Toolbar/BuildProtein/Score.png"))

        self.subControlActionGroupForSimulateProtein.addAction(
            self.rosetta_fixedbb_design_Action)
        self.subControlActionGroupForSimulateProtein.addAction(
            self.rosetta_backrub_Action)
        self.subControlActionGroupForSimulateProtein.addAction(
            self.editResiduesAction)
        self.subControlActionGroupForSimulateProtein.addAction(
            self.rosetta_score_Action)
        return
Exemplo n.º 4
0
    def _createActions(self, parentWidget):
        """
        Define flyout toolbar actions for this mode.
        """
        #@NOTE: In Build mode, some of the actions defined in this method are also
        #used in Build Atoms PM. (e.g. bond actions) So probably better to rename
        #it as _init_modeActions. Not doing that change in mmkit code cleanup
        #commit(other modes still implement a method by same name)-ninad20070717

        _superclass._createActions(self, parentWidget)

        # The subControlActionGroup is the parent of all flyout QActions.
        self.subControlActionGroup = QActionGroup(parentWidget)
        # Shouldn't the parent be self.win?
        # Isn't parentWidget = BuildAtomsPropertyManager.
        # Ask Bruce about this. --Mark 2008-12-07.

        self.subControlActionGroup.setExclusive(True)

        #Following Actions are added in the Flyout toolbar.
        #Defining them outside that method as those are being used
        #by the subclasses of deposit mode (testmode.py as of 070410) -- ninad

        self.atomsToolAction = \
            NE1_QWidgetAction(self.subControlActionGroup, win = self.win)
        self.atomsToolAction.setText("Atoms Tool")
        self.atomsToolAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildAtoms/AtomsTool.png"))
        self.atomsToolAction.setCheckable(True)
        self.atomsToolAction.setChecked(True)
        self.atomsToolAction.setObjectName('ACTION_ATOMS_TOOL')


        self.bondsToolAction = \
            NE1_QWidgetAction(self.subControlActionGroup, win = self.win)
        self.bondsToolAction.setText("Bonds Tool")
        self.bondsToolAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildAtoms/BondsTool.png"))
        self.bondsToolAction.setCheckable(True)
        self.bondsToolAction.setObjectName('ACTION_BOND_TOOL')

        self.subControlActionGroup.addAction(self.atomsToolAction)
        self.subControlActionGroup.addAction(self.bondsToolAction)

        self.transmuteAtomsAction = \
            NE1_QWidgetAction(self.subControlActionGroup, win = self.win)
        self.transmuteAtomsAction.setText("Transmute Atoms")
        self.transmuteAtomsAction.setIcon(
            geticon(
                "ui/actions/Command Toolbar/BuildAtoms/TransmuteAtoms.png"))
        self.transmuteAtomsAction.setCheckable(False)

        self._createBondToolActions(parentWidget)
Exemplo n.º 5
0
    def _createActions(self, parentWidget):
        self.exitNanotubeAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.exitNanotubeAction.setText("Exit NT")
        self.exitNanotubeAction.setIcon(
            geticon("ui/actions/Toolbars/Smart/Exit.png"))
        self.exitNanotubeAction.setCheckable(True)

        self.insertNanotubeAction = NE1_QWidgetAction(parentWidget,
                                                      win=self.win)
        self.insertNanotubeAction.setText("Insert NT")
        self.insertNanotubeAction.setCheckable(True)
        self.insertNanotubeAction.setIcon(
            geticon("ui/actions/Tools/Build Structures/InsertNanotube.png"))
Exemplo n.º 6
0
    def _createActions(self, parentWidget):
        """
        Define flyout toolbar actions for this mode.
        """

        _superclass._createActions(self, parentWidget)

        #Urmi 20080814: show this flyout toolbar only when rosetta plugin path
        # is there
        #Probably only rosetta_enabled_prefs_key check would have sufficed
        plugin_name = "ROSETTA"
        plugin_prefs_keys = (rosetta_enabled_prefs_key, rosetta_path_prefs_key)
        errorcode, errortext_or_path = \
                 checkPluginPreferences(plugin_name, plugin_prefs_keys, ask_for_help = False)
        #print "Error code =", errorcode, errortext_or_path
        if errorcode == 0:
            self.rosetta_enabled = True
        else:
            self.rosetta_enabled = False

        # The subControlActionGroup is the parent of all flyout QActions.
        self.subControlActionGroup = QActionGroup(parentWidget)
            # Shouldn't the parent be self.win?
            # Isn't parentWidget = BuildProteinPropertyManager?
            # Ask Bruce about this. --Mark 2008-12-07.

        self.subControlActionGroup.setExclusive(True)

        self.modelProteinAction = \
            NE1_QWidgetAction(self.subControlActionGroup, win = self.win)
        self.modelProteinAction.setText("Model")
        self.modelProteinAction.setIcon(geticon(
            'ui/actions/Command Toolbar/BuildProtein/ModelProtein.png'))
        self.modelProteinAction.setCheckable(True)
        self.modelProteinAction.setChecked(True)
        self.modelProteinAction.setObjectName('ACTION_MODEL_PROTEINS')

        self.simulateProteinAction = \
            NE1_QWidgetAction(self.subControlActionGroup, win = self.win)
        self.simulateProteinAction.setText("Simulate")
        self.simulateProteinAction.setIcon(geticon(
            "ui/actions/Command Toolbar/BuildProtein/Simulate.png"))
        self.simulateProteinAction.setCheckable(True)
        self.simulateProteinAction.setObjectName('ACTION_SIMULATE_PROTEINS')


        self.subControlActionGroup.addAction(self.modelProteinAction)
        self.subControlActionGroup.addAction(self.simulateProteinAction)

        self._createModelProteinsActions(parentWidget)
        self._createSimulateProteinsActions(parentWidget)
Exemplo n.º 7
0
    def _createModelProteinsActions(self, parentWidget):
        """
        Create the actions to be included in flyout toolbar, when the 'Model
        Proteins' is active. 
        
        @see: self._createActions() where this is called. 
        """

        self.subControlActionGroupForModelProtein = QActionGroup(parentWidget)
        # Shouldn't the parent be self.win?
        # Isn't parentWidget = BuildProteinPropertyManager?
        # Ask Bruce about this. --Mark 2008-12-07.
        self.subControlActionGroupForModelProtein.setExclusive(True)

        self.buildPeptideAction = \
            NE1_QWidgetAction(self.subControlActionGroupForModelProtein, win = self.win)
        self.buildPeptideAction.setText("Insert Peptide")
        self.buildPeptideAction.setCheckable(True)
        self.buildPeptideAction.setIcon(
            geticon(
                "ui/actions/Command Toolbar/BuildProtein/InsertPeptide.png"))

        self.compareProteinsAction = \
            NE1_QWidgetAction(self.subControlActionGroupForModelProtein, win = self.win)
        self.compareProteinsAction.setText("Compare")
        self.compareProteinsAction.setCheckable(True)
        self.compareProteinsAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildProtein/Compare.png"))

        self.displayProteinStyleAction = \
            NE1_QWidgetAction(self.subControlActionGroupForModelProtein, win = self.win)
        self.displayProteinStyleAction.setText("Edit Style")
        self.displayProteinStyleAction.setCheckable(True)
        self.displayProteinStyleAction.setIcon(
            geticon(
                "ui/actions/Command Toolbar/BuildProtein/EditProteinDisplayStyle.png"
            ))

        self.subControlActionGroupForModelProtein.addAction(
            self.buildPeptideAction)
        self.subControlActionGroupForModelProtein.addAction(
            self.displayProteinStyleAction)
        self.subControlActionGroupForModelProtein.addAction(
            self.compareProteinsAction)
        return
Exemplo n.º 8
0
    def getFlyoutActionList(self):  #Ninad 20070618
        """ Returns a tuple that contains mode spcific actionlists in the
        added in the flyout toolbar of the mode.
        CommandToolbar._createFlyoutToolBar method calls this
        @return: params: A tuple that contains 3 lists:
        (subControlAreaActionList, commandActionLists, allActionsList)"""

        #'allActionsList' returns all actions in the flyout toolbar
        #including the subcontrolArea actions
        allActionsList = []

        #Action List for  subcontrol Area buttons.
        #In this mode, there is really no subcontrol area.
        #We will treat subcontrol area same as 'command area'
        #(subcontrol area buttons will have an empty list as their command area
        #list). We will set  the Comamnd Area palette background color to the
        #subcontrol area.

        subControlAreaActionList = []

        self.exitMoveAction = NE1_QWidgetAction(self.w, win=self.w)
        self.exitMoveAction.setText("Exit Move")
        self.exitMoveAction.setWhatsThis("Exits Move Mode")
        self.exitMoveAction.setCheckable(True)
        self.exitMoveAction.setChecked(True)
        self.exitMoveAction.setIcon(
            geticon("ui/actions/Toolbars/Smart/Exit.png"))
        subControlAreaActionList.append(self.exitMoveAction)

        separator = QtGui.QAction(self.w)
        separator.setSeparator(True)
        subControlAreaActionList.append(separator)

        subControlAreaActionList.append(self.w.toolsMoveMoleculeAction)
        subControlAreaActionList.append(self.w.rotateComponentsAction)
        subControlAreaActionList.append(self.w.modifyAlignCommonAxisAction)

        allActionsList.extend(subControlAreaActionList)

        #Empty actionlist for the 'Command Area'
        commandActionLists = []

        #Append empty 'lists' in 'commandActionLists equal to the
        #number of actions in subControlArea
        for i in range(len(subControlAreaActionList)):
            lst = []
            commandActionLists.append(lst)

        params = (subControlAreaActionList, commandActionLists, allActionsList)

        return params
Exemplo n.º 9
0
    def getFlyoutActionList(self):  #Ninad 20070618
        """
        Returns custom actionlist that will be used in a specific mode
        or editing a feature etc Example: while in movie mode,
        the _createFlyoutToolBar method calls
        this.
        """

        #'allActionsList' returns all actions in the flyout toolbar
        #including the subcontrolArea actions
        allActionsList = []

        #Action List for  subcontrol Area buttons.
        #In this mode there is really no subcontrol area.
        #We will treat subcontrol area same as 'command area'
        #(subcontrol area buttons will have an empty list as their command area
        #list). We will set  the Comamnd Area palette background color to the
        #subcontrol area.

        subControlAreaActionList = []

        self.exitMovieAction = NE1_QWidgetAction(self.w, win=self.w)
        self.exitMovieAction.setText("Exit Movie")
        self.exitMovieAction.setWhatsThis("Exits Movie Mode")
        self.exitMovieAction.setCheckable(True)
        self.exitMovieAction.setChecked(True)
        self.exitMovieAction.setIcon(
            geticon("ui/actions/Toolbars/Smart/Exit.png"))
        subControlAreaActionList.append(self.exitMovieAction)

        separator = QAction(self.w)
        separator.setSeparator(True)
        subControlAreaActionList.append(separator)

        subControlAreaActionList.append(self.w.simPlotToolAction)

        allActionsList.extend(subControlAreaActionList)

        #Empty actionlist for the 'Command Area'
        commandActionLists = []

        #Append empty 'lists' in 'commandActionLists equal to the
        #number of actions in subControlArea
        for i in range(len(subControlAreaActionList)):
            lst = []
            commandActionLists.append(lst)

        params = (subControlAreaActionList, commandActionLists, allActionsList)

        return params
Exemplo n.º 10
0
 def _createActions(self, parentWidget):
     
     _superclass._createActions(self, parentWidget)
     
     self.subControlActionGroup = QtGui.QActionGroup(self.parentWidget)
     self.subControlActionGroup.setExclusive(False)  
     
     self.insertNanotubeAction = \
         NE1_QWidgetAction(self.subControlActionGroup,
                           win = self.win)
     self.insertNanotubeAction.setText("Insert NT")
     self.insertNanotubeAction.setCheckable(True)        
     self.insertNanotubeAction.setIcon(
         geticon("ui/actions/Tools/Build Structures/InsertNanotube.png"))
      
     self.subControlActionGroup.addAction(self.insertNanotubeAction)
Exemplo n.º 11
0
    def _createActions(self, parentWidget):
        """
        Define flyout toolbar actions for this mode.
        @see: self._getExitActionText() which defines text for exit action.

        @note: subclasses typically extend this method to define more actions.
        """
        #@NOTE: In Build mode, some of the actions defined in this method are also
        #used in Build Atoms PM. (e.g. bond actions) So probably better to rename
        #it as _init_modeActions. Not doing that change in mmkit code cleanup
        #commit(other modes still implement a method by same name)-ninad20070717

        self.exitModeAction = NE1_QWidgetAction(parentWidget, win=self.win)
        exitActionText = self._getExitActionText()
        self.exitModeAction.setText(exitActionText)
        self.exitModeAction.setIcon(
            geticon('ui/actions/Command Toolbar/ControlArea/Exit.png'))
        self.exitModeAction.setCheckable(True)
        self.exitModeAction.setChecked(True)
Exemplo n.º 12
0
    def _createActions(self, parentWidget):
        self.exitProteinAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.exitProteinAction.setText("Exit Protein")
        self.exitProteinAction.setIcon(
            geticon("ui/actions/Command Toolbar/ControlArea/Exit.png"))
        self.exitProteinAction.setCheckable(True)

        self.buildPeptideAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.buildPeptideAction.setText("Insert Peptide")
        self.buildPeptideAction.setCheckable(True)
        self.buildPeptideAction.setIcon(
            geticon(
                "ui/actions/Command Toolbar/BuildProtein/InsertPeptide.png"))

        self.editRotamersAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.editRotamersAction.setText("Rotamers")
        self.editRotamersAction.setCheckable(True)
        self.editRotamersAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildProtein/Rotamers.png"))

        self.editResiduesAction = NE1_QWidgetAction(parentWidget, win=self.win)
        self.editResiduesAction.setText("Residues")
        self.editResiduesAction.setCheckable(True)
        self.editResiduesAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildProtein/Residues.png"))

        self.compareProteinsAction = NE1_QWidgetAction(parentWidget,
                                                       win=self.win)
        self.compareProteinsAction.setText("Compare")
        self.compareProteinsAction.setCheckable(True)
        self.compareProteinsAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildProtein/Compare.png"))

        self.displayProteinStyleAction = NE1_QWidgetAction(parentWidget,
                                                           win=self.win)

        self.displayProteinStyleAction.setText("Edit Style")
        self.displayProteinStyleAction.setCheckable(True)
        self.displayProteinStyleAction.setIcon(
            geticon(
                "ui/actions/Command Toolbar/BuildProtein/EditProteinDisplayStyle.png"
            ))

        self.subControlActionGroup = QtGui.QActionGroup(self.parentWidget)
        self.subControlActionGroup.setExclusive(False)
        self.subControlActionGroup.addAction(self.buildPeptideAction)
        self.subControlActionGroup.addAction(self.displayProteinStyleAction)
Exemplo n.º 13
0
    def _createActions(self, parentWidget):

        _superclass._createActions(self, parentWidget)

        # The subControlActionGroup is the parent of all flyout QActions.
        self.subControlActionGroup = QtGui.QActionGroup(parentWidget)

        self._subControlAreaActionList.append(self.exitModeAction)
        separator = QtGui.QAction(parentWidget)
        separator.setSeparator(True)
        self._subControlAreaActionList.append(separator)

        self.polygonShapeAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                    win=self.win)
        self.polygonShapeAction.setObjectName("DEFAULT")
        self.polygonShapeAction.setText("Polygon")
        self._subControlAreaActionList.append(self.polygonShapeAction)

        self.circleShapeAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                   win=self.win)
        self.circleShapeAction.setObjectName("CIRCLE")
        self.circleShapeAction.setText("Circle")
        self._subControlAreaActionList.append(self.circleShapeAction)

        self.squareShapeAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                   win=self.win)
        self.squareShapeAction.setObjectName("SQUARE")
        self.squareShapeAction.setText("Square")
        self._subControlAreaActionList.append(self.squareShapeAction)

        self.rectCtrShapeAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                    win=self.win)
        self.rectCtrShapeAction.setObjectName("RECTANGLE")
        self.rectCtrShapeAction.setText("RectCenter")
        self._subControlAreaActionList.append(self.rectCtrShapeAction)

        self.rectCornersShapeAction = NE1_QWidgetAction(
            self.subControlActionGroup, win=self.win)
        self.rectCornersShapeAction.setObjectName("RECT_CORNER")
        self.rectCornersShapeAction.setText("RectCorners")
        self._subControlAreaActionList.append(self.rectCornersShapeAction)

        self.triangleShapeAction = NE1_QWidgetAction(
            self.subControlActionGroup, win=self.win)
        self.triangleShapeAction.setObjectName("TRIANGLE")
        self.triangleShapeAction.setText("Triangle")
        self._subControlAreaActionList.append(self.triangleShapeAction)

        self.diamondShapeAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                    win=self.win)
        self.diamondShapeAction.setObjectName("DIAMOND")
        self.diamondShapeAction.setText("Diamond")
        self._subControlAreaActionList.append(self.diamondShapeAction)

        self.hexagonShapeAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                    win=self.win)
        self.hexagonShapeAction.setObjectName("HEXAGON")
        self.hexagonShapeAction.setText("Hexagon")
        self._subControlAreaActionList.append(self.hexagonShapeAction)

        self.lassoShapeAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                  win=self.win)
        self.lassoShapeAction.setObjectName("LASSO")
        self.lassoShapeAction.setText("Lasso")
        self._subControlAreaActionList.append(self.lassoShapeAction)

        for action in self._subControlAreaActionList[1:]:
            if isinstance(action, NE1_QWidgetAction):
                action.setCheckable(True)
                self.subControlActionGroup.addAction(action)
                iconpath = "ui/actions/Command Toolbar/BuildCrystal/" + str(
                    action.text()) + ".png"
                action.setIcon(geticon(iconpath))

        if not self.subControlActionGroup.checkedAction():
            self.polygonShapeAction.setChecked(True)

        return
Exemplo n.º 14
0
    def _createBondToolActions(self, parentWidget):
        """
        Create the actions to be included in flyout toolbar , when the 'bonds
        tool' is active. Note that the object names of these action will be 
        be used to find the Bond Tool type to which each action corresponds to.
        
        @see: self._createActions() where this is called. 
        """
        self.bondToolsActionGroup = QActionGroup(parentWidget)
        self.bondToolsActionGroup.setExclusive(True)

        self.bond1Action = \
            NE1_QWidgetAction(self.bondToolsActionGroup, win = self.win)
        self.bond1Action.setText("Single")
        self.bond1Action.setIcon(
            geticon("ui/actions/Command Toolbar/BuildAtoms/SingleBond.png"))
        self.bond1Action.setObjectName('ACTION_SINGLE_BOND_TOOL')

        self.bond2Action = \
            NE1_QWidgetAction(self.bondToolsActionGroup, win = self.win)
        self.bond2Action.setText("Double")
        self.bond2Action.setIcon(
            geticon("ui/actions/Command Toolbar/BuildAtoms/DoubleBond.png"))
        self.bond2Action.setObjectName('ACTION_DOUBLE_BOND_TOOL')

        self.bond3Action = \
            NE1_QWidgetAction(self.bondToolsActionGroup, win = self.win)
        self.bond3Action.setText("Triple")
        self.bond3Action.setIcon(
            geticon("ui/actions/Command Toolbar/BuildAtoms/TripleBond.png"))
        self.bond3Action.setObjectName('ACTION_TRIPLE_BOND_TOOL')

        self.bondaAction = \
            NE1_QWidgetAction(self.bondToolsActionGroup, win = self.win)
        self.bondaAction.setText("Aromatic")
        self.bondaAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildAtoms/AromaticBond.png"))
        self.bondaAction.setObjectName('ACTION_AROMATIC_BOND_TOOL')

        self.bondgAction = \
            NE1_QWidgetAction(self.bondToolsActionGroup, win = self.win)
        self.bondgAction.setText("Graphitic")
        self.bondgAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildAtoms/GraphiticBond.png"))
        self.bondgAction.setObjectName('ACTION_GRAPHITIC_BOND_TOOL')

        self.cutBondsAction = \
            NE1_QWidgetAction(self.bondToolsActionGroup, win = self.win)
        self.cutBondsAction.setText("Cut Bonds")
        self.cutBondsAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildAtoms/CutBonds.png"))
        self.cutBondsAction.setObjectName('ACTION_DELETE_BOND_TOOL')

        for action in [
                self.bond1Action, self.bond2Action, self.bond3Action,
                self.bondaAction, self.bondgAction, self.cutBondsAction
        ]:
            self.bondToolsActionGroup.addAction(action)
            action.setCheckable(True)

        return
Exemplo n.º 15
0
    def _createActions(self, parentWidget):
        """
        Overrides superclass method
        """

        _superclass._createActions(self, parentWidget)

        # The subControlActionGroup is the parent of all flyout QActions.
        self.subControlActionGroup = QtGui.QActionGroup(self.parentWidget)
        # Shouldn't the parent be self.win?
        # IIRC, parentWidget = BuildDnaPropertyManager.
        # Ask Bruce about this. --Mark 2008-12-07.
        self.subControlActionGroup.setExclusive(False)

        self.dnaDuplexAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                 win=self.win)
        self.dnaDuplexAction.setText("Insert DNA")
        self.dnaDuplexAction.setCheckable(True)
        self.dnaDuplexAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildDna/InsertDna.png"))

        self.breakStrandAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                   win=self.win)
        self.breakStrandAction.setText("Break Strand")
        self.breakStrandAction.setCheckable(True)
        self.breakStrandAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildDna/BreakStrand.png"))

        self.joinStrandsAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                   win=self.win)
        self.joinStrandsAction.setText("Join Strands")
        self.joinStrandsAction.setCheckable(True)
        self.joinStrandsAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildDna/JoinStrands.png"))

        self.makeCrossoversAction = NE1_QWidgetAction(
            self.subControlActionGroup, win=self.win)
        self.makeCrossoversAction.setText("Crossovers")
        self.makeCrossoversAction.setCheckable(True)
        self.makeCrossoversAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildDna/MakeCrossovers.png"))

        self.dnaOrigamiAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                  win=self.win)
        self.dnaOrigamiAction.setText("Origami")
        self.dnaOrigamiAction.setIcon(
            geticon("ui/actions/Tools/Build Structures/DNA_Origami.png"))

        self.convertDnaAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                  win=self.win)
        self.convertDnaAction.setText("Convert")
        self.convertDnaAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildDna/ConvertDna.png"))

        self.orderDnaAction = NE1_QWidgetAction(self.subControlActionGroup,
                                                win=self.win)
        self.orderDnaAction.setText("Order DNA")
        self.orderDnaAction.setIcon(
            geticon("ui/actions/Command Toolbar/BuildDna/OrderDna.png"))

        self.editDnaDisplayStyleAction = NE1_QWidgetAction(
            self.subControlActionGroup, win=self.win)
        self.editDnaDisplayStyleAction.setText("Edit Style")
        self.editDnaDisplayStyleAction.setCheckable(True)
        self.editDnaDisplayStyleAction.setIcon(
            geticon(
                "ui/actions/Command Toolbar/BuildDna/EditDnaDisplayStyle.png"))

        # Add the actions.
        self.subControlActionGroup.addAction(self.dnaDuplexAction)
        self.subControlActionGroup.addAction(self.breakStrandAction)
        self.subControlActionGroup.addAction(self.joinStrandsAction)
        self.subControlActionGroup.addAction(self.makeCrossoversAction)
        self.subControlActionGroup.addAction(self.editDnaDisplayStyleAction)
Exemplo n.º 16
0
    def _init_flyoutActions(self):
        """
        Define flyout toolbar actions for this command
        """
        #Create an action group and add all the cookie selection shape buttons to it
        self.cookieSelectionGroup = QActionGroup(self.w)

        #Action List for  subcontrol Area buttons.
        #In cookie cutter, there is really no subcontrol area.
        #We will treat subcontrol area same as 'command area'
        #(subcontrol area buttons will have an empty list as their command area
        #list). We will set  the Comamnd Area palette background color to the
        #subcontrol area. This list will be used in getFlyoutActionList

        self.subControlAreaActionList = []

        self.exitCrystalAction = NE1_QWidgetAction(self.w, win=self.w)
        self.exitCrystalAction.setText("Exit Crystal")
        self.exitCrystalAction.setCheckable(True)
        self.exitCrystalAction.setChecked(True)
        self.exitCrystalAction.setIcon(
            geticon('ui/actions/Toolbars/Smart/Exit.png'))
        self.subControlAreaActionList.append(self.exitCrystalAction)

        separator = QtGui.QAction(self.w)
        separator.setSeparator(True)
        self.subControlAreaActionList.append(separator)

        self.DefaultSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.DefaultSelAction.setObjectName("DEFAULT")
        self.DefaultSelAction.setText("Default")
        self.subControlAreaActionList.append(self.DefaultSelAction)
        self.DefaultSelAction.setToolTip("Default Selection (D)")
        self.DefaultSelAction.setWhatsThis("""<b>Default </b>
        <p>
       Defines the crystal shape as a polygon with the user specifying the 
       sides
        </p>""")

        self.CircleSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.CircleSelAction.setObjectName("CIRCLE")
        self.CircleSelAction.setText("Circle")
        self.subControlAreaActionList.append(self.CircleSelAction)
        self.CircleSelAction.setToolTip("Circle (C)")
        self.CircleSelAction.setWhatsThis("""<b>Circle </b>
        <p>
        Draws the crystal geometry as a circle
        </p>""")

        self.RectCtrSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.RectCtrSelAction.setObjectName("RECTANGLE")
        self.RectCtrSelAction.setText("RectCenter")
        self.subControlAreaActionList.append(self.RectCtrSelAction)
        self.RectCtrSelAction.setToolTip("Rectangular Center (R)")
        self.RectCtrSelAction.setWhatsThis("""<b>Rectangle - Center Select</b>
        <p>
        Draws the crystal geometry as a rectangle with the cursor defining
        the center of the rectangle
        </p>""")

        self.HexagonSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.HexagonSelAction.setObjectName("HEXAGON")
        self.HexagonSelAction.setText("Hexagon")
        self.subControlAreaActionList.append(self.HexagonSelAction)
        self.HexagonSelAction.setToolTip("Hexagon (H)")
        self.HexagonSelAction.setWhatsThis("""<b>Hexagon </b>
        <p>
        Draws the crystal geometry as a hexagon
        </p>""")

        self.TriangleSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.TriangleSelAction.setObjectName("TRIANGLE")
        self.TriangleSelAction.setText("Triangle")
        self.subControlAreaActionList.append(self.TriangleSelAction)
        self.TriangleSelAction.setToolTip("Triangle (T)")
        self.TriangleSelAction.setWhatsThis("""<b>Triangle </b>
        <p>
        Draws the crystal geometry as a triangle
        </p>""")

        self.RectCornerSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.RectCornerSelAction.setObjectName("RECT_CORNER")
        self.RectCornerSelAction.setText("RectCorners")
        self.subControlAreaActionList.append(self.RectCornerSelAction)
        self.RectCornerSelAction.setToolTip("Rectangular Corner (Shift+R)")
        self.RectCornerSelAction.setWhatsThis(
            """<b>Rectangle - Corner Select</b>
        <p>
        Draws the crystal geometry as a rectangle with the cursor defining 
        the initial corner 
        </p>""")

        self.LassoSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.LassoSelAction.setObjectName("LASSO")
        self.LassoSelAction.setText("Lasso")
        self.subControlAreaActionList.append(self.LassoSelAction)
        self.LassoSelAction.setToolTip("Lasso (L)")
        self.LassoSelAction.setWhatsThis("""<b>Lasso</b>
        <p>
        Can be used to draw irregular crystal geometries 
        </p>""")

        self.DiamondSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.DiamondSelAction.setObjectName("DIAMOND")
        self.DiamondSelAction.setText("Diamond")
        self.subControlAreaActionList.append(self.DiamondSelAction)
        self.DiamondSelAction.setToolTip("Diamond (D)")
        self.DiamondSelAction.setWhatsThis("""<b>Diamond</b>
        <p>
        Draws the crystal geometry as a diamond
        </p>""")

        self.SquareSelAction = NE1_QWidgetAction(self.w, win=self.w)
        self.SquareSelAction.setObjectName("SQUARE")
        self.SquareSelAction.setText("Square")
        self.subControlAreaActionList.append(self.SquareSelAction)
        self.SquareSelAction.setToolTip("Square(S)")
        self.SquareSelAction.setWhatsThis("""<b>Square</b>
        <p>
        Draws the crystal geometry as a square
        </p>""")

        for action in self.subControlAreaActionList[1:]:
            if isinstance(action, QtGui.QWidgetAction):
                action.setCheckable(True)
                self.cookieSelectionGroup.addAction(action)
                iconpath = "ui/actions/Toolbars/Smart/" + str(
                    action.text()) + ".png"
                action.setIcon(geticon(iconpath))

        if not self.cookieSelectionGroup.checkedAction():
            self.DefaultSelAction.setChecked(True)