本文整理汇总了Python中ViewerFramework.VFCommand.CommandGUI.addMenuCommand方法的典型用法代码示例。如果您正苦于以下问题:Python CommandGUI.addMenuCommand方法的具体用法?Python CommandGUI.addMenuCommand怎么用?Python CommandGUI.addMenuCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewerFramework.VFCommand.CommandGUI
的用法示例。
在下文中一共展示了CommandGUI.addMenuCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
for f in faces:
for n in range(ntr):
if (n/2)*2 == n:
new_faces[i] = [f[n], f[n+1], f[n+2]]
else:
new_faces[i] = [f[n+2], f[n+1], f[n]]
i = i + 1
return new_faces
def dismiss_cb(self):
"""Withdraws the GUI."""
self.cmdForms['sl'].withdraw()
self.isDisplayed=0
SLGUI = CommandGUI()
SLGUI.addMenuCommand('menuRoot', 'SL','Operate objects', index=1)
class SaveBsptCommand(MVCommand):
"""Command to save a Bspt set in a file."""
def __init__(self):
MVCommand.__init__(self)
self.isDisplayed=0
#self.sl = SLGeom()
def checkDependencies(self):
try:
from SpatialLogic import geometrylib
except:
print "WARNING: Spatial Logic module not found"
def guiCallback(self):
示例2: map
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
warnings.warn("IndexError for %s" %textcolor)
molecules, nodeSets = self.vf.getNodesByMolecule(nodes)
for mol, nodes in map(None, molecules, nodeSets):
nodes.sort()
drawLabels(mol, nodes, materials, function , lambdaFunc, font,
location, only, negate, format)
#labelByPropertiesGuiDescr = {'widgetType':'Menu', 'menuBarName':'menuRoot',
# 'menuButtonName':'Label', 'menuEntryLabel':'by Properties'}
LabelByPropertiesGUI = CommandGUI()
LabelByPropertiesGUI.addMenuCommand('menuRoot', 'Display', 'by Properties',
cascadeName= 'Label')
LabelByExpressionGUI = CommandGUI()
LabelByExpressionGUI.addMenuCommand('menuRoot', 'Display', 'by Expression',
cascadeName= 'Label')
commandList = [
{'name':'labelByProperty','cmd': LabelByProperties(), 'gui': LabelByPropertiesGUI},
{'name':'labelByExpression','cmd': LabelByExpression(), 'gui': LabelByExpressionGUI}
]
def initModule(viewer):
for dict in commandList:
viewer.addCommand(dict['cmd'], dict['name'], dict['gui'])
示例3: CommandGUI
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
#'defaultValue':self.vf.Mols[1].name+", , , ",
'tooltip':'Please select the mobile nodes set. By default the mobile nodes will be the second molecule loaded in the viewer',
'name':'smobNodes',
'wcfg':{ 'molSet': self.vf.Mols,
'vf': self.vf,
'all':1,
'crColor':(0.,0.,1.),'forceEmpty':1,
},
'gridcfg':{'row':-1, 'sticky':'we' }})
return idf
SuperimposeAtomsCommandGUI = CommandGUI()
## SuperimposeAtomsGUICommandGUI.addMenuCommand('menuRoot', 'Compute',
## 'superimpose Atom Pairs',
## cascadeName = "Superimpose")
SuperimposeAtomsCommandGUI.addMenuCommand('menuRoot', 'Compute',
'Superimpose Atom Pairs')
commandList = [
{'name':'superimposeAtoms', 'cmd':SuperimposeAtomsCommand(),
'gui':None},
## {'name':'superimposeAtomsGC2', 'cmd':SuperimposeAtomsGUICommand(),
## 'gui':SuperimposeAtomsCommandGUI},
{'name':'superimposeGUI', 'cmd':SuperimposeAtomsGUICommand(),
'gui':SuperimposeAtomsCommandGUI},
{'name':'superimpose', 'cmd':SuperimposeCommand(),
'gui':None},
{'name':'transformAtoms', 'cmd':TransformAtomsCommand(),
'gui':None},
示例4: ColorPalette
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
pass
from Pmv.pmvPalettes import AtomElements
self.vf.colorByAtomType.palette = ColorPalette('Atom Elements', colorDict=AtomElements,
lookupMember='element')
geoms = self.vf.colorByAtomType.getAvailableGeoms(self.vf.Mols)
self.cleanup()
self.vf.colorByAtomType(self.vf.Mols, geoms)
def doit(self):
self.vf.colorByAtomType.palette.configure(ramp=self.paletteGUI.ramp, labels=self.paletteGUI.labels)
self.vf.colorByAtomType.palette.configureCmap()
self.vf.colorByAtomType.palette.write(os.path.join(self.vf.rcFolder,"colorByAtom_map.py"))
EditColorPaletteByAtomTypeGUI = CommandGUI()
EditColorPaletteByAtomTypeGUI.addMenuCommand('menuRoot',
'Edit',
'Edit Color by Atom Type',
cascadeName='Color Palettes')
class EditColorPaletteByResidueType(MVCommand):
def onAddCmdToViewer(self):
if not self.vf.commands.has_key('colorByResidueType'):
self.vf.loadCommand('colorCommands', 'colorByResidueType', 'Pmv', topCommand = 0)
self.vf.colorByResidueType.palette.read(os.path.join(self.vf.rcFolder,"colorByResidueType_map.py"))
def guiCallback(self):
self.paletteGUI = PaletteChooser(apply_cb=self.apply, makeDefault_cb=self.doit,
restoreDefault_cb = self.restoreDefault,
labels=self.vf.colorByResidueType.palette.labels,
ramp=self.vf.colorByResidueType.palette.ramp)
示例5: openPklData
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
if self.minZ < atom.coords[2] > self.maxZ:
return
self.ifd.entryByName['gridPointsX']['widget'].set(atom.coords[0])
self.ifd.entryByName['gridPointsY']['widget'].set(atom.coords[1])
self.ifd.entryByName['gridPointsZ']['widget'].set(atom.coords[2])
self.cross.Set(visible=1)
self.cross.Set(vertices=((atom.coords[0], atom.coords[1], atom.coords[2]),))
self.vf.GUI.VIEWER.Redraw()
def openPklData(self):
self.vf.AutoLigandMovieCommand(self.fileBaseName+'_flood.pkl')
AutoLigandCommandGUI = CommandGUI()
AutoLigandCommandGUI.addMenuCommand('menuRoot', 'Compute', 'Run AutoLigand...',
cascadeName="AutoLigand")
class OpenMovieCommand(MVCommand):
"GUI that opens saved movie of fill file."
def __init__(self, func=None):
MVCommand.__init__(self, func)
self.floodFile = None
def guiCallback(self):
file = self.vf.askFileOpen(types=[('Saved Flood File', '*.pkl'),('All Files', '*')],
title='Open Saved Flood File')
if file:
self.doitWrapper(file)
示例6: CommandGUI
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
(A checkbutton, "DONE", allows the user to withdraw the autoTools menuBar)
"""
from ViewerFramework.VFCommand import CommandGUI
from AutoDockTools.autodpfCommands import DpfSetDpo, DpfLoadDefaults,\
Dpf4MacroSelector, Dpf4FlexResSelector, Dpf4MacroChooser,\
Dpf4InitLigand, Dpf4LigandChooser, Dpf4LigPDBQReader,\
DpfEditor, Dpf4SAWriter, Dpf4GAWriter, Dpf4LSWriter,\
Dpf4GALSWriter, Dpf4ClusterWriter, SimAnneal, GA,\
LS, SetDockingRunParms, SetAutoDock4Parameters, StopAutoDpf, menuText,\
checkHasDpo, sortKeyList, setDpoFields
DpfLoadDefaultsGUI = CommandGUI()
DpfLoadDefaultsGUI.addMenuCommand('AutoTools4Bar', menuText['AutoDpfMB'], menuText['ReadDpfMB'])
Dpf4MacroSelectorGUI=CommandGUI()
Dpf4MacroSelectorGUI.addMenuCommand('AutoTools4Bar', menuText['AutoDpfMB'],\
menuText['ReadMacro4'], cascadeName = menuText['MacromoleculeMB'])
Dpf4FlexResSelectorGUI=CommandGUI()
Dpf4FlexResSelectorGUI.addMenuCommand('AutoTools4Bar', menuText['AutoDpfMB'],\
menuText['ReadFlexRes4'], cascadeName = menuText['MacromoleculeMB'])
Dpf4MacroChooserGUI=CommandGUI()
Dpf4MacroChooserGUI.addMenuCommand('AutoTools4Bar', menuText['AutoDpfMB'],\
menuText['ChooseMacro4'], cascadeName = menuText['MacromoleculeMB'])
示例7: open
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
req._passwd = passwd
resp = gamaLoginService.loginUserMyProxy(req)
f = open(self.proxy_gama, "w")
f.write(resp._loginUserMyProxyReturn)
f.close()
if self.RememberLogin_var.get():
file = open(self.rc_ad,'w')
user = self.cmdForms['default'].descr.entryByName\
['UserName_Entry']['widget'].get()
passwd = self.cmdForms['default'].descr.entryByName\
['Password_Entry']['widget'].get()
file.write("User:%s\nPassword:%s\n"%(user,passwd))
self.login = True
WebServicesGUI=CommandGUI()
WebServicesGUI.addMenuCommand('AutoToolsBar', menuText['StartMB'], "Web Services...")
commandList = [{'name':'ADweb_services','cmd':WebServices(),'gui':WebServicesGUI}]
WebServices4GUI=CommandGUI()
WebServices4GUI.addMenuCommand('AutoTools4Bar', menuText['StartMB'], "Web Services...")
def initModule(viewer):
if not hasattr(viewer, 'ADweb_services') and hasattr(viewer, 'GUI')\
and hasattr(viewer.GUI, 'currentADTBar'):
viewer.addCommand(WebServices(),'ADweb_services',WebServices4GUI)
#else:
# for _dict in commandList:
# viewer.addCommand(_dict['cmd'],_dict['name'],_dict['gui'])
示例8: CommandGUI
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
"""
from ViewerFramework.VFCommand import CommandGUI
from AutoDockTools.autogpfCommands import GpfSetGpo,\
GpfMacroInit, GpfLoadDefaults, GpfEditor, GpfInitLigand, GpfWriter,\
SelectCenter, SetUpCovalentMap4, SetBoxParameters, SetOtherOptions,\
Gpf4ParameterFileSelector, Gpf4ParameterFileEditor, GpfMergeNonPolarHs,\
Gpf4SetMapTypes, Gpf4SetAtomTypes, Gpf4MacroInit, Gpf4MacroReader,\
Gpf4MacroChooser, Gpf4InitLigand, Gpf4LigandChooser, Gpf4LigReader,\
Gpf4FlexResChooser, Gpf4FlexResReader, Gpf4Writer, menuText, gridOpts,\
messages, checkHasGpo, box, cenSph, cenCross
GpfLoadDefaultsGUI = CommandGUI()
GpfLoadDefaultsGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'],\
menuText['ReadGpfMB'])
GpfEditorGUI= CommandGUI()
GpfEditorGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'],\
menuText['EditGpfMB'])
GpfWriterGUI= CommandGUI()
GpfWriterGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'], \
menuText['WriteGpfMB'], cascadeName=menuText['WriteMB'])
SetUpCovalentMap4GUI = CommandGUI()
SetUpCovalentMap4GUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'], \
menuText['SetUpCovalentMap4'], cascadeName = menuText['SetMapTypesMB'])
示例9: CommandGUI
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
## # Save the pyShell stdin and redirect it to the main Python
## # interpreter only works if the main interpreter has been
## # started in a interactive mode.
## self.vf.pyShellstdin = sys.stdin
## sys.stdin = sys.__stdin__
## # Save the pyShell stderr and redirect it to the main Python
## # interpreter only works if the main interpreter has been
## # started in a interactive mode.
## self.vf.pyShellstderr = sys.stderr
## sys.stderr = sys.__stderr__
# HideGUI command GUI.
HideGUI = CommandGUI()
HideGUI.addMenuCommand('menuRoot', 'File', 'Hide VF GUI...',
cascadeName='Preferences')
class ShowGUICommand(Command):
"""Allow to show the ViewerFrameworkGUI at any time
\nPackage : Pmv
\nModule : customizeVFGUICommands
\nClass : ShowGUICommand
\nCommand : ShowGUI
\nSynopsis:\n
None <- ShowGUI(**kw)
"""
def __call__(self,**kw):
""" None <- ShowGUI(**kw)
"""
if not kw.has_key('redraw'):
示例10: guiCallback
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
def guiCallback(self):
"""called each time the 'read ->Grid' sequence is pressed"""
gridFile = self.vf.askFileOpen(types=[('grid data files', '*.*')],
title = 'Grid File:')
if gridFile is not None and len(gridFile):
self.doitWrapper(gridFile, redraw=0)
gridReaderGuiDescr = {'widgetType':'Menu', 'menuBarName':'menuRoot',
'menuButtonName':'Grid', 'menuEntryLabel':'Grid',
'menuCascadeName':'read'}
GridReaderGUI = CommandGUI()
GridReaderGUI.addMenuCommand('menuRoot', 'Grid', 'Grid', cascadeName='read')
class AutoGridReader(MVCommand):
""" Command to load autogrid data files, creating an 'AutoGrid' object
\nPackage : Pmv
\nModule : GridCommands
\nClass : AutoGridReader
\nCommand : readAUTOGRID
\nSynopsis:\n
None <- readAUTOGRID(gridFile, **kw)
\nRequired Arguments:\n
gridFile --- path to the autogrid data file
"""
示例11: zip
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
levelLabels = ['Molecule ', 'Chain ',
'Residue ', 'Atom ']
self.levelVar.set("Molecule")
for level, levlabel in zip(levels, levelLabels):
ifd.append({'name':level,
'widgetType': Tkinter.Radiobutton,
'wcfg':{'text':levlabel,
'variable':self.levelVar,
'value':level,
'justify':'left',
'activebackground':self.levelColors[level],
'selectcolor':self.levelColors[level],
'command':self.setLevel_cb},
'gridcfg':{'sticky':'we'}})
ifd.append({'name':'dismiss',
'widgetType':Tkinter.Button,
'defaultValue':1,
'wcfg':{'text':'Dismiss',
'command':self.Close_cb},
'gridcfg':{'sticky':'we'}
})
self.form = self.vf.getUserInput(self.ifd, modal=0, blocking=0)
self.form.root.protocol('WM_DELETE_WINDOW',self.Close_cb)
MVSetSelectionLevelGUI = CommandGUI()
MVSetSelectionLevelGUI.addMenuCommand('menuRoot', 'Select','Set Selection Level')
示例12: CommandGUI
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
'widgetType':Tkinter.Button,
'wcfg':{'text':'Dismiss',
'command':self.dismissCB},
'gridcfg':{'column':3, 'row':10,'sticky':'ew'}})
self.form = self.vf.getUserInput(idf, modal = 0, blocking = 0)
lb = idf.entryByName['selectedGeometries']['widget'].lb
lb.bind("<ButtonRelease-1>", self.updateProps, '+')
e1 = idf.entryByName['pigment']['widget']
e1.bind("<Return>", self.bindPigment)
e2 = idf.entryByName['finish']['widget']
e2.bind("<Return>", self.bindFinish)
povrayGuiDescr = {'widgetType':'Menu', 'menuBarName':'menuRoot',
'menuButtonName':'File',
'menuEntryLabel':'Povray', 'index':0}
PovrayGUI = CommandGUI()
PovrayGUI.addMenuCommand('menuRoot', 'File', 'Povray', index = 0)
commandList = [
{'name':'povray','cmd': Povray(), 'gui': PovrayGUI},
]
def initModule(viewer):
for dict in commandList:
viewer.addCommand(dict['cmd'], dict['name'], dict['gui'])
示例13: dirChoose
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
## folderPath = dirChoose(self.vf.GUI.ROOT)
## if folderPath:
## print folderPath,type(folderPath)
## ## get all the *.vu file from folderPath,
## ## create filelist
## from glob import glob
## filelist = glob(str(folderPath)+'/*.vu')
## if filelist:
## if self.vf.userpref['expandNodeLogString']['value'] == 0:
## self.nodeLogString = "self.getSelection()"
## apply(self.doitWrapper, (self.vf.getSelection(),filelist),kw)
loadVectGUI = CommandGUI()
loadVectGUI.addMenuCommand('menuRoot', 'VectField', 'loadVect')
####### VU Field ###################
class loadVUFile(MVCommand):
""" Command to a load a VU file to display"""
def __init__(self):
MVCommand.__init__(self)
self.fileTypes =[('VU file',"*.vu")]
self.fileBrowserTitle = "Read VU File"
self.lastDir = "."
def onAddCmdToViewer(self):
if not self.vf.commands.has_key('loadVect'):
self.vf.loadCommand('vectfieldCommands', 'loadVect', 'Pmv',
示例14: not
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
Specs.define_field(specEntry)
else: return None
if not (Specs.DefFieldsDict.has_key('x') and
Specs.DefFieldsDict.has_key('y') and
Specs.DefFieldsDict.has_key('z')):
msg = "specs for atom coordinates (x,y,z) are missing"
self.warningMsg(msg)
return None
return Specs
genPDBReaderGuiDescr = {'widgetType':'menuRoot', 'menuBarName':'File',
'menuButtonName':'Read PDB with Gen Parser ...',
'index':0}
GenPDBReaderGUI = CommandGUI()
GenPDBReaderGUI.addMenuCommand('menuRoot', 'File',
'Read PDB with Gen Parser ...',index=0)
FieldNames = ('serial', 'name', 'altLoc', 'resName', 'chainID',
'resSeq', 'iCode', 'x', 'y', 'z', 'occupancy',
'tempFactor', 'segID', 'element', 'charge', 'other')
variableTypes = ('int', 'character', 'float', 'alphabetic', 'string')
specEntries = ('field_name', 'var_type', 'from', 'to', 'index')
class DefinePdbSpecifications(MVCommand):
""" class to define some pdb specifications in a dictionary and save them
in a file """
def __init__(self):
""" constructor """
示例15: destroy
# 需要导入模块: from ViewerFramework.VFCommand import CommandGUI [as 别名]
# 或者: from ViewerFramework.VFCommand.CommandGUI import addMenuCommand [as 别名]
command=self.register)
reg.pack(side = 'left')
b = Tkinter.Button(self.master,text=' Close ',
command=self.destroy)
b.pack(side = 'left')
notebook.setnaturalsize()
else:
self.master.deiconify()
self.master.lift()
def destroy(self):
self.master.destroy()
self.master = None
def openurl(self, evt=None):
import webbrowser
webbrowser.open('http://mgltools.scripps.edu')
def register(self):
self.master.withdraw()
from mglutil.splashregister.register import Register_User
Register_User(self.vf.help_about.version)
AboutGUI = CommandGUI()
AboutGUI.addMenuCommand('menuRoot', 'Help', 'About',separatorAbove = 1)
commandList = [{'name':'about','cmd':About(),'gui':AboutGUI}]
def initModule(viewer):
for _dict in commandList:
viewer.addCommand(_dict['cmd'],_dict['name'],_dict['gui'])