Ejemplo n.º 1
0
 def close(self):
     """
     Close this Property manager.
     """
     if self.attachedAtomsListWidget:
         self.attachedAtomsListWidget.clearTags()
     EditCommand_PM.close(self)
    def __init__(self, win, editCommand):
        """
        Constructor for the Build DNA property manager.
        """

        #For model changed signal
        self.previousSelectionParams = None

        #Urmi 20080713: set the protein chunk name and its length
        #for the first available chunk and not the selected one, that's
        #not implemented as yet

        #self.showProteinParametersAndSequenceEditorForInit(win)

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        EditCommand_PM.__init__(self, win, editCommand)

        DebugMenuMixin._init1(self)

        self.showTopRowButtons( PM_DONE_BUTTON | \
                                PM_CANCEL_BUTTON | \
                                PM_WHATS_THIS_BUTTON)
    def update_props_if_needed_before_closing(self):
        """
        This updates some cosmetic properties of the Plane (e.g. fill color,
        border color, etc.) before closing the Property Manager.
        """

        # Example: The Plane Property Manager is open and the user is
        # 'previewing' the plane. Now the user clicks on "Build > Atoms"
        # to invoke the next command (without clicking "Done").
        # This calls openPropertyManager() which replaces the current PM
        # with the Build Atoms PM.  Thus, it creates and inserts the Plane
        # that was being previewed. Before the plane is permanently inserted
        # into the part, it needs to change some of its cosmetic properties
        # (e.g. fill color, border color, etc.) which distinguishes it as
        # a new plane in the part. This function changes those properties.
        # ninad 2007-06-13

        #called in updatePropertyManager in MWsemeantics.py --(Partwindow class)

        EditCommand_PM.update_props_if_needed_before_closing(self)

        #Don't draw the direction arrow when the object is finalized.
        if self.command.struct and \
           self.command.struct.offsetParentGeometry:

            dirArrow = self.command.struct.offsetParentGeometry.directionArrow
            dirArrow.setDrawRequested(False)
    def __init__( self, win, editCommand ):
        """
        Constructor for the Build DNA property manager.
        """
        
        #For model changed signal
        self.previousSelectionParams = None
         
        #Urmi 20080713: set the protein chunk name and its length
        #for the first available chunk and not the selected one, that's
        #not implemented as yet
        
        #self.showProteinParametersAndSequenceEditorForInit(win)
        
        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False           
        
        EditCommand_PM.__init__( self, 
                                    win,
                                    editCommand)


        DebugMenuMixin._init1( self )

        self.showTopRowButtons( PM_DONE_BUTTON | \
                                PM_CANCEL_BUTTON | \
                                PM_WHATS_THIS_BUTTON)
Ejemplo n.º 5
0
 def close(self):
     """
     Close this Property manager.
     """
     if self.attachedAtomsListWidget:
         self.attachedAtomsListWidget.clearTags()
     EditCommand_PM.close(self)
Ejemplo n.º 6
0
    def update_props_if_needed_before_closing(self):
        """
        This updates some cosmetic properties of the Plane (e.g. fill color,
        border color, etc.) before closing the Property Manager.
        """

        # Example: The Plane Property Manager is open and the user is
        # 'previewing' the plane. Now the user clicks on "Build > Atoms"
        # to invoke the next command (without clicking "Done").
        # This calls openPropertyManager() which replaces the current PM
        # with the Build Atoms PM.  Thus, it creates and inserts the Plane
        # that was being previewed. Before the plane is permanently inserted
        # into the part, it needs to change some of its cosmetic properties
        # (e.g. fill color, border color, etc.) which distinguishes it as
        # a new plane in the part. This function changes those properties.
        # ninad 2007-06-13

        #called in updatePropertyManager in MWsemeantics.py --(Partwindow class)

        EditCommand_PM.update_props_if_needed_before_closing(self)

        #Don't draw the direction arrow when the object is finalized.
        if self.command.struct and \
           self.command.struct.offsetParentGeometry:

            dirArrow = self.command.struct.offsetParentGeometry.directionArrow
            dirArrow.setDrawRequested(False)
 def close(self):
     """
     Overrides superclass close method
     """
     self.sequenceEditor.hide()
     env.history.statusbar_msg("")
     EditCommand_PM.close(self)
     return
Ejemplo n.º 8
0
 def close(self):
     """
     Overrides superclass close method
     """
     self.sequenceEditor.hide()
     env.history.statusbar_msg("")
     EditCommand_PM.close(self)
     return
 def show(self):
     """
     Show this PM 
     As of 2007-11-20, it also shows the Sequence Editor widget and hides 
     the history widget. This implementation may change in the near future
     """
     EditCommand_PM.show(self) 
     self.updateListWidgets()    
 def close(self):
     """
     Closes the Property Manager. Overrides EditCommand_PM.close()
     """
     #Clear tags, if any, due to the selection in the self.strandListWidget.        
     if self.segmentListWidget:
         self.segmentListWidget.clear()
                
     EditCommand_PM.close(self)
    def close(self):
        """
        Closes the Property Manager. Overrides EditCommand_PM.close()
        """
        #Clear tags, if any, due to the selection in the self.strandListWidget.
        if self.segmentListWidget:
            self.segmentListWidget.clear()

        EditCommand_PM.close(self)
 def close(self):
     """
     Closes the Property Manager. Overrides EditCommand_PM.close()
     """
     #Clear tags, if any, due to the selection in the self.strandListWidget.
     #self.nanotubeListWidget.clear()
     env.history.statusbar_msg("")
     EditCommand_PM.close(self)
     return
Ejemplo n.º 13
0
 def close(self):
     """
     Closes the Property Manager. Overrides EditCommand_PM.close()
     """
     #Clear tags, if any, due to the selection in the self.strandListWidget.
     #self.nanotubeListWidget.clear()
     env.history.statusbar_msg("")
     EditCommand_PM.close(self)
     return
 def show(self):
     """
     Overrides superclass show method
     """
     env.history.statusbar_msg("")
     self._updateProteinListForShow()
     self._showProteinParametersAndSequenceEditor()
     EditCommand_PM.show(self)
     self.updateMessage()
     return
Ejemplo n.º 15
0
 def show(self):
     """
     Overrides superclass show method
     """
     env.history.statusbar_msg("")
     self._updateProteinListForShow()
     self._showProteinParametersAndSequenceEditor()
     EditCommand_PM.show(self)
     self.updateMessage()
     return
Ejemplo n.º 16
0
    def show(self):
        """
        Show this PM 
        As of 2007-11-20, it also shows the Sequence Editor widget and hides 
        the history widget. This implementation may change in the near future
        """
        EditCommand_PM.show(self)

        self.updateMessage("Use appropriate command in the command "\
                               "toolbar to create or modify a DNA Object"\
                               "<br>" )
    def show(self):
        """
        Show this PM
        As of 2007-11-20, it also shows the Sequence Editor widget and hides
        the history widget. This implementation may change in the near future
        """
        EditCommand_PM.show(self)

        self.updateMessage("Use appropriate command in the command "\
                               "toolbar to create or modify a DNA Object"\
                               "<br>" )
Ejemplo n.º 18
0
    def show(self):
        """
        Show the  motor Property Manager.
        """
        EditCommand_PM.show(self)
        #It turns out that if updateCosmeticProps is called before
        #EditCommand_PM.show, the 'preview' properties are not updated
        #when you are editing an existing R.Motor. Don't know the cause at this
        #time, issue is trivial. So calling it in the end -- Ninad 2007-10-03
        if self.command and self.command.struct:
            self.command.struct.updateCosmeticProps(previewing = True)

        self.updateAttachedAtomListWidget()
Ejemplo n.º 19
0
    def show(self):
        """
        Show the  motor Property Manager.
        """
        EditCommand_PM.show(self)
        #It turns out that if updateCosmeticProps is called before
        #EditCommand_PM.show, the 'preview' properties are not updated
        #when you are editing an existing R.Motor. Don't know the cause at this
        #time, issue is trivial. So calling it in the end -- Ninad 2007-10-03
        if self.command and self.command.struct:
            self.command.struct.updateCosmeticProps(previewing = True)

        self.updateAttachedAtomListWidget()
    def connect_or_disconnect_signals(self, isConnect):
        """
        Connect or disconnect widget signals sent to their slot methods.
        This can be overridden in subclasses. By default it does nothing.
        @param isConnect: If True the widget will send the signals to the slot
                          method.
        @type  isConnect: boolean
        """
        if isConnect:
            change_connect = self.win.connect
        else:
            change_connect = self.win.disconnect

        EditCommand_PM.connect_or_disconnect_signals(self, isConnect)

        self.attachedAtomsListWidget.connect_or_disconnect_signals(isConnect)
Ejemplo n.º 21
0
    def __init__(self, command):
        """
        Construct the  Motor Property Manager.
        """

        EditCommand_PM.__init__( self, command)

        msg = "Attach a " + self.title + " to the selected atoms"

        # This causes the "Message" box to be displayed as well.
        self.updateMessage(msg)

        self.glpane = self.win.glpane

        # Hide Restore defaults button for Alpha9.
        self.hideTopRowButtons(PM_PREVIEW_BUTTON | PM_RESTORE_DEFAULTS_BUTTON)
    def show(self):
        """
        Show the PM. Extends superclass method.
        @note: _update_UI_do_updates() gets called immediately after this and
               updates PM widgets with their correct values/settings.
        """

        env.history.statusbar_msg("")
        EditCommand_PM.show(self)

        # NOTE: Think about moving this msg to _update_UI_do_updates() where
        # custom msgs can be created based on the current selection, etc.
        # Mark 2008-12-14
        msg = "Select <b>Insert Nanotube</b> to create a nanotube or " "select an existing nantube to modify it."
        self.updateMessage(msg)
        return
Ejemplo n.º 23
0
    def connect_or_disconnect_signals(self, isConnect):
        """
        Connect or disconnect widget signals sent to their slot methods.
        This can be overridden in subclasses. By default it does nothing.
        @param isConnect: If True the widget will send the signals to the slot
                          method.
        @type  isConnect: boolean
        """
        if isConnect:
            change_connect = self.win.connect
        else:
            change_connect = self.win.disconnect

        EditCommand_PM.connect_or_disconnect_signals(self, isConnect)

        self.attachedAtomsListWidget.connect_or_disconnect_signals(isConnect)
Ejemplo n.º 24
0
    def __init__(self, command):
        """
        Construct the  Motor Property Manager.
        """

        EditCommand_PM.__init__( self, command)

        msg = "Attach a " + self.title + " to the selected atoms"

        # This causes the "Message" box to be displayed as well.
        self.updateMessage(msg)

        self.glpane = self.win.glpane

        # Hide Restore defaults button for Alpha9.
        self.hideTopRowButtons(PM_PREVIEW_BUTTON | PM_RESTORE_DEFAULTS_BUTTON)
Ejemplo n.º 25
0
    def show(self):
        """
        Show the Plane Property Manager.
        """
        EditCommand_PM.show(self)
        #It turns out that if updateCosmeticProps is called before
        #EditCommand_PM.show, the 'preview' properties are not updated
        #when you are editing an existing plane. Don't know the cause at this
        #time, issue is trivial. So calling it in the end -- Ninad 2007-10-03

        if self.editCommand.struct:

            plane = self.editCommand.struct
            plane.updateCosmeticProps(previewing=True)
            if plane.imagePath:
                self.imageDisplayFileChooser.setText(plane.imagePath)
            self.imageDisplayCheckBox.setChecked(plane.display_image)
Ejemplo n.º 26
0
    def show(self):
        """
        Show the PM. Extends superclass method.
        @note: _update_UI_do_updates() gets called immediately after this and
               updates PM widgets with their correct values/settings.
        """

        env.history.statusbar_msg("")
        EditCommand_PM.show(self)

        # NOTE: Think about moving this msg to _update_UI_do_updates() where
        # custom msgs can be created based on the current selection, etc.
        # Mark 2008-12-14
        msg = "Select <b>Insert Nanotube</b> to create a nanotube or "\
            "select an existing nantube to modify it."
        self.updateMessage(msg)
        return
Ejemplo n.º 27
0
    def __init__(self, command):
        """
        Constructor for the Build DNA property manager.
        """

        self.current_protein = ""
        self.sequenceEditor = command.win.createProteinSequenceEditorIfNeeded()

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        EditCommand_PM.__init__(self, command)

        self.showTopRowButtons( PM_DONE_BUTTON | \
                                PM_CANCEL_BUTTON | \
                                PM_WHATS_THIS_BUTTON)
    def __init__( self, command ):
        """
        Constructor for the Build DNA property manager.
        """

        self.current_protein = ""
        self.sequenceEditor = command.win.createProteinSequenceEditorIfNeeded()

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        EditCommand_PM.__init__( self, command)

        self.showTopRowButtons( PM_DONE_BUTTON | \
                                PM_CANCEL_BUTTON | \
                                PM_WHATS_THIS_BUTTON)
Ejemplo n.º 29
0
    def show(self):
        """
        Show the Plane Property Manager.
        """
        EditCommand_PM.show(self)
        #It turns out that if updateCosmeticProps is called before 
        #EditCommand_PM.show, the 'preview' properties are not updated 
        #when you are editing an existing plane. Don't know the cause at this
        #time, issue is trivial. So calling it in the end -- Ninad 2007-10-03

        if self.editCommand.struct:

            plane = self.editCommand.struct 
            plane.updateCosmeticProps(previewing = True)
            if plane.imagePath:
                self.imageDisplayFileChooser.setText(plane.imagePath)
            self.imageDisplayCheckBox.setChecked(plane.display_image) 
    def __init__(self, command):
        """
        Constructor for the Build Nanotube property manager.
        """

        # Attributes for self._update_UI_do_updates() to keep track of changes
        # in these , since the last call of that method. These are used to
        # determine whether certain UI updates are needed.
        self._previousSelectionParams = None
        self._previousStructureParams = None
        self._previousCommandStackParams = None

        # see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        EditCommand_PM.__init__(self, command)

        self.showTopRowButtons(PM_DONE_BUTTON | PM_WHATS_THIS_BUTTON)
        return
    def __init__(self, win, editCommand):
        """
        Constructor for the Build Nanotube property manager.
        """

        #For model changed signal
        self.previousSelectionParams = None

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        self.sequenceEditor = None

        EditCommand_PM.__init__(self, win, editCommand)

        DebugMenuMixin._init1(self)

        self.showTopRowButtons( PM_DONE_BUTTON | \
                                PM_WHATS_THIS_BUTTON)
Ejemplo n.º 32
0
    def __init__(self, win, planeEditCommand):
        """
        Construct the Plane Property Manager.

        @param plane: The plane.
        @type  plane: L{Plane}
        """

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False


        EditCommand_PM.__init__( self, 
                                 win,
                                 planeEditCommand) 



        msg = "Insert a Plane parallel to the screen. Note: This feature is "\
            "experimental for Alpha9 and has known bugs."

        # This causes the "Message" box to be displayed as well.
        self.updateMessage(msg)

        # self.resized_from_glpane flag makes sure that the 
        #spinbox.valueChanged()
        # signal is not emitted after calling spinbox.setValue.
        self.resized_from_glpane = False

        # Hide Preview and Restore defaults button for Alpha9.
        self.hideTopRowButtons(PM_RESTORE_DEFAULTS_BUTTON)
        # needed to figure out if the model has changed or not
        self.previousPMParams = None
        self.gridColor = black
        self.gridXSpacing = 4.0
        self.gridYSpacing = 4.0
        self.gridLineType = 3
        self.displayLabels = False
        self.originLocation = LOWER_LEFT
        self.displayLabelStyle = LABELS_ALONG_ORIGIN
Ejemplo n.º 33
0
    def __init__(self, command):
        """
        Constructor for the Build Nanotube property manager.
        """

        #Attributes for self._update_UI_do_updates() to keep track of changes
        #in these , since the last call of that method. These are used to
        #determine whether certain UI updates are needed.
        self._previousSelectionParams = None
        self._previousStructureParams = None
        self._previousCommandStackParams = None

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        EditCommand_PM.__init__(self, command)

        self.showTopRowButtons( PM_DONE_BUTTON | \
                                PM_WHATS_THIS_BUTTON)
        return
Ejemplo n.º 34
0
    def __init__(self, win, planeEditCommand):
        """
        Construct the Plane Property Manager.

        @param plane: The plane.
        @type  plane: L{Plane}
        """

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        EditCommand_PM.__init__(self, win, planeEditCommand)



        msg = "Insert a Plane parallel to the screen. Note: This feature is "\
            "experimental for Alpha9 and has known bugs."

        # This causes the "Message" box to be displayed as well.
        self.updateMessage(msg)

        # self.resized_from_glpane flag makes sure that the
        #spinbox.valueChanged()
        # signal is not emitted after calling spinbox.setValue.
        self.resized_from_glpane = False

        # Hide Preview and Restore defaults button for Alpha9.
        self.hideTopRowButtons(PM_RESTORE_DEFAULTS_BUTTON)
        # needed to figure out if the model has changed or not
        self.previousPMParams = None
        self.gridColor = black
        self.gridXSpacing = 4.0
        self.gridYSpacing = 4.0
        self.gridLineType = 3
        self.displayLabels = False
        self.originLocation = LOWER_LEFT
        self.displayLabelStyle = LABELS_ALONG_ORIGIN
    def __init__( self, win, editCommand ):
        """
        Constructor for the Build Nanotube property manager.
        """
        
        #For model changed signal
        self.previousSelectionParams = None
                
        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False
        
        self.sequenceEditor = None              
        
        EditCommand_PM.__init__( self, 
                                    win,
                                    editCommand)


        DebugMenuMixin._init1( self )

        self.showTopRowButtons( PM_DONE_BUTTON | \
                                PM_WHATS_THIS_BUTTON)
    def __init__(self, command):
        """
        Construct the Plane Property Manager.

        @param plane: The plane.
        @type  plane: L{Plane}
        """

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        self.gridColor = black
        self.gridXSpacing = 4.0
        self.gridYSpacing = 4.0
        self.gridLineType = 3
        self.displayLabels = False
        self.originLocation = PLANE_ORIGIN_LOWER_LEFT
        self.displayLabelStyle = LABELS_ALONG_ORIGIN

        EditCommand_PM.__init__( self, command)

        # Hide Preview and Restore defaults buttons
        self.hideTopRowButtons(PM_RESTORE_DEFAULTS_BUTTON)
    def show(self):
        """
        Show the Plane Property Manager.
        """
        EditCommand_PM.show(self)
        #It turns out that if updateCosmeticProps is called before
        #EditCommand_PM.show, the 'preview' properties are not updated
        #when you are editing an existing plane. Don't know the cause at this
        #time, issue is trivial. So calling it in the end -- Ninad 2007-10-03

        if self.command.struct:

            plane = self.command.struct
            plane.updateCosmeticProps(previewing = True)
            if plane.imagePath:
                self.imageDisplayFileChooser.setText(plane.imagePath)
            self.imageDisplayCheckBox.setChecked(plane.display_image)

            #Make sure that the plane placement option is always set to
            #'Custom' when the Plane PM is shown. This makes sure that bugs like
            #2949 won't occur. Let the user change the plane placement option
            #explicitely
            button = self.pmPlacementOptions.getButtonById(3)
            button.setChecked(True)
Ejemplo n.º 38
0
    def __init__(self, command):
        """
        Construct the Plane Property Manager.

        @param plane: The plane.
        @type  plane: L{Plane}
        """

        #see self.connect_or_disconnect_signals for comment about this flag
        self.isAlreadyConnected = False
        self.isAlreadyDisconnected = False

        self.gridColor = black
        self.gridXSpacing = 4.0
        self.gridYSpacing = 4.0
        self.gridLineType = 3
        self.displayLabels = False
        self.originLocation = PLANE_ORIGIN_LOWER_LEFT
        self.displayLabelStyle = LABELS_ALONG_ORIGIN

        EditCommand_PM.__init__(self, command)

        # Hide Preview and Restore defaults buttons
        self.hideTopRowButtons(PM_RESTORE_DEFAULTS_BUTTON)
Ejemplo n.º 39
0
    def show(self):
        """
        Show the Plane Property Manager.
        """
        EditCommand_PM.show(self)
        #It turns out that if updateCosmeticProps is called before
        #EditCommand_PM.show, the 'preview' properties are not updated
        #when you are editing an existing plane. Don't know the cause at this
        #time, issue is trivial. So calling it in the end -- Ninad 2007-10-03

        if self.command.struct:

            plane = self.command.struct
            plane.updateCosmeticProps(previewing=True)
            if plane.imagePath:
                self.imageDisplayFileChooser.setText(plane.imagePath)
            self.imageDisplayCheckBox.setChecked(plane.display_image)

            #Make sure that the plane placement option is always set to
            #'Custom' when the Plane PM is shown. This makes sure that bugs like
            #2949 won't occur. Let the user change the plane placement option
            #explicitely
            button = self.pmPlacementOptions.getButtonById(3)
            button.setChecked(True)
 def close(self):
     self.sequenceEditor.hide()
     env.history.statusbar_msg("")
     EditCommand_PM.close(self)
     return
 def show(self):
     self.showProteinParametersAndSequenceEditor(self.win)
     EditCommand_PM.show(self)        
     
     return
 def close(self):
     self.sequenceEditor.hide() 
     env.history.statusbar_msg("")
     EditCommand_PM.close(self)
     return
    def show(self):
        self.showProteinParametersAndSequenceEditor(self.win)
        EditCommand_PM.show(self)

        return