sel = self.vf.selection
            _set = sel.__class__(sel.data)
            
            self.doitWrapper( name, _set )
    

    def __call__(self, name, _set, **kw):
        """None <- addSelectionToDashboard( self, **kw)
        add a line to the dashboard to represent current selection
        """
        _set = self.vf.expandNodes(_set)
        if len(_set)==0:
            return
        self.doitWrapper( *(name, _set), **kw )

addSelectionToDashboardCommandGUI = MVCommandGUI()
addSelectionToDashboardCommandGUI.addMenuCommand('menuRoot', 'Select',
                                                 'Add selection To Dashboard')

addSelectionToDashboardGUI = MVCommandGUI()
addSetToDashboardmsg = 'Add the current selection to the dashboard'
from Pmv.moleculeViewer import ICONPATH
addSelectionToDashboardGUI.addToolBar(
    'addSetToDashboard', icon1='AddToDashboard.gif',index=15., 
    balloonhelp=addSetToDashboardmsg, type='ToolBarButton', icon_dir=ICONPATH)


class FloatDashboard(MVCommand):
    """Command to move the dashboard widget into its own toplevel widget"""

    def onAddCmdToViewer(self):
##         molFrag = args[0]
##         negate = kw['negate']
##         if column<6:#command==self.vf.displayLines:
##             for o in molFrag:
##                 try:
##                     node = self.tree.objectToNode[o]
##                     if node.chkbtval[column]==negate:
##                         #only call if button needs to be checked
##                         node.set(column, negate==False)
##                 except KeyError:
##                     #print 'Failed to find object in tree', o
##                     pass
                    
                
Dashboard_GUI = MVCommandGUI()
from moleculeViewer import ICONPATH
Dashboard_GUI.addToolBar('Dashboard', icon1='dashboard.png', 
                         icon_dir=ICONPATH,
                         balloonhelp='Float Dashboard Widget', index=9)
            
commandList = [
    {'name':'dashboard', 'cmd':Dashboard(), 'gui':Dashboard_GUI},
    #{'name':'showDashboard', 'cmd':ShowDashboard(), 'gui':None},
    {'name':'floatDashboard', 'cmd':FloatDashboard(), 'gui':None},
    {'name':'dockDashboard', 'cmd':DockDashboard(), 'gui':None},
    {'name':'addDashboardCmd', 'cmd':AddDashboardCmd(), 'gui':None},
    {'name':'dashboardSuspendRedraw', 'cmd':DashboardSuspendRedraw(),
     'gui':None},
]
        if self.root:
            self.root.withdraw()
        self.vf.GUI.toolbarCheckbuttons['Vision']['Variable'].set(0)

    
    def guiCallback(self):
        self.doitWrapper()


    def __call__(self, **kw):
        """None <- vision(**kw) starts the visual programming environment"""
        apply( self.doitWrapper, (), kw )


        
VisionCommandGUI = MVCommandGUI()
msg = 'show/Hide the visual programming environment Vision'
from moleculeViewer import ICONPATH
VisionCommandGUI.addToolBar('Vision', icon1='vision.png', balloonhelp=msg,
                            icon_dir=ICONPATH, index=5)



class ExportSets(MVCommand):
    """Command to export PMV sets (sets defined through the selection command)
into Vision. Each set is exported as a Vision node, added to the Pmv Library
into the category Molecules."""


    def __init__(self):
        self.form = None
Ejemplo n.º 4
0
                if self.tree.objToNode.has_key(o):
                    node = self.tree.objToNode[o]
                else:
                    return
                if cmdType=='useNegate':
                    negate = not kw['negate']
                    node.chkbtVar[column].set(negate)
                    node.tree.manageChildren(node, column)
                elif cmdType=='radioGroupColor':
                    node.chkbtVar[column].set(1)
                    #print 'value', node.chkbtVar[column].get()
                    node.tree.manageChildren(node, column)
                    for col in range(9,15):
                        if col==column: continue
                        node.chkbtVar[col].set(0)
                        node.tree.manageChildren(node, col)
                    
                
ControlPanel_GUI = MVCommandGUI()
from moleculeViewer import ICONPATH
ControlPanel_GUI.addToolBar('Control_Panel', icon1 = 'view_tree.gif', 
                 icon_dir=ICONPATH, balloonhelp='Control Panel Widget', index=8)
            
commandList = [
    {'name':'controlPanel', 'cmd':ControlPanel(), 'gui':ControlPanel_GUI}
]

def initModule(viewer):
    for dict in commandList:
        viewer.addCommand(dict['cmd'], dict['name'], dict['gui'])
Ejemplo n.º 5
0
            sel = self.vf.selection
            _set = sel.__class__(sel.data)

            self.doitWrapper(name, _set)

    def __call__(self, name, _set, **kw):
        """None <- addSelectionToDashboard( self, **kw)
        add a line to the dashboard to represent current selection
        """
        _set = self.vf.expandNodes(_set)
        if len(_set) == 0:
            return
        self.doitWrapper(*(name, _set), **kw)


addSelectionToDashboardCommandGUI = MVCommandGUI()
addSelectionToDashboardCommandGUI.addMenuCommand('menuRoot', 'Select',
                                                 'Add selection To Dashboard')

addSelectionToDashboardGUI = MVCommandGUI()
addSetToDashboardmsg = 'Add the current selection to the dashboard'
from Pmv.moleculeViewer import ICONPATH

addSelectionToDashboardGUI.addToolBar('addSetToDashboard',
                                      icon1='AddToDashboard.gif',
                                      index=15.,
                                      balloonhelp=addSetToDashboardmsg,
                                      type='ToolBarButton',
                                      icon_dir=ICONPATH)

Ejemplo n.º 6
0
        self.vf.GUI.toolbarCheckbuttons['Vision']['Variable'].set(1)

    def hide(self, event=None):
        if self.root:
            self.root.withdraw()
        self.vf.GUI.toolbarCheckbuttons['Vision']['Variable'].set(0)

    def guiCallback(self):
        self.doitWrapper()

    def __call__(self, **kw):
        """None <- vision(**kw) starts the visual programming environment"""
        apply(self.doitWrapper, (), kw)


VisionCommandGUI = MVCommandGUI()
msg = 'show/Hide the visual programming environment Vision'
from moleculeViewer import ICONPATH
VisionCommandGUI.addToolBar('Vision',
                            icon1='vision.png',
                            balloonhelp=msg,
                            icon_dir=ICONPATH,
                            index=5)

commandList = [
    {
        'name': 'vision',
        'cmd': VisionCommand(),
        'gui': VisionCommandGUI
    },
]