Package Pmv :: Module labelCommands :: Class LabelByProperties
[hide private]
[frames] | no frames]

Class LabelByProperties

source code

 ViewerFramework.VFCommand.Command --+    
                                     |    
                   mvCommand.MVCommand --+
                                         |
ViewerFramework.VFCommand.ICOM --+       |
                                 |       |
                  mvCommand.MVICOM --+   |
                                     |   |
                  mvCommand.MVAtomICOM --+
                                         |
                                        LabelByProperties
Known Subclasses:
LabelByExpression

selector.selection,property,textcolor,font,location,only,negate,funcItems Command to label the current selection items according to different properties of the selection level (Actually of the first item in the current selection.) Color can be specified as 'red','green','blue','white' or 'yellow'. Other values can be entered as a RGB tuple.One font can selected per label level: Atom,Residue,Chain,Molecule.Labels can be centered on first atom of selection level item, last atom of item or on the center of the item which is found by averaging the coordinates of all the atoms in the item. (eg all atoms in a residue if labelling at the Residue Level)
   
Package : Pmv
   
Module  : labelCommands
   
Class   : LabelByProperties
   
Command : labelByProperty
   
Synopsis:

        None<-labelByProperty(nodes, prop, textcolor, font, location,only, negate, funcItems, format, kw)
   
Required Arguments:

        nodes --- TreeNodeSet holding the current selection
   
Optional Arguments:
    
        prop --- attribute to use for label (default 'name')
        
textcolor --- colorname or RGB tuple (default 'white')
        
font --- font understood by DejaVu (default 'Helvetica12')
        
location --- 'First', 'Center', 'Last' atom in node (default 'Center')
        
only --- show this label only 
        
negate --- Boolean flag to toggle visibility of label 
        
format --- format string for label



Instance Methods [hide private]
  __init__(self, func=None)
  atomPropToVertices(self, geom, atoms, propName, propIndex=None)
  onAddCmdToViewer(self)
method called when an instance of this command is added to the viewer.
  onAddObjectToViewer(self, obj)
  update_cb(self, tag, force=False)
  updateChooser(self)
  buildFormDescr(self, formName='default')
descr <- buildFormDescr(self, formName): this virtual method is implemented in the classes derived from Command.
  getRelatedLabelsGeom(self)
  labelsSettings_cb(self)
  dismiss_cb(self)
  configureButton(self, col)
  chooseColor_cb(self)
  getLastUsedValues(self, formName='default', **kw)
Return dictionary of last used values
  guiCallback(self)
Default callback function called by the gui
  __call__(self, nodes, properties=['name',], textcolor='white', font='arial1.glf', location='Center', only=False, negate=False, format=None, **kw)
None<-labelByProperty(nodes, prop, textcolor, font, location,only, negate, funcItems, format, kw)
  doit(self, nodes, properties=['name',], textcolor='white', font={}, location='Center', only=False, negate=False, format=None)
virtual method.

Inherited from mvCommand.MVCommand: strArg

Inherited from mvCommand.MVCommand (private): _strArg

Inherited from ViewerFramework.VFCommand.Command: __repr__, addCallbackAfter, addCallbackBefore, addUndoCall, afterDoit, beforeDoit, buildLogArgList, checkDependencies, cleanup, customizeGUI, doitWrapper, getArguments, getHelp, getLogArgs, getValNamedArgs, log, logString, onAddNewCmd, onCmdRun, setLastUsedValues, setupUndoAfter, setupUndoBefore, showForm, tkCb, updateGeom, warningMsg

Inherited from mvCommand.MVAtomICOM: getObjects

Inherited from ViewerFramework.VFCommand.ICOM: initICOM, startICOM, stopICOM


Class Variables [hide private]

Inherited from ViewerFramework.VFCommand.Command: negateKw, objArgOnly


Method Details [hide private]

__init__(self, func=None)
(Constructor)

source code 
None
Overrides: mvCommand.MVCommand.__init__

atomPropToVertices(self, geom, atoms, propName, propIndex=None)

source code 
None

onAddCmdToViewer(self)

source code 
method called when an instance of this command is added to the viewer. This enable viewer-addition time initializations
Overrides: ViewerFramework.VFCommand.Command.onAddCmdToViewer
(inherited documentation)

onAddObjectToViewer(self, obj)

source code 
None

update_cb(self, tag, force=False)

source code 
None

updateChooser(self)

source code 
None

buildFormDescr(self, formName='default')

source code 
descr <- buildFormDescr(self, formName): this virtual method is implemented in the classes derived from Command. This is where the inputFormDescr is created and the description of the widgets appended. If a command has several inputForm buildFormDescr should build all the inputFormDescr and you do a if / elif check to know which one to create. formName : string name of the form corresponding to this descr.
Overrides: ViewerFramework.VFCommand.Command.buildFormDescr
(inherited documentation)

getRelatedLabelsGeom(self)

source code 
None

labelsSettings_cb(self)

source code 
None

dismiss_cb(self)

source code 
None

configureButton(self, col)

source code 
None

chooseColor_cb(self)

source code 
None

getLastUsedValues(self, formName='default', **kw)

source code 
Return dictionary of last used values
Overrides: ViewerFramework.VFCommand.Command.getLastUsedValues

guiCallback(self)

source code 
Default callback function called by the gui
Overrides: mvCommand.MVCommand.guiCallback

__call__(self, nodes, properties=['name',], textcolor='white', font='arial1.glf', location='Center', only=False, negate=False, format=None, **kw)
(Call operator)

source code 

None<-labelByProperty(nodes, prop, textcolor, font, location,only, negate, funcItems, format, kw)

nodes --- TreeNodeSet holding the current selection

prop --- attribute to use for label (default 'name')

textcolor --- colorname or RGB tuple (default 'white')

font --- font understood by DejaVu (default 'arial1.glf')

location --- 'First', 'Center', 'Last' atom in node (default 'Center')

only --- show this label only

negate --- Boolean flag to toggle visibility of label

format --- format string for label
Overrides: ViewerFramework.VFCommand.Command.__call__

doit(self, nodes, properties=['name',], textcolor='white', font={}, location='Center', only=False, negate=False, format=None)

source code 
virtual method. Has to be implemented by the sub classes
Overrides: ViewerFramework.VFCommand.Command.doit
(inherited documentation)