コード例 #1
0
 def _addPartLibGroupBox(self):
     """
     Add the part library groupbox to this property manager
     """
     if not self.previewGroupBox:
        return
     
     elementViewer = self.previewGroupBox.elementViewer
     self.partLibGroupBox = PM_PartLib(self, 
                                       win = self.parentMode.w,
                                       elementViewer = elementViewer)
コード例 #2
0
    def _addPartLibGroupBox(self):
        """
        Add the part library groupbox to this property manager
        """
        if not self.previewGroupBox:
            return

        elementViewer = self.previewGroupBox.elementViewer
        self.partLibGroupBox = PM_PartLib(self, win=self.parentMode.w, elementViewer=elementViewer)
コード例 #3
0
class PartLibPropertyManager(PastePropertyManager):
    """
    The PartLibPropertyManager class provides the Property Manager for the
    B{Partlib mode}. It lists the parts in the partlib and also shows the
    current selected part in its 'Preview' box.

    @ivar title: The title that appears in the property manager header.
    @type title: str

    @ivar pmName: The name of this property manager. This is used to set
                  the name of the PM_Dialog object via setObjectName().
    @type name: str

    @ivar iconPath: The relative path to the PNG file that contains a
                    22 x 22 icon image that appears in the PM header.
    @type iconPath: str
    """

    # The title that appears in the Property Manager header
    title = "Part Library"
    # The name of this Property Manager. This will be set to
    # the name of the PM_Dialog object via setObjectName().
    pmName = title
    # The relative path to the PNG file that appears in the header
    iconPath = "ui/actions/Insert/Part_Library.png"

    def __init__(self, command):
        """
        Constructor for the PartLibProperty Manager.

        @param command: The parent mode where this Property Manager is used
        @type  command: L{PartLibPropertyManager}
        """
        self.partLibGroupBox = None

        PastePropertyManager.__init__(self, command)
        self.updateMessage(
        """The part library contains structures and molecules
        that can be added to a project by selecting from the directory
        and double clicking in the 3D graphics area.""")

    def _update_UI_do_updates(self):
        """
        @see: Command_PropertyManager._update_UI_do_updates()
        """
        #This does nothing in this propMGr at present.
        return

    def _addGroupBoxes(self):
        """
        Add various group boxes to this Property manager.
        """
        self._addPreviewGroupBox()
        self._addPartLibGroupBox()

    def _addPartLibGroupBox(self):
        """
        Add the part library groupbox to this property manager
        """
        if not self.previewGroupBox:
           return

        elementViewer = self.previewGroupBox.elementViewer
        self.partLibGroupBox = PM_PartLib(self,
                                          win = self.command.w,
                                          elementViewer = elementViewer)


    def connect_or_disconnect_signals(self, isConnect):
        """
        Connect or disconnect widget signals sent to their slot methods.
        @param isConnect: If True the widget will send the signals to the slot
                          method.
        @type  isConnect: boolean
        """
        self.partLibGroupBox.connect_or_disconnect_signals(isConnect)


    def getPastablePart(self):
        """
        Returns the Pastable part and its hotspot (if any)
        @return: (L{Part}, L{Atom})
        """
        return self.partLibGroupBox.newModel, \
               self.previewGroupBox.elementViewer.hotspotAtom

    def _addWhatsThisText(self):
        """
        What's This text for widgets in this Property Manager.
        """
        whatsThis_PartLibPropertyManager(self)
        return



    def _addToolTipText(self):
        """
        Tool Tip text for widgets in this Property Manager.
        """
        from ne1_ui.ToolTipText_for_PropertyManagers import ToolTip_PartLibPropertyManager
        ToolTip_PartLibPropertyManager(self)
コード例 #4
0
class PartLibPropertyManager(PastePropertyManager):
    """
    The PartLibPropertyManager class provides the Property Manager for the
    B{Partlib mode}. It lists the parts in the partlib and also shows the 
    current selected part in its 'Preview' box. 
    
    @ivar title: The title that appears in the property manager header.
    @type title: str
    
    @ivar pmName: The name of this property manager. This is used to set
                  the name of the PM_Dialog object via setObjectName().
    @type name: str
    
    @ivar iconPath: The relative path to the PNG file that contains a
                    22 x 22 icon image that appears in the PM header.
    @type iconPath: str
    """
    
    # The title that appears in the Property Manager header        
    title = "Part Library"
    # The name of this Property Manager. This will be set to
    # the name of the PM_Dialog object via setObjectName().
    pmName = title
    # The relative path to the PNG file that appears in the header
    iconPath = "ui/actions/Insert/Part_Library.png"
    
    def __init__(self, parentMode):
        """
        Constructor for the PartLibProperty Manager. 
        
        @param parentMode: The parent mode where this Property Manager is used
        @type  parentMode: L{PartLibPropertyManager} 
        """
        self.partLibGroupBox = None
        
        PastePropertyManager.__init__(self, parentMode)
        self.updateMessage(
        """The part library contains structures and molecules
        that can be added to a project by selecting from the directory
        and double clicking in the 3D graphics area."""
        )
    
    def model_changed(self):
        """
        Overrides BuildAtomsPropertyManager.model_changed. 
        """
        #This does nothing in this propMGr at present. 
        return
            
    def _addGroupBoxes(self):
        """
        Add various group boxes to this Property manager.
        """
        self._addPreviewGroupBox()
        self._addPartLibGroupBox()
    
    def _addPartLibGroupBox(self):
        """
        Add the part library groupbox to this property manager
        """
        if not self.previewGroupBox:
           return
        
        elementViewer = self.previewGroupBox.elementViewer
        self.partLibGroupBox = PM_PartLib(self, 
                                          win = self.parentMode.w,
                                          elementViewer = elementViewer)
        
        
    def connect_or_disconnect_signals(self, isConnect):         
        """
        Connect or disconnect widget signals sent to their slot methods.
        @param isConnect: If True the widget will send the signals to the slot 
                          method. 
        @type  isConnect: boolean
        """
        self.partLibGroupBox.connect_or_disconnect_signals(isConnect)
        
    
    def getPastablePart(self):
        """
        Returns the Pastable part and its hotspot (if any)
        @return: (L{Part}, L{Atom})
        """        
        return self.partLibGroupBox.newModel, \
               self.previewGroupBox.elementViewer.hotspotAtom

    def _addWhatsThisText(self):
        """
        What's This text for widgets in this Property Manager.  
        """
        whatsThis_PartLibPropertyManager(self)
        return
        
    
                   
    def _addToolTipText(self):
        """
        Tool Tip text for widgets in this Property Manager.  
        """
        from ne1_ui.ToolTipText_for_PropertyManagers import ToolTip_PartLibPropertyManager
        ToolTip_PartLibPropertyManager(self)