def whatsThisTextForNanotubeCommandToolbar(commandToolbar):
    """
    "What's This" text for widgets in the Build Nanotube Command Toolbar.
    """
    commandToolbar.exitModeAction.setWhatsThis("""<b>Exit Nanotube</b>
        <p>
        Exits the <b>Build Nanotube</b> command set.
        </p>""")

    commandToolbar.insertNanotubeAction.setWhatsThis("""<b>Insert Nanotube</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildNanotube/InsertNanotube.png\"><br>
        Insert a carbon or boron-nitride nanotube by clicking two endpoints in 
        the graphics area.
        </p>""")

    # Convert all "img" tags in the button's "What's This" text
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)

    return
Example #2
0
def whatsThisTextForNanotubeCommandToolbar(commandToolbar):
    """
    "What's This" text for widgets in the Build Nanotube Command Toolbar.
    """
    commandToolbar.exitModeAction.setWhatsThis(
        """<b>Exit Nanotube</b>
        <p>
        Exits the <b>Build Nanotube</b> command set.
        </p>""")
    
    commandToolbar.insertNanotubeAction.setWhatsThis(
        """<b>Insert Nanotube</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildNanotube/InsertNanotube.png\"><br>
        Insert a carbon or boron-nitride nanotube by clicking two endpoints in 
        the graphics area.
        </p>""")
    
    # Convert all "img" tags in the button's "What's This" text 
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)
    
    return
Example #3
0
    def __init__(self, assy, parent):
        """
        Constructor for the part window.

        @param assy: The assembly (part)
        @type  assy: Assembly

        @param parent: The parent widget.
        @type  parent: U{B{QMainWindow}
                       <http://doc.trolltech.com/4/qmainwindow.html>}
        """
        QWidget.__init__(self, parent)
        self.parent = parent
        self.assy = assy
        # note: to support MDI, self.assy would probably need to be a
        # different assembly for each PartWindow.
        # [bruce 080216 comment]
        self.setWindowIcon(geticon("ui/border/Part.png"))
        self.updateWindowTitle()

        # The main layout for the part window is a VBoxLayout <pwVBoxLayout>.
        self.pwVBoxLayout = QVBoxLayout(self)
        pwVBoxLayout = self.pwVBoxLayout
        pwVBoxLayout.setMargin(0)
        pwVBoxLayout.setSpacing(0)

        # ################################################################
        # <pwSplitter> is the horizontal splitter b/w the
        # pwLeftArea (mt and pm) and the glpane.
        self.pwSplitter = QSplitter(Qt.Horizontal)
        pwSplitter = self.pwSplitter
        pwSplitter.setObjectName("pwSplitter")
        pwSplitter.setHandleWidth(3)  # 3 pixels wide.
        pwVBoxLayout.addWidget(pwSplitter)

        # ##################################################################
        # <pwLeftArea> is the container holding the pwProjectTabWidget.
        # Note: Making pwLeftArea (and pwRightArea and pwBottomArea) QFrame
        # widgets has the benefit of making it easy to draw a border around
        # each area. One purpose of this would be to help developers understand
        # (visually) how the part window is laid out. I intend to add a debug
        # pref to draw part window area borders and add "What's This" text to
        # them. Mark 2008-01-05.
        self.pwLeftArea = LeftFrame(self)
        pwLeftArea = self.pwLeftArea
        pwLeftArea.setObjectName("pwLeftArea")
        pwLeftArea.setMinimumWidth(PM_MINIMUM_WIDTH)
        pwLeftArea.setMaximumWidth(PM_MAXIMUM_WIDTH)

        # Setting the frame style like this is nice since it clearly
        # defines the splitter at the top-left corner.
        pwLeftArea.setFrameStyle(QFrame.Panel | QFrame.Sunken)

        # This layout will contain splitter (above) and the pwBottomArea.
        leftChannelVBoxLayout = QVBoxLayout(pwLeftArea)
        leftChannelVBoxLayout.setMargin(0)
        leftChannelVBoxLayout.setSpacing(0)

        pwSplitter.addWidget(pwLeftArea)

        # Makes it so pwLeftArea is not collapsible.
        pwSplitter.setCollapsible(0, False)

        # ##################################################################
        # <pwProjectTabWidget> is a QTabWidget that contains the MT and PM
        # widgets. It lives in the "left area" of the part window.
        self.pwProjectTabWidget = _pwProjectTabWidget()
        # _pwProjectTabWidget subclasses QTabWidget
        # Note [bruce 070829]: to fix bug 2522 I need to intercept
        # self.pwProjectTabWidget.removeTab, so I made it a subclass of
        # QTabWidget. It needs to know the GLPane, but that's not created
        # yet, so we set it later using KLUGE_setGLPane (below).
        # Note: No parent supplied. Could this be the source of the
        # minor vsplitter resizing problem I was trying to resolve a few
        # months ago?  Try supplying a parent later. Mark 2008-01-01
        self.pwProjectTabWidget.setObjectName("pwProjectTabWidget")
        self.pwProjectTabWidget.setCurrentIndex(0)
        self.pwProjectTabWidget.setAutoFillBackground(True)

        # Create the model tree "tab" widget. It will contain the MT GUI widget.
        # Set the tab icon, too.
        self.modelTreeTab = QWidget()
        self.modelTreeTab.setObjectName("modelTreeTab")
        self.pwProjectTabWidget.addTab(self.modelTreeTab,
                                       geticon("ui/modeltree/Model_Tree.png"),
                                       "")

        modelTreeTabLayout = QVBoxLayout(self.modelTreeTab)
        modelTreeTabLayout.setMargin(0)
        modelTreeTabLayout.setSpacing(0)

        # Create the model tree (GUI) and add it to the tab layout.
        self.modelTree = ModelTree(self.modelTreeTab, parent)
        self.modelTree.modelTreeGui.setObjectName("modelTreeGui")
        modelTreeTabLayout.addWidget(self.modelTree.modelTreeGui)

        # Create the property manager "tab" widget. It will contain the PropMgr
        # scroll area, which will contain the property manager and all its
        # widgets.
        self.propertyManagerTab = QWidget()
        self.propertyManagerTab.setObjectName("propertyManagerTab")

        self.propertyManagerScrollArea = QScrollArea(self.pwProjectTabWidget)
        self.propertyManagerScrollArea.setObjectName(
            "propertyManagerScrollArea")
        self.propertyManagerScrollArea.setWidget(self.propertyManagerTab)
        self.propertyManagerScrollArea.setWidgetResizable(True)
        # Eureka!
        # setWidgetResizable(True) will resize the Property Manager (and its
        # contents) correctly when the scrollbar appears/disappears.
        # It even accounts correctly for collapsed/expanded groupboxes!
        # Mark 2007-05-29

        # Add the property manager scroll area as a "tabbed" widget.
        # Set the tab icon, too.
        self.pwProjectTabWidget.addTab(
            self.propertyManagerScrollArea,
            geticon("ui/modeltree/Property_Manager.png"), "")

        # Finally, add the "pwProjectTabWidget" to the left channel layout.

        leftChannelVBoxLayout.addWidget(self.pwProjectTabWidget)

        # Create the glpane and make it a child of the part splitter.
        self.glpane = GLPane(assy, self, 'glpane name', parent)
        # note: our owner (MWsemantics) assumes
        # there is just this one GLPane for assy, and stores it
        # into assy as assy.o and assy.glpane. [bruce 080216 comment]

        # Add what's this text to self.glpane.
        # [bruce 080912 moved this here from part of a method in class GLPane.
        #  In this code's old location, Mark wrote [2007-06-01]: "Problem -
        #  I don't believe this text is processed by fix_whatsthis_text_and_links()
        #  in whatsthis_utilities.py." Now that this code is here, I don't know
        #  whether that's still true. ]
        from ne1_ui.WhatsThisText_for_MainWindow import whats_this_text_for_glpane
        self.glpane.setWhatsThis(whats_this_text_for_glpane())

        # update [re the above comment], bruce 081209:
        # I added the following explicit call of fix_whatsthis_text_and_links,
        # but it doesn't work to replace Ctrl with Cmd on Mac;
        # see today's comment in fix_whatsthis_text_and_links for likely reason.
        # So I will leave this here, but also leave in place the kluges
        # in whats_this_text_for_glpane to do that replacement itself.
        # The wiki help link in this whatsthis text doesn't work,
        # but I guess that is an independent issue, related to lack
        # of use of class QToolBar_WikiHelp or similar code, for GLPane
        # or this class or the main window class.
        from foundation.whatsthis_utilities import fix_whatsthis_text_and_links
        fix_whatsthis_text_and_links(self.glpane)  # doesn't yet work

        self.pwProjectTabWidget.KLUGE_setGLPane(self.glpane)
        # help fix bug 2522 [bruce 070829]
        qt4warnDestruction(self.glpane, 'GLPane of PartWindow')
        pwSplitter.addWidget(self.glpane)

        # ##################################################################
        # <pwBottomArea> is a container at the bottom of the part window
        # spanning its entire width. It is intended to be used as an extra
        # area for use by Property Managers (or anything else) that needs
        # a landscape oriented layout.
        # An example is the Sequence Editor, which is part of the
        # Strand Properties PM.
        self.pwBottomArea = QFrame()
        # IMHO, self is not a good parent. Mark 2008-01-04.
        pwBottomArea = self.pwBottomArea
        pwBottomArea.setObjectName("pwBottomArea")
        pwBottomArea.setMaximumHeight(50)

        # Add a frame border to see what it looks like.
        pwBottomArea.setFrameStyle(QFrame.Panel | QFrame.Sunken)

        self.pwVBoxLayout.addWidget(pwBottomArea)

        # Hide the bottom frame for now. Later this might be used for the
        # sequence editor.
        pwBottomArea.hide()

        #This widget implementation is subject to heavy revision. The purpose
        #is to implement a NFR that Mark urgently needs : The NFR is: Need a
        #way to quickly find a node in the MT by entering its name.
        #-- Ninad 2008-11-06
        self.pwSpecialDockWidgetInLeftChannel = SelectNodeByNameDockWidget(
            self.glpane.win)
        leftChannelVBoxLayout.addWidget(self.pwSpecialDockWidgetInLeftChannel)

        # See the resizeEvent() docstring for more information about
        # resizeTimer.
        self.resizeTimer = QTimer(self)
        self.resizeTimer.setSingleShot(True)
        return
    def setupUi(self):
        """
        Sets up the main window UI in the following order:
        - Create all main window widgets used by menus and/or toolbars.
        - Create main menu bar and its menus
        - Create main toolbars
        - Create the statusbar
        """
        self.setObjectName("MainWindow")
        self.setEnabled(True)
        self.setWindowIcon(geticon("ui/border/MainWindow.png"))
        self.setWindowTitle("NanoEngineer-1")

        # Set minimum width and height of the main window.
        # To do: Check that the current screen size is at least 800 x 600.
        MINIMUM_MAIN_WINDOW_SIZE = (800, 600) # Mark 2008-02-08
        self.setMinimumWidth(MINIMUM_MAIN_WINDOW_SIZE[0])
        self.setMinimumHeight(MINIMUM_MAIN_WINDOW_SIZE[1])

        # Create all widgets for all main window menus and toolbars.
        Ui_MainWindowWidgets.setupUi(self)

        # Set up all main window widget connections to their slots.
        Ui_MainWindowWidgetConnections.setupUi(self)

        # Toolbars should come before menus. The only reason this is necessary
        # is that the "View > Toolbars" submenu needs the main window toolbars
        # to be created before it is created (in
        self._setupToolbars()
        self._setupMenus()

        # Now set all UI text for main window widgets.
        # Note: I intend to compile all retranslateUi() functions into a single
        # function/method soon. mark 2007-12-31.
        self._retranslateUi()

        # The central widget of the NE1 main window contains a VBoxLayout
        # containing the Command Toolbar at top. Below that will be either:
        # 1. a Part Window widget (the default), or
        # 2. a QWorkspace widget (for MDI support) which will contain only
        #    a single Part Window (experimental)
        # The QWorkspace can be enabled by setting the following debug pref
        # to True: "Enable QWorkspace for MDI support? (next session)"
        # Mark 2007-12-31
        _centralWidget = QWidget()
        self.setCentralWidget(_centralWidget)
        self.centralAreaVBoxLayout = QVBoxLayout(_centralWidget)
        self.centralAreaVBoxLayout.setMargin(0)
        self.centralAreaVBoxLayout.setSpacing(0)

        # Add the Command Toolbar to the top of the central widget.
        # Note: Main window widgets must have their text set
        # via retranslateUi() before instantiating CommandToolbar.
        from commandToolbar.CommandToolbar import CommandToolbar
        self.commandToolbar = CommandToolbar(self)
        self.centralAreaVBoxLayout.addWidget(self.commandToolbar)

        # Create the statusbar for the main window.
        self.setStatusBar(StatusBar(self))

        # =

        # Create the "What's This?" text for all main window widgets.
        from ne1_ui.WhatsThisText_for_MainWindow import createWhatsThisTextForMainWindowWidgets
        createWhatsThisTextForMainWindowWidgets(self)

        # IMPORTANT: All main window widgets and their "What's This" text should
        # be created before this line. [If this is not possible, we'll need to
        # split out some functions within this one which can be called
        # later on individual QActions and/or QWidgets. bruce 060319]
        from foundation.whatsthis_utilities import fix_whatsthis_text_and_links
        fix_whatsthis_text_and_links(self)
            # (main call) Fixes bug 1136.  Mark 051126.
        fix_whatsthis_text_and_links(self.toolsMoveRotateActionGroup)
Example #5
0
    def __init__(self, assy, parent):
        """
        Constructor for the part window.

        @param assy: The assembly (part)
        @type  assy: Assembly

        @param parent: The parent widget.
        @type  parent: U{B{QMainWindow}
                       <http://doc.trolltech.com/4/qmainwindow.html>}
        """
        QWidget.__init__(self, parent)
        self.parent = parent
        self.assy = assy
            # note: to support MDI, self.assy would probably need to be a
            # different assembly for each PartWindow.
            # [bruce 080216 comment]
        self.setWindowIcon(geticon("ui/border/Part.png"))
        self.updateWindowTitle()
        
        # The main layout for the part window is a VBoxLayout <pwVBoxLayout>.
        self.pwVBoxLayout = QVBoxLayout(self)
        pwVBoxLayout = self.pwVBoxLayout
        pwVBoxLayout.setMargin(0)
        pwVBoxLayout.setSpacing(0)

        # ################################################################
        # <pwSplitter> is the horizontal splitter b/w the
        # pwLeftArea (mt and pm) and the glpane.
        self.pwSplitter = QSplitter(Qt.Horizontal)
        pwSplitter = self.pwSplitter
        pwSplitter.setObjectName("pwSplitter")
        pwSplitter.setHandleWidth(3) # 3 pixels wide.
        pwVBoxLayout.addWidget(pwSplitter)

        # ##################################################################
        # <pwLeftArea> is the container holding the pwProjectTabWidget.
        # Note: Making pwLeftArea (and pwRightArea and pwBottomArea) QFrame
        # widgets has the benefit of making it easy to draw a border around
        # each area. One purpose of this would be to help developers understand
        # (visually) how the part window is laid out. I intend to add a debug
        # pref to draw part window area borders and add "What's This" text to
        # them. Mark 2008-01-05.
        self.pwLeftArea = LeftFrame(self)
        pwLeftArea = self.pwLeftArea
        pwLeftArea.setObjectName("pwLeftArea")
        pwLeftArea.setMinimumWidth(PM_MINIMUM_WIDTH)
        pwLeftArea.setMaximumWidth(PM_MAXIMUM_WIDTH)

        # Setting the frame style like this is nice since it clearly
        # defines the splitter at the top-left corner.
        pwLeftArea.setFrameStyle( QFrame.Panel | QFrame.Sunken )

        # This layout will contain splitter (above) and the pwBottomArea.
        leftChannelVBoxLayout = QVBoxLayout(pwLeftArea)
        leftChannelVBoxLayout.setMargin(0)
        leftChannelVBoxLayout.setSpacing(0)

        pwSplitter.addWidget(pwLeftArea)

        # Makes it so pwLeftArea is not collapsible.
        pwSplitter.setCollapsible (0, False)

        # ##################################################################
        # <pwProjectTabWidget> is a QTabWidget that contains the MT and PM
        # widgets. It lives in the "left area" of the part window.
        self.pwProjectTabWidget = _pwProjectTabWidget()
           # _pwProjectTabWidget subclasses QTabWidget
           # Note [bruce 070829]: to fix bug 2522 I need to intercept
           # self.pwProjectTabWidget.removeTab, so I made it a subclass of
           # QTabWidget. It needs to know the GLPane, but that's not created
           # yet, so we set it later using KLUGE_setGLPane (below).
           # Note: No parent supplied. Could this be the source of the
           # minor vsplitter resizing problem I was trying to resolve a few
           # months ago?  Try supplying a parent later. Mark 2008-01-01
        self.pwProjectTabWidget.setObjectName("pwProjectTabWidget")
        self.pwProjectTabWidget.setCurrentIndex(0)
        self.pwProjectTabWidget.setAutoFillBackground(True)

        # Create the model tree "tab" widget. It will contain the MT GUI widget.
        # Set the tab icon, too.
        self.modelTreeTab = QWidget()
        self.modelTreeTab.setObjectName("modelTreeTab")
        self.pwProjectTabWidget.addTab(
            self.modelTreeTab,
            geticon("ui/modeltree/Model_Tree.png"),
            "")

        modelTreeTabLayout = QVBoxLayout(self.modelTreeTab)
        modelTreeTabLayout.setMargin(0)
        modelTreeTabLayout.setSpacing(0)

        # Create the model tree (GUI) and add it to the tab layout.
        self.modelTree = ModelTree(self.modelTreeTab, parent)
        self.modelTree.modelTreeGui.setObjectName("modelTreeGui")
        modelTreeTabLayout.addWidget(self.modelTree.modelTreeGui)

        # Create the property manager "tab" widget. It will contain the PropMgr
        # scroll area, which will contain the property manager and all its
        # widgets.
        self.propertyManagerTab = QWidget()
        self.propertyManagerTab.setObjectName("propertyManagerTab")

        self.propertyManagerScrollArea = QScrollArea(self.pwProjectTabWidget)
        self.propertyManagerScrollArea.setObjectName("propertyManagerScrollArea")
        self.propertyManagerScrollArea.setWidget(self.propertyManagerTab)
        self.propertyManagerScrollArea.setWidgetResizable(True)
        # Eureka!
        # setWidgetResizable(True) will resize the Property Manager (and its
        # contents) correctly when the scrollbar appears/disappears.
        # It even accounts correctly for collapsed/expanded groupboxes!
        # Mark 2007-05-29

        # Add the property manager scroll area as a "tabbed" widget.
        # Set the tab icon, too.
        self.pwProjectTabWidget.addTab(
            self.propertyManagerScrollArea,
            geticon("ui/modeltree/Property_Manager.png"),
            "")

        # Finally, add the "pwProjectTabWidget" to the left channel layout.
        
        leftChannelVBoxLayout.addWidget(self.pwProjectTabWidget)
       

        # Create the glpane and make it a child of the part splitter.
        self.glpane = GLPane(assy, self, 'glpane name', parent)
            # note: our owner (MWsemantics) assumes
            # there is just this one GLPane for assy, and stores it
            # into assy as assy.o and assy.glpane. [bruce 080216 comment]
        
        # Add what's this text to self.glpane.
        # [bruce 080912 moved this here from part of a method in class GLPane.
        #  In this code's old location, Mark wrote [2007-06-01]: "Problem -
        #  I don't believe this text is processed by fix_whatsthis_text_and_links()
        #  in whatsthis_utilities.py." Now that this code is here, I don't know
        #  whether that's still true. ]
        from ne1_ui.WhatsThisText_for_MainWindow import whats_this_text_for_glpane
        self.glpane.setWhatsThis( whats_this_text_for_glpane() )
        
        # update [re the above comment], bruce 081209:
        # I added the following explicit call of fix_whatsthis_text_and_links,
        # but it doesn't work to replace Ctrl with Cmd on Mac;
        # see today's comment in fix_whatsthis_text_and_links for likely reason.
        # So I will leave this here, but also leave in place the kluges
        # in whats_this_text_for_glpane to do that replacement itself.
        # The wiki help link in this whatsthis text doesn't work,
        # but I guess that is an independent issue, related to lack
        # of use of class QToolBar_WikiHelp or similar code, for GLPane
        # or this class or the main window class.
        from foundation.whatsthis_utilities import fix_whatsthis_text_and_links
        fix_whatsthis_text_and_links(self.glpane) # doesn't yet work
        
        self.pwProjectTabWidget.KLUGE_setGLPane(self.glpane)
            # help fix bug 2522 [bruce 070829]
        qt4warnDestruction(self.glpane, 'GLPane of PartWindow')
        pwSplitter.addWidget(self.glpane)

        # ##################################################################
        # <pwBottomArea> is a container at the bottom of the part window
        # spanning its entire width. It is intended to be used as an extra
        # area for use by Property Managers (or anything else) that needs
        # a landscape oriented layout.
        # An example is the Sequence Editor, which is part of the
        # Strand Properties PM.
        self.pwBottomArea = QFrame()
            # IMHO, self is not a good parent. Mark 2008-01-04.
        pwBottomArea = self.pwBottomArea
        pwBottomArea.setObjectName("pwBottomArea")
        pwBottomArea.setMaximumHeight(50)

        # Add a frame border to see what it looks like.
        pwBottomArea.setFrameStyle( QFrame.Panel | QFrame.Sunken )

        self.pwVBoxLayout.addWidget(pwBottomArea)

        # Hide the bottom frame for now. Later this might be used for the
        # sequence editor.
        pwBottomArea.hide()
        
        #This widget implementation is subject to heavy revision. The purpose
        #is to implement a NFR that Mark urgently needs : The NFR is: Need a 
        #way to quickly find a node in the MT by entering its name.
        #-- Ninad 2008-11-06
        self.pwSpecialDockWidgetInLeftChannel = SelectNodeByNameDockWidget(self.glpane.win)
        leftChannelVBoxLayout.addWidget(self.pwSpecialDockWidgetInLeftChannel)
                
        # See the resizeEvent() docstring for more information about
        # resizeTimer.
        self.resizeTimer = QTimer(self)
        self.resizeTimer.setSingleShot(True)
        return
Example #6
0
def whatsThisTextForAtomsCommandToolbar(commandToolbar):
    """
    "What's This" text for widgets in the Build Atoms Command Toolbar.
    
    @note: This is a placeholder function. Currenly, all the tooltip text is 
           defined in BuildAtoms_Command.py.
    """
    
    commandToolbar.exitModeAction.setWhatsThis(
        """<b>Exit Atoms</b>
        <p>
        Exits the <b>Build Atoms</b> command set.
        </p>""")
    
    commandToolbar.atomsToolAction.setWhatsThis(
        """<b>Atoms Tool</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/AtomsTool.png\"><br>
        Activates <i>Atoms Tool Mode</i> for depositing and/or selecting atoms. 
        Double-click to insert a new atom into the model by itself. 
        Single-click on <a href=Bondpoints>bondpoints</a> to insert and bond
        a new atom to an existing atom.
        </p>""")
    
    commandToolbar.transmuteAtomsAction.setWhatsThis(
        """<b>Transmute Atoms</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/TransmuteAtoms.png\"><br>
        Transmutes the selected atoms to the active element type. The active 
        element type in set using the <b>Atom Chooser</b> in the 
        <a href=Property_Manager>property manager</a>.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> Use the <b>Selection Filter</b> to limit selects to 
        specific atom types in the <a href=Graphics_Area>raphics area</a>
        <a href=Command_Toolbar>command toolbar</a>.
        </p>""")
    
    commandToolbar.bondsToolAction.setWhatsThis(
        """<b>Bonds Tool</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/BondsTool.png\"><br>
        Enters <i>Bonds Tool Mode</i> for changing bonds (i.e. the bond order) 
        or deleting bonds. Singe-clicking bonds will transmute them into the 
        active bond type. The active bond type in set by selecting one of 
        the bond types (i.e. single, double, triple, etc.) in the flyout area
        of the <a href=Command_Toolbar>command toolbar</a>.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds at the same 
        time. To do this, select all the atoms with bonds you want to transmute, 
        then click on the bond type in the 
        <a href=Command_Toolbar>command toolbar</a>.
        </p>""")
    
    commandToolbar.bond1Action.setWhatsThis(
        """<b>Single Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/SingleBond.png\"><br>
        Sets the active bond type to <b>single</b>. Singe-clicking a 
        highlighted bond transmutes it into a single bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into single 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")
    
    commandToolbar.bond2Action.setWhatsThis(
        """<b>Double Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/DoubleBond.png\"><br>
        Sets the active bond type to <b>double</b>. Singe-clicking a 
        highlighted bond transmutes it into a double bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into double 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")
    
    commandToolbar.bond3Action.setWhatsThis(
        """<b>Triple Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/TripleBond.png\"><br>
        Sets the active bond type to <b>triple</b>. Singe-clicking a 
        highlighted bond transmutes it into a triple bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into triple 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")
    
    commandToolbar.bondaAction.setWhatsThis(
        """<b>Aromatic Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/AromaticBond.png\"><br>
        Sets the active bond type to <b>aromatic</b>. Singe-clicking a 
        highlighted bond transmutes it into an aromatic bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into aromatic 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")
    
    commandToolbar.bondgAction.setWhatsThis(
        """<b>Graphitic Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/GraphiticBond.png\"><br>
        Sets the active bond type to <b>graphitic</b>. Singe-clicking a 
        highlighted bond transmutes it into a graphitic bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into graphitic 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")
    
    commandToolbar.cutBondsAction.setWhatsThis(
        """<b>Cut Bonds</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/CutBonds.png\"><br>
        Activates cut bonds mode. Singe-clicking a highlighted bond deletes it.
        </p>""")
    
    # Convert all "img" tags in the button's "What's This" text 
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)
    fix_whatsthis_text_and_links(commandToolbar.bondToolsActionGroup)    
    return
Example #7
0
def whatsThisTextForCrystalCommandToolbar(commandToolbar):
    """
    "Tool Tip" text for widgets in the Build Crystal (crystal) Command Toolbar.
    """
    commandToolbar.exitModeAction.setWhatsThis(
        """<b>Exit Crystal</b>
        <p>
        Exits the <b>Build Crystal</b> command set.
        </p>""")
    
    commandToolbar.polygonShapeAction.setWhatsThis(
        """<b>Polygon</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Polygon.png\"><br>
        Defines the selection shape as a polygon with the user specifying the 
        vertices.</p>
        <p>
        <img source=\"ui/whatsthis/Remember.png\"><br>
        <b>Remember:</b> You must <b>double-click</b> to define the final vertex and close the polygon.
        </p>""")
    
    commandToolbar.circleShapeAction.setWhatsThis(
        """<b>Circle</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Circle.png\"><br>
        Defines the selection shape as a circle with the user specifying the 
        center (first click) and radius (second click).
        </p>""")
        
    commandToolbar.squareShapeAction.setWhatsThis(
        """<b>Square</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Square.png\"><br>
        Defines the selection shape as a square with the user specifying the 
        center (first click) and a corner (second click).
        </p>""")
    
    commandToolbar.rectCtrShapeAction.setWhatsThis(
        """<b>Rectangle</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/RectCenter.png\"><br>
        Defines the selection shape as a rectangle with the user defining
        the center (first click) and corner (second click).
        </p>""")
    
    commandToolbar.rectCornersShapeAction.setWhatsThis(
        """<b>Rectangle Corners</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/RectCorners.png\"><br>
        Defines the selection shape as a rectangle with the user specifying 
        one corner (first click) and then the opposite corner (second click).
        </p>""")
    
    commandToolbar.hexagonShapeAction.setWhatsThis(
        """<b>Hexagon</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Hexagon.png\"><br>
        Defines the selection shape as a hexagon with the user specifying the 
        center (first click) and corner (second click).
        </p>""")
    
    commandToolbar.triangleShapeAction.setWhatsThis(
        """<b>Triangle</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Triangle.png\"><br>
        Defines the selection shape as a triangle with the user specifying the 
        center (first click) and corner (second click).
        </p>""")
    
    commandToolbar.diamondShapeAction.setWhatsThis(
        """<b>Diamond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Diamond.png\"><br>
        Defines the selection shape as a diamond with the user specifying the 
        center (first click) and corner (second click).
        </p>""")

    commandToolbar.lassoShapeAction.setWhatsThis(
        """<b>Lasso</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Lasso.png\"><br>
        Defines the selection shape as a freeform lasso. Draw the shape by 
        dragging the mouse while holding down the <a href=LMB>LMB</a>.
        </p>""")
    
    # Convert all "img" tags in the button's "What's This" text 
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)
    
    return
Example #8
0
def whatsThisTextForDnaCommandToolbar(commandToolbar):
    """
    "What's This" text for the Build DNA Command Toolbar
    """
    commandToolbar.exitModeAction.setWhatsThis(
        """<b>Exit DNA</b>
        <p>
        Exits the <b>Build DNA</b> command set.
        </p>""")
    
    commandToolbar.dnaDuplexAction.setWhatsThis(
        """<b>Insert DNA</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/InsertDna.png\"><br>
        Insert a DNA duplex by clicking two endpoints in the graphics area.
        </p>""")
    
    commandToolbar.breakStrandAction.setWhatsThis(
        """<b>Break Strands</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/BreakStrand.png\"><br>
        This command provides an interactive mode where the user can 
        break strands by clicking on a bond in a DNA strand. </p>
        <p>
        You can also join strands while in this command by dragging and 
        dropping strand arrow heads onto their strand conjugate 
        (i.e. 3' on to 5' and vice versa). </p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> Changing the <b>Global display style</b> to <b>CPK</b>  
        results in faster interactive graphics while in this command, especially 
        for large models.
        </p>""")
    
    commandToolbar.joinStrandsAction.setWhatsThis(
        """<b>Join Strands</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/JoinStrands.png\"><br>
        This command provides an interactive mode where the user can
        join strands by dragging and dropping strand arrow heads onto their 
        strand conjugate (i.e. 3' on to 5' and vice versa). </p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> Changing the <b>Global display style</b> to <b>CPK</b>  
        results in faster interactive graphics while in this command, especially 
        for large models.
        </p>""")
    
    commandToolbar.convertDnaAction.setWhatsThis(
        """<b>Convert DNA </b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/ConvertDna.png\"><br>
        Converts the selected DNA from PAM3 to PAM5 or PAM5 to PAM3. The only
        reason to convert to PAM5 is to get more accurate minimizations of DNA 
        nanostructures.</p>
        <p>
        Here is the protocol for producing more accurate minimizations:<br>
        1. Make sure the current model is saved.
        2. Select <b>File > Save As...</b> to save the model under a new name (i.e. <i>model_name</i>_minimized).<br>
        3. Select <b>Build > DNA > Convert</b> to convert the entire model from PAM3 to PAM5.<br>
        4. Select <b>Tools > Minimize Energy</b>.<br>
        5. In the Minimize Energy dialog, select <b>GROMACS with ND1 force field</b> as the Physics engine.<br>
        6. Click the <b>Minimize Energy</b> button.<br>
        7. After minimize completes, convert from PAM5 to PAM3.</p>
        <p>
        Next, visually inspect the model for structural distortions such as 
        puckering, warping, or other unwanted strained areas that will require 
        model changes to correct. Model changes should be made in a version
        of the model that hasn't been minimized. You can either click
        <b>Edit > Undo</b> or save this model and reopen the previous 
        version.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> Changing the <b>Global display style</b> to <b>CPK</b> or 
        <b>DNA Cylinder</b> may make the model easier to visually inspect.</p>
        <p>
        <a href=PAM3_and_PAM5_Model_Descriptions>Click here for a technical 
        overview of the NanoEngineer-1 PAM3 and PAM5 reduced models.</a>
        </p>""")
    
    commandToolbar.orderDnaAction.setWhatsThis(
        """<b>Order DNA</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/OrderDna.png\"><br>
        Produces a comma-separated value (.CSV) text file containing all  
        DNA strand sequences in the model.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> This file can be used to order 
        oligos from suppliers of custom oligonucleotides such as 
        Integrated DNA Technologies and Gene Link.
        </p>""")
        
    commandToolbar.editDnaDisplayStyleAction.setWhatsThis(
        """<b>Edit (DNA Display) Style</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/EditDnaDisplayStyle.png\"><br>
        Edit the DNA Display Style settings used whenever the <b>Global Display
        Style</b> is set to <b>DNA Cylinder</b>. These settings also apply
        to DNA strands and segments that have had their display style set
        to <b>DNA Cylinder</b>.
        </p>""")    
    
    commandToolbar.makeCrossoversAction.setWhatsThis(
        """<b>Make Crossovers</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/MakeCrossovers.png\"><br>
        Creates crossovers interactively between two or more selected DNA 
        segments.</p>
        <p>
        To create crossovers, select the DNA segments to be searched for 
        potential crossover sites. Transparent green spheres indicating 
        potential crossover sites are displayed as you move (rotate or 
        translate) a DNA segment. After you are finished moving a DNA segment, 
        crossover sites are displayed as a pair of white cylinders that can 
        be highlighted/selected. Clicking on a highlighted crossover site 
        makes a crossover.
        </p>""")
    
    # Convert all "img" tags in the button's "What's This" text 
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)
    
    return
Example #9
0
def whatsThisTextForProteinCommandToolbar(commandToolbar):
    """
    "What's This" text for the Build Protein Command Toolbar
    """
    commandToolbar.exitModeAction.setWhatsThis(
        """<b>Exit Protein</b>
        <p>
        Exits the <b>Build Protein</b> command set.
        </p>""")
    
    commandToolbar.modelProteinAction.setWhatsThis(
        """<b>Model Protein</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/ModelProtein.png\"><br> 
        Enter protein modeling mode. Protein modeling sub-commands are 
        displayed to the right in the flyout area of the 
        <a href=Command_Toolbar>command toolbar</a>.
        </p>""")
    
    commandToolbar.simulateProteinAction.setWhatsThis(
        """<b>Simulate Protein with Rosetta</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Simulate.png\"><br> 
        Enter protein simulation mode using Rosetta. Rosetta simulation 
        sub-commands are displayed to the right in the flyout area of the 
        <a href=Command_Toolbar>command toolbar</a>.</p>
        <p>
        Rosetta is a collection of computational tools for the prediction and 
        design of protein structures and protein-protein interactions.</p>
        <p>
        <a href=Rosetta_for_NanoEngineer-1> 
        Click here for more information about Rosetta for NanoEngineer-1</a>
        </p>""")
    
    commandToolbar.buildPeptideAction.setWhatsThis(
        """<b>Insert Peptide</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/InsertPeptide.png\"><br> 
        Insert a peptide chain by clicking two endpoints in the 
        <a href=Graphics_Area>graphics area</a>. The user can also specify 
        different conformation options (i.e. Alpha helix, Beta sheet, etc.) 
        in the <a href=Property_Manager>property manager</a>.
        </p>""")
    
    commandToolbar.compareProteinsAction.setWhatsThis(
        """<b>Compare Proteins</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Compare.png\"><br> 
        Select two protein structures and compare them visually.
        </p>""")
    
    commandToolbar.displayProteinStyleAction.setWhatsThis(
        """<b>Edit (Protein Display) Style</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/EditProteinDisplayStyle.png\"><br> 
        Edit the Protein Display Style settings used whenever the 
        <b>Global Display Style</b> is set to <b>Protein</b>.
        </p>""")
    
    commandToolbar.rosetta_fixedbb_design_Action.setWhatsThis(
        """<b>Fixed Backbone Protein Sequence Design</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/FixedBackbone.png\"><br> 
        Design an optimized fixed backbone protein sequence using Rosetta.
        </p>""")
    
    commandToolbar.rosetta_backrub_Action.setWhatsThis(
        """<b>Backrub Motion</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Backrub.png\"><br> 
        Design an optimized backbone protein sequence using Rosetta 
        with backrub motion allowed.
        </p>""")
    
    commandToolbar.editResiduesAction.setWhatsThis(
        """<b>Edit Residues</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Residues.png\"><br> 
        Provides an interface to edit residues so that Rosetta can predict
        the optimized sequence of an initial sequence (peptide chain).
        </p>""")
    
    commandToolbar.rosetta_score_Action.setWhatsThis(
        """<b>Compute Rosetta Score</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Score.png\"><br> 
        Produce the Rosetta score, which is useful for predicting errors in a 
        peptide/protein structure. </p>
        <p>
        The Rosetta scoring function is an all-atom force field that focuses 
        on short-range interactions (i.e., van der Waals packing, hydrogen 
        bonding and desolvation) while neglecting long-range electrostatics. 
        </p>""")
    
    # Convert all "img" tags in the button's "What's This" text 
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroupForModelProtein)
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroupForSimulateProtein)
    return
Example #10
0
    def setupUi(self):
        """
        Sets up the main window UI in the following order:
        - Create all main window widgets used by menus and/or toolbars.
        - Create main menu bar and its menus
        - Create main toolbars
        - Create the statusbar
        """
        self.setObjectName("MainWindow")
        self.setEnabled(True)
        self.setWindowIcon(geticon("ui/border/MainWindow.png"))
        self.setWindowTitle("NanoEngineer-1")
        
        # Set minimum width and height of the main window.
        # To do: Check that the current screen size is at least 800 x 600.
        MINIMUM_MAIN_WINDOW_SIZE = (800, 600) # Mark 2008-02-08
        self.setMinimumWidth(MINIMUM_MAIN_WINDOW_SIZE[0])
        self.setMinimumHeight(MINIMUM_MAIN_WINDOW_SIZE[1])

        # Create all widgets for all main window menus and toolbars.
        Ui_MainWindowWidgets.setupUi(self)
        
        # Set up all main window widget connections to their slots.
        Ui_MainWindowWidgetConnections.setupUi(self)
        
        # Toolbars should come before menus. The only reason this is necessary
        # is that the "View > Toolbars" submenu needs the main window toolbars
        # to be created before it is created (in 
        self._setupToolbars() 
        self._setupMenus()
        
        # Now set all UI text for main window widgets.
        # Note: I intend to compile all retranslateUi() functions into a single
        # function/method soon. mark 2007-12-31.
        self._retranslateUi()
        
        # The central widget of the NE1 main window contains a VBoxLayout
        # containing the Command Toolbar at top. Below that will be either:
        # 1. a Part Window widget (the default), or 
        # 2. a QWorkspace widget (for MDI support) which will contain only
        #    a single Part Window (experimental)
        # The QWorkspace can be enabled by setting the following debug pref
        # to True: "Enable QWorkspace for MDI support? (next session)"
        # Mark 2007-12-31
        _centralWidget = QWidget()
        self.setCentralWidget(_centralWidget)
        self.centralAreaVBoxLayout = QVBoxLayout(_centralWidget)
        self.centralAreaVBoxLayout.setMargin(0)
        self.centralAreaVBoxLayout.setSpacing(0)
        
        # Add the Command Toolbar to the top of the central widget.
        # Note: Main window widgets must have their text set 
        # via retranslateUi() before instantiating CommandToolbar.
        from commandToolbar.CommandToolbar import CommandToolbar
        self.commandToolbar = CommandToolbar(self)
        self.centralAreaVBoxLayout.addWidget(self.commandToolbar)
        
        # Create the statusbar for the main window.
        self.setStatusBar(StatusBar(self))
        
        # =
    
        # Create the "What's This?" text for all main window widgets.
        from ne1_ui.WhatsThisText_for_MainWindow import createWhatsThisTextForMainWindowWidgets
        createWhatsThisTextForMainWindowWidgets(self)
        
        # IMPORTANT: All main window widgets and their "What's This" text should 
        # be created before this line. [If this is not possible, we'll need to 
        # split out some functions within this one which can be called
        # later on individual QActions and/or QWidgets. bruce 060319]
        from foundation.whatsthis_utilities import fix_whatsthis_text_and_links
        fix_whatsthis_text_and_links(self)
            # (main call) Fixes bug 1136.  Mark 051126.
        fix_whatsthis_text_and_links(self.toolsMoveRotateActionGroup)
def whatsThisTextForAtomsCommandToolbar(commandToolbar):
    """
    "What's This" text for widgets in the Build Atoms Command Toolbar.
    
    @note: This is a placeholder function. Currenly, all the tooltip text is 
           defined in BuildAtoms_Command.py.
    """

    commandToolbar.exitModeAction.setWhatsThis("""<b>Exit Atoms</b>
        <p>
        Exits the <b>Build Atoms</b> command set.
        </p>""")

    commandToolbar.atomsToolAction.setWhatsThis("""<b>Atoms Tool</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/AtomsTool.png\"><br>
        Activates <i>Atoms Tool Mode</i> for depositing and/or selecting atoms. 
        Double-click to insert a new atom into the model by itself. 
        Single-click on <a href=Bondpoints>bondpoints</a> to insert and bond
        a new atom to an existing atom.
        </p>""")

    commandToolbar.transmuteAtomsAction.setWhatsThis("""<b>Transmute Atoms</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/TransmuteAtoms.png\"><br>
        Transmutes the selected atoms to the active element type. The active 
        element type in set using the <b>Atom Chooser</b> in the 
        <a href=Property_Manager>property manager</a>.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> Use the <b>Selection Filter</b> to limit selects to 
        specific atom types in the <a href=Graphics_Area>raphics area</a>
        <a href=Command_Toolbar>command toolbar</a>.
        </p>""")

    commandToolbar.bondsToolAction.setWhatsThis("""<b>Bonds Tool</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/BondsTool.png\"><br>
        Enters <i>Bonds Tool Mode</i> for changing bonds (i.e. the bond order) 
        or deleting bonds. Singe-clicking bonds will transmute them into the 
        active bond type. The active bond type in set by selecting one of 
        the bond types (i.e. single, double, triple, etc.) in the flyout area
        of the <a href=Command_Toolbar>command toolbar</a>.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds at the same 
        time. To do this, select all the atoms with bonds you want to transmute, 
        then click on the bond type in the 
        <a href=Command_Toolbar>command toolbar</a>.
        </p>""")

    commandToolbar.bond1Action.setWhatsThis("""<b>Single Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/SingleBond.png\"><br>
        Sets the active bond type to <b>single</b>. Singe-clicking a 
        highlighted bond transmutes it into a single bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into single 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")

    commandToolbar.bond2Action.setWhatsThis("""<b>Double Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/DoubleBond.png\"><br>
        Sets the active bond type to <b>double</b>. Singe-clicking a 
        highlighted bond transmutes it into a double bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into double 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")

    commandToolbar.bond3Action.setWhatsThis("""<b>Triple Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/TripleBond.png\"><br>
        Sets the active bond type to <b>triple</b>. Singe-clicking a 
        highlighted bond transmutes it into a triple bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into triple 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")

    commandToolbar.bondaAction.setWhatsThis("""<b>Aromatic Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/AromaticBond.png\"><br>
        Sets the active bond type to <b>aromatic</b>. Singe-clicking a 
        highlighted bond transmutes it into an aromatic bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into aromatic 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")

    commandToolbar.bondgAction.setWhatsThis("""<b>Graphitic Bond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/GraphiticBond.png\"><br>
        Sets the active bond type to <b>graphitic</b>. Singe-clicking a 
        highlighted bond transmutes it into a graphitic bond.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> It is possible to transmute multiple bonds into graphitic 
        bonds at the same time. To do this, select all the atoms with bonds 
        you want to transmute, then click on this button. <b>Note:</b> <i>Only 
        selected atoms with bonds between them will be transmuted.</i>
        </p>""")

    commandToolbar.cutBondsAction.setWhatsThis("""<b>Cut Bonds</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildAtoms/CutBonds.png\"><br>
        Activates cut bonds mode. Singe-clicking a highlighted bond deletes it.
        </p>""")

    # Convert all "img" tags in the button's "What's This" text
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)
    fix_whatsthis_text_and_links(commandToolbar.bondToolsActionGroup)
    return
def whatsThisTextForCrystalCommandToolbar(commandToolbar):
    """
    "Tool Tip" text for widgets in the Build Crystal (crystal) Command Toolbar.
    """
    commandToolbar.exitModeAction.setWhatsThis("""<b>Exit Crystal</b>
        <p>
        Exits the <b>Build Crystal</b> command set.
        </p>""")

    commandToolbar.polygonShapeAction.setWhatsThis("""<b>Polygon</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Polygon.png\"><br>
        Defines the selection shape as a polygon with the user specifying the 
        vertices.</p>
        <p>
        <img source=\"ui/whatsthis/Remember.png\"><br>
        <b>Remember:</b> You must <b>double-click</b> to define the final vertex and close the polygon.
        </p>""")

    commandToolbar.circleShapeAction.setWhatsThis("""<b>Circle</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Circle.png\"><br>
        Defines the selection shape as a circle with the user specifying the 
        center (first click) and radius (second click).
        </p>""")

    commandToolbar.squareShapeAction.setWhatsThis("""<b>Square</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Square.png\"><br>
        Defines the selection shape as a square with the user specifying the 
        center (first click) and a corner (second click).
        </p>""")

    commandToolbar.rectCtrShapeAction.setWhatsThis("""<b>Rectangle</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/RectCenter.png\"><br>
        Defines the selection shape as a rectangle with the user defining
        the center (first click) and corner (second click).
        </p>""")

    commandToolbar.rectCornersShapeAction.setWhatsThis(
        """<b>Rectangle Corners</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/RectCorners.png\"><br>
        Defines the selection shape as a rectangle with the user specifying 
        one corner (first click) and then the opposite corner (second click).
        </p>""")

    commandToolbar.hexagonShapeAction.setWhatsThis("""<b>Hexagon</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Hexagon.png\"><br>
        Defines the selection shape as a hexagon with the user specifying the 
        center (first click) and corner (second click).
        </p>""")

    commandToolbar.triangleShapeAction.setWhatsThis("""<b>Triangle</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Triangle.png\"><br>
        Defines the selection shape as a triangle with the user specifying the 
        center (first click) and corner (second click).
        </p>""")

    commandToolbar.diamondShapeAction.setWhatsThis("""<b>Diamond</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Diamond.png\"><br>
        Defines the selection shape as a diamond with the user specifying the 
        center (first click) and corner (second click).
        </p>""")

    commandToolbar.lassoShapeAction.setWhatsThis("""<b>Lasso</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildCrystal/Lasso.png\"><br>
        Defines the selection shape as a freeform lasso. Draw the shape by 
        dragging the mouse while holding down the <a href=LMB>LMB</a>.
        </p>""")

    # Convert all "img" tags in the button's "What's This" text
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)

    return
def whatsThisTextForDnaCommandToolbar(commandToolbar):
    """
    "What's This" text for the Build DNA Command Toolbar
    """
    commandToolbar.exitModeAction.setWhatsThis("""<b>Exit DNA</b>
        <p>
        Exits the <b>Build DNA</b> command set.
        </p>""")

    commandToolbar.dnaDuplexAction.setWhatsThis("""<b>Insert DNA</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/InsertDna.png\"><br>
        Insert a DNA duplex by clicking two endpoints in the graphics area.
        </p>""")

    commandToolbar.breakStrandAction.setWhatsThis("""<b>Break Strands</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/BreakStrand.png\"><br>
        This command provides an interactive mode where the user can 
        break strands by clicking on a bond in a DNA strand. </p>
        <p>
        You can also join strands while in this command by dragging and 
        dropping strand arrow heads onto their strand conjugate 
        (i.e. 3' on to 5' and vice versa). </p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> Changing the <b>Global display style</b> to <b>CPK</b>  
        results in faster interactive graphics while in this command, especially 
        for large models.
        </p>""")

    commandToolbar.joinStrandsAction.setWhatsThis("""<b>Join Strands</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/JoinStrands.png\"><br>
        This command provides an interactive mode where the user can
        join strands by dragging and dropping strand arrow heads onto their 
        strand conjugate (i.e. 3' on to 5' and vice versa). </p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> Changing the <b>Global display style</b> to <b>CPK</b>  
        results in faster interactive graphics while in this command, especially 
        for large models.
        </p>""")

    commandToolbar.convertDnaAction.setWhatsThis("""<b>Convert DNA </b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/ConvertDna.png\"><br>
        Converts the selected DNA from PAM3 to PAM5 or PAM5 to PAM3. The only
        reason to convert to PAM5 is to get more accurate minimizations of DNA 
        nanostructures.</p>
        <p>
        Here is the protocol for producing more accurate minimizations:<br>
        1. Make sure the current model is saved.
        2. Select <b>File > Save As...</b> to save the model under a new name (i.e. <i>model_name</i>_minimized).<br>
        3. Select <b>Build > DNA > Convert</b> to convert the entire model from PAM3 to PAM5.<br>
        4. Select <b>Tools > Minimize Energy</b>.<br>
        5. In the Minimize Energy dialog, select <b>GROMACS with ND1 force field</b> as the Physics engine.<br>
        6. Click the <b>Minimize Energy</b> button.<br>
        7. After minimize completes, convert from PAM5 to PAM3.</p>
        <p>
        Next, visually inspect the model for structural distortions such as 
        puckering, warping, or other unwanted strained areas that will require 
        model changes to correct. Model changes should be made in a version
        of the model that hasn't been minimized. You can either click
        <b>Edit > Undo</b> or save this model and reopen the previous 
        version.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> Changing the <b>Global display style</b> to <b>CPK</b> or 
        <b>DNA Cylinder</b> may make the model easier to visually inspect.</p>
        <p>
        <a href=PAM3_and_PAM5_Model_Descriptions>Click here for a technical 
        overview of the NanoEngineer-1 PAM3 and PAM5 reduced models.</a>
        </p>""")

    commandToolbar.orderDnaAction.setWhatsThis("""<b>Order DNA</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/OrderDna.png\"><br>
        Produces a comma-separated value (.CSV) text file containing all  
        DNA strand sequences in the model.</p>
        <p>
        <img source=\"ui/whatsthis/HotTip.png\"><br>
        <b>Hot Tip:</b> This file can be used to order 
        oligos from suppliers of custom oligonucleotides such as 
        Integrated DNA Technologies and Gene Link.
        </p>""")

    commandToolbar.editDnaDisplayStyleAction.setWhatsThis(
        """<b>Edit (DNA Display) Style</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/EditDnaDisplayStyle.png\"><br>
        Edit the DNA Display Style settings used whenever the <b>Global Display
        Style</b> is set to <b>DNA Cylinder</b>. These settings also apply
        to DNA strands and segments that have had their display style set
        to <b>DNA Cylinder</b>.
        </p>""")

    commandToolbar.makeCrossoversAction.setWhatsThis("""<b>Make Crossovers</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildDna/MakeCrossovers.png\"><br>
        Creates crossovers interactively between two or more selected DNA 
        segments.</p>
        <p>
        To create crossovers, select the DNA segments to be searched for 
        potential crossover sites. Transparent green spheres indicating 
        potential crossover sites are displayed as you move (rotate or 
        translate) a DNA segment. After you are finished moving a DNA segment, 
        crossover sites are displayed as a pair of white cylinders that can 
        be highlighted/selected. Clicking on a highlighted crossover site 
        makes a crossover.
        </p>""")

    # Convert all "img" tags in the button's "What's This" text
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)

    return
def whatsThisTextForProteinCommandToolbar(commandToolbar):
    """
    "What's This" text for the Build Protein Command Toolbar
    """
    commandToolbar.exitModeAction.setWhatsThis("""<b>Exit Protein</b>
        <p>
        Exits the <b>Build Protein</b> command set.
        </p>""")

    commandToolbar.modelProteinAction.setWhatsThis("""<b>Model Protein</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/ModelProtein.png\"><br> 
        Enter protein modeling mode. Protein modeling sub-commands are 
        displayed to the right in the flyout area of the 
        <a href=Command_Toolbar>command toolbar</a>.
        </p>""")

    commandToolbar.simulateProteinAction.setWhatsThis(
        """<b>Simulate Protein with Rosetta</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Simulate.png\"><br> 
        Enter protein simulation mode using Rosetta. Rosetta simulation 
        sub-commands are displayed to the right in the flyout area of the 
        <a href=Command_Toolbar>command toolbar</a>.</p>
        <p>
        Rosetta is a collection of computational tools for the prediction and 
        design of protein structures and protein-protein interactions.</p>
        <p>
        <a href=Rosetta_for_NanoEngineer-1> 
        Click here for more information about Rosetta for NanoEngineer-1</a>
        </p>""")

    commandToolbar.buildPeptideAction.setWhatsThis("""<b>Insert Peptide</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/InsertPeptide.png\"><br> 
        Insert a peptide chain by clicking two endpoints in the 
        <a href=Graphics_Area>graphics area</a>. The user can also specify 
        different conformation options (i.e. Alpha helix, Beta sheet, etc.) 
        in the <a href=Property_Manager>property manager</a>.
        </p>""")

    commandToolbar.compareProteinsAction.setWhatsThis(
        """<b>Compare Proteins</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Compare.png\"><br> 
        Select two protein structures and compare them visually.
        </p>""")

    commandToolbar.displayProteinStyleAction.setWhatsThis(
        """<b>Edit (Protein Display) Style</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/EditProteinDisplayStyle.png\"><br> 
        Edit the Protein Display Style settings used whenever the 
        <b>Global Display Style</b> is set to <b>Protein</b>.
        </p>""")

    commandToolbar.rosetta_fixedbb_design_Action.setWhatsThis(
        """<b>Fixed Backbone Protein Sequence Design</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/FixedBackbone.png\"><br> 
        Design an optimized fixed backbone protein sequence using Rosetta.
        </p>""")

    commandToolbar.rosetta_backrub_Action.setWhatsThis("""<b>Backrub Motion</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Backrub.png\"><br> 
        Design an optimized backbone protein sequence using Rosetta 
        with backrub motion allowed.
        </p>""")

    commandToolbar.editResiduesAction.setWhatsThis("""<b>Edit Residues</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Residues.png\"><br> 
        Provides an interface to edit residues so that Rosetta can predict
        the optimized sequence of an initial sequence (peptide chain).
        </p>""")

    commandToolbar.rosetta_score_Action.setWhatsThis(
        """<b>Compute Rosetta Score</b>
        <p>
        <img source=\"ui/actions/Command Toolbar/BuildProtein/Score.png\"><br> 
        Produce the Rosetta score, which is useful for predicting errors in a 
        peptide/protein structure. </p>
        <p>
        The Rosetta scoring function is an all-atom force field that focuses 
        on short-range interactions (i.e., van der Waals packing, hydrogen 
        bonding and desolvation) while neglecting long-range electrostatics. 
        </p>""")

    # Convert all "img" tags in the button's "What's This" text
    # into abs paths (from their original rel paths).
    # Partially fixes bug 2943. --mark 2008-12-07
    fix_whatsthis_text_and_links(commandToolbar.subControlActionGroup)
    fix_whatsthis_text_and_links(
        commandToolbar.subControlActionGroupForModelProtein)
    fix_whatsthis_text_and_links(
        commandToolbar.subControlActionGroupForSimulateProtein)
    return